diff --git a/packages/two_dimensional_scrollables/CHANGELOG.md b/packages/two_dimensional_scrollables/CHANGELOG.md index 953f52aceed2..e99a4bd66079 100644 --- a/packages/two_dimensional_scrollables/CHANGELOG.md +++ b/packages/two_dimensional_scrollables/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.2 + +* Fixes override of default TwoDimensionalChildBuilderDelegate.addRepaintBoundaries. + ## 0.0.1+1 * Adds pub topics to package metadata. diff --git a/packages/two_dimensional_scrollables/lib/src/table_view/table_delegate.dart b/packages/two_dimensional_scrollables/lib/src/table_view/table_delegate.dart index 43cb1c574fd2..86accc4f999b 100644 --- a/packages/two_dimensional_scrollables/lib/src/table_view/table_delegate.dart +++ b/packages/two_dimensional_scrollables/lib/src/table_view/table_delegate.dart @@ -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, diff --git a/packages/two_dimensional_scrollables/pubspec.yaml b/packages/two_dimensional_scrollables/pubspec.yaml index 9437ae872787..fba32c5fa639 100644 --- a/packages/two_dimensional_scrollables/pubspec.yaml +++ b/packages/two_dimensional_scrollables/pubspec.yaml @@ -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+ diff --git a/packages/two_dimensional_scrollables/test/table_view/table_delegate_test.dart b/packages/two_dimensional_scrollables/test/table_view/table_delegate_test.dart index b9e2da26b801..98e88fcfd55e 100644 --- a/packages/two_dimensional_scrollables/test/table_view/table_delegate_test.dart +++ b/packages/two_dimensional_scrollables/test/table_view/table_delegate_test.dart @@ -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; diff --git a/packages/two_dimensional_scrollables/test/table_view/table_test.dart b/packages/two_dimensional_scrollables/test/table_view/table_test.dart index b3e27bfa42bc..3fbd4e7a938f 100644 --- a/packages/two_dimensional_scrollables/test/table_view/table_test.dart +++ b/packages/two_dimensional_scrollables/test/table_view/table_test.dart @@ -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(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(find.byKey(childKeys[vicinity]!)), + viewport.childAfter(viewport.firstChild!)!, ); expect(parentData.vicinity, vicinity); expect(parentData.layoutOffset, const Offset(200, 0.0)); @@ -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(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); @@ -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(find.byKey(childKeys[vicinity]!)), + viewport.childBefore(viewport.lastChild!)!, ); expect(parentData.vicinity, vicinity); expect(parentData.layoutOffset, const Offset(600.0, 800.0));