Cqrs class

Class used for communicating with the backend via queries and commands.

Constructors

Cqrs(Client _client, Uri _apiUri, {Duration timeout = const Duration(seconds: 30), Map<String, String> headers = const {}, Logger? logger, List<CqrsMiddleware> middlewares = const []})
Creates a Cqrs class.

Properties

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

Methods

addMiddleware(CqrsMiddleware middleware) → void
Add given middleware at the end of a list.
get<T>(Query<T> query, {Map<String, String> headers = const {}}) Future<QueryResult<T>>
Send a query to the backend and expect a result of the type T.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
perform<T>(Operation<T> operation, {Map<String, String> headers = const {}}) Future<OperationResult<T>>
Send a operation to the backend and expect a result of the type T.
removeMiddleware(CqrsMiddleware middleware) → void
Remove given middleware from the list.
run(Command command, {Map<String, String> headers = const {}}) Future<CommandResult>
Send a command to the backend and get the results of running it, that is whether it was successful and validation errors if there were any.
toString() String
A string representation of this object.
inherited

Operators

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