Fixed issues from last Flutter update.

pull/1210/head
Michal Misiaszek 2 years ago
parent 8758c2d952
commit 8782d51422
  1. 3
      lib/src/widgets/delegate.dart
  2. 2
      lib/src/widgets/raw_editor.dart
  3. 5
      lib/src/widgets/text_selection.dart

@ -312,7 +312,8 @@ class EditorTextSelectionGestureDetectorBuilder {
/// which triggers this callback./lib/src/material/text_field.dart /// which triggers this callback./lib/src/material/text_field.dart
@protected @protected
void onDragSelectionUpdate( void onDragSelectionUpdate(
DragStartDetails startDetails, DragUpdateDetails updateDetails) { //DragStartDetails startDetails,
DragUpdateDetails updateDetails) {
renderEditor!.extendSelection(updateDetails.globalPosition, renderEditor!.extendSelection(updateDetails.globalPosition,
cause: SelectionChangedCause.drag); cause: SelectionChangedCause.drag);
} }

@ -325,6 +325,8 @@ class RawEditorState extends EditorState
TextDirection get _textDirection => Directionality.of(context); TextDirection get _textDirection => Directionality.of(context);
void insertContent(KeyboardInsertedContent content) {}
/// Returns the [ContextMenuButtonItem]s representing the buttons in this /// Returns the [ContextMenuButtonItem]s representing the buttons in this
/// platform's default selection menu for [RawEditor]. /// platform's default selection menu for [RawEditor].
/// ///

@ -713,7 +713,7 @@ class EditorTextSelectionGestureDetector extends StatefulWidget {
/// The frequency of calls is throttled to avoid excessive text layout /// The frequency of calls is throttled to avoid excessive text layout
/// operations in text fields. The throttling is controlled by the constant /// operations in text fields. The throttling is controlled by the constant
/// [_kDragSelectionUpdateThrottle]. /// [_kDragSelectionUpdateThrottle].
final DragSelectionUpdateCallback? onDragSelectionUpdate; final GestureDragUpdateCallback? onDragSelectionUpdate;
/// Called when a mouse that was previously dragging is released. /// Called when a mouse that was previously dragging is released.
final GestureDragEndCallback? onDragSelectionEnd; final GestureDragEndCallback? onDragSelectionEnd;
@ -857,7 +857,8 @@ class _EditorTextSelectionGestureDetectorState
assert(_lastDragUpdateDetails != null); assert(_lastDragUpdateDetails != null);
if (widget.onDragSelectionUpdate != null) { if (widget.onDragSelectionUpdate != null) {
widget.onDragSelectionUpdate!( widget.onDragSelectionUpdate!(
_lastDragStartDetails!, _lastDragUpdateDetails!); //_lastDragStartDetails!,
_lastDragUpdateDetails!);
} }
_dragUpdateThrottleTimer = null; _dragUpdateThrottleTimer = null;
_lastDragUpdateDetails = null; _lastDragUpdateDetails = null;

Loading…
Cancel
Save