forEachEvent method

Future<void> forEachEvent({
  1. EventHandler<XmlCDATAEvent>? onCDATA,
  2. EventHandler<XmlCommentEvent>? onComment,
  3. EventHandler<XmlDeclarationEvent>? onDeclaration,
  4. EventHandler<XmlDoctypeEvent>? onDoctype,
  5. EventHandler<XmlEndElementEvent>? onEndElement,
  6. EventHandler<XmlProcessingEvent>? onProcessing,
  7. EventHandler<XmlStartElementEvent>? onStartElement,
  8. EventHandler<XmlTextEvent>? onText,
})

Executes the provided callbacks on each event of this stream.

Completes the returned Future when all events of this stream have been processed.

Implementation

Future<void> forEachEvent({
  EventHandler<XmlCDATAEvent>? onCDATA,
  EventHandler<XmlCommentEvent>? onComment,
  EventHandler<XmlDeclarationEvent>? onDeclaration,
  EventHandler<XmlDoctypeEvent>? onDoctype,
  EventHandler<XmlEndElementEvent>? onEndElement,
  EventHandler<XmlProcessingEvent>? onProcessing,
  EventHandler<XmlStartElementEvent>? onStartElement,
  EventHandler<XmlTextEvent>? onText,
}) =>
    tapEachEvent(
      onCDATA: onCDATA,
      onComment: onComment,
      onDeclaration: onDeclaration,
      onDoctype: onDoctype,
      onEndElement: onEndElement,
      onProcessing: onProcessing,
      onStartElement: onStartElement,
      onText: onText,
    ).drain();