From 7f36b3bf24ba761995d047e325c039d6cd97c522 Mon Sep 17 00:00:00 2001 From: Darwin Morocho Date: Sat, 2 Apr 2022 16:08:01 -0500 Subject: [PATCH] Added textSelectionControls field in QuillEditor (#748) --- CHANGELOG.md | 2 ++ lib/src/widgets/editor.dart | 8 +++++++- pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0916841..54a247cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +# [4.1.1] +* Added textSelectionControls field in QuillEditor. # [4.1.0] * Added Node to linkActionPickerDelegate. diff --git a/lib/src/widgets/editor.dart b/lib/src/widgets/editor.dart index 2ae4cf00..2501903d 100644 --- a/lib/src/widgets/editor.dart +++ b/lib/src/widgets/editor.dart @@ -172,6 +172,7 @@ class QuillEditor extends StatefulWidget { this.customStyleBuilder, this.locale, this.floatingCursorDisabled = false, + this.textSelectionControls, Key? key}) : super(key: key); @@ -362,6 +363,11 @@ class QuillEditor extends StatefulWidget { final bool floatingCursorDisabled; + /// allows to create a custom textSelectionControls, + /// if this is null a default textSelectionControls based on the app's theme + /// will be used + final TextSelectionControls? textSelectionControls; + @override QuillEditorState createState() => QuillEditorState(); } @@ -448,7 +454,7 @@ class QuillEditorState extends State expands: widget.expands, autoFocus: widget.autoFocus, selectionColor: selectionColor, - selectionCtrls: textSelectionControls, + selectionCtrls: widget.textSelectionControls ?? textSelectionControls, keyboardAppearance: widget.keyboardAppearance, enableInteractiveSelection: widget.enableInteractiveSelection, scrollPhysics: widget.scrollPhysics, diff --git a/pubspec.yaml b/pubspec.yaml index 90510137..0f9387c2 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: 4.1.0 +version: 4.1.1 #author: bulletjournal homepage: https://bulletjournal.us/home/index.html repository: https://github.com/singerdmx/flutter-quill