A pragmatic Flutter Starter Template for personal and academic projects, built with Clean Architecture, Firebase integration, and best practices out of the box.
- π Highlights
- π¦ Tech Stack
- ποΈ Architecture
- π Project Structure
- π οΈ Getting Started
- π§ͺ Testing
- π Docker Build
- π§ Why This Template?
- π Documentation
- π€ Contributing
- π License
- β¨ Author
- ποΈ Clean Architecture (Data β Domain β Presentation)
- π Dependency Injection (GetIt + Provider)
- π₯ Firebase integration (Core, Crashlytics, Analytics)
β οΈ Error Handling (Result pattern + Failure hierarchy)- π Logging with AppLogger abstraction and Mixin for Bloc/Cubit
- π§ Navigation with GoRouter and automatic screen tracking
- π¦ Modular Structure for scalable feature development
- π¨ Shared UIKit (buttons, images, themes)
| Category | Technology |
|---|---|
| Framework | Flutter 3.10.0+ |
| State Management | flutter_bloc |
| Dependency Injection | get_it, provider |
| Backend | Firebase (Core, Auth, Crashlytics, Analytics, Firestore, Storage) |
| Navigation | go_router |
| Connectivity Tracking | connectivity_plus |
| HTTP Client | dio, retrofit |
| UI Components | flutter_svg, cached_network_image |
| Code Generation | freezed, json_serializable, build_runner |
| Logging | logger |
| Localization | intl, flutter_localizations |
| Testing | mockito, bloc_test, flutter_test |
| Local Storage | shared_preferences |
This template follows Clean Architecture principles:
βββββββββββββββββββββββββββββββββββββββββββ
β Presentation Layer β
β (Pages, Widgets, BLoC/Cubit) β
βββββββββββββββββββββ¬ββββββββββββββββββββββ
β
β uses
βββββββββββββββββββββΌββββββββββββββββββββββ
β Domain Layer β
β (Entities, UseCases, Repositories*) β * interfaces only
βββββββββββββββββββββ²ββββββββββββββββββββββ
β
β implements
βββββββββββββββββββββ΄ββββββββββββββββββββββ
β Data Layer β
β (DTOs, DataSources, Repositories Impl) β
βββββββββββββββββββββββββββββββββββββββββββ
Presentation β Domain β Data
Domain Layer does NOT know about:
- Flutter framework (
import 'package:flutter/...'β) - Firebase, Dio, SharedPreferences
- JSON serialization (
@JsonSerializableonly in Data layer)
lib/
βββ core/ # Shared infrastructure
β βββ di/ # Dependency injection setup
β βββ failures/ # Error handling (Failure)
β βββ localization/ # Localization files
β βββ result/ # Result-pattern
β βββ router/ # Navigation (GoRouter, paths)
β βββ services/ # Services (Network, etc.)
β βββ utils/ # Utilities (Logger, Analytics)
βββ features/ # Feature modules (Clean Architecture)
β βββ [feature_name]/
β βββ data/ # DTOs, DataSources, Repository Impl
β βββ domain/ # Entities, UseCases, Repository Interfaces
β βββ presentation/ # Pages, Widgets, BLoC/Cubit
βββ uikit/ # Shared UI components
βββ main.dart # App entry point
- Flutter SDK:
>=3.10.0 - Dart SDK:
>=3.10.0 - Firebase project (for Analytics, Crashlytics)
-
Clone or use this template:
# Option 1: Clone git clone https://github.com/CowboyGH/flutter_starter_template.git # Option 2: Use template (on GitHub: "Use this template" button)
-
Install dependencies:
flutter pub get
-
Configure Firebase:
# Install FlutterFire CLI dart pub global activate flutterfire_cli # Configure Firebase for your project flutterfire configure
-
Generate localization files:
flutter gen-l10n
-
Run code generation:
flutter pub run build_runner build --delete-conflicting-outputs
-
Run the app:
flutter run
Run tests:
# Unit tests
flutter test
# Widget tests
flutter test test/features/*/presentation/
# Coverage (requires lcov)
flutter test --coverage
genhtml coverage/lcov.info -o coverage/htmlBuild Android APK using Docker:
docker build
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
--build-arg VCS_REF=$(git rev-parse --short HEAD)
--progress=plain
--no-cache
-t flutter-starter-android:latest .Extract APK files:
docker create --name temp-flutter flutter-starter-android:latest
docker cp temp-flutter:/artifacts/. ./apk-output/
docker rm temp-flutterThis repository is primarily a personal starter used to move faster on personal and academic projects.
- Provide a stable baseline with Clean Architecture and strict layer boundaries.
- Have a ready-to-use infrastructure for errors, logging, navigation, and CI/CD.
- Reduce recurring setup work so feature development starts from a consistent foundation.
- Competing with popular community templates.
- Shipping a complete UI kit/design system out of the box.
- Covering every possible app scenario or advanced product requirements.
If you find it useful β great! If not, treat it as a reference implementation of the patterns listed above.
- CHANGELOG - Version history and release notes
- CONTRIBUTING - Development guidelines and coding standards
- LICENSE - MIT License
Issues and PRs are welcome, but the template is primarily maintained for personal use. See CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License.
Developed by Ryan Delaney