Skip to content

Commit bcc0c47

Browse files
Handle#6537 bottom navigation bar (flutter#172404)
This is my attempt to handle flutter#6537 for the BottomNavigationBar UI control. --------- Co-authored-by: Tong Mu <[email protected]>
1 parent c210614 commit bcc0c47

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

packages/flutter/test/material/bottom_navigation_bar_test.dart

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3092,6 +3092,29 @@ void main() {
30923092
expect(find.byKey(key1), findsOneWidget);
30933093
expect(find.byKey(key2), findsOneWidget);
30943094
});
3095+
3096+
testWidgets('BottomNavigationBar and BottomNavigationBarItem render at zero size', (
3097+
WidgetTester tester,
3098+
) async {
3099+
await tester.pumpWidget(
3100+
MaterialApp(
3101+
home: Center(
3102+
child: SizedBox.shrink(
3103+
child: Scaffold(
3104+
bottomNavigationBar: BottomNavigationBar(
3105+
items: const <BottomNavigationBarItem>[
3106+
BottomNavigationBarItem(icon: Icon(Icons.favorite_border), label: 'X'),
3107+
BottomNavigationBarItem(icon: Icon(Icons.access_alarm), label: 'Y'),
3108+
],
3109+
),
3110+
),
3111+
),
3112+
),
3113+
),
3114+
);
3115+
final Finder xText = find.text('X');
3116+
expect(tester.getSize(xText).isEmpty, isTrue);
3117+
});
30953118
}
30963119

30973120
Widget boilerplate({

0 commit comments

Comments
 (0)