Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/two_dimensional_scrollables/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.2

* Fixes override of default TwoDimensionalChildBuilderDelegate.addRepaintBoundaries.

## 0.0.1+1

* Adds pub topics to package metadata.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class TableCellBuilderDelegate extends TwoDimensionalChildBuilderDelegate
required int rowCount,
int pinnedColumnCount = 0,
int pinnedRowCount = 0,
super.addRepaintBoundaries = false,
super.addRepaintBoundaries,
required TableViewCellBuilder cellBuilder,
required TableSpanBuilder columnBuilder,
required TableSpanBuilder rowBuilder,
Expand Down
2 changes: 1 addition & 1 deletion packages/two_dimensional_scrollables/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: two_dimensional_scrollables
description: Widgets that scroll using the two dimensional scrolling foundation.
version: 0.0.1+1
version: 0.0.2
repository: https://github.com/flutter/packages/tree/main/packages/two_dimensional_scrollables
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+two_dimensional_scrollables%22+

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ void main() {
expect(delegate.maxXIndex, 4); // columns
});

test('Respects super class default for addRepaintBoundaries', () {
final TableCellBuilderDelegate delegate = TableCellBuilderDelegate(
cellBuilder: (_, __) => cell,
columnBuilder: (_) => span,
rowBuilder: (_) => span,
columnCount: 5,
rowCount: 6,
);
expect(delegate.addRepaintBoundaries, isTrue);
});

test('Notifies listeners & rebuilds', () {
int notified = 0;
TableCellBuilderDelegate oldDelegate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,24 +287,17 @@ void main() {
expect(viewport.mainAxis, Axis.vertical);
// first child
TableVicinity vicinity = const TableVicinity(column: 0, row: 0);
expect(
parentDataOf(viewport.firstChild!).vicinity,
vicinity,
);
TableViewParentData parentData = parentDataOf(
tester.renderObject<RenderBox>(find.byKey(childKeys[vicinity]!)),
viewport.firstChild!,
);
expect(parentData.vicinity, vicinity);
expect(parentData.layoutOffset, Offset.zero);
expect(parentData.isVisible, isTrue);
// after first child
vicinity = const TableVicinity(column: 1, row: 0);
expect(
parentDataOf(viewport.childAfter(viewport.firstChild!)!).vicinity,
vicinity,
);

parentData = parentDataOf(
tester.renderObject<RenderBox>(find.byKey(childKeys[vicinity]!)),
viewport.childAfter(viewport.firstChild!)!,
);
expect(parentData.vicinity, vicinity);
expect(parentData.layoutOffset, const Offset(200, 0.0));
Expand All @@ -317,13 +310,7 @@ void main() {

// last child
vicinity = const TableVicinity(column: 4, row: 4);
expect(
parentDataOf(viewport.lastChild!).vicinity,
vicinity,
);
parentData = parentDataOf(
tester.renderObject<RenderBox>(find.byKey(childKeys[vicinity]!)),
);
parentData = parentDataOf(viewport.lastChild!);
expect(parentData.vicinity, vicinity);
expect(parentData.layoutOffset, const Offset(800.0, 800.0));
expect(parentData.isVisible, isFalse);
Expand All @@ -334,12 +321,8 @@ void main() {
);
// before last child
vicinity = const TableVicinity(column: 3, row: 4);
expect(
parentDataOf(viewport.childBefore(viewport.lastChild!)!).vicinity,
vicinity,
);
parentData = parentDataOf(
tester.renderObject<RenderBox>(find.byKey(childKeys[vicinity]!)),
viewport.childBefore(viewport.lastChild!)!,
);
expect(parentData.vicinity, vicinity);
expect(parentData.layoutOffset, const Offset(600.0, 800.0));
Expand Down