Skip to content

Instantly share code, notes, and snippets.

@gabrielbmoro
Created January 21, 2022 14:03
Show Gist options
  • Save gabrielbmoro/924faa652c87956bfada27191475e481 to your computer and use it in GitHub Desktop.
Save gabrielbmoro/924faa652c87956bfada27191475e481 to your computer and use it in GitHub Desktop.
Navigation graph - Navigation Compose
composable(
"${ScreenRoutes.QUIZ_ROUTE}/{${ScreenRoutes.QUIZ_ARGUMENT_KEY}}",
arguments = listOf(
navArgument(ScreenRoutes.QUIZ_ARGUMENT_KEY) {
type = NavQuizType()
}
)
) {
val quiz = it.arguments?.getParcelable<Quiz>(ScreenRoutes.QUIZ_ARGUMENT_KEY)
?: throw IllegalStateException("It is not possible access the quiz object")
QuizScreen(quiz = quiz)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment