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:
@@ -258,24 +258,26 @@ void main() {
|
||||
expect(pill.width, lessThan(640 * 0.6));
|
||||
});
|
||||
|
||||
testWidgets('390: the bar hugs its tabs at the phone\'s bottom '
|
||||
'right', (tester) async {
|
||||
testWidgets('390: a phone shows the full-width navigation bar at the bottom, '
|
||||
'with no floating pill', (tester) async {
|
||||
await setSize(tester, const Size(390, 844));
|
||||
await tester.pumpWidget(shell(split: false));
|
||||
await tester.pump();
|
||||
final pill = destinationPill(tester);
|
||||
expect(pill.width, lessThanOrEqualTo(390 - 2 * kFloatingBarMargin));
|
||||
final bar = find.byType(NavigationBar);
|
||||
final rect = tester.getRect(bar);
|
||||
expect(rect.left, 0);
|
||||
expect(rect.right, 390);
|
||||
expect(rect.bottom, 844);
|
||||
expect(find.byType(FloatingDestinationBar), findsNothing);
|
||||
for (final destination in shellTabDestinations) {
|
||||
expect(
|
||||
find.byKey(
|
||||
ValueKey(
|
||||
'destination-label-${destinationDetails(destination).label}',
|
||||
),
|
||||
find.descendant(
|
||||
of: bar,
|
||||
matching: find.text(destinationDetails(destination).label),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
}
|
||||
expect(pill.right, closeTo(390 - kFloatingBarMargin, 0.5));
|
||||
});
|
||||
|
||||
for (final width in [600.0, 640.0]) {
|
||||
|
||||
Reference in New Issue
Block a user