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

Global scaffoldMessengerKey to show SnackBar, but Flushbar? #128

Open
danielrrys opened this issue Sep 23, 2024 · 0 comments
Open

Global scaffoldMessengerKey to show SnackBar, but Flushbar? #128

danielrrys opened this issue Sep 23, 2024 · 0 comments

Comments

@danielrrys
Copy link

danielrrys commented Sep 23, 2024

FlutterError: Navigator operation requested with a context that does not include a Navigator. The context used to push or pop routes from the Navigator must be that of a widget that is a descendant of a Navigator widget.

I decided to change to Flushbar, before I used the Snackbar default, but before it occupied the GlobalKey<ScaffoldMessengerState> in the main.dart MaterialApp to show the Snackbar as :

messengerKey.currentState!
      ..hideCurrentSnackBar()
      ..showSnackBar(snackBar); 

And have a better control in all my application of the Snackbar, but in Flushbar I don't know if I can really use it like that.

If I use flush.show(messengerKey.currentContext!); i have that error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant