runCommand method

FutureOr<T?> runCommand(
  1. CommandContext<O, T> context, {
  2. CommandHandler<O, T>? runNextCommand,
})
inherited

Runs this command, including its middlewares (hooks).

When runNextCommand is omitted, this command is run, wrapped by the middlewares of this command. When runNextCommand is provided, it is run instead of run, wrapped by the middlewares of this command.

Typically not overridden by subclasses.

Implementation

FutureOr<T?> runCommand(
  final CommandContext<O, T> context, {
  final CommandHandler<O, T>? runNextCommand,
}) {
  final terminalHandler = runNextCommand ?? runAsLeaf;
  final handler = _handlerChain(terminalHandler);
  return handler(context);
}