ZenithMediator class

An in-memory Command/Event Mediator engine for flutter_zenith.

Equivalent to MediatR in .NET. Decouples UI callers from business logic handlers.

Constructors

ZenithMediator(ZenithContainer container)
Creates a ZenithMediator bound to container.

Properties

container → ZenithContainer
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addBehavior(ZenithPipelineBehavior behavior) → void
Adds a cross-cutting pipeline behavior to this mediator.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
publish<E extends ZenithEvent>(E event) → Future<void>
Publishes event to all registered 1-to-Many event handlers.
registerCommandHandler<C extends ZenithCommand<R>, R>(ZenithCommandHandler<C, R> handler) → void
Registers a 1-to-1 command handler for command type C.
registerEventHandler<E extends ZenithEvent>(ZenithEventHandler<E> handler) → void
Registers a 1-to-Many domain event listener for event type E.
send<R>(ZenithCommand<R> command) → Future<R>
Sends command to its registered 1-to-1 command handler.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

maxCallDepth → const int