Selection class

A object represents the range of text selected by the user or the current position of the caret. To obtain a object for examination or manipulation, call window.getSelection(). A user may make a selection from left to right (in document order) or right to left (reverse of document order). The anchor is where the user began the selection and the focus is where the user ends the selection. If you make a selection with a desktop mouse, the anchor is placed where you pressed the mouse button, and the focus is placed where you released the mouse button.

Note: Anchor and focus should not be confused with the start and end positions of a selection. The anchor can be placed before the focus or vice-versa, depending on the direction you made your selection.

Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

Selection()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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