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

Improve SnackBar error message when shown during build #106658

Conversation

bleroux
Copy link
Contributor

@bleroux bleroux commented Jun 27, 2022

Description

This PR catches the generic error thrown when calling ScaffoldMessenger.showSnackBar() during build and throws an error with a more intuitive message.

Related Issue

Fixes #66789

Tests

Adds 1 test.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Jun 27, 2022
@bleroux bleroux requested a review from Piinks June 27, 2022 12:28
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me run this through Google testing first, in the past folks have tried to solve this and broken some customers internally (I need to approve before being able to run the tests). This is a different approach though, so it may be ok. Thanks!

@Piinks Piinks changed the title Improve SnackBar error message when shown during build WIP - Improve SnackBar error message when shown during build Jun 27, 2022
@Piinks
Copy link
Contributor

Piinks commented Jun 27, 2022

Marked WIP so the bot will not merge accidentally.

@Piinks
Copy link
Contributor

Piinks commented Jun 30, 2022

Internal tests all passed, it looks like there is a merge conflict though, can you resolve?

@Piinks Piinks changed the title WIP - Improve SnackBar error message when shown during build Improve SnackBar error message when shown during build Jun 30, 2022
@Piinks Piinks added the a: error message Error messages from the Flutter framework label Jun 30, 2022
@bleroux bleroux force-pushed the improve_snackbar_shown_during_build_error_message branch from 28f00f6 to 12b60aa Compare June 30, 2022 18:29
@bleroux bleroux force-pushed the improve_snackbar_shown_during_build_error_message branch from 12b60aa to 66cb5a7 Compare June 30, 2022 18:38
@Piinks Piinks added waiting for tree to go green autosubmit Merge PR when tree becomes green via auto submit App labels Jun 30, 2022
@auto-submit auto-submit bot merged commit 0eed9ad into flutter:master Jun 30, 2022
@bleroux bleroux deleted the improve_snackbar_shown_during_build_error_message branch July 1, 2022 06:18
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Jul 1, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 1, 2022
camsim99 pushed a commit to camsim99/flutter that referenced this pull request Aug 10, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 30, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: error message Error messages from the Flutter framework autosubmit Merge PR when tree becomes green via auto submit App f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The error message when you show a snackbar during build is unintuitive
2 participants