Upgrade to 6.4.1

pull/1106/head
X Code 2 years ago
parent efd09b535a
commit 06d62d61bb
  1. 3
      CHANGELOG.md
  2. 47
      lib/src/widgets/delegate.dart
  3. 12
      lib/src/widgets/editor.dart
  4. 10
      lib/src/widgets/raw_editor.dart
  5. 4
      lib/src/widgets/raw_editor/raw_editor_state_selection_delegate_mixin.dart
  6. 2
      pubspec.yaml

@ -1,3 +1,6 @@
# [6.4.1]
* Control the detect word boundary behaviour.
# [6.4.0] # [6.4.0]
* Use `axis` to make the toolbar vertical. * Use `axis` to make the toolbar vertical.
* Use `toolbarIconCrossAlignment` to align the toolbar icons on the cross axis. * Use `toolbarIconCrossAlignment` to align the toolbar icons on the cross axis.

@ -66,9 +66,8 @@ class EditorTextSelectionGestureDetectorBuilder {
/// Creates a [EditorTextSelectionGestureDetectorBuilder]. /// Creates a [EditorTextSelectionGestureDetectorBuilder].
/// ///
/// The [delegate] must not be null. /// The [delegate] must not be null.
EditorTextSelectionGestureDetectorBuilder({ EditorTextSelectionGestureDetectorBuilder(
required this.delegate, {required this.delegate, this.detectWordBoundary = true});
this.detectWordBoundary = true});
/// The delegate for this [EditorTextSelectionGestureDetectorBuilder]. /// The delegate for this [EditorTextSelectionGestureDetectorBuilder].
/// ///
@ -341,26 +340,28 @@ class EditorTextSelectionGestureDetectorBuilder {
/// ///
/// The [child] or its subtree should contain [EditableText]. /// The [child] or its subtree should contain [EditableText].
Widget build( Widget build(
{required HitTestBehavior behavior, required Widget child, Key? key, {required HitTestBehavior behavior,
bool detectWordBoundary = true}) { required Widget child,
Key? key,
bool detectWordBoundary = true}) {
return EditorTextSelectionGestureDetector( return EditorTextSelectionGestureDetector(
key: key, key: key,
onTapDown: onTapDown, onTapDown: onTapDown,
onForcePressStart: delegate.forcePressEnabled ? onForcePressStart : null, onForcePressStart:
onForcePressEnd: delegate.forcePressEnabled ? onForcePressEnd : null, delegate.forcePressEnabled ? onForcePressStart : null,
onSingleTapUp: onSingleTapUp, onForcePressEnd: delegate.forcePressEnabled ? onForcePressEnd : null,
onSingleTapCancel: onSingleTapCancel, onSingleTapUp: onSingleTapUp,
onSingleLongTapStart: onSingleLongTapStart, onSingleTapCancel: onSingleTapCancel,
onSingleLongTapMoveUpdate: onSingleLongTapMoveUpdate, onSingleLongTapStart: onSingleLongTapStart,
onSingleLongTapEnd: onSingleLongTapEnd, onSingleLongTapMoveUpdate: onSingleLongTapMoveUpdate,
onDoubleTapDown: onDoubleTapDown, onSingleLongTapEnd: onSingleLongTapEnd,
onSecondarySingleTapUp: onSecondarySingleTapUp, onDoubleTapDown: onDoubleTapDown,
onDragSelectionStart: onDragSelectionStart, onSecondarySingleTapUp: onSecondarySingleTapUp,
onDragSelectionUpdate: onDragSelectionUpdate, onDragSelectionStart: onDragSelectionStart,
onDragSelectionEnd: onDragSelectionEnd, onDragSelectionUpdate: onDragSelectionUpdate,
behavior: behavior, onDragSelectionEnd: onDragSelectionEnd,
detectWordBoundary: detectWordBoundary, behavior: behavior,
child: child detectWordBoundary: detectWordBoundary,
); child: child);
} }
} }

@ -416,8 +416,8 @@ class QuillEditorState extends State<QuillEditor>
void initState() { void initState() {
super.initState(); super.initState();
_selectionGestureDetectorBuilder = _selectionGestureDetectorBuilder =
_QuillEditorSelectionGestureDetectorBuilder(this, _QuillEditorSelectionGestureDetectorBuilder(
widget.detectWordBoundary); this, widget.detectWordBoundary);
} }
@override @override
@ -467,9 +467,8 @@ class QuillEditorState extends State<QuillEditor>
readOnly: widget.readOnly, readOnly: widget.readOnly,
placeholder: widget.placeholder, placeholder: widget.placeholder,
onLaunchUrl: widget.onLaunchUrl, onLaunchUrl: widget.onLaunchUrl,
contextMenuBuilder: showSelectionToolbar contextMenuBuilder:
? RawEditor.defaultContextMenuBuilder showSelectionToolbar ? RawEditor.defaultContextMenuBuilder : null,
: null,
showSelectionHandles: isMobile(theme.platform), showSelectionHandles: isMobile(theme.platform),
showCursor: widget.showCursor, showCursor: widget.showCursor,
cursorStyle: CursorStyle( cursorStyle: CursorStyle(
@ -593,7 +592,8 @@ class QuillEditorState extends State<QuillEditor>
class _QuillEditorSelectionGestureDetectorBuilder class _QuillEditorSelectionGestureDetectorBuilder
extends EditorTextSelectionGestureDetectorBuilder { extends EditorTextSelectionGestureDetectorBuilder {
_QuillEditorSelectionGestureDetectorBuilder(this._state, this._detectWordBoundary) _QuillEditorSelectionGestureDetectorBuilder(
this._state, this._detectWordBoundary)
: super(delegate: _state, detectWordBoundary: _detectWordBoundary); : super(delegate: _state, detectWordBoundary: _detectWordBoundary);
final QuillEditorState _state; final QuillEditorState _state;

@ -311,12 +311,10 @@ class RawEditorState extends EditorState
onCopy: copyEnabled onCopy: copyEnabled
? () => copySelection(SelectionChangedCause.toolbar) ? () => copySelection(SelectionChangedCause.toolbar)
: null, : null,
onCut: cutEnabled onCut:
? () => cutSelection(SelectionChangedCause.toolbar) cutEnabled ? () => cutSelection(SelectionChangedCause.toolbar) : null,
: null, onPaste:
onPaste: pasteEnabled pasteEnabled ? () => pasteText(SelectionChangedCause.toolbar) : null,
? () => pasteText(SelectionChangedCause.toolbar)
: null,
onSelectAll: selectAllEnabled onSelectAll: selectAllEnabled
? () => selectAll(SelectionChangedCause.toolbar) ? () => selectAll(SelectionChangedCause.toolbar)
: null, : null,

@ -156,8 +156,8 @@ mixin RawEditorStateSelectionDelegateMixin on EditorState
bool get copyEnabled => widget.contextMenuBuilder != null; bool get copyEnabled => widget.contextMenuBuilder != null;
@override @override
bool get pasteEnabled => widget.contextMenuBuilder != null bool get pasteEnabled =>
&& !widget.readOnly; widget.contextMenuBuilder != null && !widget.readOnly;
@override @override
bool get selectAllEnabled => widget.contextMenuBuilder != null; bool get selectAllEnabled => widget.contextMenuBuilder != null;

@ -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: 6.4.0 version: 6.4.1
#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