Tamal
01/15/2025, 4:41 PMArne Jans
01/15/2025, 5:54 PMIs there any standard pattern to create navigation graphs in compose that allows for such extensibility?I think, the easiest way would be to use optional arguments (or any other type of flag, like a settings-boolean or similar) to specify non-default behavior for any specific NavDestination where you have to do the following navigation differently. This describes how to do optional arguments for `NavDestination`s https://developer.android.com/guide/navigation/design#compose-arguments
Arne Jans
01/15/2025, 6:00 PMIs it even a good idea to be able to create multiple copies of the same subgraph, each with some minor variations?I don't think it would be necessary to copy and modify a whole sub-graph (if that is even possible due to immutability). It would also put quite some maintenance-burden on the developer, if you simply do the variants by duplicating the code itself, so I would try to avoid it. Disclaimer: I only have experience with the XML-graph and Fragment-navigation for now, but the basic concepts are the same.