Flutter Get Started
To build Flutter apps on your own computer you need the Flutter SDK (which bundles Dart), a code editor and at least one target device: an emulator, a real phone, Chrome or your desktop. This lesson walks through setup and your first flutter create / flutter run cycle.
Note: The terminal sessions below are simulated — they show typical output so you know what to expect on your machine.
Step 1: Install the Flutter SDK
| Platform | Recommended way |
|---|---|
| Windows | Download the SDK zip from flutter.dev, extract it (e.g. to C:\src\flutter) and add flutter\bin to PATH |
| macOS | Download the SDK zip or use the VS Code "Flutter: New Project" prompt to install it; install Xcode for iOS |
| Linux | Download the tarball or use snap install flutter --classic; add flutter/bin to PATH |
Then install an editor. VS Code with the Flutter extension or Android Studio with the Flutter plugin both give you code completion, a debugger and hot-reload buttons.
For Android apps you also need the Android SDK (installed with Android Studio). For iOS apps you need a Mac with Xcode.
Step 2: Check your setup with flutter doctor
flutter doctor inspects your machine and reports what is installed and what is missing.
flutter doctorDoctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on Ubuntu 24.04 LTS 6.8.0-45-generic, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.93.1)
[✓] Connected device (2 available)
[✓] Network resources
• No issues found!
A [✗] or [!] line comes with a hint about how to fix it — for example running flutter doctor --android-licenses to accept the Android licenses.
Step 3: Create a project
flutter create generates a complete starter app. Project names must be lowercase with underscores.
flutter create hello_flutter
cd hello_flutterCreating project hello_flutter...
Resolving dependencies in `hello_flutter`...
Got dependencies in `hello_flutter`.
Wrote 129 files.
All done!
You can find general documentation for Flutter at: https://docs.flutter.dev/
Detailed API documentation is available at: https://api.flutter.dev/
In order to run your application, type:
$ cd hello_flutter
$ flutter run
Your application code is in hello_flutter/lib/main.dart.
Tip: Use
flutter create --platforms=android,web my_appto generate only the platforms you care about, and--org com.exampleto set the package identifier.
Step 4: Pick a device
flutter devicesFound 3 connected devices:
sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 14 (API 34) (emulator)
Linux (desktop) • linux • linux-x64 • Ubuntu 24.04 LTS
Chrome (web) • chrome • web-javascript • Google Chrome 129.0
Step 5: Run the app
flutter run -d chromeLaunching lib/main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome... 9.8s
This app is linked to the debug service: ws://127.0.0.1:41235/abcdEFgh/ws
Debug service listening on ws://127.0.0.1:41235/abcdEFgh/ws
Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
The starter app is the famous counter app: a title bar, a number and a floating "+" button. Here is a trimmed version of the generated lib/main.dart, together with what it looks like:
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() => setState(() => _counter++);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text('You have pushed the button this many times:'),
Text('$_counter', style: Theme.of(context).textTheme.headlineMedium),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
),
);
}
}Change the seedColor to Colors.green, save the file, and press r — the whole app turns green instantly while the counter keeps its value.
Useful commands
| Command | What it does |
|---|---|
flutter doctor |
Checks your installation |
flutter create <name> |
Creates a new project |
flutter devices |
Lists available devices |
flutter run |
Builds and runs in debug mode with hot reload |
flutter pub get |
Downloads packages listed in pubspec.yaml |
flutter pub add <pkg> |
Adds a package dependency |
flutter test |
Runs tests in the test/ folder |
flutter build apk / web |
Builds a release version |
Test yourself
Which command checks your Flutter installation and reports missing tools?
- flutter check
- flutter doctor
- flutter status
- flutter verify
Which project name is valid for flutter create?
- HelloFlutter
- hello-flutter
- hello_flutter
- Hello Flutter
While flutter run is active, which key triggers a hot reload?
- r
- R
- h
- q