tapEachEvent method
Stream<List<XmlEvent> >
tapEachEvent({
- EventHandler<
XmlCDATAEvent> ? onCDATA, - EventHandler<
XmlCommentEvent> ? onComment, - EventHandler<
XmlDeclarationEvent> ? onDeclaration, - EventHandler<
XmlDoctypeEvent> ? onDoctype, - EventHandler<
XmlEndElementEvent> ? onEndElement, - EventHandler<
XmlProcessingEvent> ? onProcessing, - EventHandler<
XmlStartElementEvent> ? onStartElement, - EventHandler<
XmlTextEvent> ? onText,
Executes the provided callbacks on each event of this stream as a side effect.
Returns the unmodified stream of events. Note that this does not start processing the events unless somebody subscribes to the stream.
Implementation
Stream<List<XmlEvent>> tapEachEvent({
EventHandler<XmlCDATAEvent>? onCDATA,
EventHandler<XmlCommentEvent>? onComment,
EventHandler<XmlDeclarationEvent>? onDeclaration,
EventHandler<XmlDoctypeEvent>? onDoctype,
EventHandler<XmlEndElementEvent>? onEndElement,
EventHandler<XmlProcessingEvent>? onProcessing,
EventHandler<XmlStartElementEvent>? onStartElement,
EventHandler<XmlTextEvent>? onText,
}) {
final handler = XmlEventHandler(
onCDATA: onCDATA,
onComment: onComment,
onDeclaration: onDeclaration,
onDoctype: onDoctype,
onEndElement: onEndElement,
onProcessing: onProcessing,
onStartElement: onStartElement,
onText: onText,
);
return map((eventList) {
eventList.forEach(handler.visit);
return eventList;
});
}