File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
packages/flutter/test/material Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -4280,6 +4280,22 @@ void main() {
42804280 expect (viewTextField.smartDashesType, SmartDashesType .disabled);
42814281 expect (viewTextField.smartQuotesType, SmartQuotesType .disabled);
42824282 });
4283+
4284+ testWidgets ('SearchBar does not crash at zero area' , (WidgetTester tester) async {
4285+ tester.view.physicalSize = Size .zero;
4286+ final TextEditingController controller = TextEditingController (text: 'X' );
4287+ addTearDown (controller.dispose);
4288+ addTearDown (tester.view.reset);
4289+ await tester.pumpWidget (
4290+ MaterialApp (
4291+ home: Center (child: SearchBar (controller: controller)),
4292+ ),
4293+ );
4294+ expect (tester.getSize (find.byType (SearchBar )), Size .zero);
4295+ controller.selection = const TextSelection .collapsed (offset: 0 );
4296+ await tester.pump ();
4297+ expect (find.text ('X' ), findsOne);
4298+ });
42834299}
42844300
42854301Future <void > checkSearchBarDefaults (
You can’t perform that action at this time.
0 commit comments