How to Install Flutter: Step-by-Step Guide for Beginners
To install
Flutter, download the Flutter SDK from the official website, extract it, and add the flutter/bin folder to your system's PATH. Then run flutter doctor in your terminal to check and complete the setup.Syntax
The basic steps to install Flutter are:
- Download the Flutter SDK zip file for your OS.
- Extract it to a desired location.
- Add the
flutter/bindirectory to your system PATH. - Run
flutter doctorto verify installation and install dependencies.
bash
flutter doctor
Example
This example shows how to check your Flutter installation and environment setup using the flutter doctor command.
bash
flutter doctor
Output
[ā] Flutter (Channel stable, 3.7.0, on macOS 13.3 22E261 darwin-x64, locale en-US)
[ā] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[ā] Xcode - develop for iOS and macOS
[ā] Chrome - develop for the web
[ā] Android Studio (version 2021.1)
[ā] VS Code (version 1.75.0)
[ā] Connected device (2 available)
⢠No issues found!
Common Pitfalls
Common mistakes when installing Flutter include:
- Not adding
flutter/binto the PATH, causing commands to fail. - Skipping
flutter doctorand missing required dependencies like Android SDK or Xcode. - Using outdated Flutter versions or channels.
- Not accepting Android licenses, which blocks Android builds.
bash
Wrong: flutter Right: export PATH="$PATH:[PATH_TO_FLUTTER_DIRECTORY]/bin" flutter doctor
Quick Reference
| Step | Description |
|---|---|
| Download SDK | Get Flutter SDK zip from flutter.dev |
| Extract | Unzip to a folder on your computer |
| Set PATH | Add flutter/bin to your system PATH environment variable |
| Run flutter doctor | Check setup and install missing dependencies |
| Accept licenses | Run flutter doctor --android-licenses for Android |
Key Takeaways
Download and extract Flutter SDK from the official site.
Add flutter/bin to your system PATH to run Flutter commands anywhere.
Run flutter doctor to verify installation and fix missing dependencies.
Accept Android licenses to enable Android app development.
Keep Flutter updated by switching to the stable channel.