Msg class abstract TUI

Base class for all messages in the TUI runtime.

Messages represent events that can trigger state updates in a Model. All message types should extend this class.

  • Msg: Represents an event (key press, timer tick, network response).
  • Cmd: Represents an effect to be performed by the runtime (quitting, sending a message, running an external process).

Use BatchMsg to group multiple messages, and BatchCmd to group multiple commands.

Built-in Message Types

Custom Messages

Create custom message types by extending Msg:

class DataLoadedMsg extends Msg {
  final List<String> items;
  DataLoadedMsg(this.items);
}

class ErrorMsg extends Msg {
  final String message;
  ErrorMsg(this.message);
}
Implementers

Constructors

Msg()
const

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

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