mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
b076f52ee1
commit
c99db0dc0d
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user