Make sure that a ChoiceChip doesn't crash in 0x0 environment (#173322)

This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the ChoiceChip UI
control.
This commit is contained in:
Ahmed Mohamed Sameh 2025-08-14 02:53:03 +03:00 committed by GitHub
parent 1c0ee96c8f
commit 72e1bf1a15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -848,4 +848,18 @@ void main() {
SystemMouseCursors.forbidden,
);
});
testWidgets('ChoiceChip renders at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Center(
child: SizedBox.shrink(
child: Scaffold(body: ChoiceChip(label: Text('X'), selected: true)),
),
),
),
);
final Finder xText = find.text('X');
expect(tester.getSize(xText).isEmpty, isTrue);
});
}