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

Function missing Future keyword #971

Open
matheusrmribeiro opened this issue Oct 20, 2024 · 0 comments
Open

Function missing Future keyword #971

matheusrmribeiro opened this issue Oct 20, 2024 · 0 comments
Labels
new New issue request attention

Comments

@matheusrmribeiro
Copy link

Describe the bug
The function navigate declared in the file "modular_navigator.dart", is set as "void navigate(...)" but on it implementation function it works asynchronous, so I can't await this function finishes to executes to call my code.
I'm talking about the implementation in the file "modular_router_delegate.dart".

Environment
flutter_modular: ^6.3.4

To Reproduce
Here I want to first navigate to the root page "menus", then push a named route to open the specified menu.

  void navigateToSubpage(String destination) async {
    await Modular.to.navigate("/menus"); <-- Can't use await here because the way the function is declared
    Modular.to.pushNamed(destination);
  }

Expected behavior
That the function navigate could be awaited.

Screenshots
image
image

@matheusrmribeiro matheusrmribeiro added the new New issue request attention label Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new New issue request attention
Projects
None yet
Development

No branches or pull requests

1 participant