On this page10 sections
  1. Prerequisites
  2. Learning Objectives
  3. 1. DartPad: Dart in the Browser
  4. 2. Install the Dart SDK
  5. 3. IntelliJ IDEA
  6. Code Examples
  7. Common Beginner Mistakes
  8. Practice Questions
  9. Practice Answers
  10. Key Takeaways

Lecture 003 — Dart Setup: DartPad & IntelliJ

Category2 — Getting Started
Lecture003 of 057
Estimated video length14 min
TargetDart 3.12
LevelBeginner

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.

  1. Delete the sample code.
  2. Type a program (Lecture 004 writes our first).
  3. 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):

bash
brew tap dart-lang/dart
brew install dart

Windows (with Chocolatey, in an administrator terminal):

bash
choco install dart-sdk

Linux (Debian/Ubuntu): follow the apt steps on dart.dev/get-dart.

Open a new terminal and check:

bash
dart --version
code
Dart SDK version: 3.12.0 (stable)

Any 3.x version is fine for this course.

3. IntelliJ IDEA

  1. Download IntelliJ IDEA Community Edition (free) from jetbrains.com/idea and install it.
  2. Open it, go to Settings → Plugins → Marketplace, search Dart, install, restart.
  3. 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
  4. 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:

bash
dart create -t console hello_dart
cd hello_dart
dart run

Output

code
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

  1. What can't DartPad do that IntelliJ can?
  2. Which command shows the installed Dart version?
  3. Where do you install the Dart plugin in IntelliJ?
  4. Do Flutter users need to install Dart separately?

Practice Answers

  1. Read typed keyboard input and use files on your computer.
  2. dart --version.
  3. Settings → Plugins → Marketplace.
  4. No — Flutter comes with Dart.

Key Takeaways

  • DartPad runs Dart in the browser with nothing to install.
  • The Dart SDK gives you the dart command; check it with dart --version.
  • IntelliJ + the Dart plugin is the full setup for real projects.
  • ▶ next to main runs the program.