Skip to content

Commit a9be1df

Browse files
authored
Make sure that a Checkbox doesn't crash in 0x0 environment (#173178)
This is my attempt to handle flutter/flutter#6537 for the Checkbox UI control.
1 parent 2734643 commit a9be1df

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

packages/flutter/test/material/checkbox_test.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,6 +2476,17 @@ void main() {
24762476
);
24772477
expect(getCheckboxRenderer(), paints..path(color: inactiveBackgroundColor));
24782478
});
2479+
2480+
testWidgets('Checkbox renders at zero area', (WidgetTester tester) async {
2481+
await tester.pumpWidget(
2482+
const MaterialApp(
2483+
home: Center(
2484+
child: SizedBox.shrink(child: Scaffold(body: Checkbox(value: true, onChanged: null))),
2485+
),
2486+
),
2487+
);
2488+
expect(tester.takeException(), isNull);
2489+
});
24792490
}
24802491

24812492
class _SelectedGrabMouseCursor extends MaterialStateMouseCursor {

0 commit comments

Comments
 (0)