Persist exact tab locations including Settings under Pipelines

This commit is contained in:
2026-11-08 01:04:00 +00:00
parent d6006bb1f8
commit 151d99fbb6
10 changed files with 778 additions and 25 deletions
+10 -1
View File
@@ -21,6 +21,7 @@ class AdaptiveShell extends StatefulWidget {
this.cupertino = false,
this.destination,
this.onDestinationSelected,
this.onClosePage,
this.onSearch,
this.attentionCount = 0,
this.listPaneWidthStore = const SharedPreferencesListPaneWidthStore(),
@@ -36,6 +37,7 @@ class AdaptiveShell extends StatefulWidget {
/// selection, which preserves the plain-shell tests and native composition.
final AppDestination? destination;
final ValueChanged<AppDestination>? onDestinationSelected;
final VoidCallback? onClosePage;
/// Opens the transient Search page. Null hides the action, so the plain
/// shell tests and compositions without routing keep their tab set only.
@@ -265,7 +267,14 @@ class _AdaptiveShellState extends State<AdaptiveShell> {
}
/// Leaves a page destination (Settings) for the tab it belongs to.
void _closePage() => _select(shellTabFor(_selected));
void _closePage() {
final close = widget.onClosePage;
if (close != null) {
close();
} else {
_select(shellTabFor(_selected));
}
}
/// The system Back the shell handles: it closes a page, or else returns to
/// the previous tab unless the open item's own pane closes a page first.