@@ -957,23 +957,27 @@ void main() {
957
957
columnBuilder: (int index) => TableSpan (
958
958
extent: const FixedTableSpanExtent (200.0 ),
959
959
foregroundDecoration: const TableSpanDecoration (
960
- border: TableSpanBorder (
961
- trailing: BorderSide (
962
- color: Colors .orange,
963
- width: 3 ,
964
- ))),
960
+ border: TableSpanBorder (
961
+ trailing: BorderSide (
962
+ color: Colors .orange,
963
+ width: 3 ,
964
+ ),
965
+ ),
966
+ ),
965
967
backgroundDecoration: TableSpanDecoration (
966
968
color: index.isEven ? Colors .red : null ,
967
969
),
968
970
),
969
971
rowBuilder: (int index) => TableSpan (
970
972
extent: const FixedTableSpanExtent (200.0 ),
971
973
foregroundDecoration: const TableSpanDecoration (
972
- border: TableSpanBorder (
973
- leading: BorderSide (
974
- color: Colors .green,
975
- width: 3 ,
976
- ))),
974
+ border: TableSpanBorder (
975
+ leading: BorderSide (
976
+ color: Colors .green,
977
+ width: 3 ,
978
+ ),
979
+ ),
980
+ ),
977
981
backgroundDecoration: TableSpanDecoration (
978
982
color: index.isOdd ? Colors .blue : null ,
979
983
),
@@ -1002,23 +1006,27 @@ void main() {
1002
1006
columnBuilder: (int index) => TableSpan (
1003
1007
extent: const FixedTableSpanExtent (200.0 ),
1004
1008
foregroundDecoration: const TableSpanDecoration (
1005
- border: TableSpanBorder (
1006
- trailing: BorderSide (
1007
- color: Colors .orange,
1008
- width: 3 ,
1009
- ))),
1009
+ border: TableSpanBorder (
1010
+ trailing: BorderSide (
1011
+ color: Colors .orange,
1012
+ width: 3 ,
1013
+ ),
1014
+ ),
1015
+ ),
1010
1016
backgroundDecoration: TableSpanDecoration (
1011
1017
color: index.isEven ? Colors .red : null ,
1012
1018
),
1013
1019
),
1014
1020
rowBuilder: (int index) => TableSpan (
1015
1021
extent: const FixedTableSpanExtent (200.0 ),
1016
1022
foregroundDecoration: const TableSpanDecoration (
1017
- border: TableSpanBorder (
1018
- leading: BorderSide (
1019
- color: Colors .green,
1020
- width: 3 ,
1021
- ))),
1023
+ border: TableSpanBorder (
1024
+ leading: BorderSide (
1025
+ color: Colors .green,
1026
+ width: 3 ,
1027
+ ),
1028
+ ),
1029
+ ),
1022
1030
backgroundDecoration: TableSpanDecoration (
1023
1031
color: index.isOdd ? Colors .blue : null ,
1024
1032
),
@@ -1040,6 +1048,63 @@ void main() {
1040
1048
);
1041
1049
});
1042
1050
1051
+ testWidgets ('paint rects are correct when reversed and pinned' ,
1052
+ (WidgetTester tester) async {
1053
+ // TODO(Piinks): Rewrite this to remove golden files from this repo when
1054
+ // mock_canvas is public - https://github.com/flutter/flutter/pull/131631
1055
+ // foreground, background, and precedence per mainAxis
1056
+ final TableView tableView = TableView .builder (
1057
+ verticalDetails: const ScrollableDetails .vertical (reverse: true ),
1058
+ horizontalDetails: const ScrollableDetails .horizontal (reverse: true ),
1059
+ rowCount: 2 ,
1060
+ pinnedRowCount: 1 ,
1061
+ columnCount: 2 ,
1062
+ pinnedColumnCount: 1 ,
1063
+ columnBuilder: (int index) => TableSpan (
1064
+ extent: const FixedTableSpanExtent (200.0 ),
1065
+ foregroundDecoration: const TableSpanDecoration (
1066
+ border: TableSpanBorder (
1067
+ trailing: BorderSide (
1068
+ color: Colors .orange,
1069
+ width: 3 ,
1070
+ ),
1071
+ ),
1072
+ ),
1073
+ backgroundDecoration: TableSpanDecoration (
1074
+ color: index.isEven ? Colors .red : null ,
1075
+ ),
1076
+ ),
1077
+ rowBuilder: (int index) => TableSpan (
1078
+ extent: const FixedTableSpanExtent (200.0 ),
1079
+ foregroundDecoration: const TableSpanDecoration (
1080
+ border: TableSpanBorder (
1081
+ leading: BorderSide (
1082
+ color: Colors .green,
1083
+ width: 3 ,
1084
+ ),
1085
+ ),
1086
+ ),
1087
+ backgroundDecoration: TableSpanDecoration (
1088
+ color: index.isOdd ? Colors .blue : null ,
1089
+ ),
1090
+ ),
1091
+ cellBuilder: (_, TableVicinity vicinity) {
1092
+ return const SizedBox .square (
1093
+ dimension: 200 ,
1094
+ child: Center (child: FlutterLogo ()),
1095
+ );
1096
+ },
1097
+ );
1098
+
1099
+ await tester.pumpWidget (MaterialApp (home: tableView));
1100
+ await tester.pumpAndSettle ();
1101
+ await expectLater (
1102
+ find.byType (TableView ),
1103
+ matchesGoldenFile ('goldens/reversed.pinned.painting.png' ),
1104
+ skip: ! runGoldens,
1105
+ );
1106
+ });
1107
+
1043
1108
testWidgets ('mouse handling' , (WidgetTester tester) async {
1044
1109
int enterCounter = 0 ;
1045
1110
int exitCounter = 0 ;
0 commit comments