OmegaFlowExpression class

Message a flow sends to the UI (loading, success, error). The UI listens to OmegaFlow.expressions.

Why use it: The flow announces state; the UI doesn't ask "are you loading?". Use payloadAs for typed reads.

Example: In the flow: emitExpression("success", payload: user); In the UI: exp.payloadAs<User>();

Available extensions

Constructors

OmegaFlowExpression(String type, {dynamic payload})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
payload → dynamic
Optional data. Use payloadAs to read with type.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
Type ("loading", "success", "error"). The UI typically does setState based on this value.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
payloadAs<T>() → T?

Available on OmegaFlowExpression, provided by the OmegaFlowExpressionPayloadExtension extension

Returns payload as T if compatible; otherwise null.
toString() String
A string representation of this object.
inherited

Operators

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