{"id":13453558,"url":"https://github.com/fluttercommunity/font_awesome_flutter","last_synced_at":"2025-05-14T01:07:08.983Z","repository":{"id":37589924,"uuid":"95259195","full_name":"fluttercommunity/font_awesome_flutter","owner":"fluttercommunity","description":"The Font Awesome Icon pack available as Flutter Icons","archived":false,"fork":false,"pushed_at":"2024-11-03T17:35:25.000Z","size":2642,"stargazers_count":868,"open_issues_count":8,"forks_count":261,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-10T04:01:37.920Z","etag":null,"topics":["flutter","flutter-icons","font-awesome","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluttercommunity.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-06-23T21:54:24.000Z","updated_at":"2025-04-09T13:42:14.000Z","dependencies_parsed_at":"2024-04-22T01:02:01.309Z","dependency_job_id":"81c0792b-8b34-4217-bf6b-f4d52db1064c","html_url":"https://github.com/fluttercommunity/font_awesome_flutter","commit_stats":{"total_commits":205,"total_committers":21,"mean_commits":9.761904761904763,"dds":0.2829268292682927,"last_synced_commit":"44ea1dbbb169efeb21bd27077863f3365481162f"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercommunity%2Ffont_awesome_flutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercommunity%2Ffont_awesome_flutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercommunity%2Ffont_awesome_flutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluttercommunity%2Ffont_awesome_flutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluttercommunity","download_url":"https://codeload.github.com/fluttercommunity/font_awesome_flutter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248182072,"owners_count":21060893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter","flutter-icons","font-awesome","hacktoberfest"],"created_at":"2024-07-31T08:00:43.167Z","updated_at":"2025-04-14T00:59:38.998Z","avatar_url":"https://github.com/fluttercommunity.png","language":"Dart","readme":"# font_awesome_flutter \n\n[![Flutter Community: font_awesome_flutter](https://fluttercommunity.dev/_github/header/font_awesome_flutter)](https://github.com/fluttercommunity/community)\n\n[![Pub](https://img.shields.io/pub/v/font_awesome_flutter.svg)](https://pub.dartlang.org/packages/font_awesome_flutter)\n\nThe *free* [Font Awesome](https://fontawesome.com/icons) Icon pack available \nas set of Flutter Icons - based on font awesome version 6.6.0.\n\nThis icon pack includes only the *free* icons offered by Font Awesome out-of-the-box.\nIf you have purchased the pro icons and want to enable support for them, please see the instructions below.\n\n## Installation\n\nIn the `dependencies:` section of your `pubspec.yaml`, add the following line:\n\n```yaml\ndependencies:\n  font_awesome_flutter: \u003clatest_version\u003e\n```\n\n## Usage\n\n```dart\nimport 'package:font_awesome_flutter/font_awesome_flutter.dart';\n\nclass MyWidget extends StatelessWidget {\n  Widget build(BuildContext context) {\n    return IconButton(\n      // Use the FaIcon Widget + FontAwesomeIcons class for the IconData\n      icon: FaIcon(FontAwesomeIcons.gamepad), \n      onPressed: () { print(\"Pressed\"); }\n     );\n  }\n}\n```\n\n### Icon names\n\nIcon names equal those on the [official website](https://fontawesome.com/icons), 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\".\nDue to restrictions in dart, icons starting with numbers have those numbers written out.\n\n#### Examples:\n| Icon name                                                                             | Code | Style|\n|---------------------------------------------------------------------------------------| --- | ---|\n| [angle-double-up](https://fontawesome.com/icons/angle-double-up?style=solid)          | `FontAwesomeIcons.angleDoubleUp` | solid _(this icon does not have other free styles)_ |\n| [arrow-alt-circle-up](https://fontawesome.com/icons/arrow-alt-circle-up?style=regular) | `FontAwesomeIcons.arrowAltCircleUp` | regular |\n| [arrow-alt-circle-up](https://fontawesome.com/icons/arrow-alt-circle-up?style=solid)  |  `FontAwesomeIcons.solidArrowAltCircleUp` | solid |\n| [1](https://fontawesome.com/icons/1?style=solid)                                      | `FontAwesomeIcons.solidOne` | solid |\n\n## Example App\n\nView the Flutter app in the `example` directory to see all the available `FontAwesomeIcons`.\n\n## Customizing font awesome flutter\n\nWe supply a configurator tool to assist you with common customizations to this package.\nAll options are interoperable.\nBy default, if run without arguments and no `icons.json` in `lib/fonts` exists, it updates all icons to the\nnewest free version of font awesome.\n\n### Setup\nTo use your custom version, you must first clone [this repository](https://github.com/fluttercommunity/font_awesome_flutter.git)\nto a location of your choice and run `flutter pub get` inside. This installs all dependencies.\n\nThe configurator is located in the `util` folder and can be started by running `configurator.bat` on Windows, or \n`./configurator.sh` on linux and mac. All following examples use the `.sh` version, but work same for `.bat`.\n(If on windows, omit the `./` or replace it with `.\\`.)\nAn overview of available options can be viewed with `./configurator.sh --help`.\n\nTo use your customized version in an app, go to the app's `pubspec.yaml` and add a dependency for\n`font_awesome_flutter: '\u003e= 4.7.0'`. Then override the dependency's location:\n```yaml\ndependencies:\n  font_awesome_flutter: '\u003e= 4.7.0'\n  ...\n  \ndependency_overrides:\n  font_awesome_flutter:\n    path: path/to/your/font_awesome_flutter\n  ...\n```\n\n### Enable pro icons\n:exclamation: By importing pro icons you acknowledge that it is your obligation\nto keep these files private. This includes **not** uploading your package to\na public github repository or other public file sharing services.\n\n* Go to the location of your custom font_awesome_flutter version (see [setup](#setup))\n* Download the web version of font awesome pro and open it\n* Move **all** `.ttf` files from the `webfonts` directory and `icons.json` from `metadata` to\n  `path/to/your/font_awesome_flutter/lib/fonts`. Replace existing files. \n  Newer versions might have an `icon-families.json`.  If this is the case, \n  move its contents to `path/to/your/font_awesome_flutter/lib/fonts/icons.json`.\n* Run the configurator. It should say \"Custom icons.json found\"\n\nIt may be required to run `flutter clean` in apps who use this version for changes to appear.\n\n### Excluding styles\nOne or more styles can be excluded from all generation processes by passing them with the `--exclude` option:\n```\n$ ./configurator.sh --exclude solid\n$ ./configurator.sh --exclude solid,brands\n```\n\nSee the [optimizations](#what-about-file-size-and-ram-usage) and [dynamic icon retrieval by name](#retrieve-icons-dynamically-by-their-name-or-css-class)\nsections for more information as to why it makes sense for your app.\n\n### Retrieve icons dynamically by their name or css class\nProbably the most requested feature after support for pro icons is the ability to retrieve an icon by their name.\nThis was previously not possible, because a mapping from name to icon would break all\n[discussed optimizations](#what-about-file-size-and-ram-usage). Please bear in mind that this is still the case.\nAs all icons could theoretically be requested, none can be removed by flutter. It is strongly advised to only use this\noption in conjunction with [a limited set of styles](#excluding-styles) and with as few of them as possible. You may\nneed to build your app with the `--no-tree-shake-icons` flag for it to succeed.\n\nUsing the configurator tool, this is now an optional feature. Run the tool with the `--dynamic` flag to generate...\n```\n$ ./configurator.sh --dynamic\n```\n...and use the following import to access the map. For normal icons, use \n`faIconNameMapping` with a key of this format: 'style icon-name'.\n```dart\nimport 'package:font_awesome_flutter/name_icon_mapping.dart';\n\n...\n    FaIcon(faIconNameMapping['solid abacus']);\n...\n```\n\nTo exclude unused styles combine the configurator options:\n```\n$ ./configurator.sh --dynamic --exclude solid\n```\n\n\nA common use case also includes fetching css classes from a server. The utility function `getIconFromCss()` takes a\nstring of classes and returns the icon which would be shown by a browser:\n```dart\ngetIconFromCss('far custom-class fa-abacus'); // returns the abacus icon in regular style. custom-class is ignored\n```\n\n## Duotone icons\n\nDuotone support has been discontinued after font awesome changed the way they lay out the icon glyphs inside the font's\nfile. The new way using ligatures is not supported by flutter at the moment.\n\nFor more information on why duotone icon support was discontinued, see\n[this comment](https://github.com/fluttercommunity/font_awesome_flutter/issues/192#issuecomment-1073003668).\n\n## FAQ\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch3\u003eWhy aren't the icons aligned properly or why are the icons being cut off?\u003c/h3\u003e\u003c/summary\u003e\n  Please use the `FaIcon` widget provided by the library instead of the `Icon`\n  widget provided by Flutter. The `Icon` widget assumes all icons are square, but\n  many Font Awesome Icons are not.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch3\u003eWhat about file size and ram usage\u003c/h3\u003e\u003c/summary\u003e\n  This package has been written in a way so that it only uses the minimum amount of resources required.\n\n  All links (eg. `FontAwesomeIcons.abacus`) to unused icons will be removed automatically, which means only required icon\n  definitions are loaded into ram.\n\n  Flutter 1.22 added icon tree shaking. This means unused icon \"images\" will be removed as well. However, this only\n  applies to styles of which at least one icon has been used. Assuming only icons of style \"regular\" are being used,\n  \"regular\" will be minified to only include the used icons and \"solid\" and \"brands\" will stay in their raw, complete\n  form. This issue is being [tracked over in the flutter repository](https://github.com/flutter/flutter/issues/64106).\n\n  However, using the configurator, you can easily exclude styles from the package. For more information, see\n  [customizing font awesome flutter](#customizing-font-awesome-flutter)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch3\u003eWhy aren't the icons showing up on Mobile devices?\u003c/h3\u003e\u003c/summary\u003e\n  If you're not seeing any icons at all, sometimes it means that Flutter has a cached version of the app on device and\n  hasn't pushed the new fonts. I've run into that as well a few times...\n\n  Please try:\n\n  1. Stopping the app\n  2. Running `flutter clean` in your app directory\n  3. Deleting the app from your simulator / emulator / device\n  4. Rebuild \u0026 Deploy the app.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch3\u003eWhy aren't the icons showing up on Web?\u003c/h3\u003e\u003c/summary\u003e\n  Most likely, the fonts were not correctly added to the `FontManifest.json`.\n  Note: older versions of Flutter did not properly package non-Material fonts\n  in the `FontManifest.json` during the build step, but that issue has been\n  resolved and this shouldn't be much of a problem these days.\n\n  Please ensure you are using `Flutter 1.14.6 beta` or newer! \n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch3\u003eWhy does mac/linux not run the configurator?\u003c/h3\u003e\u003c/summary\u003e\n  This is most probably due to missing file permissions. Downloaded scripts cannot be executed by default.\n  \n  Either give the execute permission to `util/configurator.sh` with `$ chmod +x configurator.sh` or run the commands by prepending an `sh`:\n  \n  `$ sh ./configurator.sh`\n\u003c/details\u003e\n","funding_links":[],"categories":["Customizing font awesome flutter","Dart"],"sub_categories":["Setup"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluttercommunity%2Ffont_awesome_flutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluttercommunity%2Ffont_awesome_flutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluttercommunity%2Ffont_awesome_flutter/lists"}