resetRoot

fun Navigator.resetRoot(newRoot: Screen, saveState: Boolean = false, restoreState: Boolean = false, clearState: Boolean = false): List<Screen>(source)

Parameter based alternate for Navigator.resetRoot.


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

Clear the existing backstack of screens and navigate to newRoot.

This is useful in preventing the user from returning to a completed workflow, such as a tutorial, wizard, or authentication flow.

This version of the function provides easy to lambdas for saveState, restoreState, and clearState allowing computation of the values based on the current root screen.