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
doctorchecks,createscaffolds,runlaunches,rreloads.
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 deviceflutter doctorprints a checklist. A cross next to Android or Xcode tells you exactly what to install before that platform will work.flutter createneeds a valid Dart package name: lower-case letters, digits and underscores, likesproutorplant_pal.flutter runstays 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 |