Skip to content

[CP-stable][ Widget Preview ] Report an error if a web device is unavailable (#174036) #174085

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

Merged
merged 1 commit into from
Aug 20, 2025

Conversation

bkonyi
Copy link
Contributor

@bkonyi bkonyi commented Aug 19, 2025

Issue Link:

What is the link to the issue this cherry-pick is addressing?

#173960

Changelog Description:

Explain this cherry pick in one line that is accessible to most Flutter developers. See best practices for examples

Starting the widget previewer fails if Chrome or Edge is not installed.

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 production app (the app crashes on launch)

The Flutter tool crashes with a StateError if flutter widget-preview start is run on a host with no Chrome or Edge installed without providing any meaningful error message.

Workaround:

Is there a workaround for this issue?

Installing Chrome or Edge, but it's not clear that this needs to be done based on the failure mode.

Risk:

What is the risk level of this cherry-pick?

  • Low
  • Medium
  • High

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

  • Yes
  • No

Validation Steps:

What are the steps to validate that this fix works?

Run flutter widget-preview start on a device without Chrome or Edge and verify that there's an error message telling users to install Chrome or Edge.

…74036)

Fixes #173960

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@flutter-dashboard
Copy link

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.

@bkonyi bkonyi requested a review from matanlurey August 19, 2025 23:50
@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Aug 19, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 effectively resolves a crash in the widget previewer that occurred when no web device was available by introducing a clear error message. It also improves device selection logic when multiple browsers are installed, preferring Chrome. The changes are well-supported by new unit and integration tests. My feedback includes minor suggestions to improve the accuracy of test fakes for better long-term maintainability. Overall, the changes are robust and well-implemented.

@matanlurey matanlurey added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 20, 2025
@auto-submit auto-submit bot merged commit 812b771 into flutter-3.35-candidate.0 Aug 20, 2025
146 checks passed
@auto-submit auto-submit bot deleted the cherrypick_174036 branch August 20, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants