-
-
Save dilrajsingh1997/fd5d714236df8bbe3b792257dc19cabc 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, | |
val userName: kotlin.String, | |
) | |
companion object { | |
fun parseArguments(backStackEntry: NavBackStackEntry): UserPageArgs { | |
return UserPageArgs( | |
userId = backStackEntry.arguments?.getString("userId") ?: "", | |
isLoggedIn = backStackEntry.arguments?.getBoolean("isLoggedIn") ?: false, | |
userName = backStackEntry.arguments?.getString("userName") ?: "", | |
) | |
} | |
val argumentList: MutableList<NamedNavArgument> | |
get() = mutableListOf( | |
navArgument("userId") { | |
type = NavType.StringType | |
}, | |
navArgument("isLoggedIn") { | |
type = NavType.BoolType | |
}, | |
navArgument("userName") { | |
type = NavType.StringType | |
}, | |
) | |
fun getDestination(userId: kotlin.String, isLoggedIn: kotlin.Boolean, userName: kotlin.String, ): String { | |
return "userPage?" + | |
"userId=$userId," + | |
"isLoggedIn=$isLoggedIn," + | |
"userName=$userName" + | |
"" | |
} | |
val route = "userPage?userId={userId},isLoggedIn={isLoggedIn},userName={userName}" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment