Skip to content

Instantly share code, notes, and snippets.

@AndroidPoet
Created April 17, 2026 17:28
Show Gist options
  • Select an option

  • Save AndroidPoet/a0a840a3f0583ec8a0a9070ac9850009 to your computer and use it in GitHub Desktop.

Select an option

Save AndroidPoet/a0a840a3f0583ec8a0a9070ac9850009 to your computer and use it in GitHub Desktop.
@Composable
fun AppNavigation(navController: NavController) {
NavHost(
navController = navController,
startDestination = Route.Home,
) {
composable<Route.Home> {
HomeScreen(navController)
}
composable<Route.UserProfile> { entry ->
val profile = entry.toRoute<Route.UserProfile>()
UserProfileScreen(
userId = profile.userId,
showPosts = profile.showPosts,
navController = navController
)
}
composable<Route.ProductDetail> { entry ->
val detail = entry.toRoute<Route.ProductDetail>()
ProductDetailScreen(
productId = detail.productId,
category = detail.category,
navController = navController
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment