a1c4c1c402
Settings leaves the tab bar (Pipelines, Runs, Chat, Search) and opens as a page from a gear in the Pipelines bar, keeping /settings, its keys and a Back to Pipelines (also the system Back). Every floating tab bar shows icons only, named for assistive technology. On wide windows the shell's tab bar stays at the bottom right; a split detail learns its height plus a 12px gap, so its tabs or the chat composer float above it, and pages the detail opens (the stage page) stay in its pane through its own navigator.
46 lines
1.7 KiB
Dart
46 lines
1.7 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../ui/adaptive/host.dart';
|
|
|
|
/// The open item's own navigator beside a list on a wide window.
|
|
///
|
|
/// A page the item opens (a run's stage page, an artifact, a file) is pushed
|
|
/// here, so it fills the item's pane while the list and the shell's tab bar
|
|
/// stay in place: the page's own tabs then float above the shell's bar, as
|
|
/// the item's tabs do. Dialogs still use the root navigator.
|
|
///
|
|
/// The item is this navigator's first page under a fixed key, so a rebuilt
|
|
/// item updates in place and is never remounted. The system Back pops a page
|
|
/// pushed here before it leaves the item.
|
|
class DetailPaneNavigator extends StatefulWidget {
|
|
const DetailPaneNavigator({super.key, required this.child});
|
|
|
|
final Widget child;
|
|
|
|
@override
|
|
State<DetailPaneNavigator> createState() => _DetailPaneNavigatorState();
|
|
}
|
|
|
|
class _DetailPaneNavigatorState extends State<DetailPaneNavigator> {
|
|
final GlobalKey<NavigatorState> _navigator = GlobalKey();
|
|
static const _rootKey = ValueKey<String>('list-detail-root');
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final Page<void> root = usesCupertinoHost(context)
|
|
? CupertinoPage<void>(key: _rootKey, child: widget.child)
|
|
: MaterialPage<void>(key: _rootKey, child: widget.child);
|
|
return NavigatorPopHandler(
|
|
onPopWithResult: (_) => _navigator.currentState?.maybePop(),
|
|
child: Navigator(
|
|
key: _navigator,
|
|
pages: [root],
|
|
// The item is never popped from here: its pane closes with the
|
|
// selection, which the owning screen controls.
|
|
onDidRemovePage: (_) {},
|
|
),
|
|
);
|
|
}
|
|
}
|