fluttercommunity / font_awesome_flutter

The Font Awesome Icon pack available as Flutter Icons
Other
831 stars 233 forks source link

Support for Multiple FontAwesome Versions #221

Closed MatthewJones517 closed 2 years ago

MatthewJones517 commented 2 years ago

Is your feature request related to a problem? Please describe. I'm currently working on a design that specs out FontAwesome V5 icons. The designer doesn't want to upgrade to V6.

I have resolved this by locking the version to 9.2.0 in the pubspec, however it would be nice to be able to specify the version of the icons being used while pulling the latest package.

Describe the solution you'd like In FaIcon, I'd like to be able to have an optional version argument. If nothing is provided, it defaults to the latest version. So for example version: 5 would pull the version 5 icon.

Another idea might be to provide multiple FontAwesomeIcons objects. So FontAwesomeIconsV1, FontAwesomeIconsV2, etc... This would be easier to maintain since FontAwesome has changed the library in numerous ways over time.

Describe alternatives you've considered As I said before, for my specific case I just downgraded to 9.2.0.

Additional context This would also allow greater flexibility in the design. My designer could specify version 5 of an icon in one section and version 6 in another.

michaelspiss commented 2 years ago

Hi, thanks for your suggestion! Shipping different versions programmatically would blow up this package's size considerably, as we cannot remove unused assets in an automated way. You should however be able to use the configurator tool and drop in version five's files.

As to using two versions, you could definitely have two local copies of this package. You only need to rename the second copy's package name to something like font_awesome_flutter_v_six and depend on it not via a version, but a path argument. It would then work similarly to your FontAwesomeIconsV1/2 proposal.

As this is a very niche request, I am not planning to incorporate this proposal into font_awesome_flutter by default. I think you will be off best by using the configurator. For usage instructions, please have a look at the customizing font_awesome_flutter section of the readme.

If you have further questions, don't hesitate to ask.