Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Modular to navigate to a BottomSheet or Dialog? #730

Closed
rhbrunetto opened this issue May 27, 2022 · 7 comments
Closed

How to use Modular to navigate to a BottomSheet or Dialog? #730

rhbrunetto opened this issue May 27, 2022 · 7 comments
Labels
in triage new New issue request attention

Comments

@rhbrunetto
Copy link

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 Return routeGenerator to the route #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 routeGenerator back in?

Btw, I do appreciate the job you guys are doing with Modular!
Let us help to resolve such limitations.

@rhbrunetto rhbrunetto added the new New issue request attention label May 27, 2022
@guigzp
Copy link

guigzp commented Jun 29, 2022

Seems like it would be a nice a improvement, any updates on this?

@Zeca-dev
Copy link

Zeca-dev commented Jul 27, 2022

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.

@rhbrunetto
Copy link
Author

@jacobaraujo7 how can we help on this? Should we submit a new PR following similar changes from #598? Should we propose a different solution?

@vscmaster
Copy link

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

@andersonmendesdev
Copy link

andersonmendesdev commented Mar 5, 2023

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?

@gibahjoe
Copy link
Contributor

Maybe the maintainer can enlighten us to why it was removed.

@jacobaraujo7
Copy link
Contributor

RouterGenerator is no longer used as we are working with Navigator 2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in triage new New issue request attention
Projects
None yet
Development

No branches or pull requests

7 participants