TextSelection class
A text selection represented with base and extent UTF-16 offsets.
Constructors
- TextSelection({required int baseOffset, required int extentOffset, TextAffinity affinity = TextAffinity.downstream, bool isDirectional = false})
-
Creates a text selection from
baseOffsettoextentOffset.const - TextSelection.collapsed({required int offset, TextAffinity affinity = TextAffinity.downstream})
-
Creates a collapsed selection at
offset.const
Properties
- affinity → TextAffinity
-
Preference when this selection is collapsed at a soft boundary.
final
- baseOffset → int
-
The fixed end of the selection.
final
- end → int
-
The UTF-16 offset after the last selected code unit.
finalinherited
- extentOffset → int
-
The moving end of the selection.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- isCollapsed → bool
-
Whether this range contains no text.
no setterinherited
- isDirectional → bool
-
Whether the selection direction should be preserved.
final
- isValid → bool
-
Whether this range has non-negative endpoints.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- start → int
-
The UTF-16 offset before the first selected code unit.
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
textInside(
String text) → String -
Text inside this range.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override