CodeLineSelection class

A range of code lines that represents a selection.

Constructors

CodeLineSelection({required int baseIndex, required int baseOffset, required int extentIndex, required int extentOffset, TextAffinity baseAffinity = TextAffinity.downstream, TextAffinity extentAffinity = TextAffinity.downstream})
Creates a code selection.
const
CodeLineSelection.collapsed({required int index, required int offset, TextAffinity affinity = TextAffinity.downstream})
Creates a collapsed selection at the given line index and offset.
const
CodeLineSelection.fromPosition({required CodeLinePosition position})
Creates a collapsed selection at the given code position.
CodeLineSelection.fromRange({required CodeLineRange range})
Creates a selection at the given line index and range.
CodeLineSelection.fromTextSelection({required int index, required TextSelection selection})
Creates a selection at the given line index and selection.
CodeLineSelection.zero()
Creates a collapsed selection at the beginning.
const

Properties

base CodeLinePosition
The position at which the selection originates.
no setter
baseAffinity TextAffinity
If the code range is collapsed and has more than one visual location (e.g., occurs at a line break), which of the two locations to use when painting the caret.
final
baseIndex int
The line index at which the selection originates.
final
baseOffset int
The offset at which the selection originates.
final
end CodeLinePosition
The position at which the selection ends.
no setter
endIndex int
The line index at which the selection ends.
no setter
endOffset int
The offset at which the selection ends.
no setter
extent CodeLinePosition
The position at which the selection terminates.
no setter
extentAffinity TextAffinity
If the code range is collapsed and has more than one visual location (e.g., occurs at a line break), which of the two locations to use when painting the caret.
final
extentIndex int
The line index at which the selection terminates.
final
extentOffset int
The offset at which the selection terminates.
final
hashCode int
The hash code for this object.
no setteroverride
isCollapsed bool
Whether this range is empty (but still potentially placed inside the text).
no setter
isSameLine bool
Whether this selection is in a same line.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
start CodeLinePosition
The position at which the selection starts.
no setter
startIndex int
The line index at which the selection starts.
no setter
startOffset int
The offset at which the selection starts.
no setter

Methods

contains(CodeLineSelection selection) bool
Whether this selection contains another selection.
copyWith({int? baseIndex, int? extentIndex, int? baseOffset, int? extentOffset, TextAffinity? baseAffinity, TextAffinity? extentAffinity}) CodeLineSelection
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