Skip to content

Wrong icon preview shown for CupertinoIcons.location #3997

Closed

Description

@DanTup

Activity

  1. added
    in flutterRelates to running Flutter apps
    in editorRelates to code editing or language features
    on May 31, 2022
  2. added this to the v3.42.0 milestone on May 31, 2022
  3. DanTup commented on May 31, 2022

    @DanTup
    MemberAuthor

    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.

  4. DanTup commented on May 31, 2022

    @DanTup
    MemberAuthor

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

  5. stevemessick commented on May 31, 2022

    @stevemessick

    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.

  6. DanTup commented on May 31, 2022

    @DanTup
    MemberAuthor

    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.

  7. stevemessick commented on May 31, 2022

    @stevemessick

    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).

  8. DanTup commented on Jun 1, 2022

    @DanTup
    MemberAuthor

    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!

  9. added a commit that references this issue on Sep 2, 2025
    c2137e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin flutterRelates to running Flutter appsis bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions