StatefulFuture<T> class

A wrapper around a Future that delivers its result as an input to a logic block.

Use StateLogic.async to create instances. Chain input and errorInput to define which inputs to fire on success or failure.

If the logic block has been stopped or disposed by the time the future completes, the input is silently discarded.

Inputs are delivered even if the originating state has been replaced (detached), because async work should not be lost on state transitions. Whatever state is active when the future completes will receive the input.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

errorInput<TInput extends Object>(TInput toInput(Object error)) StatefulFuture<T>
Registers a callback that converts the future's error into an input for the logic block.
input<TInput extends Object>(TInput toInput(T value)) StatefulFuture<T>
Registers a callback that converts the future's success value into an input for the logic block.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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