我从Flutter web开始,我想把material 图标添加到我的Ffltter web应用程序中,但是它显示的是方框.

enter image description here

如有任何帮助,我们将不胜感激.谢谢

推荐答案

flutter_web repository开始:

Note: a reference to 100 is intentionally omitted because the corresponding font is not included in this source.

If you add 100 to this directory, you can update 101 as follows:

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

Solution/Workaround

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

Flutter相关问答推荐

ListView内的ListView正在一次构建所有项目

当仅点击一行时,所有行都被选中

如何防止alert 对话框在收到通知时出现在某个flutter页面中

文本未设置在集装箱摆动的中心

Flutter 蜂窝-检索非基元数据类型列表

将图标呈现在Flutter 克牌小工具的角落上

Flutter 块消费者仅对特定的状态属性更改做出react

如何使DropDownMenu宽度等于TextFormfield?

导航回上一页会将我带回Ffltter应用程序中的登录页面

Firestore 不会取代 map

如何从 Flutter 中的 App2 远程点击 App1 中的按钮

为什么我们使用 RiverpodGenerator

我在手机上找不到我的 Flutter 应用缓存数据

如何制作flutter showDialog、AlertDialog屏障 colored颜色 渐变

通过一个具体的例子理解Flutter约束的本质

访问 AsyncSnapshot 中的嵌套属性

如何在 Flutter 中滚动时为多个小部件设置动画

如何在 flutter 中制作这种类型的扩展瓦片

在 FAB 上添加表格小部件单击 FLUTTER

Flutter 平台通道将多数据传递给 windows 功能