Are there any good solutions for typesafe and boilerplate free Compose Navigation?
1. For specific navigation graph only a certain set of destinations (sealed class hierarchy/enums) can be passed to
navigate()
2. Pass navigation arguments (like item IDs) in a typesafe manner
3. Automatically generate the route URIs with argument placeholders
4. Easily extract the navigation arguments without additional boilerplate
I'm writing extension functions and sealed class hierarchies/enums for this, but this is such a common use case that maybe someone already came up with a library (or at least someone of you has good suggestions).
Oh, that's a great thread! Thanks so much for the link!
Lukasz Kalnik
08/12/2022, 9:38 AM
Ok, so I'm using Compose Destinations and I navigate passing an argument. I'm reading the argument in the ViewModel via
savedStateHandle
.
The problem is, when navigated to this screen, I have to load some data based on the passed argument.
Do I get a callback when the screen is being navigated to? How can I do the initial loading based on the navigation?
Lukasz Kalnik
08/12/2022, 12:30 PM
Never mind, there were other problems in my code which required fixing.