Make sure that CupertinoNavigationBar doesn't crash in 0x0 environment (#179235)

This is my attempt to handle
https://github.com/flutter/flutter/issues/6537 for the
CupertinoNavigationBar widget.

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
Ahmed Mohamed Sameh 2025-12-06 01:46:25 +02:00 committed by GitHub
parent ebd263e392
commit a8577f996b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3329,6 +3329,15 @@ void main() {
expect(find.text('First'), findsNothing);
expect(find.text('Second'), findsOneWidget);
});
testWidgets('CupertinoNavigationBar does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
const CupertinoApp(
home: Center(child: SizedBox.shrink(child: CupertinoNavigationBar())),
),
);
expect(tester.getSize(find.byType(CupertinoNavigationBar)), Size.zero);
});
}
class _ExpectStyles extends StatelessWidget {