selection property

TextSelection selection

The region of text that is selected, if any.

Implementation

TextSelection get selection => _selection;
void selection= (TextSelection value)

Implementation

set selection(TextSelection value) {
  if (_selection == value)
    return;
  // Use the _fallbackAffinity when the set selection has a null
  // affinity. This happens when the platform does not supply affinity,
  // in which case using the fallback affinity computed from dart:ui will
  // be superior to simply defaulting to TextAffinity.downstream.
  if (value.affinity == null) {
    _selection = value.copyWith(affinity: _fallbackAffinity);
  } else {
    _selection = value;
  }
  _selectionRects = null;
  markNeedsPaint();
  markNeedsSemanticsUpdate();
}