File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
packages/flutter/test/material Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -4853,6 +4853,30 @@ void main() {
48534853 expect (controller.text, TestMenu .mainMenu1.label);
48544854 },
48554855 );
4856+
4857+ testWidgets ('DropdownMenu does not crash at zero area' , (WidgetTester tester) async {
4858+ tester.view.physicalSize = Size .zero;
4859+ final TextEditingController controller = TextEditingController (text: 'I' );
4860+ addTearDown (controller.dispose);
4861+ addTearDown (tester.view.reset);
4862+
4863+ await tester.pumpWidget (
4864+ MaterialApp (
4865+ home: Scaffold (
4866+ body: Center (
4867+ child: DropdownMenu <TestMenu >(
4868+ dropdownMenuEntries: menuChildren,
4869+ controller: controller,
4870+ ),
4871+ ),
4872+ ),
4873+ ),
4874+ );
4875+ expect (tester.getSize (find.byType (DropdownMenu <TestMenu >)), Size .zero);
4876+ controller.selection = const TextSelection .collapsed (offset: 0 );
4877+ await tester.pump ();
4878+ expect (find.byType (MenuItemButton ), findsWidgets);
4879+ });
48564880}
48574881
48584882enum TestMenu {
You can’t perform that action at this time.
0 commit comments