CustomMsg<T> class

Message wrapper for custom user-defined messages.

This allows wrapping any value as a message:

// Define a custom message type
final msg = CustomMsg<String>('hello');

// Or use the factory
final msg = CustomMsg.of('hello');
Inheritance

Constructors

CustomMsg(T value)
Creates a custom message wrapping a value.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
The wrapped value.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

of<T>(T value) CustomMsg<T>
Factory constructor for type inference.