Skip to content

Commit 393c51f

Browse files
ahmedsameha1victorsannidkwingsmt
authored
Make sure that a CupertinoApp doesn't crash in 0x0 environment (#178610)
This is my attempt to handle flutter/flutter#6537 for the CupertinoApp widget. Co-authored-by: Victor Sanni <victorsanniay@gmail.com> Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
1 parent fed50b1 commit 393c51f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/flutter/test/cupertino/app_test.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,15 @@ void main() {
704704
},
705705
variant: TargetPlatformVariant.all(),
706706
);
707+
708+
testWidgets('CupertinoApp does not crash at zero area', (WidgetTester tester) async {
709+
await tester.pumpWidget(
710+
const Center(
711+
child: SizedBox.shrink(child: CupertinoApp(home: Text('X'))),
712+
),
713+
);
714+
expect(tester.getSize(find.byType(CupertinoApp)), Size.zero);
715+
});
707716
}
708717

709718
class MockScrollBehavior extends ScrollBehavior {

0 commit comments

Comments
 (0)