Make sure that a Tab doesn't crash in 0x0 environment (#178118)

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

Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
This commit is contained in:
Ahmed Mohamed Sameh 2025-11-11 02:34:17 +02:00 committed by GitHub
parent b076f52ee1
commit c99db0dc0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9323,6 +9323,19 @@ void main() {
expect((innerMaterial as dynamic).debugInkFeatures, hasLength(1));
});
testWidgets('Tab does not crash at zero area', (WidgetTester tester) async {
await tester.pumpWidget(
const MaterialApp(
home: Scaffold(
body: Center(
child: SizedBox.shrink(child: Tab(child: Text('X'))),
),
),
),
);
expect(tester.getSize(find.byType(Tab)), Size.zero);
});
testWidgets('Tab can have children with other semantics roles', (WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(