Are there any good solutions for typesafe and boil...
# compose
l
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).
i
Yep, we had talked about Compose Destinations and how you'd want to structure your code previously: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1645595702068129?thread_ts=1645552485.247699&cid=CJLTWPH7S
l
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
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?
Never mind, there were other problems in my code which required fixing.