MiddlewareHooks<R, A> class

Base class for easy creation of Middleware hooks.

Use it as Middleware like this:

final middleware = MiddlewareHooks<foo, bar>().middleware;
Implementers

Constructors

MiddlewareHooks()
const

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

middleware(Handler<FutureOr<R>, A> next) → Handler<FutureOr<R>, A>
Middleware method that produces the handler that runs these hooks. Adheres to the Middleware signature.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onError(Object error, StackTrace stackTrace, A arg) → FutureOr<R>
Hook method that is called if the next handler throws.
onFinally(A arg) → FutureOr<void>
Hook method that is called after the next handler returns or throws, after the onReturn / onError hook has run.
onReturn(A arg, R response) → FutureOr<R>
Hook method that is called after the next handler returns normally.
onRun(A arg) → FutureOr<A>
Hook method that is called before the next handler is run.
toString() → String
A string representation of this object.
inherited

Operators

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