Skip to content

Instantly share code, notes, and snippets.

@raamcosta
Created Sep 28, 2021
Embed
What would you like to do?
First approach: ProfileScreenSpec
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