minimise
minimise copied to clipboard
How to implement popUpTo start naviagtion
I added NavOptionsBuilder
interface NavigationCommand {
val arguments: List<NamedNavArgument>
val destination: String
val builder: NavOptionsBuilder.() -> Unit
}
but I cannot access start navigation because I don't have reference on navController graph,
i used popUpTo and popBackStack() in this way : navController.navigate(command.destination){ // Clear the back stack up to the OnBoarding screen navController.popBackStack(OnBoardingDirections.onBoarding.destination, true) or // Clear the back stack launchSingleTop = true restoreState = true } hope i helped