Skip to content

Commit 518722a

Browse files
Make sure that a Radio doesn't crash in 0x0 environment (flutter#177580)
This is my attempt to handle flutter#6537 for the Radio widget. Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
1 parent f311a23 commit 518722a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/flutter/test/material/radio_test.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2771,4 +2771,15 @@ void main() {
27712771
expect(semanticNode.hint, anyOf(isNull, isEmpty));
27722772
});
27732773
});
2774+
2775+
testWidgets('Radio does not crash at zero area', (WidgetTester tester) async {
2776+
await tester.pumpWidget(
2777+
const MaterialApp(
2778+
home: Scaffold(
2779+
body: Center(child: SizedBox.shrink(child: Radio<bool>(value: true))),
2780+
),
2781+
),
2782+
);
2783+
expect(tester.getSize(find.byType(Radio<bool>)), Size.zero);
2784+
});
27742785
}

0 commit comments

Comments
 (0)