Skip to content

Instantly share code, notes, and snippets.

@mohanmanu484
Created May 28, 2024 10:09
Show Gist options
  • Save mohanmanu484/f6c05a21259978c92e815794358ad695 to your computer and use it in GitHub Desktop.
Save mohanmanu484/f6c05a21259978c92e815794358ad695 to your computer and use it in GitHub Desktop.
fun handleDeeplink(
navController: NavHostController,
deeplink: String
) {
val navigation = when {
deeplink.startsWith("/login") -> {
val id = extractId(deeplink)
Navigation.Login(id)
}
deeplink.startsWith("/buysell") -> {
val id = extractId(deeplink)
val isModifyFlow = extractModifyFlow(deeplink)
val orderId = extractOrderId(deeplink)
Navigation.Login(id)
}
else -> null
}
navController.navigate(navigation)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment