I am trying to pass data with compose navigation 1...
# compose
z
I am trying to pass data with compose navigation 1.0.0-alpha01 (alpha02 is causing a crash with slotTable but that’s irrelevant to my question) I manage to pass primitive quite well but when trying to pass ParcelableType classes, i get a crash:
UnsupportedOperationException: Parcelables don't support default values.
My code for passing the data is:
Copy code
composable("route".plus("/argument_key"),
        arguments = listOf(navArgument("argument_key) {
            type = NavType.ParcelableType(AnimationIdHolder::class.java)
        })
)
And my code for extracting it is:
Copy code
backStackEntry.arguments?.getParcelable<AnimationIdHolder>("argument_key")
Where
AnimationIdHolder
is:
Copy code
@Parcelize
data class AnimationIdHolder(
    val animationId: Int

): Parcelable
@Ian Lake Any idea on what is the default value required here and why it is not supported? Further more, maybe someone can point me in the direction of how i can pass parcelable types using the safeArgs in jetpack compose navigation?
g
j
alpha02 is causing a crash with slotTable but that’s irrelevant to my question
to use alpha02 you need to use compose07 too. And all libraries that use compose should also point to 07 (in my case it was Koin the problem)
z
Thank you @gsala, that thread basically answered my question. And thank you @Jordi Saumell for the tip, I get this crash whenever I try to upgrade the compose version to 07 but I guess I have to go through my Gradle more carefully to find all the dependencies.