在flutter项目中使用最新版本的google_fonts(6.2.0)包时,我遇到了"Type FontFeature not found"问题:

/C:/Users/Dell/AppData/Local/Pub/Cache/hosted/pub.dev/google_fonts-6.2.0/lib/src/google_fonts_base.dart:69:8: 
Error: 'FontFeature' isn't a type.
  List<FontFeature>? fontFeatures,
       ^^^^^^^^^^^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

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

我try 降低程序包版本,但问题仍然存在. 我也try 了Flutter 翼清洁和wine 吧获得..

推荐答案

对于面临此问题的所有人,请降级到旧版本6.1.0(推荐)以解决此问题. 另外,请记住这一点:

降级包时,请确保删除版本号前面的插入符号(^).例如:Google_Fonts:6.1.0

感谢@Dhafin Rayhan人的指点.

Flutter相关问答推荐

当MyChangeNotifier更改时如何计算函数,而无需在构建方法中进行不必要的调用- Flutter

Firebase Auth异常未被catch捕获

为什么我不能看到类音频源在flutter?'

无法在主屏幕视图中设置当前日期容器'

如何在不使用NULL-check(!)的情况下缩小`FutureBuilder.Builder()`内部的`Snaphot`范围

SupabaseFlutter 集成问题:无法更新行

为什么PUT方法没有发出任何响应?

任务';:app:check DebugDuplicateClasss';的Ffltter Share_plus抛出执行失败

如何在Flutter Webview包中触发基于URL导航的事件

dart /长笛中的返回早期模式和拆分方法

在 Flutter 中解码 BLE 设备负载

无法在 ListView (Flutter) 中限制 Card 的最大宽度

Flutter / 为什么当我点击我的图片时我的模型没有更新?

从子集合sem中获取参考学年&&课程名称的值

如何在 flutter 中使用带有有效负载数据的重定向来执行 firebase 推送通知.?

在 flutter 的另一个类中使用变量值

如何在 Flutter 中使用简写 IF 禁用单选按钮?

我的主屏幕上的 FutureBuilder 不断重新加载(但仅在其他屏幕上时)?

在 Flutter Bloc 中具有称为 status 的属性的一种状态或不同的状态,哪个更可取?

如何将 pushNamed 与 Dismissible Widget 一起使用并查看背景透明第一页