Showing blank boxes for custom icons

1,559 views
Skip to first unread message

Cloe Su

unread,
Apr 19, 2020, 2:28:35 PM4/19/20
to Flutter Development (flutter-dev)

Hi everyone,

I am quite new in coding but I like challenges. That's why I'm facing an issue with custom icons.
I wanted specific icons that I could not find so I decided to draw them by myself and save them as .svg. Then I went to the plateform fluttericon.com to convert them as font. On this web site, the icons are showing perfectly.
See below:
image
BUT when I put them into my project, it shows empty boxes
image
I did my code as suggested on https://medium.com/flutterpub/how-to-use-custom-icons-in-flutter-834a079d977
In the main.dart file:
image
image
In the pubspec.yaml file:
image
As I was wondering if the .ttf file was working, I tried the Icons on MSWord and there they are also working perfectly:
image
So I really don't know what is not working in my project. I restarted it many time, I did flutter clean, reinstall the app on my emulator, wipe data on the emulator, tried on my own android device (which then show chinese writings instead of the icon), flutter doctor does not show any issues, all the SDKs are uptodate.
Flutter doctor:
`D:...MyApp\flutter\bin\flutter.bat doctor --verbose
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [version 6.1.7601], locale fr-FR)
• Flutter version 1.12.13+hotfix.8 at D:...\MyApp\flutter
• Framework revision 0b8abb4724 (6 weeks ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at D:/.../MyApp/SDK
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = D:/.../MyApp/SDK
• Java binary at: D:...\MyApp\Android\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
• All Android licenses accepted.

[√] Android Studio (version 3.6)
• Android Studio at D:...\MyApp\Android
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] Connected device (1 available)
• Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 8.0.0 (API 26) (emulator)

• No issues found!
`
If any has an idea where my problem comes from, I will be pleased to be helped in this way.
Please also let me know if you need more info or if I should present my issue in an other way (I'm quite new here :) )
Have a nice day!

Souvik Dutta

unread,
Apr 21, 2020, 12:56:17 AM4/21/20
to Cloe Su, Flutter Development (flutter-dev)
I think you should consider using the svg image without converting it to font using a package. https://pub.dev/packages/flutter_svg

Souvik flutter dev

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/763f99b2-5be0-4700-aede-589480594fd7%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages