Node class Null safety

Really basic implementation of a DOM-core like Node.

Implementers

Properties

attributes LinkedHashMap<Object, String>
A map holding name, value pairs for attributes of the node. [...]
read / write
attributeSpans LinkedHashMap<Object, FileSpan>?
If sourceSpan is available, this contains the spans of each attribute. The span of an attribute is the entire attribute, including the name and quotes (if any). For example, the span of "attr" in <a attr="value"> would be the text attr="value".
read-only
attributeValueSpans LinkedHashMap<Object, FileSpan>?
If sourceSpan is available, this contains the spans of each attribute's value. Unlike attributeSpans, this span will include only the value. For example, the value span of "attr" in <a attr="value"> would be the text value.
read-only
children List<Element>
read-only
firstChild Node?
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
nodes NodeList
A list of child nodes of the current node. This must include all elements but not necessarily other node types.
late, final
nodeType int
read-only
parent Element?
The parent element of this node. [...]
read-only
parentNode Node?
The parent of the current node (or null for the document node).
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
sourceSpan FileSpan?
The source span of this node, if it was created by the HtmlParser.
read / write
text String?
read / write

Methods

append(Node node) → void
clone(bool deep) Node
Returns a copy of this node. [...]
contains(Node node) bool
hasChildNodes() bool
hasContent() bool
Return true if the node has children or text.
insertBefore(Node node, Node? refNode) → void
Insert node as a child of the current node, before refNode in the
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
remove() Node
reparentChildren(Node newParent) → void
Move all the children of the current node to newParent. This is needed so that trees that don't store text as nodes move the text in the correct way.
replaceWith(Node otherNode) Node
Replaces this node with another node.
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Constants

ATTRIBUTE_NODE → const int
2
CDATA_SECTION_NODE → const int
4
COMMENT_NODE → const int
8
DOCUMENT_FRAGMENT_NODE → const int
11
DOCUMENT_NODE → const int
9
DOCUMENT_TYPE_NODE → const int
10
ELEMENT_NODE → const int
1
ENTITY_NODE → const int
6
ENTITY_REFERENCE_NODE → const int
5
NOTATION_NODE → const int
12
PROCESSING_INSTRUCTION_NODE → const int
7
TEXT_NODE → const int
3