galonsos / line_icons

Flutter class for Awesome Line Icons
GNU General Public License v3.0
73 stars 10 forks source link

Icons called with complex names not working #21

Closed johnareid54 closed 3 years ago

johnareid54 commented 3 years ago

I am having a problem calling the icons by name. For example: Icon(LineIcons.byName('home')); works Icon(LineIcons.byName('info-circle')); does not works

It seems to be related to the name having more than one word in the string.

Any suggestions?

galonsos commented 3 years ago

Hi, @johnareid54.

Yes, it does indeed have to do with the number of words of the icon name. Since version 2.0, names are camelCase instead of the original ones.

So

Icon(LineIcons.byName('infoCircle'));

should work properly.

Out of curiosity, why such a long statement instead of LineIcon.infoCircle()?

Thanks.

johnareid54 commented 3 years ago

Thanks for the great answer!

Out of curiosity, why such a long statement instead of LineIcon.infoCircle()? I guess I did not read the documentation all that well.

galonsos commented 3 years ago

You're welcome!

I'd suggest to take a look to the values property, which will provide you with a list of the available names.

Cheers