Commit 67b809f2 authored by Brian Egan's avatar Brian Egan

Remove need to specify the font in your own pubspec

parent c3a17517
## 4.7.3
* Simpler Install: Remove the need to specify the font in your own pubspec.yaml
## 4.7.2 ## 4.7.2
* MOAR README updates * MOAR README updates
...@@ -12,4 +16,4 @@ ...@@ -12,4 +16,4 @@
* 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 `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 a Gallery App that can be used to view all provided icons
* Created README with installation instructions * Created README with installation instructions
* Added LICENSE.md file * Added LICENSE.md file
\ No newline at end of file
...@@ -4,25 +4,10 @@ The [Font Awesome](http://fontawesome.io/icons/) Icon pack available as set of F ...@@ -4,25 +4,10 @@ The [Font Awesome](http://fontawesome.io/icons/) Icon pack available as set of F
## Installation ## Installation
This requires two steps:
### Install the dependency
In the `dependencies:` section of your `pubspec.yaml`, add the following line: In the `dependencies:` section of your `pubspec.yaml`, add the following line:
```yaml ```yaml
font_awesome_flutter: 4.7.2 font_awesome_flutter: ^4.7.3
```
### Install the font asset
In the `flutter:` section of your `pubspec.yaml`, add the following section:
```yaml
fonts:
- family: FontAwesome # Do not change!
fonts:
- asset: packages/font_awesome_flutter/fonts/fontawesome.woff
``` ```
## Usage ## Usage
...@@ -43,4 +28,4 @@ class MyWidget extends StatelessWidget { ...@@ -43,4 +28,4 @@ class MyWidget extends StatelessWidget {
## Example ## Example
View the Flutter app in the `example` directory to see all the available `FontAwesomeIcons`. View the Flutter app in the `example` directory to see all the available `FontAwesomeIcons`.
\ No newline at end of file
...@@ -36,7 +36,7 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> { ...@@ -36,7 +36,7 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> {
final filteredIcons = icons final filteredIcons = icons
.where((icon) => .where((icon) =>
_searchTerm.isEmpty || _searchTerm.isEmpty ||
icon.title.toLowerCase().startsWith(_searchTerm.toLowerCase())) icon.title.toLowerCase().contains(_searchTerm.toLowerCase()))
.toList(); .toList();
final orientation = MediaQuery.of(context).orientation; final orientation = MediaQuery.of(context).orientation;
...@@ -77,8 +77,9 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> { ...@@ -77,8 +77,9 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> {
children: <Widget>[ children: <Widget>[
new Hero(tag: icon, child: new Icon(icon.iconData)), new Hero(tag: icon, child: new Icon(icon.iconData)),
new Container( new Container(
padding: new EdgeInsets.only(top: 16.0), padding: new EdgeInsets.only(top: 16.0),
child: new Text(icon.title)) child: new Text(icon.title),
)
], ],
), ),
); );
...@@ -93,14 +94,16 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> { ...@@ -93,14 +94,16 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> {
new IconButton( new IconButton(
icon: new Icon(FontAwesomeIcons.search), icon: new Icon(FontAwesomeIcons.search),
onPressed: () { onPressed: () {
ModalRoute ModalRoute.of(context).addLocalHistoryEntry(
.of(context) new LocalHistoryEntry(
.addLocalHistoryEntry(new LocalHistoryEntry(onRemove: () { onRemove: () {
setState(() { setState(() {
_searchTerm = ""; _searchTerm = "";
_isSearching = false; _isSearching = false;
}); });
})); },
),
);
setState(() { setState(() {
_isSearching = true; _isSearching = true;
...@@ -252,7 +255,9 @@ final List<IconDefinition> icons = (<IconDefinition>[ ...@@ -252,7 +255,9 @@ final List<IconDefinition> icons = (<IconDefinition>[
new IconDefinition(FontAwesomeIcons.eyeSlash, "eyeSlash"), new IconDefinition(FontAwesomeIcons.eyeSlash, "eyeSlash"),
new IconDefinition(FontAwesomeIcons.warning, "warning"), new IconDefinition(FontAwesomeIcons.warning, "warning"),
new IconDefinition( new IconDefinition(
FontAwesomeIcons.exclamationTriangle, "exclamationTriangle"), FontAwesomeIcons.exclamationTriangle,
"exclamationTriangle",
),
new IconDefinition(FontAwesomeIcons.plane, "plane"), new IconDefinition(FontAwesomeIcons.plane, "plane"),
new IconDefinition(FontAwesomeIcons.calendar, "calendar"), new IconDefinition(FontAwesomeIcons.calendar, "calendar"),
new IconDefinition(FontAwesomeIcons.random, "random"), new IconDefinition(FontAwesomeIcons.random, "random"),
...@@ -726,7 +731,9 @@ final List<IconDefinition> icons = (<IconDefinition>[ ...@@ -726,7 +731,9 @@ final List<IconDefinition> icons = (<IconDefinition>[
new IconDefinition(FontAwesomeIcons.battery, "battery"), new IconDefinition(FontAwesomeIcons.battery, "battery"),
new IconDefinition(FontAwesomeIcons.batteryFull, "batteryFull"), new IconDefinition(FontAwesomeIcons.batteryFull, "batteryFull"),
new IconDefinition( new IconDefinition(
FontAwesomeIcons.batteryThreeQuarters, "batteryThreeQuarters"), FontAwesomeIcons.batteryThreeQuarters,
"batteryThreeQuarters",
),
new IconDefinition(FontAwesomeIcons.batteryHalf, "batteryHalf"), new IconDefinition(FontAwesomeIcons.batteryHalf, "batteryHalf"),
new IconDefinition(FontAwesomeIcons.batteryQuarter, "batteryQuarter"), new IconDefinition(FontAwesomeIcons.batteryQuarter, "batteryQuarter"),
new IconDefinition(FontAwesomeIcons.batteryEmpty, "batteryEmpty"), new IconDefinition(FontAwesomeIcons.batteryEmpty, "batteryEmpty"),
...@@ -821,9 +828,13 @@ final List<IconDefinition> icons = (<IconDefinition>[ ...@@ -821,9 +828,13 @@ final List<IconDefinition> icons = (<IconDefinition>[
new IconDefinition(FontAwesomeIcons.volumeControlPhone, "volumeControlPhone"), new IconDefinition(FontAwesomeIcons.volumeControlPhone, "volumeControlPhone"),
new IconDefinition(FontAwesomeIcons.braille, "braille"), new IconDefinition(FontAwesomeIcons.braille, "braille"),
new IconDefinition( new IconDefinition(
FontAwesomeIcons.assistiveListeningSystems, "assistiveListeningSystems"), FontAwesomeIcons.assistiveListeningSystems,
new IconDefinition(FontAwesomeIcons.americanSignLanguageInterpreting, "assistiveListeningSystems",
"americanSignLanguageInterpreting"), ),
new IconDefinition(
FontAwesomeIcons.americanSignLanguageInterpreting,
"americanSignLanguageInterpreting",
),
new IconDefinition(FontAwesomeIcons.deaf, "deaf"), new IconDefinition(FontAwesomeIcons.deaf, "deaf"),
new IconDefinition(FontAwesomeIcons.glide, "glide"), new IconDefinition(FontAwesomeIcons.glide, "glide"),
new IconDefinition(FontAwesomeIcons.glideG, "glideG"), new IconDefinition(FontAwesomeIcons.glideG, "glideG"),
...@@ -864,7 +875,9 @@ final List<IconDefinition> icons = (<IconDefinition>[ ...@@ -864,7 +875,9 @@ final List<IconDefinition> icons = (<IconDefinition>[
new IconDefinition(FontAwesomeIcons.thermometer, "thermometer"), new IconDefinition(FontAwesomeIcons.thermometer, "thermometer"),
new IconDefinition(FontAwesomeIcons.thermometerFull, "thermometerFull"), new IconDefinition(FontAwesomeIcons.thermometerFull, "thermometerFull"),
new IconDefinition( new IconDefinition(
FontAwesomeIcons.thermometerThreeQuarters, "thermometerThreeQuarters"), FontAwesomeIcons.thermometerThreeQuarters,
"thermometerThreeQuarters",
),
new IconDefinition(FontAwesomeIcons.thermometerHalf, "thermometerHalf"), new IconDefinition(FontAwesomeIcons.thermometerHalf, "thermometerHalf"),
new IconDefinition(FontAwesomeIcons.thermometerQuarter, "thermometerQuarter"), new IconDefinition(FontAwesomeIcons.thermometerQuarter, "thermometerQuarter"),
new IconDefinition(FontAwesomeIcons.thermometerEmpty, "thermometerEmpty"), new IconDefinition(FontAwesomeIcons.thermometerEmpty, "thermometerEmpty"),
......
...@@ -10,9 +10,3 @@ dependencies: ...@@ -10,9 +10,3 @@ dependencies:
flutter: flutter:
uses-material-design: true uses-material-design: true
# In order to use font_awesome_flutter in your own app, be sure to
# include the following font declaration in your pubspec.yaml
fonts:
- family: FontAwesome # Do not change!
fonts:
- asset: packages/font_awesome_flutter/fonts/fontawesome.woff
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="FLUTTER_MODULE_TYPE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/example/.idea/libraries/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/.idea/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/3.2/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/3.2/taskArtifacts/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/3.2/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/3.2/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/3.2/tasks/_app_compileDebugJavaWithJavac/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/3.2/tasks/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/.gradle/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/java/com/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/java/com/yourcompany/example/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/java/com/yourcompany/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/java/io/flutter/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/java/io/flutter/plugins/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/java/io/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/java/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/res/mipmap-hdpi/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/res/mipmap-mdpi/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/res/mipmap-xhdpi/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/res/mipmap-xxhdpi/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/res/mipmap-xxxhdpi/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/main/res/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/app/src/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/android/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/build" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/Flutter/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/Runner.xcodeproj/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/Runner.xcodeproj/project.xcworkspace/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/Runner.xcodeproj/xcshareddata/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/Runner.xcworkspace/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/Runner/Assets.xcassets/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/Runner/Base.lproj/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/Runner/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/ios/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/lib/packages" />
<excludeFolder url="file://$MODULE_DIR$/example/packages" />
<excludeFolder url="file://$MODULE_DIR$/packages" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>
\ No newline at end of file
...@@ -753,5 +753,10 @@ class FontAwesomeIcons { ...@@ -753,5 +753,10 @@ class FontAwesomeIcons {
} }
class _IconData extends IconData { class _IconData extends IconData {
const _IconData(int codePoint) : super(codePoint, fontFamily: 'FontAwesome'); const _IconData(int codePoint)
: super(
codePoint,
fontFamily: 'FontAwesome',
fontPackage: 'font_awesome_flutter',
);
} }
name: font_awesome_flutter name: font_awesome_flutter
author: Brian Egan <brian@brianegan.com>
description: The Font Awesome Icon pack available as Flutter Icons description: The Font Awesome Icon pack available as Flutter Icons
author: Brian Egan <brian@brianegan.com>
homepage: https://github.com/brianegan/font_awesome_flutter homepage: https://github.com/brianegan/font_awesome_flutter
version: 4.7.2 version: 4.7.3
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
flutter: flutter:
uses-material-design: true fonts:
- family: FontAwesome
fonts:
- asset: assets/fontawesome.woff
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment