fluttercommunity / font_awesome_flutter

The Font Awesome Icon pack available as Flutter Icons
Other
844 stars 244 forks source link

FaIcon should not accept a nullable IconData #201

Closed hamishjohnson closed 2 years ago

hamishjohnson commented 2 years ago

https://github.com/fluttercommunity/font_awesome_flutter/blob/0fc7f871d730667d5eac7291895d9a6562f1d91e/lib/src/fa_icon.dart#L31

I ran into an issue that caused a bug, where I was dynamically passing a value here, and one of the states was null. If this line changes to

final IconData icon;

Then we'll get compiler warnings :)

michaelspiss commented 2 years ago

I thought really hard about this one. For me, it'd make total sense to do this change. However, it would also further dissipate the feature gap between flutter's Icon and our FaIcon.

As there is already work underway to bring them both together again (flutter/flutter#99830), I won't add any more features to FaIcon.

You may however recreate this issue over at the flutter repository and let them have a look at it!