Make sure that a CupertinoCheckbox doesn't crash in 0x0 environment (#178630)

This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the CupertinoCheckbox
widget.

Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
Ahmed Mohamed Sameh 2025-12-06 01:46:25 +02:00 committed by GitHub
parent 393c51fb46
commit 362361484d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1019,6 +1019,17 @@ void main() {
await gesture2.up();
await tester.pump();
});
testWidgets('CupertinoCheckbox does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
CupertinoApp(
home: Center(
child: SizedBox.shrink(child: CupertinoCheckbox(value: true, onChanged: (_) {})),
),
),
);
expect(tester.getSize(find.byType(CupertinoCheckbox)), Size.zero);
});
}
class _CheckboxMouseCursor extends WidgetStateMouseCursor {