Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to work with Flutter 3.13.0-7.0.pre.62 #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions lib/src/editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -992,17 +993,17 @@ class _CupertinoTextSelectionControls extends TextSelectionControls {
Offset selectionMidpoint,
List<TextSelectionPoint> endpoints,
TextSelectionDelegate delegate,
ClipboardStatusNotifier? clipboardStatus,
ValueListenable<ClipboardStatus>? 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:
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -1331,7 +1332,7 @@ class _MaterialTextSelectionControls extends MaterialTextSelectionControls {
Offset selectionMidpoint,
List<TextSelectionPoint> endpoints,
TextSelectionDelegate delegate,
ClipboardStatusNotifier? clipboardStatus,
ValueListenable<ClipboardStatus>? clipboardStatus,
Offset? lastSecondaryTapDownPosition,
) {
// super.buildToolbar(context, globalEditableRegion, textLineHeight, selectionMidpoint, endpoints, delegate, clipboardStatus, lastSecondaryTapDownPosition)
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down