SelectionController class

Manages text selection state independently of scroll.

Holds selection start/end coordinates, a selecting flag, and provides methods for text extraction and highlighting. Used by both SelectableText (per-widget) and SelectionArea (cross-widget).

Constructors

SelectionController()

Properties

hashCode int
The hash code for this object.
no setterinherited
hasSelection bool
Whether a selection is currently active.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selecting bool
Whether a drag-selection is in progress.
no setter
selectionEnd → ({int x, int y})?
The selection end point, or null.
no setter
selectionStart → ({int x, int y})?
The selection start point, or null.
no setter

Methods

addListener(void listener()) → void
Adds a listener that is called when the selection changes.
clearSelection() → void
Clears the selection and notifies listeners.
getSelectedText(List<String> lines) String
Extracts the selected text from content lines.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeListener(void listener()) → void
Removes a previously added listener.
setSelection({required ({int x, int y}) start, required ({int x, int y}) end}) → void
Sets the selection and notifies listeners.
toString() String
A string representation of this object.
inherited

Operators

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