We gladly accept contributions via GitHub pull requests!
You must complete the Contributor License Agreement. You can do this online, and it only takes a minute. If you've never submitted code before, you must add your (or your organization's) name and contact info to the AUTHORS file.
First, set up Dart plugin development as described in the ReadMe.txt file in the Dart plugin.
- Open intellij-community project in IntelliJ, compile it.
- Open File | Project Structure | Modules | [+] | Import Module, select flutter-intellij/flutter-intellij-community.iml (from same dir as this README).
- In the same Project Structure dialog open the Dependencies tab of the community-main module, click [+] at the bottom (Mac) or right (Win/Linux) to add a module dependency on the flutter-intellij-community module.
- Install Flutter from github and set it up according to its instructions.
- Verify installation from the command line:
- Connect an android device with USB debugging.
cd <flutter>/examples/hello_world
flutter doctor
flutter run
- Verify installation of the Flutter plugin:
- Select IDEA in the Run Configuration drop-down list.
- Click Debug button (to the right of that drop-down).
- In the new IntelliJ process that spawns, open the hello_world example.
- Choose Edit Configuration in the Run Configuration drop-down list.
- Expand Defaults and verify that Flutter is present.
- Click [+] and verify that Flutter is present.
In order to run unit tests you need to create a run configuration. The easiest way is to copy the
one named 'Dart tests' defined for the Dart plugin. It can be found in the intellij-community
repository under .idea/runConfigurations/Dart_tests.xml
but it should already be in the run
configuration editor dialog. Name your copy 'Flutter tests' and modify the VM settings,
adding '-Dflutter.sdk=/path/to/flutter/sdk'.
Important! In order to be able to run a single test class or test method you need to do the following:
- Open Run | Edit Configurations, select 'Flutter tests' run configuration, copy its VM Options to clipboard
- In the same dialog (Run/Debug Configurations) expand Defaults node, find JUnit under it and paste VM Options to the corresponding field
- Repeat the same with Working directory field - it must point to intellij-community/bin