uli
04/01/2025, 7:24 AMinternal fun NavGraphBuilder.mainFlowDestination(
navController: NavHostController,
) {
DisposableEffect(Unit) { ... }
navigation<MainFlowRoute>(Route1::class) {
composable<Route1> { ... }
composable<Route2> { ... }
}
}
The problem here is, that fun mainFlowDestination
is not @Composable
. Is there a common pattern for it, like introducing a `comosable{}`around the whole method that gets inserted as a ‘silent’ node? What would the route be? Wold it affect back naviagtion?
Something like this. But that looks fishy:
internal fun NavGraphBuilder.mainFlowDestination(
navController: NavHostController,
) {
composable<MainFlowRoute> {
DisposableEffect(Unit) { ... }
navigation<MainFlowRoute>(Route1::class) {
composable<Route1> { ... }
composable<Route2> { ... }
}
}
}
Should I replace navigation<MainFlowRoute>
with a nested NavHost?
internal fun NavGraphBuilder.mainFlowDestination(
navController: NavHostController,
) {
composable<MainFlowRoute> {
DisposableEffect(Unit) { ... }
NavHost(navController, Route1::class) {
composable<Route1> { ... }
composable<Route2> { ... }
}
}
}