Skip to content

Instantly share code, notes, and snippets.

@appspell
Created May 11, 2021 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save appspell/ecc67ff757389fd7ef3fd5209ab2b9ca to your computer and use it in GitHub Desktop.
Save appspell/ecc67ff757389fd7ef3fd5209ab2b9ca to your computer and use it in GitHub Desktop.
setContent {
val navController = rememberNavController()
NavHost(navController, startDestination = NavigationDestination.Screen1.destination) {
composable(NavigationDestination.Screen1.destination) {
val viewModel: Screen1ViewModel = viewModel()
Screen1(viewModel = viewModel)
}
composable(NavigationDestination.Screen2.destination) {
val viewModel: Screen2ViewModel = viewModel()
Screen2(viewModel = viewModel)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment