mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
a52e28e0cd
commit
71ac4b2fdb
@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user