From 890e5842e57076784e9fe7af2ae8a128c89211af Mon Sep 17 00:00:00 2001 From: X Code Date: Thu, 9 Dec 2021 13:32:46 -0800 Subject: [PATCH] Upgrade to 2.2.0: Support flutter 2.8 --- CHANGELOG.md | 3 +++ lib/src/widgets/raw_editor.dart | 1 + .../raw_editor/raw_editor_state_keyboard_mixin.dart | 12 +++++++----- .../raw_editor_state_selection_delegate_mixin.dart | 5 +++-- pubspec.yaml | 2 +- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 006f50f6..050b375f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [2.2.0] +* Support flutter 2.8. + ## [2.1.1] * Add methods of clearing editor and moving cursor. diff --git a/lib/src/widgets/raw_editor.dart b/lib/src/widgets/raw_editor.dart index 1a4f3b6a..f42deef2 100644 --- a/lib/src/widgets/raw_editor.dart +++ b/lib/src/widgets/raw_editor.dart @@ -725,6 +725,7 @@ class RawEditorState extends EditorState @override bool get wantKeepAlive => widget.focusNode.hasFocus; + @override bool get readOnly => widget.readOnly; } diff --git a/lib/src/widgets/raw_editor/raw_editor_state_keyboard_mixin.dart b/lib/src/widgets/raw_editor/raw_editor_state_keyboard_mixin.dart index 8156e6ee..05dc0057 100644 --- a/lib/src/widgets/raw_editor/raw_editor_state_keyboard_mixin.dart +++ b/lib/src/widgets/raw_editor/raw_editor_state_keyboard_mixin.dart @@ -100,11 +100,13 @@ mixin RawEditorStateKeyboardMixin on EditorState { TextSelection.collapsed(offset: selection.start), ); - setTextEditingValue(TextEditingValue( - text: - selection.textBefore(plainText) + selection.textAfter(plainText), - selection: TextSelection.collapsed(offset: selection.start), - ), SelectionChangedCause.keyboard); + setTextEditingValue( + TextEditingValue( + text: selection.textBefore(plainText) + + selection.textAfter(plainText), + selection: TextSelection.collapsed(offset: selection.start), + ), + SelectionChangedCause.keyboard); } return; } diff --git a/lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart b/lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart index 8f29c2b7..0ee0ed66 100644 --- a/lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart +++ b/lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart @@ -131,11 +131,12 @@ mixin RawEditorStateSelectionDelegateMixin on EditorState case TargetPlatform.fuchsia: case TargetPlatform.linux: case TargetPlatform.windows: - // Collapse the selection and hide the toolbar and handles. + // Collapse the selection and hide the toolbar and handles. userUpdateTextEditingValue( TextEditingValue( text: textEditingValue.text, - selection: TextSelection.collapsed(offset: textEditingValue.selection.end), + selection: TextSelection.collapsed( + offset: textEditingValue.selection.end), ), SelectionChangedCause.toolbar, ); diff --git a/pubspec.yaml b/pubspec.yaml index 21febb2a..ae629332 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.1 +version: 2.2.0 #author: bulletjournal homepage: https://bulletjournal.us/home/index.html repository: https://github.com/singerdmx/flutter-quill