dave08
01/07/2024, 12:48 PMRafael Costa
01/07/2024, 12:52 PMRafael Costa
01/07/2024, 12:54 PMdave08
01/07/2024, 12:55 PMRafael Costa
01/07/2024, 12:59 PMdave08
01/07/2024, 1:02 PMsavedStateHandle.navArgs<...>()
in a runCatching and test for the other possibility... 🙈dave08
01/07/2024, 1:02 PMRafael Costa
01/07/2024, 1:03 PMRafael Costa
01/07/2024, 1:04 PMRafael Costa
01/07/2024, 1:05 PMdave08
01/07/2024, 1:08 PMRafael Costa
01/07/2024, 1:09 PMdave08
01/07/2024, 1:10 PMRafael Costa
01/07/2024, 1:10 PMRafael Costa
01/07/2024, 1:10 PMRafael Costa
01/07/2024, 1:11 PMdave08
01/07/2024, 1:11 PMcomposable { }
blocksdave08
01/07/2024, 1:12 PMRafael Costa
01/07/2024, 1:13 PMdave08
01/07/2024, 1:24 PM[ksp] com.ramcosta.composedestinations.codegen.commons.IllegalDestinationsSetup: There was an issue with 'navArgsDelegate' of composable 'DetailsScreen': make sure it is a class with a primary constructor.
Rafael Costa
01/07/2024, 1:31 PMRafael Costa
01/07/2024, 1:31 PMdave08
01/07/2024, 1:31 PMRafael Costa
01/07/2024, 1:32 PMdave08
01/07/2024, 1:33 PMdave08
01/07/2024, 1:33 PMRafael Costa
01/07/2024, 1:33 PMRafael Costa
01/07/2024, 1:35 PMdave08
01/07/2024, 1:40 PM@Serializable
sealed interface FooBase {
val id: SomeId
}
@Serializable
data class FooFromLinkArgs(
val stringId: String
) {
override id get() = ...
}
@Serializable
data class Foo(
override val id: SomeId,
val name: String,
...
)
@Destination(
navArgsDelegate = FooBase::class
...
gives me the above errordave08
01/07/2024, 1:41 PMRafael Costa
01/07/2024, 1:45 PMdata class YourScreenArgs(
val arg: FooBase
)
@Destination(
navArgsDelegate = YourScreenArgs::class
)
Rafael Costa
01/07/2024, 1:48 PMYourScreenDestination(Foo(id=…, name=…))
Rafael Costa
01/07/2024, 1:50 PMFooBase
. Otherwise navigation lib won’t be able to automatically parse your URI format back into this class.Rafael Costa
01/07/2024, 1:50 PMRafael Costa
01/07/2024, 1:52 PMRafael Costa
01/07/2024, 1:52 PMdave08
01/07/2024, 2:27 PMRafael Costa
01/07/2024, 2:43 PMRafael Costa
01/07/2024, 2:44 PMdave08
01/07/2024, 3:47 PM