Table of Contents

font_awesome_flutter_named

Live Example

An online live example can be found here

Introduction

With many thanks to the Flutter Community: font_awesome_flutter for creating the vast majority of the work required for this package.

This is built based off of Pub

This package generates the names of the fonts provided by the dependant font_awesome_flutter package. It does not actually include the font files themselves.

Font Names

As a note, the names generated by this package differs from the official package in that the string names of the font icons exactly match the generated Dart code name rather than prefixing with the style. So the names in the example app match the names you may reference in the strings maps.

Installation

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
  font_awesome_flutter_named: <latest_version>

Usage

import 'package:font_awesome_flutter_named/font_awesome_flutter_named.dart';

class MyWidget extends StatelessWidget {
  Widget build(BuildContext context) {
    return IconButton(
      // Use the FaIcon Widget + FontAwesomeIcons class for the IconData
      icon: FaIcon(faIconNameMapping['gamepad']!),
      onPressed: () { print("Pressed"); }
     );
  }
}

Icon names

Icon names equal those on the official website, but are written in lower camel case. If more than one icon style is available for an icon, the style name is used as prefix, except for "regular". Due to restrictions in dart, icons starting with numbers have those numbers written out.

Examples:

Icon nameCodeStyle
angle-double-upfaIconNameMapping['angleDoubleUp']solid (this icon does not have other free styles)
arrow-alt-circle-upfaIconNameMapping['arrowAltCircleUp']regular
arrow-alt-circle-upfaIconNameMapping['solidArrowAltCircleUp']solid
1faIconNameMapping['solidOne']solid

Libraries

font_awesome_flutter_named