move cursor helpers

pull/507/head
Andriy Trubchanin 4 years ago
parent e265b54b1b
commit 0191655f5e
  1. 10
      lib/src/widgets/controller.dart

@ -218,6 +218,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