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
-
- Object
- OmegaObject
- OmegaIntent
- Available extensions
Constructors
- OmegaIntent({required String id, required String name, dynamic payload, String? namespace})
-
const
- OmegaIntent.fromName(OmegaIntentName intentName, {dynamic payload, String? id, String? namespace})
-
Creates an intent with a typed name (OmegaIntentName). Generates
idif not provided.factory
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 asTif compatible at runtime; otherwise null. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited