Flutter IntelliJ Plugin M69 Release

535 views
Skip to first unread message

Steve Messick

unread,
Jul 1, 2022, 3:09:20 PM7/1/22
to flutter-...@googlegroups.com

Flutter IntelliJ Plugin M69 Release

Monorepo Project Support

We have some preliminary support for monorepo projects, that is, a project that contains multiple Flutter projects.


Opening a monorepo project in IntelliJ is a bit tricky, so we’re including detailed instructions here. The first step varies between Android Studio and IntelliJ. Both start from the File > New menu. In Android Studio you’ll choose Import Project… while in IntelliJ it is called File From Existing Sources… . After that, both are the same. 


The next step is to select the parent directory where the projects reside. This will look different on Windows and Linux (and possibly on Mac, depending on your preferences).



This is just a sample project with one of each of the Flutter template projects. After clicking Open a dialog is shown.



Use the option shown and click Next. The next page provides an option to make changes to the name and location, if needed. It should not be needed.



Use the directory-based project format. Click Next. If you have imported it previously and find that you need to import it again, you will be asked if you want to overwrite the .idea directory. Click Yes. This takes you to the project source roots selection page.



First, click Unmark All to clear all the checkboxes. Then select the checkbox for each directory that is indicated to be a Flutter project. If you have Dart projects mixed in with Flutter projects, you may choose to include those as well. You may have other types of projects, too, but that has not been tested in this context. The important thing is to not include any Android or Java/Kotlin projects from the android or .android directory of a Flutter project. Doing so will cause an error and you’ll have to start over. Don’t worry, the Android modules will be added automatically, after the project is opened. Sometimes, in Android Studio, the Android projects appear as !group.internal.Android.text! rather than the expected Android.


If you include any projects other than Flutter and Dart you may see a page asking to confirm libraries and another about modules.


Click Next to review the automatically detected frameworks. It starts with all checkboxes selected. You do NOT want any of those, so click the top-most checkbox to deselect everything.



Click Finish to open the project.


Once the project is opened you will need to open the Flutter plugin settings page and set the Flutter SDK.


If some of the Flutter projects are not recognized as Flutter projects you can easily correct the problem. Open the Dart plugin settings (or preferences) page. At the bottom, select all the Flutter and Dart modules that should be recognized as such, and click OK. Don’t select the Android modules.



Sometimes, you may want to do flutter pub get on all projects. Close all editor tabs and select External Libraries in the Project window. Then select the menu item Tools > Flutter > Flutter Pub Get. If there is no selection in the project tree and no file open in an editor, which would select a single project, it will work on all projects. If there is some context to choose a single project, then flutter pub get only runs for that project. Flutter Pub Upgrade and the Build > Flutter options work similarly. We know this is not a great UI and expect to change it to something more intuitive in the future.

Supported Platforms

Android Studio

  • Bumblebee | 2021.1

  • Chipmunk | 2021.2

  • Dolphin | 2021.3

  • Electric Eel | 2022.1 (unofficial, since this is the new canary version)


IntelliJ

  • 2021.1, 2021.2, 2021.3

  • 2022.1, 2022.2 EAP



Reply all
Reply to author
Forward
0 new messages