Skip to content

Instantly share code, notes, and snippets.

@arriolac
Last active January 30, 2023 21:02
Show Gist options
  • Save arriolac/83f063c408791454f5dbac52a96b8258 to your computer and use it in GitHub Desktop.
Save arriolac/83f063c408791454f5dbac52a96b8258 to your computer and use it in GitHub Desktop.
The navigation graph for Sunflower
// Copyright 2023 Google LLC.
// SPDX-License-Identifier: Apache-2.0
val navController = rememberNavController()
NavHost(navController = navController, startDestination = "home") {
composable("home") {
HomeScreen(/* ... */)
}
composable(
"plantDetail/{plantId}",
arguments = listOf(navArgument("plantId") { type = NavType.StringType })
) {
PlantDetailsScreen(/* ... */)
}
composable(
"gallery/{plantName}",
arguments = listOf(navArgument("plantName") { type = NavType.StringType })
) {
GalleryScreen(/* ... */)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment