addCommand method

void addCommand(
  1. String command,
  2. FutureOr<String?> callback(
    1. CommandArgs
    )
)

Add a command to the command handler. command is its name, and callback is the callback to invoke

Implementation

void addCommand(
    String command, FutureOr<String?> Function(CommandArgs) callback) {
  commands[command.toLowerCase()] = callback;
}