Middlewares class abstract
Convenience methods for creating CommandMiddlewares.
Constructors
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
onBeforeRun<
O extends OptionDefinition, T> (FutureOr< void> onRun(CommandContext<O, T> )) → CommandMiddleware<O, T> -
Creates a CommandMiddleware with a variant of
onRunthat does not return a value, intended for use before the command is run but no need to change the context. -
onError<
O extends OptionDefinition, T> (OnError< T?, CommandContext< onError) → CommandMiddleware<O, T> >O, T> -
Creates a CommandMiddleware with the given
onErrorhook. -
onFinally<
O extends OptionDefinition, T> (OnFinally< CommandContext< onFinally) → CommandMiddleware<O, T> >O, T> -
Creates a CommandMiddleware with the given
onFinallyhook. -
onReturn<
O extends OptionDefinition, T> (OnReturn< T?, CommandContext< onReturn) → CommandMiddleware<O, T> >O, T> -
Creates a CommandMiddleware with the given
onReturnhook. -
onRun<
O extends OptionDefinition, T> (OnRun< CommandContext< onRun) → CommandMiddleware<O, T> >O, T> -
Creates a CommandMiddleware with the given
onRunhook. -
withHooks<
O extends OptionDefinition, T> ({OnRun< CommandContext< ? onRun, OnReturn<O, T> >T?, CommandContext< ? onReturn, OnError<O, T> >T?, CommandContext< ? onError, OnFinally<O, T> >CommandContext< ? onFinally}) → CommandMiddleware<O, T> >O, T> - Factory function to create a CommandMiddleware with the given hooks.