Lay out phone content above navigation bar

Use the phone NavigationBar as a real Scaffold bottom slot so destination content ends at the bar rather than scrolling beneath it. Update shell regression coverage and document the focused verification.
This commit is contained in:
2026-11-12 19:25:39 +00:00
parent 767643d991
commit 08b2540ec2
4 changed files with 63 additions and 24 deletions
+18 -18
View File
@@ -139,24 +139,24 @@ void main() {
expect(find.text('Chat — Not implemented'), findsOneWidget);
});
testWidgets('content learns the bar height as bottom padding', (
tester,
) async {
for (final size in const [Size(390, 844), Size(640, 800)]) {
await setSize(tester, size);
await tester.pumpWidget(shell());
await tester.pump();
final rect = size.width < 600
? tester.getRect(find.byType(NavigationBar))
: tester.getRect(pill());
// The content's bottom padding clears the whole bar and its margin.
expect(
contentBottomPadding,
moreOrLessEquals(size.height - rect.top, epsilon: 0.5),
reason: '$size',
);
}
});
testWidgets(
'phone content has no floating-bar padding; tablet content does',
(tester) async {
for (final size in const [Size(390, 844), Size(640, 800)]) {
await setSize(tester, size);
await tester.pumpWidget(shell());
await tester.pump();
final rect = size.width < 600
? tester.getRect(find.byType(NavigationBar))
: tester.getRect(pill());
expect(
contentBottomPadding,
size.width < 600 ? 0 : size.height - rect.top,
reason: '$size',
);
}
},
);
testWidgets('resizing moves the bar without remounting content', (
tester,