diff --git a/lib/src/widgets/controller.dart b/lib/src/widgets/controller.dart index 8e6a3a92..db211d1d 100644 --- a/lib/src/widgets/controller.dart +++ b/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();