Skip to content

Instantly share code, notes, and snippets.

@dilrajsingh1997
Last active Nov 21, 2021
Embed
What would you like to do?
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