On this page10 sections
Lecture 003 — Dart Setup: DartPad & IntelliJ
| Category | 2 — Getting Started |
| Lecture | 003 of 057 |
| Estimated video length | 14 min |
| Target | Dart 3.12 |
| Level | Beginner |
Two ways to run Dart: DartPad in the browser, with nothing to install, and IntelliJ IDEA on your computer for real projects. We set up both.
Contents
Prerequisites · Objectives · Lesson · Code Examples · Common Mistakes · Practice Questions · Answers · Takeaways
Prerequisites
Lecture 002. A browser, and for IntelliJ: a Windows, macOS or Linux computer.
Learning Objectives
- Run Dart code in DartPad
- Install the Dart SDK and check it with
dart --version - Set up IntelliJ IDEA with the Dart plugin
- Create and run a Dart project
1. DartPad: Dart in the Browser
Open dartpad.dev. You see an editor on the left and the output on the right.
- Delete the sample code.
- Type a program (Lecture 004 writes our first).
- Press Run.
DartPad is perfect for the early days: nothing to install, works on any computer. Its limits: it can't read typed input from the keyboard or work with files on your computer — for those, use IntelliJ.
2. Install the Dart SDK
The SDK (Software Development Kit) gives you the dart command that runs programs.
Already installed Flutter? Then you already have Dart — Flutter includes it. Skip to section 3.
macOS (with Homebrew):
brew tap dart-lang/dart
brew install dartWindows (with Chocolatey, in an administrator terminal):
choco install dart-sdkLinux (Debian/Ubuntu): follow the apt steps on
dart.dev/get-dart.
Open a new terminal and check:
dart --versionDart SDK version: 3.12.0 (stable)Any 3.x version is fine for this course.
3. IntelliJ IDEA
- Download IntelliJ IDEA Community Edition (free) from jetbrains.com/idea and install it.
- Open it, go to Settings → Plugins → Marketplace, search Dart, install, restart.
- New Project → Dart. Point Dart SDK path to your SDK:
- Homebrew on macOS:
/opt/homebrew/opt/dart/libexec - Chocolatey on Windows:
C:\tools\dart-sdk - From Flutter:
<flutter folder>/bin/cache/dart-sdk
- Homebrew on macOS:
- Pick the Console Application template, give it a name, Create.
Open bin/<project name>.dart, then click the green ▶ next to main to run it. The output
appears in the Run panel at the bottom.
Prefer Android Studio? It is built on IntelliJ — the Dart plugin and steps are the same.
Code Examples
Example 1 — The Same Project from the Terminal
IntelliJ's template is the same thing dart create makes:
dart create -t console hello_dart
cd hello_dart
dart runOutput
Hello world: 42!Common Beginner Mistakes
1. "dart: command not found" — the terminal was opened before installing. Open a new one.
Still failing? The SDK's bin folder isn't on your PATH; re-run the installer's steps.
2. IntelliJ says "Dart SDK is not configured" — set the path from section 3 in Settings → Languages & Frameworks → Dart.
3. Running dart run outside the project folder — cd into it first.
Practice Questions
- What can't DartPad do that IntelliJ can?
- Which command shows the installed Dart version?
- Where do you install the Dart plugin in IntelliJ?
- Do Flutter users need to install Dart separately?
Practice Answers
- Read typed keyboard input and use files on your computer.
dart --version.- Settings → Plugins → Marketplace.
- No — Flutter comes with Dart.
Key Takeaways
- DartPad runs Dart in the browser with nothing to install.
- The Dart SDK gives you the
dartcommand; check it withdart --version. - IntelliJ + the Dart plugin is the full setup for real projects.
- ▶ next to
mainruns the program.