Getting Flutter running on your machine is straightforward. This chapter walks you through installation and creating your first project.
Install Flutter
Windows / macOS / Linux:
Bash
# Download Flutter SDK from flutter.dev or use git:
git clone https://github.com/flutter/flutter.git -b stable
export PATH="$PATH:$(pwd)/flutter/bin"
# Verify installation
flutter doctorflutter doctor reports what's missing — follow its suggestions until you see checkmarks.
Android Studio (recommended for mobile):
- Install Android Studio
- Open it → Preferences → Plugins → install "Flutter" and "Dart"
- Restart → "Create New Flutter Project"
VS Code (lightweight alternative):
- Install the "Flutter" extension (includes Dart)
Ctrl+Shift+P→ "Flutter: New Project"
Create a Project
Bash
flutter create hello_nepal
cd hello_nepalThis generates:
Code
hello_nepal/
├── lib/
│ └── main.dart # Your app starts here
├── test/ # Widget tests
├── android/ # Android-specific code
├── ios/ # iOS-specific code
├── web/ # Web build
└── pubspec.yaml # Dependencies (like package.json)Run the App
Bash
flutter run # on connected device/emulator
flutter run -d chrome # on Chrome (web)
flutter run -d macos # on macOS desktopThe pubspec.yaml
YAML
name: hello_nepal
description: My first Flutter app
environment:
sdk: '>=3.0.0 <4.0.0'
dependencies:
flutter:
sdk: flutter
http: ^1.0.0 # Add packages here
dev_dependencies:
flutter_test:
sdk: flutterRun flutter pub get after adding dependencies.
Hot Reload
- Start the app with
flutter run - Change text in
main.dart - Save — the app updates instantly without losing state
This is Flutter's killer feature for rapid development.
Common Commands
Bash
flutter doctor # Check setup
flutter create my_app # New project
flutter run # Run on device
flutter build apk # Build Android APK
flutter build ios # Build iOS
flutter test # Run tests
flutter pub get # Install dependencies
flutter clean # Clear build cacheNext: widgets.