Skip to content

Auto-select the flutter generator when invoking the new project wizard from the "New Flutter Project..." action #8210

Open
@csells

Description

@csells

I downloaded the latest version of Android Studio so I could play with the Gemini integration, but every time I try to generate a new Flutter project, I get something like this:

Image

Android Studio version:

Android Studio Meerkat Feature Drop | 2024.3.2
Build #AI-243.25659.59.2432.13423653, built on April 29, 2025
Runtime version: 21.0.6+-13368085-b895.109 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 15.4.1
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4096M
Cores: 12
Metal Rendering is ON
Registry:
  ide.experimental.ui=true
Non-Bundled Plugins:
  Dart (243.26753.1)
  io.flutter (85.3.1)

Flutter plug-in version: 85.3.1
Dart plug-in version: 243.26753.1

Activity

pq

pq commented on May 21, 2025

@pq
Contributor

Thanks Chris!

I took a quick crack at a repro and had no luck.

Here's what I had checked in the project creation wizard:

Image

and the result:

Image

What does your new project wizard content look like?

mit-mit

mit-mit commented on May 22, 2025

@mit-mit
Member

I wonder if this is a gradle issue based on the first screenshot? @csells in a terminal are you able to flutter create foobar & flutter build apk ?

csells

csells commented on May 23, 2025

@csells
Author

@mit-mit No problem with flutter create foobar & cd foobar & flutter build apk as shown here:

Image
csells

csells commented on May 23, 2025

@csells
Author

@pq here's that video I promised. Let me know if there are some log files I can dig up for you or something. I'm on the latest version of AS, the Flutter + Dart extensions to AS and Flutter stable.

Screen.Recording.2025-05-22.at.6.43.22.PM.mov
pq

pq commented on May 23, 2025

@pq
Contributor

Hey Chris!

Watching your video at around 0:10, it looks like the project type selected when you invoke the "New Flutter Project..." action is actually Kotlin (which appears to mean vanilla Kotlin and not, as you might expect, a Flutter android project that uses Kotlin).

Image

I see a similar default selection when I invoke "New Flutter Project..." but when I manually select "Flutter" from the generator list,

all works as expected.


Implementation aside: digging into FlutterNewProjectAction we're just creating a NewProjectWizard so this is WAI:

  public void actionPerformed(@NotNull AnActionEvent e) {
    if (FlutterUtils.isAndroidStudio()) {
      System.setProperty("studio.projectview", "true");
    }
    NewProjectWizard wizard = new NewProjectWizard(null, ModulesProvider.EMPTY_MODULES_PROVIDER, null);
    NewProjectUtil.createNewProject(wizard);
  }

I do have to wonder if there isn't some way to select the Flutter generator our of the gate though (since that seems to be what folks would expect)?


Thanks for the video, Chris! Let me know if this clears anything up for you!

csells

csells commented on May 23, 2025

@csells
Author

thanks, @pq. if I override the default and choose the Flutter generator after choosing New Flutter Project, I get a Flutter project. I don't know why that's not the default; it certainly should be.

changed the title [-][bug] Can't create a Flutter project in the latest Android Studio[/-] [+]Auto-select the flutter generator when invoking the new project wizard from the "New Flutter Project..." action[/+] on May 23, 2025
removed their assignment
on May 23, 2025
pq

pq commented on May 23, 2025

@pq
Contributor

Ok, cool! I agree it's not the best behavior. I'm not sure if IntelliJ's NewProjectWizard gives us a good way to set the default but I've turned this into an enhancement request so we can loop back and check it out.

Cheers!

pq

pq commented on Jun 11, 2025

@pq
Contributor

@alexander-doroshko: is there a way to set the default generator when creating a NewProjectWizard?

NewProjectWizard wizard = new NewProjectWizard(null, ModulesProvider.EMPTY_MODULES_PROVIDER, null);
NewProjectUtil.createNewProject(wizard);

alexander-doroshko

alexander-doroshko commented on Jun 12, 2025

@alexander-doroshko
Contributor

@pq I'm afraid I don’t have an answer off the top of my head. It might behave differently in Android Studio compared to IntelliJ IDEA, so it’s not straightforward for me to debug this.

By the way, are you sure you want to have a top-level 'Create Flutter Project' item in the main menu?

It certainly makes sense within the Flutter plugin's scope, but does it fit within the context of the whole IDE? Typically, we avoid placing technology-specific wizards in the main menu.

pq

pq commented on Jun 12, 2025

@pq
Contributor

Thank you!

By the way, are you sure you want to have a top-level 'Create Flutter Project' item in the main menu?

Excellent question. I expect this was done to improve discoverability but it is a little inconsistent w/ other plugins.

Incidentally: is there a guide somewhere that details plugin contribution design patterns and best practices? (In thinking about it some more, it seems like cluttering the top-level menu-space could be considered an anti-pattern...)

/fyi @anderdobo, @jwren

alexander-doroshko

alexander-doroshko commented on Jun 12, 2025

@alexander-doroshko
Contributor

is there a guide somewhere that details plugin contribution design patterns and best practices?

IntelliJ Platform Plugin SDK docs include UI Guidelines.

These guidelines are not specifically about questions like whether to place a technology-specific item in the main menu, but they do contain many useful tips.

I often chat with the AI Assistant about design ideas, and even more frequently about wording and naming suggestions. While I take its answers with a grain of salt, I still find the tool quite useful.

pq

pq commented on Jun 13, 2025

@pq
Contributor

These guidelines are fantastic. Thank you, Alex!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @pq@csells@alexander-doroshko@mit-mit

        Issue actions

          Auto-select the flutter generator when invoking the new project wizard from the "New Flutter Project..." action · Issue #8210 · flutter/flutter-intellij