doOnPause method

Stream<T> doOnPause (
  1. void onPause(
    1. Future resumeSignal
    )
)

Invokes the given callback function when the stream subscription is paused.

Example

final subscription = Stream.fromIterable([1])
  .doOnPause(() => print('Gimme a minute please'))
  .listen(null);

subscription.pause(); // prints 'Gimme a minute please'

Implementation

Stream<T> doOnPause(void Function(Future<dynamic> resumeSignal) onPause) =>
    transform(DoStreamTransformer<T>(onPause: onPause));