Lesson 3 of 51 beginner

Setting Up Flutter

Preparing Your Developer Toolkit

Open interactive version (quiz + challenge)

Real-world analogy

Before you can bake a cake, you need an oven, bowls, and ingredients. Before you can build Flutter apps, you need to install your tools: the Flutter SDK (your oven), VS Code (your kitchen counter), and extensions (your special utensils). Setting up takes a little time, but you only do it once!

What is it?

Setting up Flutter means installing the Flutter SDK, a code editor (VS Code), and platform tools (Android Studio for Android, Xcode for iOS). The 'flutter doctor' command checks that everything is ready. Once set up, you can create and run Flutter apps with simple terminal commands.

Real-world relevance

Professional Flutter developers work with VS Code or Android Studio daily. The setup process is a one-time investment that unlocks the ability to build apps for every platform. Companies prefer Flutter because developers only need ONE setup to target ALL platforms.

Key points

Code example

# Complete Flutter Setup Guide

# Step 1: Install Flutter SDK
# Download from https://flutter.dev/docs/get-started/install

# Step 2: Add to PATH (macOS/Linux)
export PATH="$HOME/flutter/bin:$PATH"

# Step 3: Verify installation
flutter --version

# Step 4: Run the doctor
flutter doctor

# Step 5: Fix any issues the doctor finds
flutter doctor --android-licenses

# Step 6: Create your first app!
flutter create hello_flutter
cd hello_flutter

# Step 7: Run it!
flutter run

# Useful commands:
flutter devices          # List available devices
flutter run -d chrome    # Run on Chrome
flutter run -d emulator  # Run on emulator
flutter clean            # Clean build files
flutter pub get          # Install dependencies

Line-by-line walkthrough

  1. 1. A comment heading for the setup guide
  2. 2.
  3. 3. Step 1 comment: installing the Flutter SDK
  4. 4. A comment with the download URL
  5. 5.
  6. 6. Step 2 comment: making flutter accessible from terminal
  7. 7. The export command adds Flutter to your system PATH
  8. 8.
  9. 9. Step 3 comment: checking the installed version
  10. 10. The flutter --version command shows what version you have
  11. 11.
  12. 12. Step 4 comment: running the health check
  13. 13. flutter doctor scans your system for issues
  14. 14.
  15. 15. Step 5 comment: fixing any problems found
  16. 16. This command accepts Android SDK licenses if needed
  17. 17.
  18. 18. Step 6 comment: creating your first project
  19. 19. flutter create generates a complete project from a template
  20. 20. cd changes into the new project directory
  21. 21.
  22. 22. Step 7 comment: running the app
  23. 23. flutter run compiles and launches your app on a connected device
  24. 24.
  25. 25. A comment labeling useful commands
  26. 26. flutter devices lists all connected phones, emulators, and browsers
  27. 27. flutter run -d chrome launches the app in Chrome browser
  28. 28. flutter run -d emulator launches on an Android emulator
  29. 29. flutter clean removes old build files to fix issues
  30. 30. flutter pub get downloads packages listed in pubspec.yaml

Spot the bug

# Setting up a Flutter project
flutter create My First App
cd My First App
flutter run
Need a hint?
Look at the project name. Are spaces allowed in Dart/Flutter project names?
Show answer
Flutter project names cannot contain spaces or capital letters. They must use lowercase with underscores. Fix: flutter create my_first_app, then cd my_first_app.

Explain like I'm 5

Before you can play a video game, you need to set up the game console, plug in the controller, and connect it to the TV. Setting up Flutter is the same idea! You download the Flutter toolkit (the console), install VS Code (the TV screen where you see your work), and add extensions (the controller). Once everything is plugged in, you are ready to play -- or in this case, build apps!

Fun fact

The 'flutter doctor' command was inspired by Homebrew's 'brew doctor' on Mac. It checks over 20 different things on your system. Some developers run it as a morning ritual -- like a health checkup for their dev environment!

Hands-on challenge

Install Flutter on your computer following the steps above. Run 'flutter doctor' and try to get all green checkmarks. Then run 'flutter create my_first_app' and 'flutter run' to see the default Flutter app!

More resources

Open interactive version (quiz + challenge) ← Back to course: Flutter & Dart