-
-
Save dilrajsingh1997/66f95dcfef546e729a9b461eea670c37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserPageDestination { | |
data class UserPageArgs ( | |
val userId: kotlin.String, | |
val isLoggedIn: kotlin.Boolean, | |
) | |
companion object { | |
fun parseArguments(backStackEntry: NavBackStackEntry): UserPageArgs { | |
return UserPageArgs( | |
userId = backStackEntry.arguments?.getString("userId") ?: "", | |
isLoggedIn = backStackEntry.arguments?.getBoolean("isLoggedIn") ?: false, | |
) | |
} | |
val argumentList: MutableList<NamedNavArgument> | |
get() = mutableListOf( | |
navArgument("userId") { | |
type = NavType.StringType | |
}, | |
navArgument("isLoggedIn") { | |
type = NavType.BoolType | |
}, | |
) | |
fun getDestination(userId: kotlin.String, isLoggedIn: kotlin.Boolean, ): String { | |
return "userPage?" + | |
"userId=$userId," + | |
"isLoggedIn=$isLoggedIn" + | |
"" | |
} | |
val route = "userPage?userId={userId},isLoggedIn={isLoggedIn}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment