OmegaIntent class

Represents a request for action (login, navigate, etc.) without coupling who asks and who executes.

Why use it: The UI emits intents instead of calling methods; OmegaFlowManager routes them to flows that are running. Optional namespace scopes intents (e.g. for modules).

Example: Emit from UI and read payload in the flow:

flowManager.handleIntent(OmegaIntent.fromName(AppIntent.authLogin, payload: creds));
// In flow onIntent: final c = ctx.intent!.payloadAs<LoginCredentials>();
Inheritance
Available extensions

Constructors

OmegaIntent({required String id, required String name, dynamic payload, String? namespace})
Prefer OmegaIntent.fromName when you have an OmegaIntentName — it supplies id when omitted.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
id String
Unique object identifier.
finalinherited
meta Map<String, dynamic>
Optional metadata (key-value).
finalinherited
name String
Intent name (e.g. "auth.login", "navigate.home"). Defines the action.
final
namespace String?
Optional namespace (e.g. "auth", "checkout"). Can be used by the host to route to the right module.
final
payload → dynamic
Data to execute the action. Use payloadAs to read with type.
final
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
payloadAs<T>() → T?

Available on OmegaIntent, provided by the OmegaIntentPayloadExtension extension

Returns payload as T if compatible at runtime; otherwise null.
toString() String
A string representation of this object.
inherited
typedPayloadAs<T extends OmegaTypedIntent>() → T?

Available on OmegaIntent, provided by the OmegaIntentTypedPayloadExtension extension

Returns payload when it implements OmegaTypedIntent and is a T.

Operators

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

Static Methods

fromName<T extends Object?>(OmegaIntentName intentName, {T? payload, String? id, String? namespace}) OmegaIntent
Creates an intent with a typed name (OmegaIntentName). Generates id if not provided.