font_awesome_flutter 8.0.1

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

font_awesome_flutter

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

Based on Font Awesome 5.2.0. 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

8.0.1

  • Fix documentation

8.0.0

  • Upgrade environment version constraint for Dart 2
  • Upgrade to font awesome icons 5.2.0

7.1.0

  • Upgrade to font awesome icons 5.1.0

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: ^8.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support 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.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
4.7.3 Dec 4, 2017 Go to the documentation of font_awesome_flutter 4.7.3 Download font_awesome_flutter 4.7.3 archive
4.7.2 Jun 23, 2017 Go to the documentation of font_awesome_flutter 4.7.2 Download font_awesome_flutter 4.7.2 archive
4.7.1 Jun 23, 2017 Go to the documentation of font_awesome_flutter 4.7.1 Download font_awesome_flutter 4.7.1 archive
4.7.0 Jun 23, 2017 Go to the documentation of font_awesome_flutter 4.7.0 Download font_awesome_flutter 4.7.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
99
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
96
Learn more about scoring.

We analyzed this package on Sep 18, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.3
  • Flutter: 0.8.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

The description is too short.

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
recase ^1.0.0+1