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

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

Loading…
Cancel
Save