Open xVemu opened 9 months ago
The icon preview for material icons is something that is implemented through the dart/flutter extensions for Visual Studio code. It would be possible to create a visual studio extension to do this for the material symbols icons, but I don't have the time to do this unfortunately.
A discussion of the flutter/dart extension and features, including icon preview , can be found here: https://dartcode.org/releases/v3-1/#preview-flutter-ui-guides
Oh, I just noticed you are talking about Android Studio, but this is the same issue. The android studio feature is discussed here: https://github.com/Dart-Code/Dart-Code/issues/1707
Basically for the material icons an android studio extension renders all of the icons to files and then pops them up.
Again, I am sure this could be done for with a special android studio addin..
Well I take it back - it looks like IntelliJ has support for non-standard icon preview
https://github.com/flutter/flutter-intellij/pull/5595
I will look into this.
In this bug report I found a clue to how to get this to work in Android Studio/IntelliJ https://github.com/flutter/flutter-intellij/issues/5850
You go to settings, search flutter, at the bottom of flutter you find 'experiments' and then there is a section 'Font Packages' where you presumably add 'material_symbols_icons' as a package. It looks like you also need to have the 'Enable Hot UI' checkbox checked..
I tried this and it did not seem to work, but you can give it a try.. It could be my android studio environment. ( I will trace through the java code for the flutter addin at some point and see what I can see.)
In my case, it also doesn't work.
In my case, it also doesn't work.
Yeah, sadly in my case it doesn't work to.
It's not a big deal, but if that works in the future it would be a nice thing!
I have found following in a Medium article:
Note that this works for icons defined as static constants in a class, as shown in the sample code in the screen shot. It won’t work for expressions, such asLineIcons.addressBook() or LineIcons.values['code'].
It's about Flutter 2.5 but shouldn't be different for newer versions.
Hi @Bohne13 - when I follow that Medium link I get a article titled 'Unit test coverage for flutter application in Android studio/Intellij' - and it does not seem to be anything about Icons.
What happens for me when I open Android Studio with a project that uses the material_symbols_icons
package is at the bottom of the screen there is a 'Checking icons...' message with a progress bar, and it gets to 100% but then hangs..
The problem could be that the Symbols. class has over 10,000 total icons. My original package had 3 separate classes, (outline, sharp and rounded) - but then I discovered the Flutter Symbols specification document by google and changed everything to match google's plan for eventual support - and their method was to place all the icons in a single class with _rounded and _sharp appended to the icon names for. I really am not sure, and I have listed urls to several issues related to above.
Yes, I found another newer issue about it here: https://github.com/flutter/flutter-intellij/issues/6932
@timmaffett sorry for that! I have updated the previous posts link. It now should point directly to the topic of icon preview.
Related issue https://github.com/dart-lang/sdk/issues/47667
Is it possible to display an icon preview next to the line number, as it is with MaterialIcons?