void setSelectionRange(int start, int end, [String? direction]) { selectionStart = start; selectionEnd = end; selectionDirection = direction ?? ''; }