DocumentNode class abstract

A single content node within a Document.

Implemented types
Implementers
Available extensions

Constructors

DocumentNode({Map<String, dynamic>? metadata})

Properties

beginningPosition NodePosition
Returns the NodePosition that corresponds to the beginning of content in this node.
no setter
endPosition NodePosition
Returns the NodePosition that corresponds to the end of the content in this node.
no setter
hashCode int
The hash code for this object.
no setteroverride
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
id String
ID that is unique within a Document.
no setter
isDeletable bool
no setter
metadata Map<String, dynamic>
Returns all metadata attached to this DocumentNode.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
computeSelection({required NodePosition base, required NodePosition extent}) NodeSelection
Returns a node-specific representation of a selection from base to extent.
containsPosition(Object position) bool
Returns true if this DocumentNode contains the given position, or false if the position doesn't sit within this node, or if the position type doesn't apply to this DocumentNode.
copy() DocumentNode
copyContent(NodeSelection selection) String?
Returns a plain-text version of the content in this node within selection, or null if the given selection does not make sense as plain-text.
copyMetadata() Map<String, dynamic>
Returns a copy of this node's metadata.
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
getMetadataValue(String key) → dynamic
Returns this node's metadata value for the given key.
hasEquivalentContent(DocumentNode other) bool
Returns true if the other node is the same type as this node, and contains the same content.
hasMetadataValue(String key) bool
Returns true if this node has a non-null metadata value for the given metadata key, and returns false, otherwise.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
putMetadataValue(String key, dynamic value) → void
Sets this node's metadata value for the given key to the given value, and notifies node listeners that a change has occurred.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
selectDownstreamPosition(NodePosition position1, NodePosition position2) NodePosition
Inspects position1 and position2 and returns the one that's positioned further downstream in this DocumentNode.
selectUpstreamPosition(NodePosition position1, NodePosition position2) NodePosition
Inspects position1 and position2 and returns the one that's positioned further upstream in this DocumentNode.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override