How to create a Flutter project and run it

Setting up a new Flutter project, configuring editors, and running on emulators and devices

, updated

Getting started with Flutter means installing the SDK, creating a project, and running it on a device or emulator.

Install Flutter

Follow the official guide at flutter.dev/docs/get-started/install, or use a version manager:

# Using Homebrew (macOS)
brew install flutter

# Verify installation
flutter doctor

flutter doctor checks your environment and reports any missing dependencies (Android SDK, Xcode, Chrome, etc.).

Create a project

# Create a new Flutter project
flutter create my_app
cd my_app

# Create with specific options
flutter create --org com.example --project-name my_app --platforms android,ios,web my_app

Project structure

my_app/
├── lib/
│   └── main.dart          # app entry point
├── test/
│   └── widget_test.dart   # tests
├── android/               # Android native project
├── ios/                   # iOS native project
├── web/                   # Flutter web support
├── pubspec.yaml           # dependencies and metadata
└── analysis_options.yaml  # linting rules

Run the app

# List available devices
flutter devices

# Run on a specific device
flutter run -d <device_id>

# Run on Chrome (web)
flutter run -d chrome

# Run in release mode
flutter run --release

Hot reload and hot restart

While flutter run is active:

  • Press r — hot reload (preserves state, injects updated code)
  • Press R — hot restart (resets state, reloads entire app)
  • Press q — quit

Use an IDE

Both provide run buttons, debug breakpoints, widget inspector, and hot reload from the IDE.