doOnListen method

Stream<T> doOnListen (
  1. void onListen(
      )
    )

    Invokes the given callback function when the stream is first listened to.

    Example

    Stream.fromIterable([1])
      .doOnListen(() => print('Is someone there?'))
      .listen(null); // prints 'Is someone there?'
    

    Implementation

    Stream<T> doOnListen(void Function() onListen) =>
        transform(DoStreamTransformer<T>(onListen: onListen));