The first hour of a Flutter project decides how the rest goes. If the toolchain is half-installed, the project name is wrong or nothing tells Claude Code how your app is organised, every later task pays for it. This page is a setup sequence you can follow with Claude Code at your side. It uses Flutter’s official installation and project guides, read on the day this post was written, and the setup MobileKit’s scaffold stage follows.
1. Install Flutter and check the toolchain
Flutter’s installation page offers two routes: install with the Flutter extension in VS Code (marked “Recommended”), which the page says can “download and install the Flutter SDK, add it to your PATH, and validate your setup”, or download the SDK bundle, extract it and add Flutter to your PATH. After that you set up the tools for each target platform: Android, iOS (which needs a Mac with Xcode), web and desktop.
Then ask Claude Code to check, not fix:
flutter --version
flutter doctor -v
flutter doctor reports what is ready and what is missing for each platform. Tell Claude Code to list everything that is missing and wait. Installing Xcode, Android Studio or command-line tools changes your machine, so approve each step yourself. MobileKit’s scaffold stage works the same way: it checks the Flutter SDK, the Firebase and FlutterFire command-line tools and a UI test runner, reports what is missing, and asks before installing anything.
2. Create the project
Flutter’s guide uses flutter create with the project name as the one non-option argument. A fuller form sets the organisation, name and platforms explicitly:
flutter create --org com.yourcompany --project-name my_app --platforms ios,android .
Choose the reverse-domain organisation once. It becomes part of your bundle identifier and package name, and those are hard to change after release. Run it with the project name and then start the app on a simulator with flutter run to confirm the baseline works before you change anything.
3. Write the CLAUDE.md before the code
Run Claude Code in the project folder and use /init to generate a starting CLAUDE.md. Then edit it down to the facts Claude should know every session: the commands to run, test and analyse, the folder layout and a few rules. Claude Code’s documentation says to target under 200 lines. A full template for Flutter is in CLAUDE.md for Flutter.
Install Flutter’s official agent plugin at the same time. For Claude Code the two commands are claude plugin marketplace add flutter/agent-plugins and claude plugin install dart-flutter@dart-flutter. It gives the assistant Flutter skills and the Dart and Flutter MCP server, which exposes analyzer diagnostics and a test runner.
4. Decide the structure now
A structure is cheaper to choose on day one than to retrofit. MobileKit’s scaffold uses a feature-first layout:
lib/
app/ app widget, router, theme
core/ analytics, crash reporting, purchases, localisation, utilities
shared/ design-system components
features/<feature>/
data/ repositories and data objects
application/ state and use cases
presentation/ screens and widgets
Flutter’s own architecture guide describes layers, a UI layer, an optional logic layer and a data layer, and a single source of truth for each kind of data. The layout above applies those ideas inside each feature. See Flutter app architecture: a feature-first layout.
5. Add flavors for development and production
A development flavor and a production flavor stop test data reaching real users. In the pack’s setup, the dev flavor uses a bundle ID with a .dev suffix and its own Firebase project, and prod uses the real identifier. Per-flavor values, such as purchase keys and feature flags, live in git-ignored config files with committed example files, and are passed to the app with --dart-define-from-file. Set up the native flavors by following Flutter’s current flavors documentation, and check each platform builds before you move on.
6. Add the baseline packages and checks
- Lints. Turn on a strict analyzer configuration from the start, so warnings are cheap to fix. The pack adds
very_good_analysis. - Splash and launcher icon packages, if you want generated assets.
- State management and your backend SDKs, chosen from your requirements, not by habit. Check the current versions on pub.dev rather than from memory.
Define your “done” commands now: flutter analyze, dart format --set-exit-if-changed . and flutter test. Put them in CLAUDE.md.
7. Make one clean first commit
Before any feature work, get to a point where the project builds on both platforms, the analyzer is clean, a smoke test passes and the first commit is made. MobileKit calls this Phase 0, the foundation: flavors, theme, a navigation shell, localisation and CI-ready checks. Everything after it starts from a state you can return to.
Prompts that work
Ask Claude Code to do one thing at a time, and to show you the plan first:
- “Run
flutter doctor -vand list what is missing. Do not install anything.” - “Create the folder structure in CLAUDE.md with a placeholder file in each folder, then run
flutter analyze.” - “Add the
devandprodflavors for Android, then show me what you changed before touching iOS.”
Where MobileKit fits
The flutter-scaffold skill automates this sequence after the design and requirements stages: preflight, project creation, flavors, structure, packages, theme and the Phase 0 commit. The idea behind the whole process is in Build a Flutter app with Claude Code. Next steps from here: test a Flutter app with Claude Code and set up Firebase with Flutter and Claude Code.
Related: fixing Flutter build errors with Claude Code, Flutter localization and Flutter CI/CD.
Sources read on the day this post was written: Flutter install, Flutter: create a new app, Flutter AI setup and Claude Code memory.