Enterprise-grade, agent-first MVVM architecture for Flutter — Riverpod 3 +
Freezed + fpdart + remote_client + sembast. Built so an automated agent
(Claude Code / Opus) can add features by following one fixed set of patterns,
and a human can review them quickly.
flutter pub get
dart run build_runner build # generate *.g.dart / *.freezed.dart (REQUIRED)
flutter run --flavor dev -t lib/main_dev.dart --dart-define=APP_ENV=devThe app has
dev/staging/prodflavours, so pass--flavor(a bareflutter runis rejected once Android flavours exist). See docs/FLAVORS.md.
Generated files are git-ignored — always run
build_runnerafter cloning or editing an annotated file..env(consumed byenvied) is committed here with a public API URL; replace it / obfuscate for real secrets.
- CLAUDE.md — the authoritative rules agents follow: state model, the single ViewModel pattern, DI/composition root, import boundaries, and the step-by-step "add a feature" runbook.
- docs/ARCHITECTURE.md — layered structure, the api→data→state→view flow, and the rationale (with sources) behind each decision.
- docs/FLAVORS.md — the dev/staging/prod build flavours, how to run each, and the manual iOS scheme setup.
dart run tool/gate.dart # build_runner + analyze + boundaries + LOC + testThe same gate runs in the commit hook and in CI
(.github/workflows/ci.yml), so a green PR satisfies every check. Individually:
flutter analyze # very_good_analysis (strict)
dart run tool/check_boundaries.dart # feature/layer import boundaries
dart run tool/check_loc.dart # every file ≤ 200 lines
flutter testlib/features/posts/ — remote fetch + sembast cache + offline fallback, with a
list and detail screen. It is the canonical template; copy it to add a feature.