A production-ready Flutter starter template designed with Clean Architecture, a feature-first structure, and built-in support for localization, theming, and global text scaling.
This template provides a clean foundation for building real applications with a scalable, maintainable architecture. It includes modern best practices and a modular layout suitable for both small and enterprise-level apps.
- π± Feature-First + Clean Architecture
- ποΈ BLoC / Cubit for state management
- π¦ GetIt as the service locator (DI)
- π¨ Material 3 with Light, Dark, and System theme modes
- π Localization (English & Persian) with system locale detection
- π€ Global text scaling with user-controlled font size
- πΌοΈ Custom Android & iOS launcher icons
- ποΈ Modern animated splash screen
- π§© Clean modular folder structure
Dark & Light mode, Localization (EN/FA), and Global Text Scaling
Light Mode![]() |
Dark Mode![]() |
Home Page![]() |
Note: You can replace the paths with your actual assets or GitHub image URLs.
A clean, scalable structure based on Feature-First + Clean Architecture:
lib/
β
βββ config/ # Global app-level configuration
β βββ di/ # Dependency injection (GetIt)
β βββ localization/ # ARB, localization cubit, delegates
β βββ router/ # AppRouter + route definitions
β βββ shared_prefs/ # Persistence (.gitkeep only)
β
βββ theme/ # Material 3 themes, color schemes, theme cubit
β
βββ core/ # Shared utilities across features
β βββ constants/
β βββ error/
β βββ services/
β βββ usecase/
β βββ utils/
β βββ extensions/ # Spacing extension lives here
β βββ widgets/ # AppWrapper, global widgets
β
βββ features/ # Main feature modules
β βββ feature_home/
β βββ feature_explore/
β βββ feature_settings/
β
βββ feature_shell/ # Bottom navigation + tab layout
β
βββ main.dart # Entry point
Key ideas:
- Each feature has its own presentation/data/domain layers (expandable later)
- All shared logic stays under core/
- Clean separation of UI, business logic, DI, and system services
Clone the repository
git clone https://github.com/zfarzaneh/flutter-clean-app-base.git
cd flutter-clean-app-baseInstall dependencies
flutter pub getRun code generation (localization)
flutter gen-l10nSetup DI (GetIt) The project uses a simple service locator. All dependencies are registered in:
lib/config/di/locator.dartMake sure setupLocator() is called before runApp():
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await setupLocator();
runApp(const AppWrapper());
}Run the app
flutter runπ± Run the app in debug mode
flutter runflutter run -d chrome
# or
flutter run -d emulator-5554π§ͺ Run unit & widget tests
flutter testπ¦ Build release APK
flutter build apk --releaseπ Build for iOS (requires macOS)
flutter build ios --releaseπ Build web release
flutter build web --releaseThis project follows a Clean Architecture + Feature-First structure, designed for scalability, readability, and long-term maintainability.
The architecture is based on four core principles:
- Separation of concerns
- UI independent from business logic
- Testability and clean boundaries
- Feature isolation (modular development)
Below is an overview of each major layer:
Located inside:
lib/features/**/presentation
This layer contains:
- Pages / Screens
- Widgets
- Cubit / Bloc (application state)
- Localization text usage
- Theme-aware UI components
The presentation layer communicates only with the Domain layer through UseCases or Cubits.
Located inside:
lib/features/**/domain
This layer contains:
- Entities
- Repositories (abstract interfaces)
- Use Cases (business logic)
The domain layer is pure Dart β it has no dependency on Flutter or any external package.
This allows easy testing and makes the business logic reusable.
Located inside:
lib/features/**/data
It provides implementations for:
- Repository interfaces
- API clients (Dio / HTTP)
- Local storage
- Mappers & DTOs
This layer converts external data formats (JSON, responses, prefs) into domain entities.
Located inside:
lib/core
This contains:
- Common widgets
- Extensions (spacing, context helpers, etc.)
- Shared utilities
- Base Cubit/State classes
- App-wide wrapper (themes, localization, navigation)
Core contains everything that multiple features may reuse.
Located inside:
lib/config
This layer manages:
- Dependency Injection (GetIt)
- Theme system (light/dark)
- Localization system (ARB + gen-l10n)
- Routing
- App color schemes
- Global settings
This is where global systems live β not feature-specific logic.
The project uses a feature-first structure, meaning each app module (Home, Explore, Settings, Auth, etc.) has its own:
data/ domain/ presentation/
Advantages:
- No huge βscreensβ folder
- Each feature is isolated and easy to maintain
- Easier onboarding for new developers
- Better testability
- Perfect for medium-to-large Flutter apps
The project uses:
Cubit (via flutter_bloc)
- UI listens to Cubit state streams
- Cubits call repositories or use-cases
- Repositories fetch data from remote/local sources
This ensures UI stays clean and reactive.
All repositories, services, and cubits register in:
lib/config/di/locator.dart
and are resolved throughout the app using:
sl<MyService>();This completely removes the need for instantiating classes manually and makes unit testing easier.
Presentation (UI, Cubit)
β
Domain (UseCases, Entities)
β
Data (API, Local)
β
External (HTTP, Prefs)
Each layer depends only on the layer below it β never upward.
Clean, predictable, maintainable.
This template currently does not include test files.
A testing setup (unit, widget, and integration tests) will be added in future updates.
This project is licensed under the MIT License β feel free to use, modify, and distribute it.
See the LICENSE file for details.


