Setting Up Your Development Environment
Prerequisites: Installing Dart
Two editors have excellent Dart support:
- Visual Studio Code with the official Dart extension (and the Flutter extension for apps) — free and lightweight.
- Android Studio or IntelliJ IDEA with the Dart and Flutter plugins.
Both give you autocomplete, instant error highlighting, quick fixes, formatting, debugging, and test running.
Your first project
The dart create command sets up a project:
dart create hello_dart
cd hello_dart
dart run
hello_dart/
├── bin/hello_dart.dart # the program's entry point
├── lib/ # reusable code
├── test/ # tests
├── pubspec.yaml # project name and dependencies
└── analysis_options.yaml # lint rules
For quick experiments, you can also run a single file directly:
dart run hello.dart.
Handy editor features
- Format on save — Dart has one standard code style, applied by
dart format. Turn on format-on-save and never think about spacing. - Quick fixes — press Ctrl + . (⌘. on macOS) on an underlined problem to see suggested fixes.