Lukasz Kalnik

08/11/2022, 2:19 PM
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
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).

Ian Lake

08/11/2022, 4:06 PM
Yep, we had talked about Compose Destinations and how you'd want to structure your code previously:

Lukasz Kalnik

08/11/2022, 4:28 PM
Oh, that's a great thread! Thanks so much for the link!
Ok, so I'm using Compose Destinations and I navigate passing an argument. I'm reading the argument in the ViewModel via
. 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?
Never mind, there were other problems in my code which required fixing.