我刚刚把Flutter 版本从2.5.3升级到了2.8.我有以下错误,我不知道如何解决它.安装的任何插件都没有错误,似乎错误来自内部类本身,我不知道错误出现在我的应用程序的哪个部分:

../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/flutter_math_fork-0.3.3+1/lib/src/widgets/selectable.dart:407:7: Error: The non-abstract class 'InternalSelectableMathState' is missing implementations for these members:
 - TextSelectionDelegate.copySelection
 - TextSelectionDelegate.cutSelection
 - TextSelectionDelegate.pasteText
 - TextSelectionDelegate.selectAll
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.

class InternalSelectableMathState extends State<InternalSelectableMath>
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/desarrollo/flutter/packages/flutter/lib/src/services/text_input.dart:985:8: Context: 'TextSelectionDelegate.copySelection' is defined here.
  void copySelection(SelectionChangedCause cause);
       ^^^^^^^^^^^^^
/C:/desarrollo/flutter/packages/flutter/lib/src/services/text_input.dart:965:8: Context: 'TextSelectionDelegate.cutSelection' is defined here.
  void cutSelection(SelectionChangedCause cause);
       ^^^^^^^^^^^^
/C:/desarrollo/flutter/packages/flutter/lib/src/services/text_input.dart:973:16: Context: 'TextSelectionDelegate.pasteText' is defined here.
  Future<void> pasteText(SelectionChangedCause cause);
               ^^^^^^^^^
/C:/desarrollo/flutter/packages/flutter/lib/src/services/text_input.dart:979:8: Context: 'TextSelectionDelegate.selectAll' is defined here.
  void selectAll(SelectionChangedCause cause);
       ^^^^^^^^^


FAILURE: Build failed with an exception.

* Where:
Script 'C:\desarrollo\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1070

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\desarrollo\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 8m 5s
Exception: Gradle task assembleDebug failed with exit code 1

我还没有在pubspec上申报flutter_math_fork.

我的Flutter doctor 输出:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.8.0, on Microsoft Windows [Versión 10.0.19041.1348], locale es-ES)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.62.3)
[√] Connected device (3 available)

• No issues found!

我已经try 过了:清除Flutter 、升级Flutter 和无效缓存/重新启动.

如有任何建议,我们将不胜感激.

推荐答案

我已经通过强制将更新flutter_math_fork添加到pubspec来解决此问题:

flutter_math_fork: ^0.5.0

我不知道为什么当我升级到2.8稳定版本时,Ffltter会安装flutter_math_fork-0.3.3+1.

Dart相关问答推荐

如何在Telegram Bot中等待用户回复?

有没有办法否定IF条件中的模式大小写匹配?

Flutter 布局:如何在 Flutter 中将 Row 放入 Flex(或另一个 Row)中?还使用堆栈小部件

如何使用 http 库捕获 SocketException?

从 Dart 中的工厂构造函数返回 null 是否可以接受?

停止从事件侦听器内部侦听事件

Dart JavaScript 与 jQuery 的互操作回调

NoSuchMethodError:在 null 上调用了方法validate

Flutter中图像纵横比的变化

如何判断一个字符串是否可以是 json.decode

如何在flatter中读取本地json导入?

如何将 Stream 转换为 List

Dart 中的动态类方法调用

从 HttpClientResponse 检索响应正文

在 Dart 中将 List 转换为字符串?

函数调用前的感叹号是什么意思?

导出两个具有相同类名的库

dart中 library关键字的确切含义

getter 和 setter 如何改变 Dart 中的属性?

dart列表最小值/最大值