:wave: i would like to use decompose stack router ...
# decompose
m
👋 i would like to use decompose stack router and was looking at how to make it work with different modules. Looks like alternatives such as the compose or flutter routers lean towards a uri based routing system. My idea is to use a config data class representing the route and then convert that to locations/destinations in the builder. Does this seem like a reasonable approach? Has anyone done something similar? Is this anyhow planned? The benefits i see are: • Implementing the web history or deeplinks would be trivial • Each module just needs to know the path, not any impl detail
a
This is by design and no changes are planned. The top priority for Decompose is compile and type safety, plus the ability to pass objects to destinations. Decompose works well in multi-module projects, and actually allows excellent decoupling. Your child screens shouldn't be aware of any destinations. They should just accept a navigation callback (like
onFinished
or
onItemSelected(id)
), and one of the parents should contain Parcelable child configurations and be responsible for navigation. So children should never know where to navigate, but instead they should signal what happened and let the parent decide what to do with the signal.
m
Understood, makes sense