navigation
Declares a scoped navigation entry within a Koin scope DSL.
This function registers a composable navigation destination that is scoped to a specific Koin scope, allowing access to scoped dependencies within the composable. The route type T is used as both the navigation destination identifier and a qualifier for the entry provider.
Example usage:
activityScope {
viewModel { MyViewModel() }
navigation<MyRoute> { route ->
MyScreen(viewModel = koinViewModel())
}
}Return
A KoinDefinition for the created EntryProviderInstaller
Parameters
The type representing the navigation route/destination
A composable function that receives the Scope and route instance T to render the destination
See also
for module-level navigation entries
Declares a singleton navigation entry within a Koin module.
This function registers a composable navigation destination as a singleton in the Koin module, allowing access to module-level dependencies within the composable. The route type T is used as both the navigation destination identifier and a qualifier for the entry provider.
Example usage:
module {
viewModel { MyViewModel() }
navigation<HomeRoute> { route ->
HomeScreen(myViewModel = koinViewModel())
}
}Return
A KoinDefinition for the created EntryProviderInstaller
Parameters
The type representing the navigation route/destination
A composable function that receives the Scope and route instance T to render the destination
See also
for scope-level navigation entries