mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
393c51fb46
commit
362361484d
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user