I started Flutter web and i wanted to add Material icons to my Flutter web app but its displaying boxes instead.

Any help is appreciated. Thanks
From flutter_web repository:
Note: a reference to MaterialIcons is intentionally omitted because the corresponding font is not included in this source.
If you add MaterialIcons-Extended.ttf to this directory, you can update FontManifest.json as follows:
[
{
"family": "MaterialIcons",
"fonts": [
{
"asset": "MaterialIcons-Extended.ttf"
}
]
},
{
"family": "GoogleSans",
"fonts": [
{
"asset": "GoogleSans-Regular.ttf"
}
]
},
{
"family": "GalleryIcons",
"fonts": [
{
"asset": "GalleryIcons.ttf"
}
]
}
]
Solution/Workaround
Download MaterialIcons-Regular.ttf here, put it inside your assets folder and update your FontManifest.json accordingly.
According to this
you can directly add Material icons to FontManifest.json as shown below.
[
{
"family": "MaterialIcons",
"fonts": [
{
"asset": "https://fonts.gstatic.com/s/materialicons/v42/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2"
}
]
}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With