Two Flutter apps — app_one and app_two — built on one shared,
dogmatic MVVM architecture. Managed with Melos 7 over Dart pub
workspaces (a single shared lockfile; one resolve for the whole repo).
melos/
pubspec.yaml workspace root + Melos scripts
analysis_options.yaml shared very_good_analysis baseline
packages/
core/ package:core — shared infra, UI kit and services
apps/
app_one/ package:app_one — app/ + features/, com.wacmob.app_one
app_two/ package:app_two — app/ + features/, com.wacmob.app_two
docs/ ARCHITECTURE.md · FLAVORS.md
Both apps depend on core and reuse it wholesale:
- Services —
remote_clientHTTP client, sembastLocalStore,flutter_secure_storageSecureStore, DNS-probe connectivity,enviedconfig. - State spine —
ViewState<T>/SubmissionState<T>+ theRemoteStateMixin/MutationStateMixinthat drive every ViewModel. - UI kit —
AppTheme, the shared Poppins font +AppTextStyles, common widgets (ViewStateSwitcher, state views,ConnectivityBanner,PoweredByBadge), context/ref extensions. - Composition —
buildCoreOverrides()(the core half of the DI root),Routes,Failure+failure_mapper,AppLogger,ErrorReporter. - Shared assets/fonts — bundled in
coreand consumed by both apps with thepackage: coreprefix (packages/core/Poppins,packages/core/assets/...).
Each app owns only its lib/app/ (composition + routing) and lib/features/
(its own splash + posts). Apps brand themselves via a different theme seed
(app_one indigo, app_two teal) over the same shared theme builder.
- Flutter 3.44+ / Dart 3.12+ (pub workspaces).
- Melos:
dart pub global activate melos.
flutter pub get # resolves the entire workspace (or: melos bootstrap)
melos run gen # build_runner in every package (codegen is git-ignored)Generated
*.g.dart/*.freezed.dartare not committed. Runmelos run genafter cloning or after editing any annotated file — missing generated files before codegen are expected, not errors.
cd apps/app_one # or apps/app_two
flutter run --flavor dev -t lib/main_dev.dart --dart-define=APP_ENV=dev
flutter run --flavor staging -t lib/main_staging.dart --dart-define=APP_ENV=staging
flutter run --flavor prod -t lib/main_prod.dart --dart-define=APP_ENV=prodSee docs/FLAVORS.md. Android flavours are wired; iOS schemes
are a documented manual step.
melos run gate # gen + analyze + boundaries + loc + test, every packageIndividual steps: melos run analyze, melos run boundaries, melos run loc,
melos run test. Each runs per-package via melos exec.
The rules are intentionally rigid so an agent can add a feature by copying one
shape. Read docs/ARCHITECTURE.md and the per-package
conventions in CLAUDE.md. The reference single-app scaffold this
monorepo is derived from lives at ../mvvm.