From 243dcd8077bb10ea63957e69cd36ada5d42eef09 Mon Sep 17 00:00:00 2001 From: Kate Lovett Date: Mon, 22 Jan 2024 16:55:14 -0600 Subject: [PATCH] Review feedback --- .../lib/src/table_view/table.dart | 35 +- .../test/table_view/table_span_test.dart | 966 +++++++++--------- 2 files changed, 503 insertions(+), 498 deletions(-) diff --git a/packages/two_dimensional_scrollables/lib/src/table_view/table.dart b/packages/two_dimensional_scrollables/lib/src/table_view/table.dart index 4e43ff065f2b..a8d9a0cc99d3 100644 --- a/packages/two_dimensional_scrollables/lib/src/table_view/table.dart +++ b/packages/two_dimensional_scrollables/lib/src/table_view/table.dart @@ -861,27 +861,27 @@ class RenderTableViewport extends RenderTwoDimensionalViewport { )!; Rect getColumnRect(bool consumePadding) { - final double leadingOffsetCorrection = + final ({double leading, double trailing}) offsetCorrection = axisDirectionIsReversed(verticalAxisDirection) - ? leadingCell.size.height - : 0.0; - final double trailingOffsetCorrection = - axisDirectionIsReversed(verticalAxisDirection) - ? trailingCell.size.height - : 0.0; + ? ( + leading: leadingCell.size.height, + trailing: trailingCell.size.height, + ) + : (leading: 0.0, trailing: 0.0); + return Rect.fromPoints( parentDataOf(leadingCell).paintOffset! + offset - Offset( consumePadding ? columnSpan.padding.leading : 0.0, - rowSpan.padding.leading - leadingOffsetCorrection, + rowSpan.padding.leading - offsetCorrection.leading, ), parentDataOf(trailingCell).paintOffset! + offset + Offset(trailingCell.size.width, trailingCell.size.height) + Offset( consumePadding ? columnSpan.padding.trailing : 0.0, - rowSpan.padding.trailing - trailingOffsetCorrection, + rowSpan.padding.trailing - offsetCorrection.trailing, ), ); } @@ -920,26 +920,25 @@ class RenderTableViewport extends RenderTwoDimensionalViewport { )!; Rect getRowRect(bool consumePadding) { - final double leadingOffsetCorrection = - axisDirectionIsReversed(horizontalAxisDirection) - ? leadingCell.size.height - : 0.0; - final double trailingOffsetCorrection = + final ({double leading, double trailing}) offsetCorrection = axisDirectionIsReversed(horizontalAxisDirection) - ? trailingCell.size.height - : 0.0; + ? ( + leading: leadingCell.size.width, + trailing: trailingCell.size.width, + ) + : (leading: 0.0, trailing: 0.0); return Rect.fromPoints( parentDataOf(leadingCell).paintOffset! + offset - Offset( - columnSpan.padding.leading - leadingOffsetCorrection, + columnSpan.padding.leading - offsetCorrection.leading, consumePadding ? rowSpan.padding.leading : 0.0, ), parentDataOf(trailingCell).paintOffset! + offset + Offset(trailingCell.size.width, trailingCell.size.height) + Offset( - columnSpan.padding.leading - trailingOffsetCorrection, + columnSpan.padding.leading - offsetCorrection.trailing, consumePadding ? rowSpan.padding.trailing : 0.0, ), ); diff --git a/packages/two_dimensional_scrollables/test/table_view/table_span_test.dart b/packages/two_dimensional_scrollables/test/table_view/table_span_test.dart index 0980ea2bd84b..b6b0db398e26 100644 --- a/packages/two_dimensional_scrollables/test/table_view/table_span_test.dart +++ b/packages/two_dimensional_scrollables/test/table_view/table_span_test.dart @@ -228,86 +228,87 @@ void main() { await tester.pumpAndSettle(); expect( - find.byType(TableViewport), - paints - // Rows first, bottom to top for reversed axis - ..rect( - rect: const Rect.fromLTRB(0.0, 500.0, 1000.0, 600.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, 400.0, 1000.0, 500.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, 300.0, 1000.0, 400.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, 200.0, 1000.0, 300.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, 100.0, 1000.0, 200.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, 0.0, 1000.0, 100.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, -100.0, 1000.0, 0.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, -200.0, 1000.0, -100.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, -300.0, 1000.0, -200.0), - color: const Color(0xffbbdefb), - ) - // Columns next - ..rect( - rect: const Rect.fromLTRB(0.0, -300.0, 100.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(100.0, -300.0, 200.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(200.0, -300.0, 300.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(300.0, -300.0, 400.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(400.0, -300.0, 500.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(500.0, -300.0, 600.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(600.0, -300.0, 700.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(700.0, -300.0, 800.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(800.0, -300.0, 900.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(900.0, -300.0, 1000.0, 600.0), - color: const Color(0xffe1bee7), - )); + find.byType(TableViewport), + paints + // Rows first, bottom to top for reversed axis + ..rect( + rect: const Rect.fromLTRB(0.0, 500.0, 1000.0, 600.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, 400.0, 1000.0, 500.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, 300.0, 1000.0, 400.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, 200.0, 1000.0, 300.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, 100.0, 1000.0, 200.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, 0.0, 1000.0, 100.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, -100.0, 1000.0, 0.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, -200.0, 1000.0, -100.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, -300.0, 1000.0, -200.0), + color: const Color(0xffbbdefb), + ) + // Columns next + ..rect( + rect: const Rect.fromLTRB(0.0, -300.0, 100.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(100.0, -300.0, 200.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(200.0, -300.0, 300.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(300.0, -300.0, 400.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(400.0, -300.0, 500.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(500.0, -300.0, 600.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(600.0, -300.0, 700.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(700.0, -300.0, 800.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(800.0, -300.0, 900.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(900.0, -300.0, 1000.0, 600.0), + color: const Color(0xffe1bee7), + ), + ); }); testWidgets('Vertical main axis, horizontal reversed', @@ -333,86 +334,87 @@ void main() { await tester.pumpAndSettle(); expect( - find.byType(TableViewport), - paints - // Rows first - ..rect( - rect: const Rect.fromLTRB(-200.0, 0.0, 800.0, 100.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 100.0, 800.0, 200.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 200.0, 800.0, 300.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 300.0, 800.0, 400.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 400.0, 800.0, 500.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 500.0, 800.0, 600.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 600.0, 800.0, 700.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 700.0, 800.0, 800.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 800.0, 800.0, 900.0), - color: const Color(0xffbbdefb), - ) - // Columns next, right to left for reversed axis - ..rect( - rect: const Rect.fromLTRB(700.0, 0.0, 800.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(600.0, 0.0, 700.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(500.0, 0.0, 600.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(400.0, 0.0, 500.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(300.0, 0.0, 400.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(200.0, 0.0, 300.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(100.0, 0.0, 200.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, 0.0, 100.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(-100.0, 0.0, 0.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 0.0, -100.0, 900.0), - color: const Color(0xffe1bee7), - )); + find.byType(TableViewport), + paints + // Rows first + ..rect( + rect: const Rect.fromLTRB(-200.0, 0.0, 800.0, 100.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 100.0, 800.0, 200.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 200.0, 800.0, 300.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 300.0, 800.0, 400.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 400.0, 800.0, 500.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 500.0, 800.0, 600.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 600.0, 800.0, 700.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 700.0, 800.0, 800.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 800.0, 800.0, 900.0), + color: const Color(0xffbbdefb), + ) + // Columns next, right to left for reversed axis + ..rect( + rect: const Rect.fromLTRB(700.0, 0.0, 800.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(600.0, 0.0, 700.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(500.0, 0.0, 600.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(400.0, 0.0, 500.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(300.0, 0.0, 400.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(200.0, 0.0, 300.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(100.0, 0.0, 200.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, 0.0, 100.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(-100.0, 0.0, 0.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 0.0, -100.0, 900.0), + color: const Color(0xffe1bee7), + ), + ); }); testWidgets('Vertical main axis, both reversed', @@ -439,86 +441,87 @@ void main() { await tester.pumpAndSettle(); expect( - find.byType(TableViewport), - paints - // Rows first, bottom to top for reversed axis - ..rect( - rect: const Rect.fromLTRB(-200.0, 500.0, 800.0, 600.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 400.0, 800.0, 500.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 300.0, 800.0, 400.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 200.0, 800.0, 300.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 100.0, 800.0, 200.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 0.0, 800.0, 100.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, -100.0, 800.0, 0.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, -200.0, 800.0, -100.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, -300.0, 800.0, -200.0), - color: const Color(0xffbbdefb), - ) - // Columns next, right to left for reversed axis - ..rect( - rect: const Rect.fromLTRB(700.0, -300.0, 800.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(600.0, -300.0, 700.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(500.0, -300.0, 600.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(400.0, -300.0, 500.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(300.0, -300.0, 400.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(200.0, -300.0, 300.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(100.0, -300.0, 200.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, -300.0, 100.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(-100.0, -300.0, 0.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, -300.0, -100.0, 600.0), - color: const Color(0xffe1bee7), - )); + find.byType(TableViewport), + paints + // Rows first, bottom to top for reversed axis + ..rect( + rect: const Rect.fromLTRB(-200.0, 500.0, 800.0, 600.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 400.0, 800.0, 500.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 300.0, 800.0, 400.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 200.0, 800.0, 300.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 100.0, 800.0, 200.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 0.0, 800.0, 100.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, -100.0, 800.0, 0.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, -200.0, 800.0, -100.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, -300.0, 800.0, -200.0), + color: const Color(0xffbbdefb), + ) + // Columns next, right to left for reversed axis + ..rect( + rect: const Rect.fromLTRB(700.0, -300.0, 800.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(600.0, -300.0, 700.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(500.0, -300.0, 600.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(400.0, -300.0, 500.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(300.0, -300.0, 400.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(200.0, -300.0, 300.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(100.0, -300.0, 200.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, -300.0, 100.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(-100.0, -300.0, 0.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, -300.0, -100.0, 600.0), + color: const Color(0xffe1bee7), + ), + ); }); testWidgets('Horizontal main axis, vertical reversed', @@ -545,86 +548,87 @@ void main() { await tester.pumpAndSettle(); expect( - find.byType(TableViewport), - paints - // Columns first - ..rect( - rect: const Rect.fromLTRB(0.0, -300.0, 100.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(100.0, -300.0, 200.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(200.0, -300.0, 300.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(300.0, -300.0, 400.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(400.0, -300.0, 500.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(500.0, -300.0, 600.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(600.0, -300.0, 700.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(700.0, -300.0, 800.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(800.0, -300.0, 900.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(900.0, -300.0, 1000.0, 600.0), - color: const Color(0xffe1bee7), - ) - // Rows next, bottom to top for reversed axis - ..rect( - rect: const Rect.fromLTRB(0.0, 500.0, 1000.0, 600.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, 400.0, 1000.0, 500.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, 300.0, 1000.0, 400.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, 200.0, 1000.0, 300.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, 100.0, 1000.0, 200.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, 0.0, 1000.0, 100.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, -100.0, 1000.0, 0.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, -200.0, 1000.0, -100.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, -300.0, 1000.0, -200.0), - color: const Color(0xffbbdefb), - )); + find.byType(TableViewport), + paints + // Columns first + ..rect( + rect: const Rect.fromLTRB(0.0, -300.0, 100.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(100.0, -300.0, 200.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(200.0, -300.0, 300.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(300.0, -300.0, 400.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(400.0, -300.0, 500.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(500.0, -300.0, 600.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(600.0, -300.0, 700.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(700.0, -300.0, 800.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(800.0, -300.0, 900.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(900.0, -300.0, 1000.0, 600.0), + color: const Color(0xffe1bee7), + ) + // Rows next, bottom to top for reversed axis + ..rect( + rect: const Rect.fromLTRB(0.0, 500.0, 1000.0, 600.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, 400.0, 1000.0, 500.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, 300.0, 1000.0, 400.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, 200.0, 1000.0, 300.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, 100.0, 1000.0, 200.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, 0.0, 1000.0, 100.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, -100.0, 1000.0, 0.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, -200.0, 1000.0, -100.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, -300.0, 1000.0, -200.0), + color: const Color(0xffbbdefb), + ), + ); }); testWidgets('Horizontal main axis, horizontal reversed', @@ -651,86 +655,87 @@ void main() { await tester.pumpAndSettle(); expect( - find.byType(TableViewport), - paints - // Columns first, right to left for reversed axis - ..rect( - rect: const Rect.fromLTRB(700.0, 0.0, 800.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(600.0, 0.0, 700.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(500.0, 0.0, 600.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(400.0, 0.0, 500.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(300.0, 0.0, 400.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(200.0, 0.0, 300.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(100.0, 0.0, 200.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, 0.0, 100.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(-100.0, 0.0, 0.0, 900.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 0.0, -100.0, 900.0), - color: const Color(0xffe1bee7), - ) - // Rows next - ..rect( - rect: const Rect.fromLTRB(-200.0, 0.0, 800.0, 100.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 100.0, 800.0, 200.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 200.0, 800.0, 300.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 300.0, 800.0, 400.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 400.0, 800.0, 500.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 500.0, 800.0, 600.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 600.0, 800.0, 700.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 700.0, 800.0, 800.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 800.0, 800.0, 900.0), - color: const Color(0xffbbdefb), - )); + find.byType(TableViewport), + paints + // Columns first, right to left for reversed axis + ..rect( + rect: const Rect.fromLTRB(700.0, 0.0, 800.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(600.0, 0.0, 700.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(500.0, 0.0, 600.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(400.0, 0.0, 500.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(300.0, 0.0, 400.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(200.0, 0.0, 300.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(100.0, 0.0, 200.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, 0.0, 100.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(-100.0, 0.0, 0.0, 900.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 0.0, -100.0, 900.0), + color: const Color(0xffe1bee7), + ) + // Rows next + ..rect( + rect: const Rect.fromLTRB(-200.0, 0.0, 800.0, 100.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 100.0, 800.0, 200.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 200.0, 800.0, 300.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 300.0, 800.0, 400.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 400.0, 800.0, 500.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 500.0, 800.0, 600.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 600.0, 800.0, 700.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 700.0, 800.0, 800.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 800.0, 800.0, 900.0), + color: const Color(0xffbbdefb), + ), + ); }); testWidgets('Horizontal main axis, both reversed', @@ -758,86 +763,87 @@ void main() { await tester.pumpAndSettle(); expect( - find.byType(TableViewport), - paints - // Columns first, right to left for reversed axis - ..rect( - rect: const Rect.fromLTRB(700.0, -300.0, 800.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(600.0, -300.0, 700.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(500.0, -300.0, 600.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(400.0, -300.0, 500.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(300.0, -300.0, 400.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(200.0, -300.0, 300.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(100.0, -300.0, 200.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(0.0, -300.0, 100.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(-100.0, -300.0, 0.0, 600.0), - color: const Color(0xffe1bee7), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, -300.0, -100.0, 600.0), - color: const Color(0xffe1bee7), - ) - // Rows next, bottom to top for reversed axis - ..rect( - rect: const Rect.fromLTRB(-200.0, 500.0, 800.0, 600.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 400.0, 800.0, 500.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 300.0, 800.0, 400.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 200.0, 800.0, 300.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 100.0, 800.0, 200.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, 0.0, 800.0, 100.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, -100.0, 800.0, 0.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, -200.0, 800.0, -100.0), - color: const Color(0xffbbdefb), - ) - ..rect( - rect: const Rect.fromLTRB(-200.0, -300.0, 800.0, -200.0), - color: const Color(0xffbbdefb), - )); + find.byType(TableViewport), + paints + // Columns first, right to left for reversed axis + ..rect( + rect: const Rect.fromLTRB(700.0, -300.0, 800.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(600.0, -300.0, 700.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(500.0, -300.0, 600.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(400.0, -300.0, 500.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(300.0, -300.0, 400.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(200.0, -300.0, 300.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(100.0, -300.0, 200.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(0.0, -300.0, 100.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(-100.0, -300.0, 0.0, 600.0), + color: const Color(0xffe1bee7), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, -300.0, -100.0, 600.0), + color: const Color(0xffe1bee7), + ) + // Rows next, bottom to top for reversed axis + ..rect( + rect: const Rect.fromLTRB(-200.0, 500.0, 800.0, 600.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 400.0, 800.0, 500.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 300.0, 800.0, 400.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 200.0, 800.0, 300.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 100.0, 800.0, 200.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, 0.0, 800.0, 100.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, -100.0, 800.0, 0.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, -200.0, 800.0, -100.0), + color: const Color(0xffbbdefb), + ) + ..rect( + rect: const Rect.fromLTRB(-200.0, -300.0, 800.0, -200.0), + color: const Color(0xffbbdefb), + ), + ); }); }); }