DocumentRange class

A span within a Document with one side bounded at start and the other side bounded at end.

A DocumentRange is considered "normalized" if start comes before end. A DocumentRange is NOT "normalized" if end comes before start.

To check if a DocumentRange is normalized, call isNormalized with a Document.

Use normalize to create a version of this DocumentRange that's guaranteed to be normalized for the given Document.

Determining normalization requires a Document because a Document is the source of truth for DocumentNode content order.

Implementers

Constructors

DocumentRange({required DocumentPosition start, required DocumentPosition end})
Creates a document range between start and end.
const

Properties

end DocumentPosition
The bounding position of the other side of a DocumentRange.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
start DocumentPosition
The bounding position of one side of a DocumentRange.
final

Methods

isNormalized(Document document) bool
Returns true if start appears at, or before end, or false otherwise.
normalize(Document document) DocumentRange
Returns a version of this DocumentRange that's normalized.
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