Persist exact tab locations including Settings under Pipelines
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user