stopCommand method

  1. @mustCallSuper
bool stopCommand(
  1. String name
)

Stop the command with the given name.

Returns true if the command was handled.

Implementation

@mustCallSuper
bool stopCommand(final String name) {
  final command = commands[name];
  if (command != null) {
    final nextRun = getCommandNextRun(command);
    if (nextRun != null) {
      commandNextRuns
          .removeWhere((final element) => element.value == command);
      stoppedCommands.add(nextRun);
    }
    final onStop = command.onStop;
    if (onStop != null) {
      onStop();
    }
    return true;
  }
  return false;
}