-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[CP-stable][ Widget Preview ] Don't require 'flutter pub get' to be run in the root project #178394
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 ] Don't require 'flutter pub get' to be run in the root project #178394
Conversation
…oot project (flutter#178175) Using the presence of `.dart_tool` in a project to determine if it's a valid Flutter project is not correct as the directory will not exist if `flutter pub get` has not yet been run. Fixes flutter#178052
|
@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 correctly modifies the widget preview command to no longer require the .dart_tool directory to exist. The project validation now correctly checks for the presence of pubspec.yaml instead of .dart_tool, and the scaffold directory creation is now recursive to handle cases where .dart_tool is missing. A new regression test has been added to verify this fix. The changes are correct and well-tested.
|
I can land this change but @bkonyi I dont understand how the change description matches the code change. |
Checking for an existing |
06f9b6a
into
flutter:flutter-3.38-candidate.0
…t' to be run in the root project (flutter/flutter#178394)
…t' to be run in the root project (flutter/flutter#178394)
…t' to be run in the root project (flutter/flutter#178394)
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?
#178052
Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See best practices for examples
The widget previewer fails to start if
flutter pub gethas not been run in the target project.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 widget previewer will fail to launch. For CLI users, the error message stating that the command needs to be run within a Flutter project is misleading. For IDE users, they may get a dialog stating the widget previewer failed to start with no actionable feedback.
Workaround:
Is there a workaround for this issue?
Run
flutter pub getin the project and then restart the widget previewer, either by relaunching the IDE or re-runningflutter widget-preview start.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?
.dart_tool/from a Flutter project.flutter widget-preview startwithin that project.