Nav3Navigator

abstract class Nav3Navigator<T : NavKey>(val backStack: NavBackStack<T>, log: (() -> String) -> Unit = {})

Provides guarded navigation operations for backStack, preventing redundant mutations and rejecting stale navigation requests.

Supports NestedNavHost destinations by prioritizing their nested back stacks during back navigation. Only one level of nesting is handled.

Back navigation preserves the root entry of each stack. The root stack must be non-empty, although direct mutations of backStack can violate this invariant.

Parameters

log

Optional callback for lazily logging skipped navigation operations. Messages are evaluated only when the callback invokes them.

Constructors

Link copied to clipboard
constructor(backStack: NavBackStack<T>, log: (() -> String) -> Unit = {})

Properties

Link copied to clipboard
Link copied to clipboard

The current root route. An empty root stack is a structural navigator error.

Functions

Link copied to clipboard
open fun popBackStack()

Pops the active nested stack first, then falls back to the root stack.

Handles back navigation only when from equals the current route of the active stack.