Skip to content

Instantly share code, notes, and snippets.

@dilrajsingh1997
Last active November 21, 2021 17:09
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 dilrajsingh1997/c1e068da85ab2f0cad7355eb644d2830 to your computer and use it in GitHub Desktop.
Save dilrajsingh1997/c1e068da85ab2f0cad7355eb644d2830 to your computer and use it in GitHub Desktop.
fun parseArguments(backStackEntry: NavBackStackEntry): UserPageArgs {
return UserPageArgs(
userId = backStackEntry.arguments?.getString("userId") ?: "",
isLoggedIn = backStackEntry.arguments?.getBoolean("isLoggedIn") ?: false,
userName = backStackEntry.arguments?.getString("userName") ?: "",
)
}
// usage
val (userId, isLoggedIn) = UserPageDestination.parseArguments(backStackEntry)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment