Skip to content

Instantly share code, notes, and snippets.

@mohanmanu484
Last active May 28, 2024 08:33
Show Gist options
  • Save mohanmanu484/065bce55ece4cf8bb26631c7370f263e to your computer and use it in GitHub Desktop.
Save mohanmanu484/065bce55ece4cf8bb26631c7370f263e to your computer and use it in GitHub Desktop.
@Composable
fun SampleNavHost() {
val navController = rememberNavController()
NavHost(
navController = navController,
startDestination = Navigation.Login.route
) {
composable(route = "/ipo/{id}?isHomepage={isHomePage}",
arguments = listOf(
navArgument("id") {
type = NavType.StringType;
nullable = false
},
navArgument("isHomePage") {
type = NavType.BoolType;
nullable = false; defaultValue = true
}
),
deepLinks = listOf(
navDeepLink {
uriPattern = "https://www.example.com/ipo/{id}?isHomepage={isHomePage}"
},
navDeepLink {
uriPattern = "app://ipo/{id}?isHomepage={isHomePage}"
}
)
) {
navController.navigate(
NavigationRoutes.ipoRoute(
id = "someId",
isHomePage = false
)
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment