From 1b44569436bdd549e504bd41f457b3df8284fa11 Mon Sep 17 00:00:00 2001
From: X Code <singerdmx@gmail.com>
Date: Tue, 7 Dec 2021 08:17:30 -0800
Subject: [PATCH] Upgrade to 2.1.1

---
 CHANGELOG.md                    | 5 ++++-
 lib/src/widgets/controller.dart | 8 ++++----
 pubspec.yaml                    | 2 +-
 3 files changed, 9 insertions(+), 6 deletions(-)

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