dart - Flutter Web 不显示 Material Design 图标

我启动了 Flutter web,我想将 Material 图标添加到我的 Flutter web 应用程序中,但改为显示框。

感谢任何帮助。谢谢

最佳答案

来自 flutter_web repository :

注意:有意省略了对 MaterialIcons 的引用,因为相应的字体未包含在此源中。

如果你将MaterialIcons-Extended.ttf添加到这个目录,你可以更新FontManifest.json如下:

[
  {
    "family": "MaterialIcons",
    "fonts": [
      {
        "asset": "MaterialIcons-Extended.ttf"
      }
    ]
  },
  {
    "family": "GoogleSans",
    "fonts": [
      {
        "asset": "GoogleSans-Regular.ttf"
      }
    ]
  },
  {
    "family": "GalleryIcons",
    "fonts": [
      {
        "asset": "GalleryIcons.ttf"
      }
    ]
  }
]

解决方案/解决方法

下载MaterialIcons-Regular.ttf here ,将其放入您的 assets 文件夹并相应地更新您的 FontManifest.json

https://stackoverflow.com/questions/56067767/

相关文章:

google-maps - 修复中心的谷歌地图标记

flutter - 带有动画提示/标签的文本字段

dart - Flutter 中的透明 PageRoute 用于显示(半)透明页面

android - Flutter:图像溢出容器

dart - 如何使用 android_intent 通过 flutter 打开位置设置

flutter - 如何定期设置状态?

dart - 格式化持续时间,如 HH :mm:ss

dart - Flutter 中的 jest 快照测试相当于什么?

dart - Dart 中有 Goto 函数吗?

flutter - 如何在 flutter 的盒子周围创建虚线边框?