setCursorPosition method
Sets a UTF-16 offset, clamped and rounded down to a grapheme boundary.
Implementation
void setCursorPosition(int position) {
_cursorPosition =
_boundaries.lastWhere((p) => p <= position.clamp(0, length));
}
Sets a UTF-16 offset, clamped and rounded down to a grapheme boundary.
void setCursorPosition(int position) {
_cursorPosition =
_boundaries.lastWhere((p) => p <= position.clamp(0, length));
}