CallToExecute<OUTPUT extends Object?> mixin

A mixin on Executable.

call function lets you use classes as methods.

Example:

class DeployCommand extends Executable<bool> with CallToExecute {

  final deployService = DeployService();

  @override
  bool execute() {
    deployService.validate();
    deployService.run();
    return true;
  }
}

Generally a command is executed like this.

final cmd = DeployCommand();
cmd.execute();

With CallToExecute mixin, you can now execute like this:

cmd();
Superclass Constraints

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

call() → OUTPUT
Calls the execute function.
execute() → OUTPUT
inherited
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