Skip to content

Commit 71ac4b2

Browse files
Make sure that a PaginatedDataTable doesn't crash in 0x0 environment (flutter#177389)
This is my attempt to handle flutter#6537 for the PaginatedDataTable widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
1 parent a52e28e commit 71ac4b2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/flutter/test/material/paginated_data_table_test.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,4 +1516,24 @@ void main() {
15161516
final Border? border = tableRowBoxDecoration?.border as Border?;
15171517
expect(border?.bottom.width, defaultDividerThickness);
15181518
});
1519+
1520+
testWidgets('PaginatedDataTable does not crash at zero area', (WidgetTester tester) async {
1521+
await tester.pumpWidget(
1522+
MaterialApp(
1523+
home: Center(
1524+
child: SizedBox.shrink(
1525+
child: PaginatedDataTable(
1526+
columns: const <DataColumn>[
1527+
DataColumn(label: Text('X')),
1528+
DataColumn(label: Text('Y')),
1529+
DataColumn(label: Text('Z')),
1530+
],
1531+
source: source,
1532+
),
1533+
),
1534+
),
1535+
),
1536+
);
1537+
expect(tester.getSize(find.byType(PaginatedDataTable)), Size.zero);
1538+
});
15191539
}

0 commit comments

Comments
 (0)