我启动了 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/