popBackTo

fun NavController.popBackTo(destination: KDestination, inclusive: Boolean = false): Boolean(source)

Pops the navigation back stack to the specified KDestination.

Example

navController.popBackTo(Screen.Login)

navController.popBackTo(
destination = Screen.Splash,
inclusive = true
)

Return

true if the back stack was popped successfully.

Parameters

destination

The destination to pop back to.

inclusive

Whether the destination itself should also be removed.