Setting Up Your First Project
Installing the Flutter SDK, creating a new project, and running it on an emulator or device.
2 min read
Before writing any widgets, you need the Flutter SDK installed and a project scaffolded. This lesson gets you from a blank machine to a running app.
Installing the SDK
Flutter ships as a single SDK download that bundles the flutter command-line tool, the Dart SDK, and the engine binaries for each platform. After installing it (following the official instructions for your OS), run:
flutter doctor
flutter doctor checks your environment and reports what's missing — Android SDK, Xcode command-line tools, a connected device, and so on. It's normal to see a few [!] warnings on a fresh install; fix them one at a time until the pieces you need (typically Android toolchain, plus Xcode if you're on macOS and targeting iOS) show green checkmarks.
Creating a project
flutter create my_app
cd my_app
flutter run
flutter create scaffolds a working counter-app template, not an empty folder — this is deliberate, so you have something runnable immediately. The generated structure includes:
lib/main.dart— your app's entry point and, for now, all of your Dart code.pubspec.yaml— the project manifest: app metadata, dependencies, and declared assets (fonts, images).android/,ios/,web/, and similar folders — the native platform "shells" that host your Flutter code on each platform. You rarely touch these directly early on.
Running on a device or emulator
flutter run needs somewhere to run your app. List what's available with:
flutter devices
This shows connected physical devices plus any running emulators (Android) or simulators (iOS). If nothing shows up, start an emulator from Android Studio's Device Manager, or an iOS Simulator via Xcode, then re-run flutter devices. You can also target a browser directly:
flutter run -d chrome
Once flutter run succeeds, you'll see the default counter app: a button that increments a number each time you tap it. Leave it running — the next lesson uses this same session to introduce hot reload.
pubspec.yaml: adding a dependency
Flutter's package ecosystem (pub.dev) is how you add third-party functionality — an HTTP client, an image picker, a state management library. Dependencies are declared in pubspec.yaml:
dependencies:
flutter:
sdk: flutter
http: ^1.2.0After editing pubspec.yaml, run flutter pub get to download the package and update the lockfile. You'll use the http package later in this course to call a real API.
With the SDK installed and a project running, you're set up for everything that follows. The rest of this course lives almost entirely inside lib/main.dart and the files you'll split out from it.