useOnStreamChange<T> function

StreamSubscription<T>? useOnStreamChange<T>(
  1. Stream<T>? stream, {
  2. void onData(
    1. T event
  3. void onError(
    1. Object error,
    2. StackTrace stackTrace
  4. void onDone()?,
  5. bool? cancelOnError,

Subscribes to a Stream and calls the Stream.listen to register the onData, onError, and onDone.

Returns the StreamSubscription returned by the Stream.listen.

See also:


StreamSubscription<T>? useOnStreamChange<T>(
  Stream<T>? stream, {
  void Function(T event)? onData,
  void Function(Object error, StackTrace stackTrace)? onError,
  void Function()? onDone,
  bool? cancelOnError,
}) {
  return use<StreamSubscription<T>?>(
      onData: onData,
      onError: onError,
      onDone: onDone,
      cancelOnError: cancelOnError,