fluttercommunity / font_awesome_flutter

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

FaIcon is not align properly #184

Closed FernandoUFS closed 2 years ago

FernandoUFS commented 2 years ago

I followed the steps to generate fonts from Font Awesome Pro, I used the new /util/configurator.sh. The script was executed successfully.

This is my code:

Container(
  decoration:
      BoxDecoration(borderRadius: BorderRadius.circular(20), border: Border.all(color: Colors.green)),
  child: FaIcon(
        FontAwesomeIcons.bug,
        size: 14,
        color: Colors.green,
      ),
));

The same happens to FontAwesomeIcons.lightBug. Do I miss something?

michaelspiss commented 2 years ago

Font awesome icons are rectangular, not squared - that's why they look off-center here. The problem is, that not all icons have the same size. This means you may have to adjust the size of them manually on a per icon basis. You may however have more luck if you use a Stack widget and overlay a FontAwesomeIcons.circle with whatever icon you need.