A clean Flutter project boilerplate with Riverpod, Freezed, and localization support.
- Riverpod: State management with code generation
- Freezed: Immutable data classes with JSON serialization
- Custom HTTP Client: Dio-based REST API service with interceptors
- Localization: Multi-language support with flutter_localizations
- Clean Architecture: Organized folder structure with features, services, and API layers
- Repository Pattern: Interface segregation with repository implementations
- Dependency Injection: Centralized providers using Riverpod
- Secure Storage: Token management with flutter_secure_storage
The project follows Clean Architecture principles with feature-based organization:
- Features: Self-contained modules with controllers, repositories, and state
- API Layer: HTTP client abstractions and response models
- Services: Business logic and external integrations
- Providers: Centralized dependency injection
- Shared: Common models and utilities
-
Install dependencies:
flutter pub get
-
Generate code (Freezed and Riverpod):
make generate
-
Generate localization files:
make generate-l10n
-
Run the app:
make run
make generate: Run code generation for Freezed and Riverpodmake generate-l10n: Generate localization filesmake generate-watch: Watch for changes and auto-generate codemake clean: Clean build artifacts and generated filesmake run: Run the Flutter appmake build-android: Build Android APK (debug)make build-ios: Build iOS app (debug)make build-android-release: Build Android APK (release)make build-ios-release: Build iOS app (release)
flutter_riverpod: State managementfreezed_annotation: Immutable data classesjson_annotation: JSON serializationdio: HTTP client with interceptorsflutter_secure_storage: Secure local storageshared_preferences: Local storageflutter_localizations: Localization support
build_runner: Code generationfreezed: Freezed code generatorjson_serializable: JSON code generatorriverpod_generator: Riverpod code generator
This project uses code generation for:
- Freezed: Immutable data classes with copyWith, toString, equality, and JSON serialization
- Riverpod: Provider generation for dependency injection and state management
Run make generate to generate all code files.
Each feature is self-contained with its own models, state, controllers, and repositories. Dependencies are injected through Riverpod providers, making the code testable and maintainable.