我刚刚将颤振版本从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我没有在我的公共规范上声明flutter_math_fork。
我的颤栗医生输出:
医生摘要(查看所有细节,运行颤振医生-v):√Flutter (频道稳定,2.8.0,在Microsoft上n 10.0.19041.1348,locale es-ES)√Android工具链-为√设备开发(Android版本31.0.0)√Chrome -为web√Android (版本2020.3)√VS代码(版本1.62.3)√连接设备(3可用)·无问题!
我已经尝试过:颤振清除、颤振升级和失效缓存/重新启动。
如有任何建议,将不胜感激。
发布于 2022-02-08 07:36:14
我也遇到了同样的错误,我把下面的代码添加到pubscpec.yaml中,它现在开始工作了。如果它不起作用,您可以遵循上述方法
dependency_overrides:
provider: 6.0.0https://stackoverflow.com/questions/70334900
复制相似问题