Skip to content

Fix empty Flutter SDK dropdown in New Project wizard on IJ 2026.2 - #9110

Open
Akshatvyas05 wants to merge 2 commits into
flutter:mainfrom
Akshatvyas05:fix-empty-flutter-sdk-dropdown-9106
Open

Fix empty Flutter SDK dropdown in New Project wizard on IJ 2026.2#9110
Akshatvyas05 wants to merge 2 commits into
flutter:mainfrom
Akshatvyas05:fix-empty-flutter-sdk-dropdown-9106

Conversation

@Akshatvyas05

Copy link
Copy Markdown

Fixes #9106

What this changes

The Flutter SDK combo box in the New Project wizard (and Settings page) is
populated asynchronously: known SDK paths are resolved on a background
thread, then the UI update is scheduled back onto the EDT via
OpenApiUtils.safeInvokeLater().

On IntelliJ Platform 2026.2, this deferred update no longer runs while the
New Project wizard's modal dialog is open, leaving the SDK dropdown empty.
Passing ModalityState.any() ensures the update runs regardless of any
open modal dialog.

How to verify

  1. Run a 2026.2 sandbox: ./gradlew runTarget -Pide=AndroidStudio -PideV=2026.2.1.4
  2. Open New Project → Flutter
  3. Confirm previously-used Flutter SDK paths appear in the SDK dropdown
    (before this fix, the dropdown was empty)
  • I've reviewed the contributor guide and applied the relevant portions to this PR.
  • I've included the required information in the description above.
  • My up-to-date information is in the AUTHORS file.
  • I've updated CHANGELOG.md.

@google-cla

google-cla Bot commented Sep 4, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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

Copy link
Copy Markdown
Contributor

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 addresses an issue where the Flutter SDK dropdown was empty in the New Project wizard on IntelliJ Platform 2026.2 by specifying a modality state when updating the combo box. The reviewer raised a valid concern regarding the use of ModalityState.any(), recommending ModalityState.stateForComponent(combo) instead to avoid executing UI updates on potentially disposed components.

Comment thread src/io/flutter/sdk/FlutterSdkUtil.java Outdated
@Akshatvyas05
Akshatvyas05 force-pushed the fix-empty-flutter-sdk-dropdown-9106 branch from dc4647c to db62f6c Compare September 4, 2026 15:37
The Flutter SDK combo box in the New Project wizard and Flutter
settings page is populated asynchronously: known SDK paths are
resolved on a background thread, then the UI update is scheduled
back onto the EDT via OpenApiUtils.safeInvokeLater().

On IntelliJ Platform 2026.2 this deferred update no longer runs
while the New Project wizard's modal dialog is showing, leaving the
SDK dropdown empty. Passing ModalityState.stateForComponent(combo)
ensures the update runs in the correct modality state associated
with the combo box itself, so it fires even while the modal wizard
is open, without the broader risk of ModalityState.any().

Fixes flutter#9106
@Akshatvyas05
Akshatvyas05 force-pushed the fix-empty-flutter-sdk-dropdown-9106 branch from db62f6c to cc541c8 Compare September 4, 2026 15:40
@Akshatvyas05

Copy link
Copy Markdown
Author

@helin24 kindly provide your feedback.

@helin24

helin24 commented Sep 5, 2026

Copy link
Copy Markdown
Member

Hi! Thanks for making this fix. Unfortunately, I'm not sure if this actually fixes the problem, because I built a plugin with this branch and I still see the issue. It may be that the initial issue I filed is inaccurate; so I will update there.

@Akshatvyas05

Copy link
Copy Markdown
Author

Thanks for updating the issue - that helps a lot. I can see the scope is broader than I first thought, so I’m going to spend some time getting more familiar with the code path and the wizard state flow to understand the underlying issue more deeply before making another change.

@helin24

helin24 commented Sep 8, 2026

Copy link
Copy Markdown
Member

Okay great! I appreciate your help looking into this issue.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty Flutter SDK options in new project wizard when starting from other language

2 participants