DomRange class

This construct enables a serializable representation of a DOM Range.

In a DOM Range object, the startContainer + startOffset tuple represents the start boundary point. Similarly, the the endContainer + endOffset tuple represents the end boundary point. In both cases, the start/endContainer property is a pointer to either a DOM text node, or a DOM element (this typically depends on the mechanism from which the DOM Range instance originates, for example when obtaining the currently-selected document fragment using the window.selection API). In the case of a DOM text node, the start/endOffset corresponds to a position within the character data. In the case of a DOM element node, the start/endOffset corresponds to a position that designates a child text node.

Note that end field is optional. When only the start field is specified, the domRange object represents a "collapsed" range that has identical start and end boundary points.

https://github.com/readium/architecture/blob/master/models/locators/extensions/html.md#the-domrange-object

@param start A serializable representation of the "start" boundary point of the DOM Range. @param end A serializable representation of the "end" boundary point of the DOM Range.

Constructors

DomRange({required Point start, Point? end})

Properties

end Point?
final
hashCode int
The hash code for this object.
no setterinherited
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
start Point
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes the object to its JSON representation.
override
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

fromJson(Map<String, dynamic>? json) DomRange?