Skip to content

Commit e4f2a91

Browse files
ahmedsameha1ksokolovskyi
authored andcommitted
Make sure that DataTable, DataColumn, DataRow, and DataCell don't crash in 0x0 environment (flutter#173515)
This is my attempt to handle flutter#6537 for the DataTable, DataColumn, DataRow, and DataCell UI controls.
1 parent a3de524 commit e4f2a91

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

packages/flutter/test/material/data_table_test.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,6 +2331,23 @@ void main() {
23312331

23322332
semantics.dispose();
23332333
});
2334+
2335+
testWidgets('DataTable, DataColumn, DataRow, and DataCell render at zero area', (
2336+
WidgetTester tester,
2337+
) async {
2338+
await tester.pumpWidget(
2339+
MaterialApp(
2340+
home: SizedBox.shrink(
2341+
child: DataTable(
2342+
columns: const <DataColumn>[DataColumn(label: Text('X'))],
2343+
rows: const <DataRow>[
2344+
DataRow(cells: <DataCell>[DataCell(Text('X'))]),
2345+
],
2346+
),
2347+
),
2348+
),
2349+
);
2350+
});
23342351
}
23352352

23362353
RenderParagraph _getTextRenderObject(WidgetTester tester, String text) {

0 commit comments

Comments
 (0)