Recipes
Tabs, nested Scopes, and branch resets
Retain independent Navigator stacks, select branches explicitly, and reset them only when application lifecycle requires it.
Tabs, nested Scopes, and branch resets
Preserve a tab stack
Model every retained tab as a child NavigationScopeDefinition. Use activateBranch to switch; inactive Scope snapshots remain unchanged.
Render the active tab
Place NavigationActiveOutlet(parentScopeId: shellScopeId) inside the shell Page. It listens to Session state and renders the selected child Navigator.
Show two stacks at once
Use two exact NavigationOutlet(scopeId: ...) widgets for master-detail or multi-pane layouts. Each Scope still owns its own stack and Back semantics.
Navigate into a non-active branch
Constrain the Target with scopeId or mountId when automatic placement is ambiguous, then activate that branch explicitly if it must become visible.
Clear private state on sign-out
Call resetBranch(accountScopeId) from the application lifecycle handler. The operation clears that Scope and descendants; ordinary tab switching must not perform this reset.