FloatyActionRouter class final
Typed action dispatch between the main app and the overlay: register handlers with on and an ActionKey, send actions with dispatch. On the overlay side, actions are queued while the main app is away.
Constructors
- FloatyActionRouter({int maxQueueSize, QueueOverflowStrategy overflowStrategy})
-
Creates an action router for the main app side.
factory
- FloatyActionRouter.overlay({int maxQueueSize, QueueOverflowStrategy overflowStrategy})
-
Creates an action router for the overlay side, queueing up to
maxQueueSizeactions while the main app is disconnected.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxQueueSize → int
-
Maximum number of actions to queue while disconnected.
final
- overflowStrategy → QueueOverflowStrategy
-
Strategy for handling queue overflow.
final
- queueLength → int
-
The number of actions currently queued (waiting for reconnection).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispatch(
FloatyAction action) → Future< void> - Dispatches an action to the other side, queueing it on the overlay side while the main app is disconnected.
-
dispose(
) → Future< void> - Releases resources and unregisters the channel handler.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
off<
A extends FloatyAction> (ActionKey< A> key) → void -
Removes the handler associated with
key. -
on<
A extends FloatyAction> (ActionKey< A> key, FutureOr<void> handler(A action)) → void -
Registers
handlerfor actions whosetypematcheskey.type. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited