FLUTTER ECOSYSTEM

dart_mediatr

The Dart Mediator package provides an implementation of the Mediator pattern for Dart inspired by MediatR ASP.net Core, including dynamic handler registration via code generation. This pattern is useful for organizing your application's commands and queries by centralizing their processing through a mediator.

Latest version
1.0.5
30-day downloads
69
Likes
7
Pub points
120

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

The dart_mediatr package implements the Mediator pattern in Dart, inspired by MediatR from ASP.NET Core. It centralizes command and query handling, promoting clean separation of concerns. The package supports dynamic handler registration through code generation, reducing boilerplate and improving maintainability. Ideal for organizing complex application logic in Flutter apps, it enables scalable and testable architectures by decoupling senders from handlers.

Use cases
  • Handling business logic in Flutter apps
  • Managing commands and queries in a centralized way
  • Enabling clean separation of concerns in large-scale applications
  • Simplifying event-driven architecture
  • Supporting dependency injection with handlers
  • Facilitating unit testing of business logic
Key features
  • Code generation for dynamic handler registration
  • Centralized command and query processing
  • Support for asynchronous and synchronous handlers
  • Integration with dependency injection
  • Minimal boilerplate with generated code
  • Cross-platform compatibility
Suitable for
  • Large Flutter applications with complex workflows
  • Teams seeking structured architecture patterns
  • Developers using dependency injection
  • Projects requiring testable and maintainable business logic
  • Applications leveraging event-driven or CQRS-like patterns
Considerations
  • Requires code generation setup
  • Learning curve for new developers unfamiliar with Mediator pattern
  • Potential overhead for very simple apps
  • Dependency on build_runner for code generation
  • Limited documentation compared to mature frameworks
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add dart_mediatr

Categories

Dependencies

Dependency list 4 items

Source repository

Related projects

No data available yet.