Skip to content

Commit 9e99953

Browse files
authored
Make sure that a Chip doesn't crash in 0x0 environment (flutter#173245)
This is my attempt to handle flutter#6537 for the Chip UI control.
1 parent 4051fab commit 9e99953

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/flutter/test/material/chip_test.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6375,6 +6375,20 @@ void main() {
63756375
},
63766376
);
63776377

6378+
testWidgets('Chip renders at zero area', (WidgetTester tester) async {
6379+
await tester.pumpWidget(
6380+
const MaterialApp(
6381+
home: Center(
6382+
child: SizedBox.shrink(
6383+
child: Scaffold(body: Chip(label: Text('X'))),
6384+
),
6385+
),
6386+
),
6387+
);
6388+
final Finder xText = find.text('X');
6389+
expect(tester.getSize(xText).isEmpty, isTrue);
6390+
});
6391+
63786392
testWidgets('RawChip renders at zero area', (WidgetTester tester) async {
63796393
await tester.pumpWidget(
63806394
const MaterialApp(

0 commit comments

Comments
 (0)