Repository navigation
Support prompting for platforms during "Flutter: New Project" flow - #6064
Conversation
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
This comment was marked as outdated.
This comment was marked as outdated.
a93ce6f to
e08670c
Compare
|
/gemini review |
There was a problem hiding this comment.
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.
e08670c to
5336e37
Compare
There was a problem hiding this comment.
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
[]intodart.flutterCreatePlatforms(because0 !== flutterCreateAvailablePlatforms.length). An empty array is truthy, so laterflutterCreate()will treat it as "set" but add no--platformsargs, and the settings UI description will become an empty string. Consider normalizing an empty selection toundefined(same as "all") or otherwise preventing empty selections from being saved.
setValue: async (newValues: any[]) => {
const valueToSave = newValues.length === flutterCreateAvailablePlatforms.length
? undefined // all
: newValues;
5336e37 to
d59a57c
Compare
|
/gemini review |
There was a problem hiding this comment.
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.
| if (doNotAskOption) { | ||
| const doNotAskOptionSelected = quickPick.selectedItems.some((item) => item.isDoNotAskNextTime); | ||
| const doNotAskConfigValue = doNotAskOption.inverted ? !doNotAskOptionSelected : doNotAskOptionSelected; | ||
| await doNotAskOption.setValue(doNotAskConfigValue); | ||
| } |
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.flutterCreatePromptForPlatformsthat controls this.Fixes #4271