[ Widget Preview ] Don't require 'flutter pub get' to be run in the root project#178175
Merged
auto-submit[bot] merged 4 commits intomasterfrom Nov 11, 2025
Merged
[ Widget Preview ] Don't require 'flutter pub get' to be run in the root project#178175auto-submit[bot] merged 4 commits intomasterfrom
auto-submit[bot] merged 4 commits intomasterfrom
Conversation
…oot project 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 #178052
Contributor
There was a problem hiding this comment.
Code Review
This pull request addresses an issue where the widget preview command would fail if flutter pub get had not been run in the project. The fix correctly removes the check for the existence of the .dart_tool directory, which is not a reliable indicator of a valid Flutter project before dependencies are fetched. Additionally, the code is updated to recursively create the widget preview scaffold directory, ensuring the necessary directory structure is in place even if .dart_tool does not exist. A new regression test is included to verify that the command now succeeds in this scenario. The changes are correct and effectively resolve the issue.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 11, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 11, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 11, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 12, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 12, 2025
…in the root project (flutter/flutter#178175)
flutteractionsbot
pushed a commit
to flutteractionsbot/flutter
that referenced
this pull request
Nov 12, 2025
…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
flutteractionsbot
pushed a commit
to flutteractionsbot/flutter
that referenced
this pull request
Nov 12, 2025
…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
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 12, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 13, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 13, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 13, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 13, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 13, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 14, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 14, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 14, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 14, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 15, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 15, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 16, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 16, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 16, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 17, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 17, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 17, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 17, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 17, 2025
…in the root project (flutter/flutter#178175)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Nov 17, 2025
…in the root project (flutter/flutter#178175)
IvoneDjaja
pushed a commit
to IvoneDjaja/flutter
that referenced
this pull request
Nov 22, 2025
…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
mboetger
pushed a commit
to mboetger/flutter
that referenced
this pull request
Dec 2, 2025
…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
reidbaker
pushed a commit
to AbdeMohlbi/flutter
that referenced
this pull request
Dec 10, 2025
…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
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 11, 2026
…in the root project (flutter/flutter#178175)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using the presence of
.dart_toolin a project to determine if it's a valid Flutter project is not correct as the directory will not exist ifflutter pub gethas not yet been run.Fixes #178052