我在"Flutter "中发现了这个错误

../../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/google_fonts-2.3.0/lib/google_fonts.dart:142265:7: Error: No named parameter with the name 'displayLarge'.
      displayLarge:
      ^^^^^^^^^^^^
../../../snap/flutter/common/flutter/packages/flutter/lib/src/material/text_theme.dart:81:9: Context: Found this candidate, but the arguments don't match.
  const TextTheme({
        ^^^^^^^^^

在运行移动应用程序时

一些代码片段.

pubspec.yaml

dependencies:
  flutter:
    sdk: flutter
  http: ^0.13.4
  cupertino_icons: ^1.0.2
  google_fonts:
  get:

code

     Padding(
              padding: const EdgeInsets.all(8.0),
              child: Text(
                'Details',
                style: GoogleFonts.pacifico(),
              ),
            )

提前谢谢

推荐答案

你应该try 设置一个特定的版本,因为它似乎是由最近谷歌字体更新的要求引起的.

google_fonts:2.1.1元对我来说很管用.

也要判断https://github.com/material-foundation/google-fonts-flutter/issues/219.

Flutter相关问答推荐

在fltter_widget_from_html中启动url

Flutter creating Constant.dart InputDecoration section put pass in hintText

如何使排内 children 的身高与其他排内 children 的身高相适应?

使小部件处于有状态状态会导致hasSize异常

摆动更改标记可轻敲文本按钮样式

在使用FutureProvider时,我想显示用于加载的指示器,但无法自定义大小

Riverpod 2.0-如何使用FutureOr和AutoDisposeSyncNotificationer处理api状态代码?

运行调试flutter应用程序时出错:B/BL超出范围(最大+/-128MB)到'';

TextField 中的富文本并获取 RenderParagraph

Flutter 使用扩展的 TextField 定位小部件

允许文本小部件在容器之间溢出

如何(部分)更新 riverpod 中的 AsyncValue?

使用 Riverpod 和 copyWith 方法更新数据类中列表中变量的值

如何在 flutter 中同时使用 ButtonStyle() 和 ElevatedButton.styleFrom() ?

扩展磁贴尾随图标在与一个磁贴交互时更新列表中的所有内容.如何只更改展开图块的图标?

Firestore:缓存和读取数据

在 flutter 中使用 Firebase 实时数据库数据创建无限滚动效果

Flutter 中父容器顶部的 Gridview 间距额外区域

使用 Chaquopy 插件后 Gradle Sync 无法正常工作

从 Uint8List 或图像对象创建 InputImageData 用于 Google ML Kit 人脸检测