"fontFamily" 关于 Flutter App 中的 wordpress 插件 ACF(高级自定义字段)的困难...(新手)

difficulties to "fontFamily" with regard to the wordpress plugin ACF (Advanced Custom Fields) in Flutter App ...(newbie)

不幸的是,我无法在我的 flutter 应用程序中以所需的字体显示 wordpress 插件 ACF ( https://www.advancedcustomfields.com/ ) + ( https://de.wordpress.org/plugins/acf-to-rest-api/ ) 的文本行,不幸的是我也不知道如何解决这个问题。不幸的是只在论坛上找到了对我没有真正帮助的东西,也许有人知道你的建议?

这是api与对应文字样式整合的方式,好像不行

  factory PostModel.fromJson(Map<String, dynamic> json, CategoryModel category, { List bookmarks = const [] }) {
    int id = int.parse(json['id'].toString());
    final postAuthor = json['author_info']['display_name'].toString();
    String secondTitle = json['acf']['second_title'].toString();
    final postTitle = _getTitle(json['title']['rendered']);
    final postExcerpt = json['excerpt']['rendered'].toString();
    String header =
        '<h4 id="second_title" fontFamily: "Storopia" >$secondTitle</h4>' +
            '<h3 fontFamily: "Storopia">$postTitle</h3>' +
            postExcerpt.replaceAll(
                '</p>', '<h5 fontFamily: "Storopia">Von $postAuthor</h5></p>');

这是我将它包含在页面显示中的方式,在本例中也是文本样式,但这也不起作用:-(,即使我在两个地方都有它,不幸的是没有成功。 ...

          /// ACF Fields (HTML)
          Html(
            data: widget.post.header,
            style: {
              "p": Style(
                fontFamily: "Storopia",
                fontSize: FontSize(14),
                color: isDark ? Colors.white : Colors.black,
                fontWeight: FontWeight.normal,
              ),
            },
          ),

不幸的是,上述acf字段未以所需字体显示,如果我的问题或类似问题有小错误,请耐心等待,希望您了解问题出在哪里,希望可以解决它...感谢您阅读...

检查您是否安装了 fontFamily: 安装在您的 pubspec.yaml 文件中。它应该看起来像这样。这是一个示例,而不是您的确切字体,因此请注意可能因您而异

  fonts:
    - family: Amaranth // In Your Case this should be Storopia
      fonts:
        - asset: assets/fonts/Amaranth-Regular.ttf
        - asset: assets/fonts/Amaranth-Bold.ttf
        - asset: assets/fonts/Amaranth-BoldItalic.ttf
        - asset: assets/fonts/Amaranth-Italic.ttf

另外,如果你有它,请确保你的工作区中有该字体的 .ttf 文件。如果也存在,那么请检查您是否在 fonts: 下使用了正确的拼写和大小写以及正确的路径和扩展名。 如果这也不能解决问题,请检查您是否在尝试包含字体系列的 Wordpress 文件中键入了正确的拼写。

已找到解决方案...只需将其添加到 MaterialApp

    theme: ThemeData(
      textTheme: TextTheme(
        bodyText2: TextStyle(color: Colors.black,fontFamily: "your font"),