visitElement method Null safety

  1. @override
void visitElement(
  1. XmlElement node
)
override

Visit an XmlElement node.

Implementation

@override
void visitElement(XmlElement node) {
  buffer.write(XmlToken.openElement);
  visit(node.name);
  writeAttributes(node);
  if (node.children.isEmpty && node.isSelfClosing) {
    buffer.write(XmlToken.closeEndElement);
  } else {
    buffer.write(XmlToken.closeElement);
    writeIterable(node.children);
    buffer.write(XmlToken.openEndElement);
    visit(node.name);
    buffer.write(XmlToken.closeElement);
  }
}