declaration method
void
declaration({})
Adds a XmlDeclaration node.
For example, to generate an XML declaration <?xml version="1.0" encoding="utf-8"?>
one would write:
builder.declaration(encoding: 'UTF-8');
Implementation
void declaration({String version = '1.0', String? encoding, Map<String, String> attributes = const {}}) {
final declaration = XmlDeclarationSyntheticImpl()
..version = version
..encoding = encoding;
attributes.forEach(declaration.setAttribute);
_stack.last.children.add(declaration);
}