|
|
|
@ -115,14 +115,9 @@ class RawEditorState extends EditorState |
|
|
|
|
late KeyboardListener _keyboardListener; |
|
|
|
|
bool _didAutoFocus = false; |
|
|
|
|
bool _keyboardVisible = false; |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
DefaultStyles? _styles; |
|
|
|
|
final ClipboardStatusNotifier _clipboardStatus = ClipboardStatusNotifier(); |
|
|
|
|
======= |
|
|
|
|
DefaultStyles _styles; |
|
|
|
|
final ClipboardStatusNotifier _clipboardStatus = |
|
|
|
|
final ClipboardStatusNotifier? _clipboardStatus = |
|
|
|
|
kIsWeb ? null : ClipboardStatusNotifier(); |
|
|
|
|
>>>>>>> dda5805935568d42b71a1a1faf7fbdf078d72633 |
|
|
|
|
final LayerLink _toolbarLayerLink = LayerLink(); |
|
|
|
|
final LayerLink _startHandleLayerLink = LayerLink(); |
|
|
|
|
final LayerLink _endHandleLayerLink = LayerLink(); |
|
|
|
@ -681,7 +676,7 @@ class RawEditorState extends EditorState |
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
|
|
|
|
|
|
_clipboardStatus.addListener(_onChangedClipboardStatus); |
|
|
|
|
_clipboardStatus?.addListener(_onChangedClipboardStatus); |
|
|
|
|
|
|
|
|
|
widget.controller.addListener(_didChangeTextEditingValue); |
|
|
|
|
|
|
|
|
@ -873,7 +868,7 @@ class RawEditorState extends EditorState |
|
|
|
|
@override |
|
|
|
|
void dispose() { |
|
|
|
|
closeConnectionIfNeeded(); |
|
|
|
|
_keyboardVisibilitySubscription?.cancel(); |
|
|
|
|
_keyboardVisibilitySubscription.cancel(); |
|
|
|
|
assert(!hasConnection); |
|
|
|
|
_selectionOverlay?.dispose(); |
|
|
|
|
_selectionOverlay = null; |
|
|
|
@ -881,8 +876,8 @@ class RawEditorState extends EditorState |
|
|
|
|
widget.focusNode.removeListener(_handleFocusChanged); |
|
|
|
|
_focusAttachment!.detach(); |
|
|
|
|
_cursorCont.dispose(); |
|
|
|
|
_clipboardStatus.removeListener(_onChangedClipboardStatus); |
|
|
|
|
_clipboardStatus.dispose(); |
|
|
|
|
_clipboardStatus?.removeListener(_onChangedClipboardStatus); |
|
|
|
|
_clipboardStatus?.dispose(); |
|
|
|
|
super.dispose(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -948,7 +943,8 @@ class RawEditorState extends EditorState |
|
|
|
|
this, |
|
|
|
|
DragStartBehavior.start, |
|
|
|
|
null, |
|
|
|
|
_clipboardStatus); |
|
|
|
|
_clipboardStatus!, |
|
|
|
|
); |
|
|
|
|
_selectionOverlay!.handlesVisible = _shouldShowSelectionHandles(); |
|
|
|
|
_selectionOverlay!.showHandles(); |
|
|
|
|
} |
|
|
|
@ -1098,9 +1094,7 @@ class RawEditorState extends EditorState |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
bool showToolbar() { |
|
|
|
|
<<<<<<< HEAD |
|
|
|
|
if (_selectionOverlay == null || _selectionOverlay!.toolbar != null) { |
|
|
|
|
======= |
|
|
|
|
// Web is using native dom elements to enable clipboard functionality of the |
|
|
|
|
// toolbar: copy, paste, select, cut. It might also provide additional |
|
|
|
|
// functionality depending on the browser (such as translate). Due to this |
|
|
|
@ -1109,14 +1103,15 @@ class RawEditorState extends EditorState |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (_selectionOverlay == null || _selectionOverlay.toolbar != null) { |
|
|
|
|
>>>>>>> dda5805935568d42b71a1a1faf7fbdf078d72633 |
|
|
|
|
if (_selectionOverlay == null || _selectionOverlay!.toolbar != null) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_selectionOverlay!.showToolbar(); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
bool get wantKeepAlive => widget.focusNode.hasFocus; |
|
|
|
|