|This is a getting started guide for developing with Dart language in WebStorm.|
Dart built-in support in WebStorm includes:
- Coding assistance (syntax highlighting for Dart code, completion, code validation and quick-fix options)
- Powerful code navigation
- Package management
- Running and Debugging Dart web apps
- Running Dart command line apps
- Unit testing for Dart apps
In this tutorial
To start using Dart in WebStorm you need to specify the path to Dart SDK.
Go to Settings | Dart, and then edit the path to the SDK location on your computer. You can download the latest Dart SDK from dartlang.org.
You can specify the Usage scope for Dart SDK. By default it is used for the whole project, but you can limit the scope to certain directories if appropriate:
In Settings | Code Style | Dart, you can configure formatting for Dart code, for example, indents, spaces before and after operators and arguments, and more.
In Settings | Editor | Colors & Fonts | Dart, you can create a custom theme for Dart files by selecting fonts and colors for code elements:
You can install or update the packages required for the project from pub (pub.dartlang.org) right from the context menu of your project’s pubspec.yaml file:
Dart code can be executed only in Dartium browser. Make sure that Dartium with JetBrains IDE Support extension is installed on your computer.
Select Debug file from the context menu of your html file which reference to the Dart file you want to debug. WebStorm will automatically detect the Dart project and start the debugging session with Dartium:
To preview your project in Dartium, select Open in Dartium from the context menu of your html file with the reference to your Dart files. The browser will start and the page will open.
Check Minify to get a minified js file and a source map as the output: