@@ -4119,6 +4119,70 @@ void main() {
41194119 expect (find.text ('R19 C0' ), findsOneWidget);
41204120 });
41214121
4122+ // Regression test for https://github.com/flutter/flutter/issues/185842.
4123+ testWidgets ('Trailing pinned rows and columns are excluded from the non-pinned ranges together' , (
4124+ WidgetTester tester,
4125+ ) async {
4126+ final verticalController = ScrollController ();
4127+ addTearDown (verticalController.dispose);
4128+ final horizontalController = ScrollController ();
4129+ addTearDown (horizontalController.dispose);
4130+ final rowPaintCounts = < int , int > {};
4131+ final columnPaintCounts = < int , int > {};
4132+
4133+ await tester.pumpWidget (
4134+ MaterialApp (
4135+ home: Scaffold (
4136+ body: SizedBox (
4137+ height: 400 ,
4138+ width: 400 ,
4139+ child: TableView .builder (
4140+ columnCount: 20 ,
4141+ rowCount: 20 ,
4142+ trailingPinnedColumnCount: 1 ,
4143+ trailingPinnedRowCount: 1 ,
4144+ verticalDetails: ScrollableDetails .vertical (controller: verticalController),
4145+ horizontalDetails: ScrollableDetails .horizontal (controller: horizontalController),
4146+ columnBuilder: (int index) => TableSpan (
4147+ extent: const FixedTableSpanExtent (100 ),
4148+ backgroundDecoration: CountingSpanDecoration (
4149+ index: index,
4150+ paintCounts: columnPaintCounts,
4151+ ),
4152+ ),
4153+ rowBuilder: (int index) => TableSpan (
4154+ extent: const FixedTableSpanExtent (100 ),
4155+ backgroundDecoration: CountingSpanDecoration (
4156+ index: index,
4157+ paintCounts: rowPaintCounts,
4158+ ),
4159+ ),
4160+ cellBuilder: (BuildContext context, TableVicinity vicinity) {
4161+ return TableViewCell (child: Text ('R${vicinity .row } C${vicinity .column }' ));
4162+ },
4163+ ),
4164+ ),
4165+ ),
4166+ ),
4167+ );
4168+
4169+ rowPaintCounts.clear ();
4170+ columnPaintCounts.clear ();
4171+ verticalController.jumpTo (verticalController.position.maxScrollExtent);
4172+ horizontalController.jumpTo (horizontalController.position.maxScrollExtent);
4173+ await tester.pump ();
4174+
4175+ expect (tester.takeException (), isNull);
4176+ // Each trailing pinned span is decorated once for each region it shares
4177+ // with the other axis: the regular region and the trailing pinned one.
4178+ expect (rowPaintCounts[19 ], 2 );
4179+ expect (columnPaintCounts[19 ], 2 );
4180+ // The corner cell belongs to the trailing pinned row and column only.
4181+ expect (find.text ('R19 C19' ), findsOneWidget);
4182+ expect (find.text ('R19 C18' ), findsOneWidget);
4183+ expect (find.text ('R18 C19' ), findsOneWidget);
4184+ });
4185+
41224186 testWidgets ('Intersections of leading and trailing pinned' , (WidgetTester tester) async {
41234187 const span = TableSpan (extent: FixedTableSpanExtent (100 ));
41244188 await tester.pumpWidget (
0 commit comments