Add phone bottom navigation bar
Replace the narrow-layout floating destination pill with a full-width Material 3 NavigationBar. Reuse the shell destination model and badge wiring while preserving re-selection callbacks and hiding the bar for keyboard/detail states.
This commit is contained in:
@@ -175,23 +175,27 @@ void main() {
|
||||
expect(body.left, greaterThan(list.right));
|
||||
});
|
||||
|
||||
testWidgets('phone and narrow windows keep the floating bar and no rail', (
|
||||
testWidgets('a phone shows the navigation bar with Settings and no rail', (
|
||||
tester,
|
||||
) async {
|
||||
for (final width in [390.0, 640.0]) {
|
||||
await pumpShell(tester, width: width);
|
||||
expect(rail(), findsNothing, reason: '$width');
|
||||
expect(
|
||||
find.byKey(const ValueKey('shell.destination.settings')),
|
||||
findsNothing,
|
||||
reason: '$width',
|
||||
);
|
||||
expect(
|
||||
find.byType(FloatingDestinationBar),
|
||||
findsOneWidget,
|
||||
reason: '$width',
|
||||
);
|
||||
}
|
||||
await pumpShell(tester, width: 390);
|
||||
expect(rail(), findsNothing);
|
||||
expect(find.byType(NavigationBar), findsOneWidget);
|
||||
expect(
|
||||
find.byKey(const ValueKey('shell.destination.settings')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.byType(FloatingDestinationBar), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('a narrow window below the rail keeps the floating bar, no rail '
|
||||
'and no navigation bar', (tester) async {
|
||||
// 640 is wide enough for the list beside its open item, which keeps the
|
||||
// floating bar under the list column.
|
||||
await pumpShell(tester, width: 640);
|
||||
expect(rail(), findsNothing);
|
||||
expect(find.byType(NavigationBar), findsNothing);
|
||||
expect(find.byType(FloatingDestinationBar), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('floating windows keep to the right of the rail on a wide '
|
||||
|
||||
Reference in New Issue
Block a user