Reusable Flutter base for Android and iOS. It includes clean architecture, fail-closed configuration, offline sync primitives, and Login/Home/Settings demo features that show how to extend the app.
Starting a new product with an AI coding agent? Follow Agent Setup Guide.
- FVM (Flutter Version Management) >= 3.2.0
- JDK 17 (OpenJDK 17 recommended)
- macOS with Xcode 27+ & CocoaPods 1.16+ (for iOS development)
# Pin Flutter version via FVM
fvm install 3.47.8
fvm use 3.47.8
# Fetch dependencies and enforce lockfile integrity
fvm flutter pub get --enforce-lockfileConfigurations are maintained via .env files located in config/:
config/env_dev.env: Development environment (logging enabled)config/env_uat.env: UAT environmentconfig/env_prod.env: Production environment (ENABLE_LOGGING=falseenforced)
Run the app with a native flavor and its matching config file:
# Run in development mode
fvm flutter run --flavor dev --dart-define-from-file=config/env_dev.env
# Run in UAT mode
fvm flutter run --flavor uat --dart-define-from-file=config/env_uat.env
# Run in production mode
fvm flutter run --release --flavor prod --dart-define-from-file=config/env_prod.envCode generation produces serialization (freezed, json_serializable), routing (auto_route), dependency injection (injectable), and localization (slang):
fvm dart run build_runner build -dRun the local continuous integration verification gate:
bash scripts/ci_local.shThe CI script verifies:
- Flutter toolchain pinning (
3.47.8). - Lockfile immutability (
--enforce-lockfile). - Clean code generation workspace (zero uncommitted diffs).
- Code formatting standards (
dart format). - Static analysis (
flutter analyze --fatal-infos --fatal-warnings). - Slang translation analysis (
slang analyze --full --exit-if-changed). - Flutter unit and widget test suite (239+ tests passing).
- Configuration format and allowlist validation (
check_config.sh). - Clean architectural boundaries enforcement (
check_boundaries.sh). - Gitleaks secret leak scanner (
check_secrets.sh).
lib/src/core/: Foundational domain primitives, configuration, networking (Dio,Retrofit), storage (SecureStorage, encrypted DB), auth session coordination, and offline outbox/sync engine.lib/src/app/: Composition root, dependency injection (injection.dart, modules), routing (app_router.dart), and global error handling.lib/src/features/: Independent, self-contained business features (e.g.auth_placeholder,home,settings). Features must never import other features directly; cross-feature communication occurs via core abstractions or deep links.