flutter_modular_monorepo Free
A comprehensive Flutter monorepo template with modular architecture, dual-GetIt DI, FeatureSDK self-registration, two-phase initialization, and build-time dependency stripping. Generates a full Dart workspace with Melos, Fastlane, and CI/CD workflows.
Version: 3.0.0
Variables
| Variable | Type | Default | Description |
|---|---|---|---|
| appName | string | MyApp | The name of your application |
| organization | string | MyCompany | The name of your organization |
| domain | string | com | Your organization's top-level domain |
| prefix | string | App | Prefix for project components (e.g., 'App' for AppButton) |
| prefixCasing | enum (upperCase, pascalCase) | pascalCase | Casing style for the prefix |
| gitProvider | enum (github, gitlab) | github | Git provider for CI/CD workflows |
| networkLibrary | enum (dio, http) | dio | HTTP client library |
| isUsingWebSocket | boolean | false | Include WebSocket SDK |
| websocketLibrary | enum (dart, phoenix) | dart | WebSocket library (if using WebSocket) |
| isUsingFirebase | boolean | false | Using Firebase |
| analyticsVendors | array | none | Analytics vendors to include (firebase, appsflyer, mixpanel, moengage, none) |
| monitoringVendors | array | none | Monitoring vendors to include (crashlytics, sentry, newrelic, grafana, none) |
| isUsingFeatureFlags | boolean | false | Include Feature Flags SDK |
| featureFlagVendor | enum | none | Feature flag vendor implementation: flagr, remote_config, launch_darkly, custom |
| stateManagement | enum (bloc, cubit, provider, riverpod) | bloc | State management solution (4 variants: bloc, cubit, provider, riverpod) |
| includeGenerated | boolean | false | Include generated files in Git |
| includeIntegrationTest | boolean | true | Include integration tests |
| integrationTestFramework | enum (patrol, maestro, none) | patrol | Integration test framework |
| initializeGitRepo | boolean | true | Initialize a Git repository |
| userTier | string | free | User subscription tier (injected by CLI, not prompted) |
Usage
Interactive
bash
archipelago generate flutter_modular_monorepoNon-interactive (CI)
bash
archipelago generate flutter_modular_monorepo --config my_config.jsonGeneration Phases
The brick orchestrates 10+ sub-bricks in a specific order:
- Phase 1: Core Utilities — shared_dependencies, shared_app_config, flutter_l10n, core_infrastructure_package, app_lints, app_utilities
- Phase 1.5: Assets & UI Kit — flutter_asset (with prefix), flutter_ui_kit
- Phase 2: Tooling — monorepo_toolkit, asset_generator
- Phase 3: Infrastructure SDKs — network_sdk, websocket_sdk (optional), analytics_sdk + per-vendor bricks (optional), feature_flag_sdk (optional), monitoring_sdk + per-vendor bricks (optional)
- Pro Tooling (Pro/Enterprise only) — coverage_manager, size_guard, asset_optimizer
- Enterprise Tooling (Enterprise only) — affected, ui_kit_generator
- Phase 5: Starter Features (always) — introduction_sdk, auth_sdk, home_sdk, paywall_sdk
- Phase 6: Git Init (optional)
- Phase 6.5: Environment Files — .env files for each flavor
- Phase 7: Platform Initialization — flutter create in temp dir + Gradle/iOS patching
- Phase 8: Bootstrap — dart pub get + melos bootstrap
- Phase 8.5: Platform Setup — flavorizr, native splash, launcher icons. flavorizr's
instructions:list runsandroid:flavorizrGradle(emitsandroid/app/flavorizr.gradle.ktswith the product flavors) immediately beforeandroid:buildGradle(which only appends theapply from("flavorizr.gradle.kts")line referencing it) — listing only the latter leaves a dangling reference and Android builds fail before compiling anything (Archipelago-28cz). - Phase 9: Slang Translations — dart run slang for all packages with slang.yaml
- Phase 10: Code Generation —
melos run build(build_runner). Thebuildscript chainsbuild:select(all non-app packages, topologically ordered) andbuild:app(the host app itself, whichbuild:selectdeliberately--ignore=s) so the single documented command covers the whole workspace, includinginjector.config.dartandapp_router.gr.dartfor the host app (Archipelago-ytsg).build:selectandbuild:appremain independently runnable for iterative, package-only loops.
Vendor Multi-Select
Analytics and monitoring vendors are selected via Mason type: array multi-select. Boolean flags are derived in pre_gen.dart:
? Which analytics vendors do you want?
❯ ◉ firebase
◯ appsflyer
◯ mixpanel
◯ moengage
◯ noneOnly selected vendor bricks are generated. Selecting "none" or leaving empty skips the entire SDK.
Generated Structure
├── .claude/commands/ # Claude Code slash commands
├── .github/workflows/ # CI/CD workflows (if GitHub)
├── CLAUDE.md # AI coding assistant context
├── apps/
│ ├── {app_name}/
│ │ ├── android/ # Generated via flutter create + Gradle patching
│ │ ├── ios/ # Generated via flutter create + iOS patching
│ │ ├── fastlane/ # iOS/Android build automation
│ │ ├── launcher/ # App icons per flavor
│ │ ├── splash/ # Splash screen assets
│ │ ├── lib/
│ │ │ ├── app.dart
│ │ │ ├── bootstrap.dart
│ │ │ ├── main_development.dart
│ │ │ ├── main_staging.dart
│ │ │ ├── main_production.dart
│ │ │ ├── di/injector.dart
│ │ │ ├── host/
│ │ │ │ ├── host_app_widget.dart
│ │ │ │ └── initializers/
│ │ │ └── router/app_router.dart
│ │ ├── flavorizr.yaml
│ │ ├── flutter_launcher_icons-*.yaml
│ │ └── flutter_native_splash.yaml
│ └── {app_name}_widgetbook/ # Widgetbook app (all platforms)
├── shared/
│ ├── feature_sdk/ # FeatureSDK base + registry
│ ├── locale_core/ # Slang-based i18n (generated by flutter_l10n)
│ ├── dependencies/ # Centralized dependencies
│ ├── app_config/ # Environment/flavor config
│ └── router_registry/ # Route registration
├── features/
│ ├── auth/ # auth_api + auth_impl (with per-feature slang)
│ ├── home/ # home_api + home_impl (with per-feature slang)
│ ├── introduction/ # Onboarding feature
│ └── paywall/ # paywall_api + paywall_impl
├── infrastructure/ # Infrastructure SDKs + vendor impls
├── packages/ # UI Kit, shared packages
├── utilities/ # Utility packages
├── devtools/ # Monorepo toolkit + asset generator
├── build_prepare.yaml # Build-time dependency stripping
├── flavors.yaml # Flavor configuration
├── pubspec.yaml # Workspace root with melos scripts
└── analysis_options.yamlKey Architecture Patterns
- Dual-GetIt — Global scope (SDKs, infra) + local scope per feature (repos, usecases)
- FeatureSDK self-registration — Features register routes and DI without app knowing about them
- Two-phase init — Pre-launch (blocking: DI, routes) + Post-launch (non-blocking: analytics, flags)
- build_prepare — Swap debug → noop dependencies at build time
- Per-feature slang — Each feature module can have its own translations with scoped
translate_var
Note: userTier is injected automatically by the CLI based on the authenticated user's subscription tier and is not included in interactive prompts.