Float glass tab bars everywhere the app has bottom tabs
One floating frosted tab bar (host NavigationBar / CupertinoTabBar in the shared GlassPill) replaces the NavigationRail, the Cupertino sidebar and the run detail, stage page and pipeline detail tab strips. Below 600px it spans the width minus 16px margins; wider it is sized to its tabs at the right edge. Content keeps the full width, scrolls behind the bar and learns its height as bottom media padding; lists pad their end clear of it and FABs sit above it. The bar now sizes itself from its own constraints instead of the screen size, which fixes the widget_test failure where a MediaQuery without a size gave it negative width constraints.
This commit is contained in:
@@ -24,14 +24,10 @@ void main() {
|
||||
);
|
||||
expect(find.text('Pipelines'), findsWidgets);
|
||||
expect(find.text('Pipelines — Not implemented'), findsOneWidget);
|
||||
expect(
|
||||
find.byType(NavigationBar),
|
||||
width < 600 ? findsOneWidget : findsNothing,
|
||||
);
|
||||
expect(
|
||||
find.byType(NavigationRail),
|
||||
width >= 600 ? findsOneWidget : findsNothing,
|
||||
);
|
||||
// One floating tab bar at every width; no rail.
|
||||
expect(find.byType(NavigationBar), findsOneWidget);
|
||||
expect(find.byType(NavigationRail), findsNothing);
|
||||
expect(tester.takeException(), isNull);
|
||||
await tester.tap(find.text('Runs').last);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Runs — Not implemented'), findsOneWidget);
|
||||
@@ -53,7 +49,7 @@ void main() {
|
||||
expect(find.text('Pipelines — Not implemented'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('Cupertino shell uses a sidebar on a wide window', (
|
||||
testWidgets('Cupertino shell floats its tab bar on a wide window', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = const Size(1280, 900);
|
||||
@@ -61,7 +57,8 @@ void main() {
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
await tester.pumpWidget(const MyApp(cupertino: true));
|
||||
expect(find.byType(CupertinoTabBar), findsNothing);
|
||||
expect(find.byType(CupertinoTabBar), findsOneWidget);
|
||||
expect(find.byType(CupertinoListTile), findsNothing);
|
||||
expect(
|
||||
find.byKey(const ValueKey('shell.destination.pipelines')),
|
||||
findsOneWidget,
|
||||
|
||||
Reference in New Issue
Block a user