DocumentPosition class
A logical position within a Document.
A DocumentPosition points to a specific node by way of a nodeId, and points to a specific position within the node by way of a nodePosition.
The type of the nodePosition depends upon the type of DocumentNode that this position points to. For example, a ParagraphNode uses a TextPosition to represent a nodePosition.
Constructors
- DocumentPosition({required String nodeId, required NodePosition nodePosition})
-
Creates a document position from its node ID and node-specific
representation of the position.
const
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- nodeId → String
-
ID of a DocumentNode within a Document.
final
- nodePosition → NodePosition
-
Node-specific representation of a position.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{String? nodeId, NodePosition? nodePosition}) → DocumentPosition - Creates a new DocumentPosition based on the current position, with the provided parameters overridden.
-
isEquivalentTo(
DocumentPosition other) → bool -
Whether this position within the document is equivalent to the given
otherDocumentPosition. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override