Navigator

A basic navigation interface for navigating between screens.

Inheritors

Types

Link copied to clipboard
object NoOp : Navigator

Functions

Link copied to clipboard
abstract override fun goTo(screen: Screen): Boolean

Navigate to the screen.

Link copied to clipboard
abstract fun peek(): Screen?

Returns current top most screen of backstack, or null if backstack is empty.

Link copied to clipboard
abstract fun peekBackStack(): ImmutableList<Screen>

Returns the current back stack.

Link copied to clipboard
abstract fun pop(result: PopResult? = null): Screen?
Link copied to clipboard
fun Navigator.popRoot(result: PopResult? = null)

Pop the Navigator as if this was the root Navigator.pop call.

Link copied to clipboard
fun Navigator.popUntil(predicate: (Screen) -> Boolean)

Calls Navigator.pop until the given predicate is matched or it pops the root.

Link copied to clipboard
abstract fun resetRoot(newRoot: Screen, saveState: Boolean = false, restoreState: Boolean = false): ImmutableList<Screen>

Clear the existing backstack of screens and navigate to newRoot.

Link copied to clipboard
inline fun Navigator.resetRoot(newRoot: Screen, saveState: (currentRoot: Screen?) -> Boolean = { false }, restoreState: (currentRoot: Screen?) -> Boolean = { false }): List<Screen>

Clear the existing backstack of screens and navigate to newRoot.