flutter - Flutter中出现这个错误的原因是什么?

标签 flutter dart

----------错误全文----------

../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/fwfh_text_style-2.22.08/lib/fwfh_text_style.dart:11:7:错误:非抽象类“FwfhTextStyle” ' 缺少这些成员的实现:

  • TextStyle.fontVariations 尝试以下任一方法
  • 提供实现方案,
  • 从父类(super class)或 mixin 继承实现,
  • 将类标记为抽象类,或者
  • 提供“noSuchMethod”实现。

类 FwfhTextStyle 扩展 _TextStyleProxy { ^^^^^^^^^^^^^^ /D:/Installion/Flutter/packages/flutter/lib/src/painting/text_style.dart:789:33:上下文:'TextStyle.fontVariations' 在这里定义。 最终列表?字体变化; ^^^^^^^^^^^^^^^ ../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/fwfh_text_style-2.22.08/lib/fwfh_text_style.dart:43:13:错误:方法“FwfhTextStyle.apply”的命名较少参数比重写方法“TextStyle.apply”的参数要多。 文本样式应用({ ^ /D:/Installion/Flutter/packages/flutter/lib/src/painting/text_style.dart:911:13:上下文:这是重写的方法('apply')。 文本样式应用({ ^ ../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/fwfh_text_style-2.22.08/lib/fwfh_text_style.dart:43:13:错误:方法“FwfhTextStyle.apply”不具有重写方法“TextStyle”的命名参数“fontVariations” 。申请'。 文本样式应用({ ^ /D:/Installion/Flutter/packages/flutter/lib/src/painting/text_style.dart:911:13:上下文:这是重写的方法('apply')。 文本样式应用({ ^ ../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/fwfh_text_style-2.22.08/lib/fwfh_text_style.dart:103:13:错误:方法“FwfhTextStyle.copyWith”的命名较少参数比重写方法 'TextStyle.copyWith 的参数 '。 TextStyle copyWith({ ^ /D:/Installion/Flutter/packages/flutter/lib/src/painting/text_style.dart:814:13:上下文:这是重写的方法('copyWith')。 TextStyle copyWith({ ^ ../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/fwfh_text_style-2.22.08/lib/fwfh_text_style.dart:103:13:错误:方法“FwfhTextStyle.copyWith”不具有重写方法“TextS”的命名参数“fontVariations” 样式.copyWith'。 TextStyle copyWith({ ^ /D:/Installion/Flutter/packages/flutter/lib/src/painting/text_style.dart:814:13:上下文:这是重写的方法('copyWith')。 TextStyle copyWith({ ^

失败:构建因异常而失败。

  • 地点: 脚本'D:\Installion\Flutter\packages\flutter_tools\gradle\flutter.gradle'行:1159

  • 出了什么问题: 任务“:app:compileFlutterBuildDebug”执行失败。

Process 'command 'D:\Installion\Flutter\bin\flutter.bat'' finished with non-zero exit value 1

最佳答案

我遇到了同样的问题,但通过升级 fwfh_text_style 解决了

flutter pub upgrade fwfh_text_style

关于flutter - Flutter中出现这个错误的原因是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73627828/

相关文章:

Dart/flutter : DropdownButton causes exception when value is changed

flutter - 为什么 ElevatedButton 会被拉伸(stretch)以适应屏幕的宽度?

android - D8 : Program type already present: android. support.v4.media.MediaBrowserCompat$CustomActionCallback

flutter - 如何在 vscode (Flutter) 上的单次运行/调试中添加 --no-sound-null-safety?

dart - 如何处理可扩展表单上的 Controller TextField

flutter - Dart Flutter 中的 "!"是什么?

dart - 如何使用 Dart 的 Difference Method 和 DateTime 使用动态日期?

flutter - 如何创建扩展方法以对字符串进行颜色加粗,删除内容

dart - 如果 Angular.dart 依赖于 shadow dom,这是一个问题吗?

regex - 如何在Flutter中根据指定的关键字拆分字符串?