diff --git a/CHANGELOG.md b/CHANGELOG.md index 0704a47e..006f50f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ +## [2.1.1] +* Add methods of clearing editor and moving cursor. + ## [2.1.0] -* Add delete handler +* Add delete handler. ## [2.0.23] * Support custom replaceText handler. diff --git a/lib/src/widgets/controller.dart b/lib/src/widgets/controller.dart index db211d1d..d389cc3d 100644 --- a/lib/src/widgets/controller.dart +++ b/lib/src/widgets/controller.dart @@ -124,9 +124,8 @@ class QuillController extends ChangeNotifier { /// clear editor void clear() { - replaceText( - 0, plainTextEditingValue.text.length-1, '', - TextSelection.collapsed(offset: 0)); + replaceText(0, plainTextEditingValue.text.length - 1, '', + const TextSelection.collapsed(offset: 0)); } void replaceText( @@ -226,7 +225,8 @@ class QuillController extends ChangeNotifier { } void moveCursorToStart() { - updateSelection(TextSelection.collapsed(offset: 0), ChangeSource.LOCAL); + updateSelection( + const TextSelection.collapsed(offset: 0), ChangeSource.LOCAL); } void moveCursorToEnd() { diff --git a/pubspec.yaml b/pubspec.yaml index 0ed5e01b..21febb2a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us) -version: 2.1.0 +version: 2.1.1 #author: bulletjournal homepage: https://bulletjournal.us/home/index.html repository: https://github.com/singerdmx/flutter-quill