hawklike
12/05/2024, 2:56 PMRoute …CharacterDetail could not find any NavType for argument id of type …Character.Id - typeMap received was {}
For better perspective see the code:
@Serializable
public data class CharacterDetail(val id: Character.Id)
composable<CharacterDetail> { backStackEntry ->
val character: CharacterDetail = backStackEntry.toRoute()
CharacterDetailScreen(character.id, onNavigateBack)
}
public data class Character(id: Character.Id, ...) {
@Serializable
public data class Id(val value: Int)
}
Is the @Serializable type safe navigation argument still not supported in CMP?Ian Lake
12/05/2024, 3:12 PMCharacter.Id
class. You need to do that if any of the fields in your class aren't primitive typesIan Lake
12/05/2024, 3:13 PMhawklike
12/05/2024, 3:19 PM@Serializable
public data class Id(val value: Int)
There is only a primitive type inside Character.Id
class. What I am missing, please?
Also, I know a value class would be a perfect match for this use case, but we had some problems using them from the iOS side, so we abandoned them.Ian Lake
12/05/2024, 3:24 PMhawklike
12/05/2024, 3:26 PM