Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong icon preview shown for CupertinoIcons.location #3997

Closed
DanTup opened this issue May 31, 2022 · 6 comments
Closed

Wrong icon preview shown for CupertinoIcons.location #3997

DanTup opened this issue May 31, 2022 · 6 comments
Labels
in editor Relates to code editing or language features in flutter Relates to running Flutter apps is bug
Milestone

Comments

@DanTup
Copy link
Member

DanTup commented May 31, 2022

See flutter/flutter#104973:

Screenshot 2022-05-31 at 10 09 26

@DanTup DanTup added is bug in flutter Relates to running Flutter apps in editor Relates to code editing or language features labels May 31, 2022
@DanTup DanTup added this to the v3.42.0 milestone May 31, 2022
@DanTup
Copy link
Member Author

DanTup commented May 31, 2022

Looks like this was a previous bug in Flutter that was fixed in flutter/flutter#101923, but the icons in tools_metadata haven't been updated since.

The tools_metadata icons will need regenerating and shipping in VS Code.

@stevemessick FYI - not sure if this affects IntelliJ. I'll send a PR to tools_metadata shortly.

@DanTup
Copy link
Member Author

DanTup commented May 31, 2022

There are also some additional missing icons like solar_power that were added in flutter/flutter#100885. Opened #3998 about that.

@DanTup DanTup closed this as completed in c2137e5 May 31, 2022
@stevemessick
Copy link

Thanks @DanTup I'm planning to update colors and icons in the upcoming release.

For background, the IntelliJ plugin does read the icons from the *.ttf or *.otf file. However, the Flutter 3.0 files have a lot of problems, so I'm going to revert to using the previews from tools_metadata for version 3.0 and up. At least until I get some time to look into what the cause of those problems is. It might be I have a bug to fix, but I suspect the Java code that reads the files isn't working.

@DanTup
Copy link
Member Author

DanTup commented May 31, 2022

With each new release the size of the icons I include grows, and it re-reminds me that we need a better way to handle this in the SDK, but I still haven't come up with a particularly good solution.

@stevemessick
Copy link

I think the big stumbling block is reading the font file to create glyphs for icons. Java and Flutter have built-in support for that, but Dart does not. Flutter uses native code in its Sky engine. We'd either have to add support to Dart to read *.otf and *.ttf files (Material uses OTF and Cupertino uses TTF), or implement a Dart package to read font files and create glyphs. I have no idea how hard that would be, but given that everyone else seems to use C++ to do it, I don't expect it to be easy.

However, if we had that then it would be fairly straight-forward. The IntelliJ plugin has code to create icon previews that could be used to help design the analyzer version. Of course, it works with the IntelliJ PSI tree and the analyzer has its own version of syntax tree, but the concepts are similar (IIRC, it has been awhile since I looked at the analyzer).

@DanTup
Copy link
Member Author

DanTup commented Jun 1, 2022

Yeah, there was some discussion about having flutter do this. Although it's not clear when it would do it. For built-in icons it could be done as part of Flutter's initial initialization, but but it would make that slower. If we supported them in packages (which I suspect we'd like to), we'd need some way to trigger this on flutter pub get (but again, it could slow that down).

I'll think a bit more about this and may try to revive some discussion on dart-lang/sdk#47667. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in flutter Relates to running Flutter apps is bug
Projects
None yet
Development

No branches or pull requests

2 participants