selection property

TextSelection? get selection

The current text selection, or null if no text is selected.

Implementation

TextSelection? get selection {
  if (_selectionStart == null || _selectionEnd == null) return null;
  return TextSelection(start: _selectionStart!, end: _selectionEnd!);
}