Update constructor of EditorTextSelectionOverlay

pull/573/head
X Code 3 years ago
parent c49af0d4d2
commit 9d6681ed2b
  1. 24
      lib/src/widgets/raw_editor.dart
  2. 28
      lib/src/widgets/text_selection.dart

@ -4,7 +4,6 @@ import 'dart:math' as math;
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
@ -588,19 +587,16 @@ class RawEditorState extends EditorState
_selectionOverlay = null;
_selectionOverlay = EditorTextSelectionOverlay(
textEditingValue,
false,
context,
widget,
_toolbarLayerLink,
_startHandleLayerLink,
_endHandleLayerLink,
getRenderEditor(),
widget.selectionCtrls,
this,
DragStartBehavior.start,
null,
_clipboardStatus,
value: textEditingValue,
context: context,
debugRequiredFor: widget,
toolbarLayerLink: _toolbarLayerLink,
startHandleLayerLink: _startHandleLayerLink,
endHandleLayerLink: _endHandleLayerLink,
renderObject: getRenderEditor(),
selectionCtrls: widget.selectionCtrls,
selectionDelegate: this,
clipboardStatus: _clipboardStatus,
);
_selectionOverlay!.handlesVisible = _shouldShowSelectionHandles();
_selectionOverlay!.showHandles();

@ -66,21 +66,21 @@ class EditorTextSelectionOverlay {
/// Creates an object that manages overlay entries for selection handles.
///
/// The [context] must not be null and must have an [Overlay] as an ancestor.
EditorTextSelectionOverlay(
this.value,
this.handlesVisible,
this.context,
this.debugRequiredFor,
this.toolbarLayerLink,
this.startHandleLayerLink,
this.endHandleLayerLink,
this.renderObject,
this.selectionCtrls,
this.selectionDelegate,
this.dragStartBehavior,
EditorTextSelectionOverlay({
required this.value,
required this.context,
required this.toolbarLayerLink,
required this.startHandleLayerLink,
required this.endHandleLayerLink,
required this.renderObject,
required this.debugRequiredFor,
required this.selectionCtrls,
required this.selectionDelegate,
required this.clipboardStatus,
this.onSelectionHandleTapped,
this.clipboardStatus,
) {
this.dragStartBehavior = DragStartBehavior.start,
this.handlesVisible = false,
}) {
final overlay = Overlay.of(context, rootOverlay: true)!;
_toolbarController = AnimationController(

Loading…
Cancel
Save