-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[CP-stable][ Widget Preview ] Throw ToolExit if Flutter Web is not enabled
#178534
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
[CP-stable][ Widget Preview ] Throw ToolExit if Flutter Web is not enabled
#178534
Conversation
…utter#178500) If Flutter Web is not enabled, the widget previewer will crash when trying to find a web device to launch with. This change explicitly checks for this case and throws `ToolExit` with instructions to enable Flutter Web if it's not enabled. Fixes flutter#178486
|
@bkonyi please fill out the PR description above, afterwards the release team will review this request. |
|
This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter. Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds a check to ensure Flutter Web is enabled before running the widget preview command. If it's not enabled, it throws a ToolExit with a helpful message. A corresponding test is added to verify this behavior. The changes are correct and well-tested, but there is a minor issue in the new test case that needs to be addressed.
packages/flutter_tools/test/commands.shard/permeable/widget_preview/widget_preview_test.dart
Show resolved
Hide resolved
b8a7a92
into
flutter:flutter-3.38-candidate.0
This pull request is created by automatic cherry pick workflow
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.
Issue Link:
What is the link to the issue this cherry-pick is addressing?
#178486
Impact Description:
What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)?
Does it impact development (ex. flutter doctor crashes when Android Studio is installed),
or the shipping of production apps (the app crashes on launch).
This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick.
Running
flutter widget-preview startwith Flutter web disabled will result in an error message stating that either Chrome couldn't be found or aStateErroris thrown (for--web-server).Changelog Description:
Explain this cherry pick:
See best practices for examples.
[flutter/178486] When running
flutter widget-preview startwith Flutter Web disabled, an exception is thrown and the widget previewer fails to start.Workaround:
Is there a workaround for this issue?
Run
flutter config --enable-web, but there's currently no indication that this needs to be done.Risk:
What is the risk level of this cherry-pick?
Test Coverage:
Are you confident that your fix is well-tested by automated tests?
Validation Steps:
What are the steps to validate that this fix works?
flutter config --no-enable-webflutter widget-preview startin a Flutter project