Skip to content

Commit 4ba3886

Browse files
authored
Make sure that a BottomAppBar doesn't crash in 0x0 environment (flutter#172097)
This is my attempt to handle flutter#6537 for the BottomAppBar UI control.
1 parent bcc0c47 commit 4ba3886

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/flutter/test/material/bottom_app_bar_test.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,18 @@ void main() {
733733
expect(iconButton.center.dy, barCenter);
734734
expect(fab.center.dy, barCenter);
735735
});
736+
737+
testWidgets('BottomAppBar renders at zero size', (WidgetTester tester) async {
738+
await tester.pumpWidget(
739+
const MaterialApp(
740+
home: Scaffold(
741+
bottomNavigationBar: SizedBox.shrink(child: BottomAppBar(child: Text('X'))),
742+
),
743+
),
744+
);
745+
final Finder bottomAppBarChild = find.text('X');
746+
expect(tester.getSize(bottomAppBarChild).isEmpty, isTrue);
747+
});
736748
}
737749

738750
// The bottom app bar clip path computation is only available at paint time.

0 commit comments

Comments
 (0)