[ Tool ] Allow creation of projects inside the engine's examples directory#182268
Merged
auto-submit[bot] merged 3 commits intoFeb 12, 2026
Merged
Conversation
…ctory engine/src/flutter/examples contains sample code for the engine embedder library. The examples include scripts that create and build Flutter projects that are run through the embedder.
Contributor
There was a problem hiding this comment.
Code Review
This pull request extends the flutter create command to allow project creation within the engine/src/flutter/examples directory. This is a useful change for engine example development. The implementation is correct and includes a corresponding test case. I've suggested a small refactoring to improve the maintainability of the directory validation logic.
Comment on lines
211
to
+216
| final String examplesDirectory = globals.fs.path.join(flutterRoot, 'examples'); | ||
| final String devDirectory = globals.fs.path.join(flutterRoot, 'dev'); | ||
| final String engineExamplesDirectory = globals.fs.path.join(flutterRoot, 'engine', 'src', 'flutter', 'examples'); | ||
| if (!globals.fs.path.isWithin(examplesDirectory, projectDirPath) && | ||
| !globals.fs.path.isWithin(devDirectory, projectDirPath)) { | ||
| !globals.fs.path.isWithin(devDirectory, projectDirPath) && | ||
| !globals.fs.path.isWithin(engineExamplesDirectory, projectDirPath)) { |
Contributor
There was a problem hiding this comment.
This refactoring makes the logic for checking allowed directories more scalable and easier to read. By using a list of allowed directories, it's clearer what directories are permitted and simplifies adding new ones in the future.
Suggested change
| final String examplesDirectory = globals.fs.path.join(flutterRoot, 'examples'); | |
| final String devDirectory = globals.fs.path.join(flutterRoot, 'dev'); | |
| final String engineExamplesDirectory = globals.fs.path.join(flutterRoot, 'engine', 'src', 'flutter', 'examples'); | |
| if (!globals.fs.path.isWithin(examplesDirectory, projectDirPath) && | |
| !globals.fs.path.isWithin(devDirectory, projectDirPath)) { | |
| !globals.fs.path.isWithin(devDirectory, projectDirPath) && | |
| !globals.fs.path.isWithin(engineExamplesDirectory, projectDirPath)) { | |
| final List<String> allowedDirectories = <String>[ | |
| globals.fs.path.join(flutterRoot, 'examples'), | |
| globals.fs.path.join(flutterRoot, 'dev'), | |
| globals.fs.path.join(flutterRoot, 'engine', 'src', 'flutter', 'examples'), | |
| ]; | |
| if (!allowedDirectories.any((String directory) => globals.fs.path.isWithin(directory, projectDirPath))) { |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 13, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 13, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 13, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 14, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 14, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 14, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 14, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 15, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 15, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 15, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 16, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 16, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 16, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 17, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 17, 2026
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Feb 17, 2026
rickhohler
pushed a commit
to rickhohler/flutter
that referenced
this pull request
Feb 19, 2026
…ctory (flutter#182268) engine/src/flutter/examples contains sample code for the engine embedder library. The examples include scripts that create and build Flutter projects that are run through the embedder.
mboetger
pushed a commit
to mboetger/flutter
that referenced
this pull request
Mar 26, 2026
…ctory (flutter#182268) engine/src/flutter/examples contains sample code for the engine embedder library. The examples include scripts that create and build Flutter projects that are run through the embedder.
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.
engine/src/flutter/examples contains sample code for the engine embedder library. The examples include scripts that create and build Flutter projects that are run through the embedder.