timmaffett / material_symbols_icons

Complete Flutter support for google's Material DesignMaterial Symbols Icons
Apache License 2.0
32 stars 5 forks source link

Symbols not displaying in web app #11

Closed pt-rick closed 7 months ago

pt-rick commented 9 months ago

Was thrilled to find your package as there are multiple Material icons I found missing in the standard Flutter Icons. Thank you!

When I attempt to use Symbols in a web app, they appear as rectangles with an ‘x - likely standard for a missing IconData? You can see the Symbol icons below the regular Flutter Icons attached. Everything looks fine on my Android Flutter app BTW.

image

I know the live example of the web app shows the symbols so I'm sure that this is something simple but I don’t see any calls in the example that might rectify getting the symbols to show in my web app.

Thanks, Rick

timmaffett commented 9 months ago

The current stable web version of the flutter engine has a bug in icon tree shaking that can corrupt the output fonts. You can turn off icon tree shaking when you build and see if that helps. This may be something else though.. can you name a small example app that demonstrates the problem ? (Or if your app is open source that would fine also). (Btw my fix for the flutter engine is in master and may be in the beta branch now also, I think you can find reference to the pr# here somewhere, again not at my computer so I can't look that up readily)

-tim

On Fri, Aug 18, 2023, 1:13 PM pt-rick @.***> wrote:

Was thrilled to find your package as there are multiple Material icons I found missing in the standard Flutter Icons. Thank you!

When I attempt to use Symbols in a web app, they appear as rectangles with an ‘x - likely standard for a missing IconData? You can see the Symbol icons below the regular Flutter Icons attached. Everything looks fine on my Android Flutter app BTW.

[image: image] https://user-images.githubusercontent.com/47258455/261701250-c09c3136-38a3-450a-8c93-46261a1b3a94.png

I know the live example of the web app shows the symbols so I'm sure that this is something simple but I don’t see any calls in the example that might rectify getting the symbols to show in my web app.

Thanks, Rick

— Reply to this email directly, view it on GitHub https://github.com/timmaffett/material_symbols_icons/issues/11, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3YUSKRTJQPTAYDRSWQ3V3XV7EIFANCNFSM6AAAAAA3V67ZS4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

pt-rick commented 9 months ago

Ah - perhaps that's the issue. I'm using Flutter 3.7.11 (Dart 2.19.6) stable since we have yet to move our application to null safety. I did try and rebuild the web app using --no-tree-shake-icons, but the symbol icons are still not showing in the web app. Our app isn't open source but the use of the icons is very simple - I have a map of strings to IconData and use the string as the key and pass the resulting IconData into a Flutter Icon. In the image I attached earlier, the icons that are displaying are Icons (e.g. Icons.tv) and the ones failing are Symbols (e.g. Symbols.tv_with_assistant). Just passing a symbol icon into Icon would be equivalent.

timmaffett commented 9 months ago

So basically no Symbols.XXX icons are working on your web version ? That might help figure this out - it sounds like the fonts themselves are not working at all..

On Mon, Aug 21, 2023 at 8:33 AM pt-rick @.***> wrote:

Ah - perhaps that's the issue. I'm using Flutter 3.7.11 (Dart 2.19.6) stable since we have yet to move our application to null safety. I did try and rebuild the web app using --no-tree-shake-icons, but the symbol icons are still not showing in the web app. Our app isn't open source but the use of the icons is very simple - I have a map of strings to IconData and use the string as the key and pass the resulting IconData into a Flutter Icon. In the image I attached earlier, the icons that are displaying are Icons (e.g. Icons.tv) and the ones failing are Symbols (e.g. Symbols.tv_with_assistant). Just passing a symbol icon into Icon would be equivalent.

— Reply to this email directly, view it on GitHub https://github.com/timmaffett/material_symbols_icons/issues/11#issuecomment-1686557609, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3YUSOBP4E2P3WSBKC3M2TXWN5UXANCNFSM6AAAAAA3V67ZS4 . You are receiving this because you commented.Message ID: @.***>

pt-rick commented 9 months ago

Correct - no Symbols are working in the web. They are fine on the Android, and, I'm assuming ,the iOS, side. I haven't tried iOS yet.

pt-rick commented 7 months ago

Quick update. I migrated our app to null safety and the symbols now work across our platforms.

timmaffett commented 7 months ago

@pt-rick That's great news!

btw. I should be making a new release this week.