useStream<T> function
Subscribes to a Stream and return its current state in an AsyncSnapshot.
preserveState
defines if the current value should be preserved when changing the Future instance.
See also:
Implementation
AsyncSnapshot<T> useStream<T>(
Stream<T>? stream, {
required T initialData,
bool preserveState = true,
}) {
return use(
_StreamHook(
stream,
initialData: initialData,
preserveState: preserveState,
),
);
}