fluttercommunity / font_awesome_flutter

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

FaIcon size 24 #254

Closed vasilich6107 closed 10 months ago

vasilich6107 commented 10 months ago

Describe the bug How to make icon take no more than 24 px by longest side?

To Reproduce

        SizedBox.square(
          dimension: 24,
          child: const FaIcon(
            FontAwesomeIcons.building,
            size: 24,
          ),
        )

Expected behavior The icon should be no more than specified size

Screenshots

image
michaelspiss commented 10 months ago

Hey, your container needs a clipBehavior specified if you want to crop. Otherwise, since font awesome icons are not square there is always the chance that they are larger/smaller in width/height than anticipated. However, this is a limitation by font awesome and not by this library