selectedText property

String selectedText

Gets the selected source code, if any.

If there is no selection, returns an empty string.

Implementation

String get selectedText {
  if (selectionStart == null) return '';
  return text.substring(selectionStart!, selectionStart! + selectionLength!);
}