Navigator

The single entry point for navigation events. NavigationState holds the state; this class is the only thing that changes it.

Feature modules never touch the back stacks directly — they declare fun Navigator.navigateToX() extensions next to their NavKey, which is what keeps a feature from having to know how the rest of the app is structured.

Constructors

Link copied to clipboard
constructor(state: NavigationState)

Properties

Link copied to clipboard

The state this navigator updates.

Functions

Link copied to clipboard

Whether goBack has somewhere to go. False means back should exit the app.

Link copied to clipboard
fun goBack()

Goes back one step.

Link copied to clipboard
fun navigate(key: NavKey)

Navigates to key, picking the behaviour from what kind of destination it is: