Make sure that a CupertinoTabView doesn't crash in 0x0 environment (#179845)

This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the CupertinoTabView
widget.
This commit is contained in:
Ahmed Mohamed Sameh 2025-12-17 08:24:57 +02:00 committed by GitHub
parent 17779252c5
commit 7d1e466d0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -323,4 +323,15 @@ void main() {
// Navigator didn't pop, so first route is still visible
expect(find.text('first route'), findsOneWidget);
});
testWidgets('CupertinoTabView does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
CupertinoApp(
home: Center(
child: SizedBox.shrink(child: CupertinoTabView(builder: (context) => const Text('X'))),
),
),
);
expect(tester.getSize(find.byType(CupertinoTabView)), Size.zero);
});
}