CompleterOr<T> class
A utility for producing and completing FutureOr objects.
Similar to CompleterOr, this class allows you to handle both synchronous and asynchronous results. It provides methods to complete the object with a value, and to retrieve the result.
Constructors
Properties
-
futureOr
→ FutureOr<
T> -
Returns the stored synchronous value if available, otherwise returns
the Future that resolves to the value.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCompleted → bool
-
Checks if the value has been set or if the CompleterOr is completed.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
complete(
FutureOr< T> value) → void -
Completes the operation with the provided
value
. Ifvalue
is a Future, the CompleterOr will wait for it to complete. Ifvalue
is synchronous, it will be stored directly. -
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