ParallelCmd class

A command that executes multiple commands in parallel through the Program's command execution system.

Cmd.batch creates a ParallelCmd so that each sub-command's message is forwarded via the runtime's send as soon as it completes. ParallelCmd also delegates special commands like EveryCmd and StreamCmd to Program._executeCommand for proper lifecycle.

Use this when you need to start both regular commands and special commands (like timers or streams) in parallel:

@override
Cmd? init() {
  return ParallelCmd([
    // This EveryCmd will be properly started by Program
    EveryCmd(interval: fps, callback: (t) => TickMsg(t)),
    // This regular command runs alongside
    Cmd.perform(fetchData, onSuccess: DataMsg.new, onError: ErrorMsg.new),
  ]);
}
Inheritance
Available extensions

Constructors

ParallelCmd(List<Cmd> commands)

Properties

commands → List<Cmd>
The commands to execute in parallel.
final
hashCode → int
The hash code for this object.
no setterinherited
isActive → bool

Available on Cmd?, provided by the CmdExtension extension

Returns true if this command is non-null and not a no-op.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

execute() → Future<Msg?>
Executes the command and returns the resulting message (if any).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
orNone() → Cmd

Available on Cmd?, provided by the CmdExtension extension

Returns the command or Cmd.none() if null.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited