Skip to content

Arnooodles/domain_driven_bloc

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

260 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Domain-Driven Bloc

License: MIT Powered by Mason

Domain-Driven Bloc jumpstarts your Flutter projects with a clean, modular foundation. Get instant best practicesโ€”Bloc, Clean Architecture, DI, and feature isolationโ€”so you can focus on building, not boilerplate. Everything you need for fast, confident app development is ready out of the box.


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 โœจ

Everything you need for a modern, production-grade Flutter app:

  • ๐Ÿ›๏ธ Clean Architecture: Modular, scalable architecture inspired by DDDโ€”separation of concerns, testability, and maintainability.
  • ๐Ÿงฉ Feature Isolation: Each feature is fully modular for easy scaling and testing.
  • ๐Ÿง  Bloc State Management: Clean separation of business logic and UI using Bloc.
  • ๐Ÿงฌ Dependency Injection: Built-in DI with injectable, get_it for testability and loose coupling.
  • ๐Ÿ›  Configurable Build Flavors: Effortless switching between dev, staging, and prod environments.
  • ๐ŸŒ Internationalization: Streamlined i18n with codegenโ€”add new languages in minutes, no manual boilerplate.
  • ๐Ÿ›ก Null Safety: 100% sound null safety for safer, more reliable code.
  • ๐Ÿ”’ Secure Storage: Secure sensitive data with flutter_secure_storage.
  • ๐Ÿงช Testing Suite: Extensive unit, widget, and golden tests; includes mocks, fakes, and golden tests for robust, reliable test suites.
  • ๐Ÿ“ Extensible Logging: Catch and log uncaught exceptions, plug in your own loggers, or use pretty logging for debugging and production.
  • ๐ŸŽ Performance Ready: Responsive layouts and best practices for smooth UX on all platforms.
  • ๐Ÿง‘โ€๐Ÿ’ป Developer Experience: Makefile, FVM, and pre-configured analysis for fast onboarding and consistent code quality.
  • ๐Ÿค– CI/CD Ready: Lint, format, test, and coverage checks via GitHub Actions.
  • ๐Ÿ”„ Automated Dependency Updates: Dependabot keeps your dependencies fresh and secure.

Key Packages ๐Ÿ—ƒ

Output ๐Ÿ—‚๏ธ

Core Functionality ๐Ÿ…

  • ๐Ÿ  Home: Live Reddit FlutterDev feed integrationโ€”real-world API, pagination, error handling.
  • ๐Ÿ” Auth: Mock login using DummyJSONโ€”prototype real auth flows with any user.
  • ๐Ÿ‘ค Profile: Mock user profile via DummyJSONโ€”user state management and editing patterns.
  • ๐ŸŒ™ Dark Mode: Seamless theme switching with persistent user preference.

Architecture ๐Ÿ—๏ธ

Architecture Diagram


Folder Structure ๐Ÿ“

Output after running the template:

โ”œโ”€โ”€ .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
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ cubit
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ interface
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ entity
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ enum
โ”‚   โ”‚   โ””โ”€โ”€ presentation
โ”‚   โ”‚       โ”œโ”€โ”€ views
โ”‚   โ”‚       โ””โ”€โ”€ widgets
โ”‚   โ”‚           โ””โ”€โ”€ dialogs
โ”‚   โ”‚           โ””โ”€โ”€ wrappers
โ”‚   โ”œโ”€โ”€ features
โ”‚   โ”‚   โ”œโ”€โ”€ auth
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ data
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ dto
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ repository
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ service
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ domain
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ cubit
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ interface
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ entity
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ presentation
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ views
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ widgets
โ”‚   โ”‚   โ”œโ”€โ”€ home
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ data
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ dto
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ repository
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ service
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ domain
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ cubit
โ”‚   โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ interface
โ”‚   โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ entity
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ presentation
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ views
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ widgets
โ”‚   โ”‚   โ””โ”€โ”€ profile
โ”‚   โ”‚       โ”œโ”€โ”€ data
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ dto
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ repository
โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ service
โ”‚   โ”‚       โ”œโ”€โ”€ domain
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ cubit
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ interface
โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ entity
โ”‚   โ”‚       โ””โ”€โ”€ presentation
โ”‚   โ”‚           โ”œโ”€โ”€ views
โ”‚   โ”‚           โ””โ”€โ”€ widgets
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ main.dart
โ”œโ”€โ”€ scripts
โ”œโ”€โ”€ test
โ”‚   โ”œโ”€โ”€ utils
โ”‚   โ”œโ”€โ”€ unit
โ”‚   โ”‚   โ”œโ”€โ”€ core
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ cubit
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ repository
โ”‚   โ”‚   โ””โ”€โ”€ features
โ”‚   โ”‚       โ”œโ”€โ”€ auth
โ”‚   โ”‚       โ”‚   โ”œโ”€โ”€ cubit
โ”‚   โ”‚       โ”‚   โ””โ”€โ”€ repository
โ”‚   โ”‚       โ””โ”€โ”€ home
โ”‚   โ”‚           โ”œโ”€โ”€ cubit
โ”‚   โ”‚           โ””โ”€โ”€ 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

Contributing ๐Ÿค

Contributions are welcome! To get started:

  1. Fork the repo and create your branch from main.
  2. Make your changes, following the existing code style and conventions.
  3. Add tests for any new features or bug fixes.
  4. Run the linter and tests to ensure everything passes:
    make lint         # for static analysis
    make lcov_*      # for running tests and generating coverage (see Makefile for available targets)
  5. Open a pull request with a clear description of your changes.

For major changes, please open an issue first to discuss what you'd like to change.

If you have questions, suggestions, or want to discuss ideas, feel free to open an issue or start a discussion.


Packages

 
 
 

Contributors

Languages

  • Dart 94.1%
  • Shell 2.7%
  • Makefile 1.3%
  • Swift 0.7%
  • Ruby 0.5%
  • Python 0.3%
  • Other 0.4%