isSelectionWithinTextBounds method Null safety
- TextSelection selection
Check that the selection
is inside of the bounds of text.
Implementation
bool isSelectionWithinTextBounds(TextSelection selection) {
return selection.start <= text.length && selection.end <= text.length;
}