Make sure that a PaginatedDataTable doesn't crash in 0x0 environment (#177389)

This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the
PaginatedDataTable widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
Ahmed Mohamed Sameh 2025-11-02 22:04:03 +02:00 committed by GitHub
parent a52e28e0cd
commit 71ac4b2fdb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1516,4 +1516,24 @@ void main() {
final Border? border = tableRowBoxDecoration?.border as Border?;
expect(border?.bottom.width, defaultDividerThickness);
});
testWidgets('PaginatedDataTable does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(
home: Center(
child: SizedBox.shrink(
child: PaginatedDataTable(
columns: const <DataColumn>[
DataColumn(label: Text('X')),
DataColumn(label: Text('Y')),
DataColumn(label: Text('Z')),
],
source: source,
),
),
),
),
);
expect(tester.getSize(find.byType(PaginatedDataTable)), Size.zero);
});
}