screen
expect inline fun <Args, VM : ViewModel> screen(route: String, noinline viewModelWithArgs: @Composable (args: Args?) -> VM, noinline content: @Composable (viewModel: VM) -> Unit)
Declare screen content for route and add it to underlying screens map. The screens map will be used to navigate between the screens.
Parameters
VM
generic type of ViewModel
route
used to identify the screen when navigating, in order to present it's content
content
Composable lambda with content of the screen that takes view model as a parameter
Throws
when attempting to add new screen for already registered route
expect fun <VM : ViewModel> screen(route: String, viewModelFactory: @Composable () -> VM, content: @Composable (viewModel: VM) -> Unit)
Alternative implementation of screen that does not pass any arguments.