getSelectionRange method
getSelectionRange to get the text selection range from editor
Implementation
Future<SelectionModel> getSelectionRange() async {
var selection = await _editorKey?.currentState?._getSelectionRange();
return selection != null
? SelectionModel.fromJson(jsonDecode(selection))
: SelectionModel(index: 0, length: 0);
}