selectLineAtPosition method
Implementation
@override
TextSelection selectLineAtPosition(TextPosition position) {
final line = getLineAtOffset(position);
// When long-pressing past the end of the text, we want a collapsed cursor.
if (position.offset >= line.end) {
return TextSelection.fromPosition(position);
}
return TextSelection(baseOffset: line.start, extentOffset: line.end);
}