OmegaFlowManager class
Manages all flows: registers them, activates/pauses, and routes intents to those in running state.
Why use it: The UI and agents don't know which flow should receive an intent; the manager sends it only to flows in OmegaFlowState.running. With wireNavigator you connect the channel to the navigator.
Example: manager.registerFlow(AuthFlow(channel)); manager.switchTo("authFlow"); manager.handleIntent(intent);
Constructors
- OmegaFlowManager({required OmegaChannel channel})
Properties
- activeFlowId ↔ String?
-
Id of the main flow (the one last activated with switchTo). Useful for snapshot and restore.
getter/setter pair
- channel → OmegaChannel
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
activate(
String id) → bool -
Activates the flow
idwithout pausing others. Multiple flows can be running and all receive intents. -
activateExclusive(
String id) → void -
dispose(
) → void - Cancels subscriptions (e.g. navigation). Call when closing the app.
-
end(
String id) → void -
endAll(
) → void -
getAppSnapshot(
) → OmegaAppSnapshot - Snapshot of app state (active flow + all flows). For save/restore on close/open.
-
getFlow(
String id) → OmegaFlow? -
Returns the flow registered with
id. Use so the UI can listen to itsexpressions(e.g. flow.expressions.listen(...)). -
getFlowSnapshot(
String id) → OmegaFlowSnapshot? - Snapshot of a flow by id. For debugging or per-flow persistence.
-
getSnapshots(
) → List< OmegaFlowSnapshot> - List of snapshots for all flows. For inspection or persistence.
-
handleIntent(
OmegaIntent intent) → void -
Sends the
intentto all flows that are running. The UI calls this when emitting an action. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
String id) → void -
registerFlow(
OmegaFlow flow) → void - Registers a flow so it can be activated and receive intents. Call at bootstrap (omega_setup).
-
restoreFromSnapshot(
OmegaAppSnapshot snapshot) → void - Restores each flow's memory and activates the flow that was active. Call when opening the app after loading the snapshot.
-
sleep(
String id) → void -
switchTo(
String id) → bool -
Activates the flow
idand pauses the rest. Only one "main" flow receives intents. -
toString(
) → String -
A string representation of this object.
inherited
- Connects the channel to the navigator: when "navigation.intent" or "navigate.xxx" is emitted, the navigator does push/pushReplacement.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited