How to use Modular to navigate to a BottomSheet or Dialog?
Following the #598 issue, there's a limitation in the most recent versions of Modular where you can't specify a RouteBuilder in ChildRoutes. I decided to turn my last comment into an issue so we can enlighten the situation.
Questions
How should we supposed to navigate to a page (for instance, in another Module) and tell Modular to build it as a BottomSheet or as a Dialog instead of a default MaterialPage?
- There was a solution proposed previously in #628. Does it goes against any pattern of how Modular should be used?
- If yes, how are we supposed to tell Modular how to build a Route? I mean, how the solution for the cases listed below should look like?
Expected Behavior
For instance, I'd like to create MyScreen (a simple widget) and navigate to it through a route (let's say Modular.to.navigate('/my-screen/')) and make it shows up as a BottomSheet or as a FullScreenDialog. This was possible via routeGenerator parameter that have been removed in the recent versions of Modular.
Arguments
This is particular useful so we can use the Modular Route system to dialogs, bottomsheets and similars. And: 1 - Set a standard of how navigation works in your app (using Modular-only); 2 - Use Bottomsheets/modals as Module roots.
-
I might have a particular complex and detached flow that takes place inside of a BottomSheet-like page and I might want to build a module for it. In this case I would like to simply navigate to the route and just tell Flutter how that page should be generated. But so far we can't since there's just a way to customize the transition and not the route generation in
ChildRoutes. -
How should it happen in the current Modular structure?
-
Shouldn't we have an extra parameter like the
routeGeneratorback in?
Btw, I do appreciate the job you guys are doing with Modular! Let us help to resolve such limitations.
Seems like it would be a nice a improvement, any updates on this?
Seria muito bom ter esse recurso. Faz muita falta. Quando usamos o Modular.to para navegar, o módulo da page é iniciado. Mas se instanciamoos um PageRouter para navegar como modal, como quermosl, o módulo não será iniciado e então teremos problemas com a injeção de depedências.
@jacobaraujo7 how can we help on this? Should we submit a new PR following similar changes from #598? Should we propose a different solution?
Hi there is it any updates regarding routeGenerator?
Our App designed to use BottomSheet via routeGenerator and we unable to upgrade Modular since 2.7v.
We have tens of BS implementations so it's not serious to break the initial UAX at all.
Thank you
I'm interested in this feature, my team and I were thinking of developing the next project using modular and it would be of great importance to be able to customize the types of screens as well as dialogs and bottomsheet. Why was the routeGenerator removed, if it was a good way to generate screen types?
Maybe the maintainer can enlighten us to why it was removed.
RouterGenerator is no longer used as we are working with Navigator 2.0