Common usecase. I'm declaring navController like.
val navController = rememberNavController()
And connect it to NavHost declaring with some kind of DSL like:
NavHost(
navController,
startDestination = SCREEN_ONE
) {
composable(SCREEN_ONE) {
screenOne(
myViewModel = myViewModel,
navController = navController
)
}
composable(SCREEN_TWO) {...}
........ all other composables
}
That's all I need to start app with embedded navigation.
I'm calling:
navController.navigate(SCREEN_IM_GOING)
inside composables.
So I can use Koin's ViewModel inside composables. But I steel need to pass navController through all compose tree to use it. Would be nice if Koin will take care of navController.