Skip to content

Commit 72e1bf1

Browse files
authored
Make sure that a ChoiceChip doesn't crash in 0x0 environment (flutter#173322)
This is my attempt to handle flutter#6537 for the ChoiceChip UI control.
1 parent 1c0ee96 commit 72e1bf1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/flutter/test/material/choice_chip_test.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,4 +848,18 @@ void main() {
848848
SystemMouseCursors.forbidden,
849849
);
850850
});
851+
852+
testWidgets('ChoiceChip renders at zero area', (WidgetTester tester) async {
853+
await tester.pumpWidget(
854+
const MaterialApp(
855+
home: Center(
856+
child: SizedBox.shrink(
857+
child: Scaffold(body: ChoiceChip(label: Text('X'), selected: true)),
858+
),
859+
),
860+
),
861+
);
862+
final Finder xText = find.text('X');
863+
expect(tester.getSize(xText).isEmpty, isTrue);
864+
});
851865
}

0 commit comments

Comments
 (0)