listen method

  1. @Deprecated('Use stream.listen instead. Will be removed in v8.0.0')
StreamSubscription<InstamojoState> listen(
  1. void onData(
    1. InstamojoState
    )?, {
  2. Function? onError,
  3. void onDone()?,
  4. bool? cancelOnError,
})
inherited

Adds a subscription to the Stream<State>. Returns a StreamSubscription which handles events from the Stream<State> using the provided onData, onError and onDone handlers.

Implementation

@Deprecated(
  'Use stream.listen instead. Will be removed in v8.0.0',
)
StreamSubscription<State> listen(
  void Function(State)? onData, {
  Function? onError,
  void Function()? onDone,
  bool? cancelOnError,
}) {
  return stream.listen(
    onData,
    onError: onError,
    onDone: onDone,
    cancelOnError: cancelOnError,
  );
}