font_awesome_flutter 7.0.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 50

font_awesome_flutter #

The Font Awesome Icon pack available as set of Flutter Icons.

Based on Font Awesome 5.0.13. Includes all free icons:

  • Regular
  • Solid
  • Brands

Installation #

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

  font_awesome_flutter: <latest_version>

Usage #

import 'package:font_awesome_flutter/font_awesome_flutter.dart';

class MyWidget extends StatelessWidget {
  Widget build(BuildContext context) {
    return new IconButton(
      // Use the FontAwesomeIcons class for the IconData
      icon: new Icon(FontAwesomeIcons.gamepad), 
      onPressed: () { print("Pressed"); }
     );
  }
}

Example #

View the Flutter app in the example directory to see all the available FontAwesomeIcons.

Contributors #

  • Brian Egan
  • Phil Plante

7.0.0 #

  • Renames:
    • All icons that end with capital-O (for outline) have been renamed. E.g. addressBookO has been renamed addressBook
    • All solid icons have been renamed to solidIconName. E.g. addressBook renamed solidAddressBook
  • Generate Icon pack based on JSON definition from source. Much easier upgrades / maintenance / consistency going forward! Big thanks to @pplante on Github for the contribution :)
  • Move fonts into the lib folder.

6.0.0 #

  • Update to Font Awesome Icons 5.0.2, which includes tons of new Icons!

5.0.0 #

  • semver mistake: 4.7.3 should have been a major bump as it involves breaking changes.

4.7.3 #

  • Simpler Install: Remove the need to specify the font in your own pubspec.yaml

4.7.2 #

  • MOAR README updates

4.7.1 #

  • README fix

4.7.0 #

  • Expose Font Awesome 4.7.0 woff font asset. This was the smallest version of the font file that worked with Flutter.
  • Created FontAwesomeIcons class, which provides static access to all Font Awesome 4.7.0 Icons as IconData, similar to Flutter's built-in Icons class.
  • Created a Gallery App that can be used to view all provided icons
  • Created README with installation instructions
  • Added LICENSE.md file

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:font_awesome_flutter_example/icons.dart';

void main() {
  runApp(new FontAwesomeGalleryApp());
}

class FontAwesomeGalleryApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Font Awesome Flutter Gallery',
      theme: new ThemeData.light().copyWith(
        iconTheme: new IconThemeData(size: 36.0, color: Colors.black87),
        textTheme: new TextTheme(
          body1: new TextStyle(fontSize: 16.0, color: Colors.black87),
        ),
      ),
      home: new FontAwesomeGalleryHome(),
    );
  }
}

class FontAwesomeGalleryHome extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => new FontAwesomeGalleryHomeState();
}

class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> {
  var _searchTerm = "";
  var _isSearching = false;

  @override
  Widget build(BuildContext context) {
    final filteredIcons = icons
        .where((icon) =>
            _searchTerm.isEmpty ||
            icon.title.toLowerCase().contains(_searchTerm.toLowerCase()))
        .toList();
    final orientation = MediaQuery.of(context).orientation;

    return new Scaffold(
      appBar: _isSearching ? _searchBar(context) : _titleBar(),
      body: new GridView.builder(
          itemCount: filteredIcons.length,
          gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(
            crossAxisCount: orientation == Orientation.portrait ? 2 : 3,
          ),
          itemBuilder: (context, index) {
            final icon = filteredIcons[index];

            return new InkWell(
              onTap: () {
                Navigator.push(
                  context,
                  new MaterialPageRoute<Null>(
                    builder: (BuildContext context) {
                      return new GestureDetector(
                        onTap: () {
                          Navigator.of(context).pop();
                        },
                        child: new Container(
                          color: Colors.white,
                          child: new SizedBox.expand(
                            child: new Hero(
                              tag: icon,
                              child: new Icon(
                                icon.iconData,
                                size: 100.0,
                              ),
                            ),
                          ),
                        ),
                      );
                    },
                  ),
                );
              },
              child: new Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  new Hero(tag: icon, child: new Icon(icon.iconData)),
                  new Container(
                    padding: new EdgeInsets.only(top: 16.0),
                    child: new Text(icon.title),
                  )
                ],
              ),
            );
          }),
    );
  }

  AppBar _titleBar() {
    return new AppBar(
      title: new Text("Font Awesome Flutter Gallery"),
      actions: [
        new IconButton(
            icon: new Icon(FontAwesomeIcons.search),
            onPressed: () {
              ModalRoute.of(context).addLocalHistoryEntry(
                new LocalHistoryEntry(
                  onRemove: () {
                    setState(() {
                      _searchTerm = "";
                      _isSearching = false;
                    });
                  },
                ),
              );

              setState(() {
                _isSearching = true;
              });
            })
      ],
    );
  }

  AppBar _searchBar(BuildContext context) {
    return new AppBar(
      leading: new IconButton(
        icon: new Icon(FontAwesomeIcons.arrowLeft),
        onPressed: () {
          setState(
            () {
              Navigator.pop(context);
              _isSearching = false;
              _searchTerm = "";
            },
          );
        },
      ),
      title: new TextField(
        onChanged: (text) => setState(() => _searchTerm = text),
        autofocus: true,
        style: new TextStyle(fontSize: 18.0),
        decoration: new InputDecoration(border: InputBorder.none),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  font_awesome_flutter: ^7.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:font_awesome_flutter/font_awesome_flutter.dart';
  
Version Uploaded Documentation Archive
8.4.0 Feb 4, 2019 Go to the documentation of font_awesome_flutter 8.4.0 Download font_awesome_flutter 8.4.0 archive
8.3.0 Feb 4, 2019 Go to the documentation of font_awesome_flutter 8.3.0 Download font_awesome_flutter 8.3.0 archive
8.2.0 Nov 7, 2018 Go to the documentation of font_awesome_flutter 8.2.0 Download font_awesome_flutter 8.2.0 archive
8.1.0 Oct 12, 2018 Go to the documentation of font_awesome_flutter 8.1.0 Download font_awesome_flutter 8.1.0 archive
8.0.1 Aug 16, 2018 Go to the documentation of font_awesome_flutter 8.0.1 Download font_awesome_flutter 8.0.1 archive
8.0.0 Aug 16, 2018 Go to the documentation of font_awesome_flutter 8.0.0 Download font_awesome_flutter 8.0.0 archive
7.1.0 Jul 9, 2018 Go to the documentation of font_awesome_flutter 7.1.0 Download font_awesome_flutter 7.1.0 archive
7.0.0 Jun 1, 2018 Go to the documentation of font_awesome_flutter 7.0.0 Download font_awesome_flutter 7.0.0 archive
6.0.0 Jan 3, 2018 Go to the documentation of font_awesome_flutter 6.0.0 Download font_awesome_flutter 6.0.0 archive
5.0.0 Dec 6, 2017 Go to the documentation of font_awesome_flutter 5.0.0 Download font_awesome_flutter 5.0.0 archive

All 14 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
99
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Running dartdoc failed with the following output: