ng_fontawesome 4.7.0+8

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 66

Font Awesome for Angular Dart

View Demo

Basic Usage

This package provides Font Awesome as an Angular2Dart component, making it easy to add icons to your Angular2Dart project. Add directives: const [FontAwesomeIconComponent] to your parent component, and then you can use the element in your markup:

<fa name="flag"></fa>

This Dart package implements all of the Font Awesome effects seen here.

Versioning

The version number of this package follows the version number of Font Awesome itself. This makes it easy to see which version of Font Awesome is provided by this package and pin your own packages to specific versions of Font Awesome (i.e. a version that adds a specific glyph that your package needs).

Icons

Font Awesome icons are implemented in FontAwesomeIconComponent. It requires one name attribute, which is the name of the icon to render:

<fa name="flag"></fa>

The component also supports all of the other Font Awesome effects through the following attributes:

  • border (bool): Display a border.
  • flip (String): Flip the icon over its "horizontal" or "vertical" axis.
  • fw (bool): Render as fixed width element.
  • inverse (bool): Invert the color scheme.
  • pull (String): Float to the "left" or "right".
  • pulse (bool): Animate a rotating icon in 8 discrete steps.
  • rotate (int): Rotate 90, 180, or 270 degrees.
  • size (String): Icon size. "lg" is 33% larger than normal, or use "2x", "3x", "4x", or "5x".
  • spin (bool): Animate the icon spinning continuously.
  • stack (bool): Indicates that the icon is part of a stack a stack, i.e. <fa-stack>, and sets the size to either "1x" or "2x".

Bulleted List

Font Awesome icons can be used as bullets. Add FontAwesomeListComponent and FontAwesomeListItemComponent to your directives, then write markup like this:

<fa-ul>
  <fa-li bullet="flag">Item one</fa-li>
  <fa-li bullet="spinner">Item two</fa-li>
  <fa-li bullet="check-square">Item three</fa-li>
</fa-ul>

The only new attribute is bullet, which should contain the name of the icon to use as the list item's bullet. You may also supply a default bullet that is used for list items which do not specify a bullet:

<fa-ul bullet='check-square'>
  <fa-li>Item one</fa-li>
  <fa-li>Item two</fa-li>
  <fa-li>Item three</fa-li>
</fa-ul>

Icon Stack

Font Awesome also lets you stack icons on top of each other. Add FontAwesomeStackComponent to your directives, then write markup like this:

<fa-stack>
  <fa name="circle" stack="2x"></fa>
  <fa name="flag" stack="1x" [inverse]="true"></fa>
</fa-stack>

An icon stack consists of two icons inside an <fa-stack>. The stack attribute is required in this context and sets the icon's size, either "1x" or "2x" .

Maintenance

This section is for the developer[s] of this package only.

To upgrade Font Awesome, download and unzip the upstream release. Replace lib/css and lib/fonts in this package with the css and fonts from the upstream release. The modify the font-awesome-css and font-awesome.css.min as follows:

sed --in-place "s:url[(]'\.\.:url('packages:g" lib/css/*

Commit the changed files, update the version in pubspec.yaml to match the upstream Font Awesome version, and publish with pub publish.


define hyperion gray

The package's version number follows the upstream Font Awesome version number. The build number (after the plus sign) is increased when the package is modified without updating the upstream.

4.7.0+6

  • Improve Pub score

4.7.0+5

  • Renamed from ng2_fontawesome to ng_fontawesome
  • Upgraded to Angular 4.0.0

Use this package as a library

1. Depend on it

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


dependencies:
  ng_fontawesome: "^4.7.0+8"

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:ng_fontawesome/ng_fontawesome.dart';
  
Version Uploaded Documentation Archive
4.7.0+8 Mar 7, 2018 Go to the documentation of ng_fontawesome 4.7.0+8 Download ng_fontawesome 4.7.0+8 archive
4.7.0+7 Mar 2, 2018 Go to the documentation of ng_fontawesome 4.7.0+7 Download ng_fontawesome 4.7.0+7 archive
4.7.0+6 Feb 23, 2018 Go to the documentation of ng_fontawesome 4.7.0+6 Download ng_fontawesome 4.7.0+6 archive
4.7.0+5 Feb 23, 2018 Go to the documentation of ng_fontawesome 4.7.0+5 Download ng_fontawesome 4.7.0+5 archive

Analysis

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

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

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

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:ng_fontawesome/ng_fontawesome.dart.

Suggestions

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use ng_fontawesome.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 4 hints.

    Run dartfmt to format lib/src/directives.dart.

    Run dartfmt to format lib/src/icon.dart.

    Similar analysis of the following files failed:

    • lib/src/list.dart (hint)
    • lib/src/stack.dart (hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.12.0 <2.0.0
angular ^4.0.0 4.0.0+2 5.0.0-beta
Transitive dependencies
analyzer 0.30.0+4 0.32.3
angular_compiler 0.3.0+1 0.4.0-alpha+16
args 1.4.3
async 2.0.7
barback 0.15.2+16
build 0.11.2 0.12.7
build_barback 0.4.0+2 0.5.0+4
charcode 1.1.2
cli_util 0.1.3
code_builder 1.0.4 3.1.1
code_transformers 0.5.1+5
collection 1.14.10
convert 2.0.1
crypto 2.0.5
csslib 0.14.4
dart_style 1.0.9+1 1.1.2
front_end 0.1.0-alpha.4.1 0.1.3
func 1.0.0
glob 1.1.6
html 0.13.3+1
intl 0.15.6
isolate 1.1.0 2.0.1
js 0.6.1
kernel 0.3.0-alpha.1.1 0.3.3
logging 0.11.3+1
matcher 0.12.3
meta 1.1.5
package_config 1.0.3
path 1.6.1
plugin 0.2.0+2
pool 1.3.5
quiver 0.25.0 0.29.0+1
quiver_hashcode 1.0.0
source_gen 0.7.5+1 0.8.3
source_maps 0.10.6
source_span 1.4.0
stack_trace 1.9.2
string_scanner 1.0.2
tuple 1.0.1
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+9
yaml 2.1.14