phosphor-icons / flutter

A flexible icon family for Flutter
https://phosphoricons.com
MIT License
103 stars 12 forks source link

Static icon classes and its members should be const #22

Open peer-f opened 1 year ago

peer-f commented 1 year ago

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 commented 1 year ago

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

k-ane commented 1 year ago

This is has been fixed I believe https://github.com/phosphor-icons/flutter/issues/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 commented 1 year ago

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

/cc @rektdeckard

rurickdev commented 10 months ago

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