Skip to content

Arnooodles/domain_driven_bloc

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Domain-Driven Bloc

License: MIT Powered by Mason

A Flutter Project Blueprint for Building Maintainable and Scalable Flutter Apps.

Credits

This project was originally developed by Very Good Ventures πŸ¦„

It has been forked and adapted for creating different app templates with a clean architecture based on domain driven design

This fork is not officially maintained or affiliated with Very Good Ventures.


Getting Started πŸš€

This app template can be generated using mason_cli with customized variables.

Ensure you have mason_cli installed.

# Activate mason_cli from https://pub.dev
dart pub global activate mason_cli
# Or install from https://brew.sh
brew tap felangel/mason
brew install mason

Installation

# Install locally
mason add domain_driven_bloc
# Or install globally
mason add -g domain_driven_bloc

Usage πŸš€

# Generate the domain_driven_bloc app template
mason make domain_driven_bloc

What's Included ✨

Out of the box, Domain-Driven Bloc includes:

  • βœ… Cross Platform Support - Built-in support for iOS, Android, Web, and Windows (MacOS/Linux coming soon!)
  • βœ… Build Flavors - Multiple flavor support for development, staging, and production
  • βœ… Internationalization Support - Internationalization support using synthetic code generation to streamline the development process
  • βœ… Sound Null-Safety - No more null-dereference exceptions at runtime. Develop with a sound, static type system.
  • βœ… Bloc - Integrated bloc architecture for scalable, testable code which offers a clear separation between business logic and presentation
  • βœ… Testing - Unit and Widget(Golden) Tests with more than 80% line coverage
  • βœ… Logging - Built-in, extensible logging to capture uncaught Flutter and Dart Exceptions
  • βœ… Continuous Integration - Lint, format, test, and enforce code coverage using GitHub Actions
  • βœ… Dependabot Integration - Automated dependency updates built into GitHub
  • βœ… Flutter Version Management - A simple CLI to manage Flutter SDK versions.
  • βœ… Makefile - A simple way to organize and standardize project commands

Additional Packages


State Management

βœ… Flutter Bloc
βœ… Flutter Hooks

Functional Programming

βœ… Fpdart

Data Classes

βœ… Freezed
βœ… Json Serializable

Navigation

βœ… Go Router

Dependency Injection

βœ… Injectable
βœ… Get It

Responsive

βœ… Responsive Framework

Environment Variable Management

βœ… Dotenv

HTTP Client

βœ… Chopper

Local Storage

βœ… Secure Storage
βœ… Shared Preferences

Security

βœ… Safe Device

Logging

βœ… Logger
βœ… Pretty Chopper Logger

Localization

βœ… Intl
βœ… Intl Utils

Package & Device Info

βœ… Package Info Plus
βœ… Device Info Plus

Assets

βœ… Flutter Svg
βœ… Flutter Gen

Testing

βœ… Alchemist
βœ… Golden Toolkit
βœ… Bloc Test

Mock

βœ… Mockito
βœ… Mocktail Image Network
βœ… Faker

Code Quality

βœ… Very Good Analysis
βœ… Dependency Validator

OutputπŸ“¦

Features ⭐

  • ✴️ Domain-Driven-Bloc - A clean architecture based on domain driven design
  • ✴️ Authentication - A mock authentication implementation using Reqres API (e.g. Email: [email protected], Password: password ).
  • ✴️ Home - Displays the post found in the sub-reddit FlutterDev.
  • ✴️ Profile - Displays the basic information of the mocked user.
  • ✴️ Dark Mode - Switch between Light and Dark themes
  • ✴️ Unit Testing - Performs a unit test to verify the correctness of a unit of logic under the Bloc and repository layers
  • ✴️ Widget(Goldens) Testing - Performs a widget tests that uses a special matcher that compares your widget with an image file and expects that it looks the same

Architecture Diagram

Folder Structure πŸ“

β”œβ”€β”€ .github
β”‚   β”œβ”€β”€ PULL_REQUEST_TEMPLATE.md
β”‚   β”œβ”€β”€ dependabot.yaml
β”‚   └── workflows
β”‚       └── main.yaml
β”œβ”€β”€ .idea
β”‚   └── runConfigurations
β”‚       β”œβ”€β”€ development.xml
β”‚       β”œβ”€β”€ production.xml
β”‚       └── staging.xml
β”œβ”€β”€ .vscode
β”‚   β”œβ”€β”€ extensions.json
β”‚   └── launch.json
β”œβ”€β”€ android
β”œβ”€β”€ assets
β”‚   β”œβ”€β”€ env
β”‚   β”œβ”€β”€ fonts
β”‚   β”œβ”€β”€ icons
β”‚   β”œβ”€β”€ images
β”‚   └── l10n
β”‚       └── app_en.arb
β”œβ”€β”€ ios
β”œβ”€β”€ lib
β”‚   β”œβ”€β”€ app
β”‚   β”‚   β”œβ”€β”€ config
β”‚   β”‚   β”œβ”€β”€ constants
β”‚   β”‚   β”œβ”€β”€ generated
β”‚   β”‚   β”œβ”€β”€ helpers
β”‚   β”‚   β”‚   β”œβ”€β”€ converters
β”‚   β”‚   β”‚   β”œβ”€β”€ extensions
β”‚   β”‚   β”‚   └── injection
β”‚   β”‚   β”œβ”€β”€ observers
β”‚   β”‚   β”œβ”€β”€ routes
β”‚   β”‚   β”œβ”€β”€ themes
β”‚   β”‚   β”œβ”€β”€ utils
β”‚   β”‚   └── app.dart
β”‚   β”œβ”€β”€ core
β”‚   β”‚   β”œβ”€β”€ data
β”‚   β”‚   β”‚   β”œβ”€β”€ dto
β”‚   β”‚   β”‚   β”œβ”€β”€ repository
β”‚   β”‚   β”‚   └── service
β”‚   β”‚   β”œβ”€β”€ domain
β”‚   β”‚   β”‚   β”œβ”€β”€ bloc
β”‚   β”‚   β”‚   β”œβ”€β”€ interface
β”‚   β”‚   β”‚   └── entity
β”‚   β”‚   └── presentation
β”‚   β”‚       β”œβ”€β”€ views
β”‚   β”‚       └── widgets
β”‚   β”œβ”€β”€ features
β”‚   β”‚   β”œβ”€β”€ auth
β”‚   β”‚   β”‚   β”œβ”€β”€ data
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ dto
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ repository
β”‚   β”‚   β”‚   β”‚   └── service
β”‚   β”‚   β”‚   β”œβ”€β”€ domain
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ bloc
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ interface
β”‚   β”‚   β”‚   β”‚   └── entity
β”‚   β”‚   β”‚   └── presentation
β”‚   β”‚   β”‚       β”œβ”€β”€ views
β”‚   β”‚   β”‚       └── widgets
β”‚   β”‚   β”œβ”€β”€ home
β”‚   β”‚   β”‚   β”œβ”€β”€ data
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ dto
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ repository
β”‚   β”‚   β”‚   β”‚   └── service
β”‚   β”‚   β”‚   β”œβ”€β”€ domain
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ bloc
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ interface
β”‚   β”‚   β”‚   β”‚   └── entity
β”‚   β”‚   β”‚   └── presentation
β”‚   β”‚   β”‚       β”œβ”€β”€ views
β”‚   β”‚   β”‚       └── widgets
β”‚   β”‚   └── profile
β”‚   β”‚       β”œβ”€β”€ data
β”‚   β”‚       β”‚   β”œβ”€β”€ dto
β”‚   β”‚       β”‚   β”œβ”€β”€ repository
β”‚   β”‚       β”‚   └── service
β”‚   β”‚       β”œβ”€β”€ domain
β”‚   β”‚       β”‚   β”œβ”€β”€ bloc
β”‚   β”‚       β”‚   β”œβ”€β”€ interface
β”‚   β”‚       β”‚   └── entity
β”‚   β”‚       └── presentation
β”‚   β”‚           β”œβ”€β”€ views
β”‚   β”‚           └── widgets
β”‚   β”œβ”€β”€ bootstrap.dart
β”‚   β”œβ”€β”€ main_development.dart
β”‚   β”œβ”€β”€ main_production.dart
β”‚   └── main_staging.dart
β”œβ”€β”€ test
β”‚   β”œβ”€β”€ utils
β”‚   β”œβ”€β”€ unit
β”‚   β”‚   β”œβ”€β”€ core
β”‚   β”‚   β”‚   β”œβ”€β”€ bloc
β”‚   β”‚   β”‚   └── repository
β”‚   β”‚   β”‚       β”œβ”€β”€ auth
β”‚   β”‚   β”‚       └── home
β”‚   β”‚   └── features
β”‚   β”‚       β”œβ”€β”€ auth
β”‚   β”‚           β”œβ”€β”€ bloc
β”‚   β”‚           └── repository
β”‚   β”‚       └── home
β”‚   β”‚           β”œβ”€β”€ bloc
β”‚   β”‚           └── repository
β”‚   β”œβ”€β”€ widget
β”‚   β”‚   β”œβ”€β”€ core
β”‚   β”‚   β”‚   β”œβ”€β”€ views
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ goldens(generated)
β”‚   β”‚   β”‚   β”‚   └── failures(generated)
β”‚   β”‚   β”‚   └── widgets
β”‚   β”‚   β”‚       β”œβ”€β”€ goldens(generated)
β”‚   β”‚   β”‚       └── failures(generated)
β”‚   β”‚   └── features
β”‚   β”‚       β”œβ”€β”€ auth
β”‚   β”‚       β”‚   β”œβ”€β”€ views
β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ goldens(generated)
β”‚   β”‚       β”‚   β”‚   └── failures(generated)
β”‚   β”‚       β”‚   └── widgets
β”‚   β”‚       β”‚       β”œβ”€β”€ goldens(generated)
β”‚   β”‚       β”‚       └── failures(generated)
β”‚   β”‚       β”œβ”€β”€ home
β”‚   β”‚       β”‚   β”œβ”€β”€ views
β”‚   β”‚       β”‚   β”‚   β”œβ”€β”€ goldens(generated)
β”‚   β”‚       β”‚   β”‚   └── failures(generated)
β”‚   β”‚       β”‚   └── widgets
β”‚   β”‚       β”‚       β”œβ”€β”€ goldens(generated)
β”‚   β”‚       β”‚       └── failures(generated)
β”‚   β”‚       └── profile
β”‚   β”‚           β”œβ”€β”€ views
β”‚   β”‚           β”‚   β”œβ”€β”€ goldens(generated)
β”‚   β”‚           β”‚   └── failures(generated)
β”‚   β”‚           └── widgets
β”‚   β”‚               β”œβ”€β”€ goldens(generated)
β”‚   β”‚               └── failures(generated)
β”‚   └── flutter_test_config.dart
β”œβ”€β”€ web
β”œβ”€β”€ .gitignore
β”œβ”€β”€ analysis_options.yaml
β”œβ”€β”€ coverage_badge.svg
β”œβ”€β”€ LICENSE
β”œβ”€β”€ Makefile
β”œβ”€β”€ pubspec.lock
β”œβ”€β”€ pubspec.yaml
└── README.md

Screenshots πŸ“·

Login Screen Home Screen Profile Screen

Releases

No releases published

Packages

No packages published

Languages

  • Dart 95.8%
  • HTML 1.9%
  • Makefile 1.4%
  • Ruby 0.7%
  • Swift 0.1%
  • Kotlin 0.1%