From 889ae9982d10274468ececf32c5d528abf1f3a4d Mon Sep 17 00:00:00 2001 From: Nuno Brito Date: Fri, 21 Jul 2023 17:20:56 +0100 Subject: [PATCH 1/2] changes to Flutter 3.13.0-7.0.pre.62 --- lib/src/editor.dart | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/src/editor.dart b/lib/src/editor.dart index eb399b7..ff96467 100644 --- a/lib/src/editor.dart +++ b/lib/src/editor.dart @@ -9,6 +9,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; +import 'package:flutter/foundation.dart'; import 'editor_api.dart'; @@ -992,17 +993,17 @@ class _CupertinoTextSelectionControls extends TextSelectionControls { Offset selectionMidpoint, List endpoints, TextSelectionDelegate delegate, - ClipboardStatusNotifier? clipboardStatus, + ValueListenable? clipboardStatus, Offset? lastSecondaryTapDownPosition, ) { return _CupertinoTextSelectionControlsToolbar( - clipboardStatus: clipboardStatus, + clipboardStatus: ClipboardStatusNotifier(value: clipboardStatus!.value), endpoints: endpoints, globalEditableRegion: globalEditableRegion, handleCut: - canCut(delegate) ? () => handleCut(delegate, clipboardStatus) : null, + canCut(delegate) ? () => handleCut(delegate) : null, handleCopy: canCopy(delegate) - ? () => handleCopy(delegate, clipboardStatus) + ? () => handleCopy(delegate) : null, handlePaste: canPaste(delegate) ? () => handlePaste(delegate) : null, handleSelectAll: @@ -1216,7 +1217,7 @@ class _CupertinoTextSelectionControlsToolbarState super.dispose(); // When used in an Overlay, this can be disposed after its creator has // already disposed _clipboardStatus. - if (_clipboardStatus != null && !_clipboardStatus!.disposed) { + if (_clipboardStatus != null ){//&& !_clipboardStatus!.value.disposed) { _clipboardStatus!.removeListener(_onChangedClipboardStatus); if (widget.clipboardStatus == null) { _clipboardStatus!.dispose(); @@ -1331,7 +1332,7 @@ class _MaterialTextSelectionControls extends MaterialTextSelectionControls { Offset selectionMidpoint, List endpoints, TextSelectionDelegate delegate, - ClipboardStatusNotifier? clipboardStatus, + ValueListenable? clipboardStatus, Offset? lastSecondaryTapDownPosition, ) { // super.buildToolbar(context, globalEditableRegion, textLineHeight, selectionMidpoint, endpoints, delegate, clipboardStatus, lastSecondaryTapDownPosition) @@ -1357,12 +1358,12 @@ class _MaterialTextSelectionControls extends MaterialTextSelectionControls { customEntries: customEntries, anchorAbove: anchorAbove, anchorBelow: anchorBelow, - clipboardStatus: clipboardStatus, + clipboardStatus: ClipboardStatusNotifier(value: clipboardStatus!.value), handleCopy: canCopy(delegate) - ? () => handleCopy(delegate, clipboardStatus) + ? () => handleCopy(delegate) : null, handleCut: - canCut(delegate) ? () => handleCut(delegate, clipboardStatus) : null, + canCut(delegate) ? () => handleCut(delegate) : null, handlePaste: canPaste(delegate) ? () => handlePaste(delegate) : null, handleSelectAll: canSelectAll(delegate) ? () => handleSelectAll(delegate) : null, @@ -1430,9 +1431,9 @@ class _MaterialTextSelectionToolbarState @override void dispose() { super.dispose(); - if (!(widget.clipboardStatus?.disposed ?? true)) { + //if (!(widget.clipboardStatus?.disposed ?? true)) { widget.clipboardStatus?.removeListener(_onChangedClipboardStatus); - } + //} } @override From c049840c0f8b9991555563780f00346cdd3cac5e Mon Sep 17 00:00:00 2001 From: Nuno Brito Date: Fri, 21 Jul 2023 17:23:29 +0100 Subject: [PATCH 2/2] changes to Flutter 3.13.0-7.0.pre.62 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 595255c..dcb06ee 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.1.0 homepage: https://github.com/Enough-Software/enough_text_editor environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" flutter: ">=1.17.0" dependencies: