-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
The error message when you show a snackbar during build is unintuitive #66789
Comments
A reproducible code sample would help. |
/cc @Piinks |
Is this change required only for the snackbar widget or for the entire general error message? |
I tried a different approach scheduling a PostFrameCallback for the Snackbar if the framework is building, like it's done for the overlay: flutter/packages/flutter/lib/src/widgets/overlay.dart Lines 154 to 160 in 38db394
What I've done in
The issue here is that the Here's my example code:
|
Always scheduling the SnackBar in a post frame callback works, but I don't know if it impact the framework in any other ways. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
We should catch it explicitly in the scaffold code and say something like "Snackbars cannot be shown during build" or some such.
The text was updated successfully, but these errors were encountered: