Skip to content

Support prompting for platforms during "Flutter: New Project" flow - #6064

Merged
DanTup merged 3 commits into
masterfrom
support-prompt-for-platforms-during-flutter-create
May 28, 2026
Merged

DanTup merged 3 commits into
masterfrom
support-prompt-for-platforms-during-flutter-create

Conversation

@DanTup

@DanTup DanTup commented May 27, 2026 •

Copy link
Copy Markdown
Member

With this change, we'll prompt for platforms during the "Flutter: New Project" flow by default, with a "Don't ask next time" option that toggles the new setting dart.flutterCreatePromptForPlatforms that controls this.

image

Fixes #4271

This adds a new setting, `dart.flutterCreatePromptForPlatforms` enabled by default, which will ask which platforms to use when using the "Flutter: New Project" command. The selection is persisted to config (so you always get the last used settings).

Fixes #4271
@DanTup DanTup added this to the v3.136.0 milestone May 27, 2026
@DanTup DanTup added is enhancement An enhancement or improvement that should be listed in release notes but is not a bug fix. in flutter Relates to running Flutter apps in commands Relates to commands (usually invoked from the command Palette) labels May 27, 2026
@DanTup
DanTup requested a review from Copilot May 27, 2026 15:27
gemini-code-assist[bot]

This comment was marked as outdated.

@codecov

This comment was marked as outdated.

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Comment thread src/extension/commands/flutter.ts Outdated
Comment thread src/extension/utils/vscode/input.ts Outdated
Comment thread src/extension/utils/vscode/input.ts
Comment thread src/test/flutter/commands/flutter.test.ts Outdated
@DanTup
DanTup force-pushed the support-prompt-for-platforms-during-flutter-create branch 2 times, most recently from a93ce6f to e08670c Compare May 27, 2026 16:30
@DanTup
DanTup requested a review from Copilot May 27, 2026 16:30
@DanTup

DanTup commented May 27, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 introduces a new setting dart.flutterCreatePromptForPlatforms to allow prompting users for target platforms when creating a new Flutter project, along with a "Don't ask next time" option to persist their choice. The review feedback suggests improving code readability and idiomatic TypeScript usage by replacing Array.prototype.find() with Array.prototype.includes() or Array.prototype.some() where appropriate.

Comment thread src/extension/commands/flutter.ts Outdated
Comment thread src/extension/utils/vscode/input.ts Outdated
Comment thread src/extension/utils/vscode/input.ts Outdated
@DanTup
DanTup force-pushed the support-prompt-for-platforms-during-flutter-create branch from e08670c to 5336e37 Compare May 27, 2026 16:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/extension/commands/flutter.ts:488

  • Saving an empty platform selection will currently persist [] into dart.flutterCreatePlatforms (because 0 !== flutterCreateAvailablePlatforms.length). An empty array is truthy, so later flutterCreate() will treat it as "set" but add no --platforms args, and the settings UI description will become an empty string. Consider normalizing an empty selection to undefined (same as "all") or otherwise preventing empty selections from being saved.
			setValue: async (newValues: any[]) => {
				const valueToSave = newValues.length === flutterCreateAvailablePlatforms.length
					? undefined // all
					: newValues;

Comment thread src/test/not_activated/flutter_create/extension.test.ts Outdated
@DanTup
DanTup force-pushed the support-prompt-for-platforms-during-flutter-create branch from 5336e37 to d59a57c Compare May 27, 2026 16:46
@DanTup
DanTup requested a review from Copilot May 27, 2026 17:04
@DanTup

DanTup commented May 27, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

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 introduces a new configuration setting, dart.flutterCreatePromptForPlatforms, which allows prompting users to select target platforms when creating a new Flutter project. It updates the project creation flow to show this platform selector and includes a "Don't ask next time" option to persist the choice. The underlying editSetting utility and corresponding tests have been updated to support this new capability. A review comment suggests using optional chaining on setting.currentValue in the multi-enum selection logic to prevent potential runtime crashes if the value is null or undefined.

Comment thread src/extension/utils/vscode/input.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment on lines +147 to +151
if (doNotAskOption) {
const doNotAskOptionSelected = quickPick.selectedItems.some((item) => item.isDoNotAskNextTime);
const doNotAskConfigValue = doNotAskOption.inverted ? !doNotAskOptionSelected : doNotAskOptionSelected;
await doNotAskOption.setValue(doNotAskConfigValue);
}
@DanTup
DanTup merged commit e2e59f7 into master May 28, 2026
42 of 43 checks passed
@DanTup
DanTup deleted the support-prompt-for-platforms-during-flutter-create branch May 28, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in commands Relates to commands (usually invoked from the command Palette) in flutter Relates to running Flutter apps is enhancement An enhancement or improvement that should be listed in release notes but is not a bug fix.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ask which platforms to create the project for when running Flutter: New Project

2 participants