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.
This commit is contained in:
Ahmed Mohamed Sameh 2025-08-09 00:08:06 +03:00 committed by GitHub
parent 2734643642
commit a9be1dfab3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2476,6 +2476,17 @@ void main() {
);
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 {