Skip to content

Arnooodles/domain_driven_bloc

 
 

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

Theme

Flex Color Scheme

Localization

Intl
Slang

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: janet.weaver@reqres.in, 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
│   └── i18n
│       └── en.i18n.json
├── 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
│   │   │       └── enum
│   │   └── presentation
│   │       ├── views
│   │       └── widgets
│   │           └── dialogs
│   │           └── wrappers
│   ├── 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
│   ├── main.dart
├── scripts
├── test
│   ├── utils
│   ├── unit
│   │   ├── core
│   │   │   ├── bloc
│   │   │   └── repository
│   │   └── features
│   │       ├── auth
│   │       │   ├── bloc
│   │       │   └── repository
│   │       └── home
│   │           ├── bloc
│   │           └── repository
│   ├── widget
│   │   ├── core
│   │   │   ├── dialogs
│   │   │   │   ├── goldens(generated)
│   │   │   │   └── failures(generated)
│   │   │   └── widgets
│   │   │       ├── goldens(generated)
│   │   │       └── failures(generated)
│   │   └── features
│   │       ├── auth
│   │       │   └── widgets
│   │       │       ├── goldens(generated)
│   │       │       └── failures(generated)
│   │       ├── home
│   │       │   └── widgets
│   │       │       ├── goldens(generated)
│   │       │       └── failures(generated)
│   │       └── profile
│   │           └── 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 94.1%
  • HTML 1.8%
  • Shell 1.8%
  • Makefile 1.5%
  • Ruby 0.6%
  • Swift 0.1%
  • Other 0.1%