DoStreamTransformer<S> constructor

DoStreamTransformer<S>({
  1. FutureOr<void> onCancel()?,
  2. void onData(
    1. S event
    )?,
  3. void onDone()?,
  4. void onEach(
    1. Notification<S> notification
    )?,
  5. void onError(
    1. Object,
    2. StackTrace
    )?,
  6. void onListen()?,
  7. void onPause()?,
  8. void onResume()?,
})

Constructs a StreamTransformer which will trigger any of the provided handlers as they occur.

Implementation

DoStreamTransformer(
    {this.onCancel,
    this.onData,
    this.onDone,
    this.onEach,
    this.onError,
    this.onListen,
    this.onPause,
    this.onResume}) {
  if (onCancel == null &&
      onData == null &&
      onDone == null &&
      onEach == null &&
      onError == null &&
      onListen == null &&
      onPause == null &&
      onResume == null) {
    throw ArgumentError('Must provide at least one handler');
  }
}