xmpp: Remove _buffer from XmlStreamBuffer

This commit is contained in:
PapaTutuWawa 2022-04-17 23:36:15 +02:00
parent e117e3d962
commit 3c51a19636

View File

@ -6,14 +6,11 @@ import "package:xml/xml.dart";
import "package:xml/xml_events.dart";
class XmlStreamBuffer extends StreamTransformerBase<String, XMLNode> {
String _buffer;
final StreamController<XMLNode> _streamController;
final XmlNodeDecoder _decoder;
XmlStreamBuffer()
: _buffer = "",
_streamController = StreamController(),
_decoder = XmlNodeDecoder();
: _streamController = StreamController(), _decoder = XmlNodeDecoder();
@override
Stream<XMLNode> bind(Stream<String> stream) {
@ -26,8 +23,6 @@ class XmlStreamBuffer extends StreamTransformerBase<String, XMLNode> {
return true;
}).transform(_decoder).listen((nodes) {
print(nodes);
for (final node in nodes) {
if (node.nodeType == XmlNodeType.ELEMENT) {
_streamController.add(XMLNode.fromXmlElement(node as XmlElement));