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

Static icon classes and its members should be const #22

Open
peer-f opened this issue May 30, 2023 · 4 comments
Open

Static icon classes and its members should be const #22

peer-f opened this issue May 30, 2023 · 4 comments

Comments

@peer-f
Copy link

peer-f commented May 30, 2023

Hello, thanks for the great set of icons!

I've noticed that different types of icons have been put into separate classes as static members of the abstract class PhosphorIcons since I've upgraded to version 2.0.0 which is really nice.

My latest builds failed for a reason that I believe is related to the way PhosphorIcons are accessed.
Error (Xcode): This application cannot tree shake icons fonts. It has non-constant instances of IconData at the following locations:

Since each class and its members are auto generated and do not change at any time I believe both classes such as PhosphorIconsBold() and all of it's members could and should be const. This way each icon could be accessed in a constant way which improves performance.

@peer-f peer-f changed the title Static icon classes should be const Static icon classes and its members should be const May 30, 2023
@peer-f
Copy link
Author

peer-f commented May 31, 2023

Downgrading to version 1.4.0 fixed the error for me and new builds ran through without issues.

@k-ane
Copy link

k-ane commented Jun 15, 2023

This is has been fixed I believe #16 but no new release has been done since. You can also point to master which is what I am doing for the time being:

# phosphor_flutter: ^2.0.0
phosphor_flutter:
    git:
      url: https://github.com/phosphor-icons/flutter.git

@johnnyasantoss
Copy link

I'm having the same issue.
Hopefully we can get a new release soon.

/cc @rektdeckard

@rurickdev
Copy link
Collaborator

A new 2.0.1 version has been released. you can point to pub dev now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants