FutureSource<T> class
An async source that wraps a Future.
FutureSource handles Future-based async operations, automatically managing the loading, success, and error states.
Example:
final future = Future.delayed(Duration(seconds: 1), () => 'Hello');
final source = FutureSource(future);
final signal = AsyncSignal(source);
- Inheritance
-
- Object
- AsyncSource<
T> - FutureSource
Constructors
-
FutureSource(Future<
T> _future) - Creates a future source with the given future.
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
-
dispose(
) → FutureOr< void> -
Disposes this async source and cleans up resources.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
subscribe(
void emit(AsyncState< T> state)) → FutureOr<void> -
Starts the future and emits appropriate states.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited