move cursor helpers (#507)

pull/515/head
Andy Trand 3 years ago committed by GitHub
parent 7d6319de5f
commit 9f68930695
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      lib/src/widgets/controller.dart

@ -225,6 +225,16 @@ class QuillController extends ChangeNotifier {
formatText(selection.start, selection.end - selection.start, attribute);
}
void moveCursorToStart() {
updateSelection(TextSelection.collapsed(offset: 0), ChangeSource.LOCAL);
}
void moveCursorToEnd() {
updateSelection(
TextSelection.collapsed(offset: plainTextEditingValue.text.length),
ChangeSource.LOCAL);
}
void updateSelection(TextSelection textSelection, ChangeSource source) {
_updateSelection(textSelection, source);
notifyListeners();

Loading…
Cancel
Save