Upgrade to 2.2.0: Support flutter 2.8

pull/517/head
X Code 3 years ago
parent 881372dd13
commit 890e5842e5
  1. 3
      CHANGELOG.md
  2. 1
      lib/src/widgets/raw_editor.dart
  3. 12
      lib/src/widgets/raw_editor/raw_editor_state_keyboard_mixin.dart
  4. 5
      lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart
  5. 2
      pubspec.yaml

@ -1,3 +1,6 @@
## [2.2.0]
* Support flutter 2.8.
## [2.1.1] ## [2.1.1]
* Add methods of clearing editor and moving cursor. * Add methods of clearing editor and moving cursor.

@ -725,6 +725,7 @@ class RawEditorState extends EditorState
@override @override
bool get wantKeepAlive => widget.focusNode.hasFocus; bool get wantKeepAlive => widget.focusNode.hasFocus;
@override
bool get readOnly => widget.readOnly; bool get readOnly => widget.readOnly;
} }

@ -100,11 +100,13 @@ mixin RawEditorStateKeyboardMixin on EditorState {
TextSelection.collapsed(offset: selection.start), TextSelection.collapsed(offset: selection.start),
); );
setTextEditingValue(TextEditingValue( setTextEditingValue(
text: TextEditingValue(
selection.textBefore(plainText) + selection.textAfter(plainText), text: selection.textBefore(plainText) +
selection: TextSelection.collapsed(offset: selection.start), selection.textAfter(plainText),
), SelectionChangedCause.keyboard); selection: TextSelection.collapsed(offset: selection.start),
),
SelectionChangedCause.keyboard);
} }
return; return;
} }

@ -131,11 +131,12 @@ mixin RawEditorStateSelectionDelegateMixin on EditorState
case TargetPlatform.fuchsia: case TargetPlatform.fuchsia:
case TargetPlatform.linux: case TargetPlatform.linux:
case TargetPlatform.windows: case TargetPlatform.windows:
// Collapse the selection and hide the toolbar and handles. // Collapse the selection and hide the toolbar and handles.
userUpdateTextEditingValue( userUpdateTextEditingValue(
TextEditingValue( TextEditingValue(
text: textEditingValue.text, text: textEditingValue.text,
selection: TextSelection.collapsed(offset: textEditingValue.selection.end), selection: TextSelection.collapsed(
offset: textEditingValue.selection.end),
), ),
SelectionChangedCause.toolbar, SelectionChangedCause.toolbar,
); );

@ -1,6 +1,6 @@
name: flutter_quill name: flutter_quill
description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us) description: A rich text editor supporting mobile and web (Demo App @ bulletjournal.us)
version: 2.1.1 version: 2.2.0
#author: bulletjournal #author: bulletjournal
homepage: https://bulletjournal.us/home/index.html homepage: https://bulletjournal.us/home/index.html
repository: https://github.com/singerdmx/flutter-quill repository: https://github.com/singerdmx/flutter-quill

Loading…
Cancel
Save