0xf1f1
06/15/2024, 11:47 PMStylianos Gakis
06/15/2024, 11:54 PM0xf1f1
06/16/2024, 12:15 AMstartDestination=Booking
where Booking is @serializer data class Booking(id: String)
I get the following error: kotlinx.serialization.SerializationException: Serializer for class 'Booking' is not found. Please ensure that class is marked as '@Serializable' and that the serialization compiler plugin is applied.
Stylianos Gakis
06/16/2024, 12:22 AMid
be?0xf1f1
06/16/2024, 12:30 AM0xf1f1
06/16/2024, 12:38 AMobject Booking -
very strange decision because as pointed out, passing data around is a key part of navigation. At the moment I just create an empty composite as a work around0xf1f1
06/16/2024, 12:39 AMStylianos Gakis
06/16/2024, 1:27 AMid: String
to work. How could you say that your start destination is something without saying what that String will be?
If you just navigate to that navGraph, where would it go as a start destination?Ian Lake
06/16/2024, 6:06 AMBooking
is Companion object for a data class, not the class itself, while Booking("home")
is an instance of Booking, which is a perfectly valid start destinationIan Lake
06/16/2024, 6:09 AMIan Lake
06/16/2024, 6:10 AMnavigate
directly to the destination you want, you wouldn't rely on navigating to a graph just to pass that same fields to its start destination0xf1f1
06/16/2024, 7:10 AMBooking
in startDestination
fixes the issue but I am a little stumped by it. Considering there is no way I will have access to the booking Id at that stage, I have to instantiate it with a blank value i.e. startDestination=Booking(id = "")
- this of course doesn't feel right. Is it a good idea to put destinations that require variables as the startDestination
? What exactly should be put here, and what should one avoid ?