A production-ready Flutter template implementing strict Clean Architecture with Domain-Driven Design (DDD).
Designed for scalability, testability, and maintainability using the
Riverpod + Freezed + fpdartstack.
# 1. Install dependencies
flutter pub get
# 2. Generate code
dart run build_runner build --delete-conflicting-outputs
# 3. Run (Dev environment)
flutter run --flavor dev -t lib/main_dev.dart| Core | Library | Purpose |
|---|---|---|
| State | Riverpod | Reactive state & DI (No setState) |
| Data | Freezed | Immutable Data Classes & Unions |
| Logic | fpdart | Functional Error Handling (Either<L, R>) |
| Network | Dio + Retrofit | Type-safe REST Client |
| Local | Drift | SQLite Database |
This project follows a strict 4-layer architecture enforcing the Dependency Rule (Inner layers allow no external dependencies).
lib/
├── core/ # Shared kernel (Failures, ValueObjects, Services)
├── features/ # Feature modules (DDD: Presentation, Application, Domain, Infra)
│ ├── auth/ # Example: Authentication feature
│ └── ...
├── shared/ # Shared UI Design System
└── router/ # AutoRoute configuration
Detailed documentation is maintained in .agent/:
We use Requirements-Driven Testing (mocking via mocktail).
flutter test