Reusable Font Awesome 7.3 icon-font assets for Flutter, with type-safe constants for every glyph included in every bundled font family.
Add the package from Git:
dependencies:
awesome_icons:
git:
url: https://github.com/stackwares/awesome-icons-flutter.git
ref: mainThen run flutter pub get.
Import the package and select an explicit style-qualified constant:
import 'package:awesome_icons/awesome_icons.dart';
AwesomeIcon(AwesomeIcons.jellyRegularStar);
AwesomeIcon(AwesomeIcons.solidStar);
AwesomeIcon(
AwesomeIcons.duotoneRegularStar,
color: const Color(0xff7c3aed),
secondaryColor: const Color(0xffc4b5fd),
);
AwesomeIcon(AwesomeIcons.sharpDuotoneSolidStar);
AwesomeIcon(AwesomeIcons.slabPressDuoRegularStar);AwesomeIcon draws both layers of every bundled Duo and Duotone face.
A missing secondaryColor uses the primary color at 40% opacity. Use
AwesomeIcon for every bundled family, including brands. Flutter's Icon
widget cannot paint these glyphs.
The style prefix matches AwesomeIconFonts: for example,
jellyRegular, duotoneRegular, sharpDuotoneSolid, and
utilityDuoSemibold. The legacy unqualified names are not available.
For a glyph that is not part of Font Awesome's canonical metadata, pass an explicit codepoint:
const customIcon = AwesomeIconData(
0xf005,
fontFamily: AwesomeIconFonts.jellyRegular400,
);awesome_icons does not construct Flutter IconData. Flutter's icon
tree-shaker therefore leaves these fonts alone, and the bundled OTFs ship
in full. You do not need --no-tree-shake-icons for this package.
Material and Cupertino icons still tree-shake as usual.
tool/fontawesome-7.3.0-icons.json is the vendored Font Awesome 7.3 metadata.
The generator reads the actual font cmap tables, so it emits a constant only
when the glyph is present in that bundled font.
After changing a font asset or updating the matching metadata, run:
dart run tool/generate_icons.dart
dart format lib tool test
flutter testSome bundled Font Awesome style families are nonstandard. Confirm your Font Awesome license before copying, publishing, or redistributing these assets.