StreamSource<T> class

An async source that wraps a Stream.

StreamSource handles Stream-based async operations, automatically managing the loading, data, and error states for each stream event.

Example:

final stream = Stream.periodic(Duration(seconds: 1), (i) => i);
final source = StreamSource(stream);
final signal = AsyncSignal(source);
Inheritance

Constructors

StreamSource(Stream<T> _stream)
Creates a stream source with the given stream.

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() → void
Disposes this async source and cleans up resources.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
subscribe(void emit(AsyncState<T> state)) FutureOr<void>
Starts listening to the stream and emits appropriate states.
override
toString() String
A string representation of this object.
inherited

Operators

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