-
-
Save raamcosta/6c3a55a07a9f2a0eb476596d3370b37c to your computer and use it in GitHub Desktop.
First approach: ProfileScreenSpec
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
object ProfileScreenSpec : ScreenSpec { | |
override val route = "profile/{id}?isEditable={isEditable}" | |
override val arguments = listOf( | |
navArgument("id") { | |
type = NavType.StringType | |
}, | |
navArgument("isEditable") { | |
type = NavType.BoolType | |
defaultValue = false | |
} | |
) | |
@Composable | |
override fun Content( | |
navController: NavController, | |
navBackStackEntry: NavBackStackEntry, | |
) { | |
ProfileScreen( | |
profileId = navBackStackEntry.arguments?.getString("id")!!, | |
isEditable = navBackStackEntry.arguments?.getBoolean("isEditable")!! | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment