You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
move all my images from ./image folder to ./web/assets/images.
create AssetManifest.json in ./web/assets/ folder using this style:
{
"assets/images/googlephotos.png":[
"assets/images/googlephotos.png"
],
"assets/images/pinterest.png":[
"assets/images/pinterest.png"
]
}
3) load images using Image(image: AssetImage(path)) where path was like this "images/googlephotos.png"
to your pubspec.yaml and also create a file FontManifest.json inside web/assets directory containing [{"fonts":[{"asset":"fonts/MaterialIcons-Regular.ttf"}],"family":"MaterialIcons"}]. Restart the server and it should work, it did for me after searching 3 hours yesterday.
Make sure to also download the MaterialIcons-Regular.tff font inside web/assets/fonts dir as well.
On Jun 12, 2019, at 2:20 AM, Rajesh Kumar Sahoo ***@***.***> wrote:
Hi @ciokan I don't see any assets folder inside web folder.
can you guide me to get the necessary list u mentioned to be present inside pls ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
This doesn't work for me with Flutter 1.22.0-12.1.pre when releasing on NGINX
For anyone who is still having this problem. I finally found a solution that worked for me 😊.
In newer versions of Flutter where the original problem is already fix, your previous fix brakes the Icons in the updated version, let me explain:
If you have tried a previous solution of adding MaterialIcons-Extended.ttf to assets/fonts/, and creating and/or updating FontManifest.json.
Erase the font from assets/fonts/ and erase the FontManifest.json file you previously created.
And of course be sure to have uses-material-design: true in the pubspec.yaml
Then flutter clean and you are good to go
It took me an incredible amount of time to fix this, hopefully this would help someone :)
to your pubspec.yaml and also create a file FontManifest.json inside web/assets directory containing [{"fonts":[{"asset":"fonts/MaterialIcons-Regular.ttf"}],"family":"MaterialIcons"}]. Restart the server and it should work, it did for me after searching 3 hours yesterday.
Make sure to also download the MaterialIcons-Regular.tff font inside web/assets/fonts dir as well.
In newer versions you have to undo all these changes to make your Icons work in Flutter web again.
Be careful, the most upvoted solution is now obsolete as of 2021.
In my case (custom icons), I had forgotten to change the line with the right icon family name:
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
recvec commentedon May 11, 2019
Maybe it's temporary solution, but If you mean that images are not displayed from assets, you can try to create AssetManifest.json.
I took the example from here
https://github.com/GeekyAnts/FlatApp-Flutter/blob/master/ios/Flutter/flutter_assets/AssetManifest.json
The steps that I did:
{
"assets/images/googlephotos.png":[
"assets/images/googlephotos.png"
],
"assets/images/pinterest.png":[
"assets/images/pinterest.png"
]
}
3) load images using Image(image: AssetImage(path)) where path was like this "images/googlephotos.png"
Also, I just found out, that you can use rootBundle API for this.
On the "3. Assets" section here https://www.didierboelens.com/2019/05/flutter-for-the-web/ you can see the instruction.
AyushBherwani1998 commentedon May 11, 2019
No, I meant Material Icons are not getting rendered.
ciokan commentedon May 11, 2019
Make sure to add
to your
pubspec.yaml
and also create a fileFontManifest.json
insideweb/assets
directory containing[{"fonts":[{"asset":"fonts/MaterialIcons-Regular.ttf"}],"family":"MaterialIcons"}]
. Restart the server and it should work, it did for me after searching 3 hours yesterday.Make sure to also download the
MaterialIcons-Regular.tff
font insideweb/assets/fonts
dir as well.AyushBherwani1998 commentedon May 11, 2019
Thank you. It worked.
compiledcode commentedon Jun 7, 2019
Thank you Ciokan
Your solution worked for me too.
RajeshKrSahoo commentedon Jun 12, 2019
Thanks!!! it worked 👍
compiledcode commentedon Jun 12, 2019
abbadabbatech commentedon Jul 2, 2019
This works for material icon fonts, is there a way to get material icon images? Like calendar_today, etc...
Gene-Dana commentedon Sep 2, 2020
Hey there ! where do I download this file??
Gene-Dana commentedon Sep 2, 2020
Found it here !
https://www.cdnpkg.com/mdui/file/MaterialIcons-Regular.ttf/#
jeffaknine commentedon Sep 17, 2020
This doesn't work for me with Flutter 1.22.0-12.1.pre when releasing on NGINX
puertojose commentedon Oct 13, 2020
For anyone who is still having this problem. I finally found a solution that worked for me 😊.
In newer versions of Flutter where the original problem is already fix, your previous fix brakes the Icons in the updated version, let me explain:
If you have tried a previous solution of adding MaterialIcons-Extended.ttf to assets/fonts/, and creating and/or updating FontManifest.json.
Erase the font from assets/fonts/ and erase the FontManifest.json file you previously created.
And of course be sure to have uses-material-design: true in the pubspec.yaml
Then
flutter clean
and you are good to goIt took me an incredible amount of time to fix this, hopefully this would help someone :)
puertojose commentedon Oct 13, 2020
In newer versions you have to undo all these changes to make your Icons work in Flutter web again.
andreagr commentedon Nov 25, 2020
I have an issue here, I am using FontManifest.json to also render my app's font.
If I remove it, as per @puertojose's suggestion, icons start working again but I lose my font styles. I'm in a deadlock here, any suggestion?
agavrel commentedon Jan 21, 2021
Be careful, the most upvoted solution is now obsolete as of 2021.
In my case (custom icons), I had forgotten to change the line with the right icon family name:
of the dart file.
Fix Material Icons not showing in newer Flutter
github-actions commentedon Aug 6, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -v
and a minimal reproduction of the issue.