Skip to the workspace
Pebellslearn by building
Development Environment  ›  Lesson

The Flutter CLI

Flutter CLI 12 minThe flutter command checks your setup with doctor, scaffolds projects with create, and launches them with run, where hot reload keeps app state and hot restart resets it.

flutter / The Flutter CLI

Explore each scene at your own pace.

01 · The rule

The rule

The Flutter CLI

Sprout is ready to leave DartPad and become a real project on your machine. Everything you do from here, whether you click buttons in an editor or not, is driven by one program: the flutter command. Knowing its handful of everyday subcommands makes every editor feel familiar.

The rule

doctor checks, create scaffolds, run launches, r reloads.

flutter doctor          # checks the SDK, platforms and devices
flutter create sprout   # makes a new project folder called sprout
cd sprout
flutter devices         # lists phones, emulators, browsers and desktops
flutter run             # builds and starts the app on a device
  • flutter doctor prints a checklist. A cross next to Android or Xcode tells you exactly what to install before that platform will work.
  • flutter create needs a valid Dart package name: lower-case letters, digits and underscores, like sprout or plant_pal.
  • flutter run stays open after launching. While it runs, keys typed in the terminal control the app:
Key What it does
r Hot reload: inject changed code, rebuild widgets, keep state
R Hot restart: rerun main() from scratch, state is lost
q Quit the app
Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.