Skip to content

feat: Add file chooser support for widget preview initialization.#8888

Merged
helin24 merged 1 commit intoflutter:mainfrom
nopjar:main
Apr 16, 2026
Merged

feat: Add file chooser support for widget preview initialization.#8888
helin24 merged 1 commit intoflutter:mainfrom
nopjar:main

Conversation

@nopjar
Copy link
Copy Markdown
Contributor

@nopjar nopjar commented Apr 3, 2026

When using a multi-module project, the widget previewer sometimes fails to automatically find the correct pubspec.yaml. Adding the possibility to manually choose the file allows for more complex project setups.

Screenshot 2026-04-03 at 22 46 57 Screenshot 2026-04-16 at 16 12 18

Review the contribution guidelines below:

  • 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 if appropriate.
Contribution guidelines:
  • See
    our contributor guide and
    the Flutter organization contributor guide
    for general expectations for PRs.
  • Larger or significant changes should be discussed in an issue before creating a PR.
  • Dart contributions to our repos should follow the Dart style guide and use
    dart format.
  • Java and Kotlin contributions should strive to follow Java and Kotlin best
    practices (discussion).

Copy link
Copy Markdown
Contributor

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

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 enables users to specify the pub root module for the Flutter Widget Previewer by adding a file selection dialog and a retry mechanism when the root is not automatically detected. Review feedback highlights the need to wrap file system and project index access within Read Actions to comply with IntelliJ threading requirements and suggests externalizing user-facing strings for localization.

Comment thread src/io/flutter/widgetpreview/WidgetPreviewPanel.java
Comment thread src/io/flutter/widgetpreview/WidgetPreviewPanel.java
Comment thread src/io/flutter/widgetpreview/WidgetPreviewPanel.java Outdated
@nopjar nopjar force-pushed the main branch 2 times, most recently from ad4855d to 35ebf75 Compare April 3, 2026 21:07
@bwilkerson bwilkerson requested a review from pq April 7, 2026 19:42
@pq
Copy link
Copy Markdown
Collaborator

pq commented Apr 7, 2026

Fantastic! Since Helin wrote this, I'll defer to her for a review when she's back from vacation.

@pq pq requested review from helin24 and removed request for pq April 7, 2026 22:51
Copy link
Copy Markdown
Member

@helin24 helin24 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the contribution.

Can you add a screenshot of the file choosing dialog?

Comment thread CHANGELOG.md Outdated
When using a multi-module project, the widget previewer sometimes fails to automatically find the correct pubspec.yaml. Adding the possibility to manually choose the file allows for more complex project setups.
@nopjar
Copy link
Copy Markdown
Contributor Author

nopjar commented Apr 16, 2026

Sure! I've added your suggested change and added a screenshot of the file chooser dialog to the PR description.

@nopjar nopjar requested a review from helin24 April 16, 2026 14:15
@helin24 helin24 merged commit 662daed into flutter:main Apr 16, 2026
7 checks passed
@helin24
Copy link
Copy Markdown
Member

helin24 commented Apr 16, 2026

Thanks @nopjar!

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.

3 participants