Make sure that a Checkbox doesn't crash in 0x0 environment (#173178)
This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the Checkbox UI
control.
diff --git a/packages/flutter/test/material/checkbox_test.dart b/packages/flutter/test/material/checkbox_test.dart
index 01a9516..549abbc 100644
--- a/packages/flutter/test/material/checkbox_test.dart
+++ b/packages/flutter/test/material/checkbox_test.dart
@@ -2476,6 +2476,17 @@
);
expect(getCheckboxRenderer(), paints..path(color: inactiveBackgroundColor));
});
+
+ testWidgets('Checkbox renders at zero area', (WidgetTester tester) async {
+ await tester.pumpWidget(
+ const MaterialApp(
+ home: Center(
+ child: SizedBox.shrink(child: Scaffold(body: Checkbox(value: true, onChanged: null))),
+ ),
+ ),
+ );
+ expect(tester.takeException(), isNull);
+ });
}
class _SelectedGrabMouseCursor extends MaterialStateMouseCursor {