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
* MOAR README updates
......@@ -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 a Gallery App that can be used to view all provided icons
* Created README with installation instructions
* Added LICENSE.md file
\ No newline at end of file
* Added LICENSE.md file
......@@ -4,25 +4,10 @@ The [Font Awesome](http://fontawesome.io/icons/) Icon pack available as set of F
## Installation
This requires two steps:
### Install the dependency
In the `dependencies:` section of your `pubspec.yaml`, add the following line:
```yaml
font_awesome_flutter: 4.7.2
```
### 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
font_awesome_flutter: ^4.7.3
```
## Usage
......@@ -43,4 +28,4 @@ class MyWidget extends StatelessWidget {
## Example
View the Flutter app in the `example` directory to see all the available `FontAwesomeIcons`.
\ No newline at end of file
View the Flutter app in the `example` directory to see all the available `FontAwesomeIcons`.
......@@ -36,7 +36,7 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> {
final filteredIcons = icons
.where((icon) =>
_searchTerm.isEmpty ||
icon.title.toLowerCase().startsWith(_searchTerm.toLowerCase()))
icon.title.toLowerCase().contains(_searchTerm.toLowerCase()))
.toList();
final orientation = MediaQuery.of(context).orientation;
......@@ -77,8 +77,9 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> {
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))
padding: new EdgeInsets.only(top: 16.0),
child: new Text(icon.title),
)
],
),
);
......@@ -93,14 +94,16 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> {
new IconButton(
icon: new Icon(FontAwesomeIcons.search),
onPressed: () {
ModalRoute
.of(context)
.addLocalHistoryEntry(new LocalHistoryEntry(onRemove: () {
setState(() {
_searchTerm = "";
_isSearching = false;
});
}));
ModalRoute.of(context).addLocalHistoryEntry(
new LocalHistoryEntry(
onRemove: () {
setState(() {
_searchTerm = "";
_isSearching = false;
});
},
),
);
setState(() {
_isSearching = true;
......@@ -252,7 +255,9 @@ final List<IconDefinition> icons = (<IconDefinition>[
new IconDefinition(FontAwesomeIcons.eyeSlash, "eyeSlash"),
new IconDefinition(FontAwesomeIcons.warning, "warning"),
new IconDefinition(
FontAwesomeIcons.exclamationTriangle, "exclamationTriangle"),
FontAwesomeIcons.exclamationTriangle,
"exclamationTriangle",
),
new IconDefinition(FontAwesomeIcons.plane, "plane"),
new IconDefinition(FontAwesomeIcons.calendar, "calendar"),
new IconDefinition(FontAwesomeIcons.random, "random"),
......@@ -726,7 +731,9 @@ final List<IconDefinition> icons = (<IconDefinition>[
new IconDefinition(FontAwesomeIcons.battery, "battery"),
new IconDefinition(FontAwesomeIcons.batteryFull, "batteryFull"),
new IconDefinition(
FontAwesomeIcons.batteryThreeQuarters, "batteryThreeQuarters"),
FontAwesomeIcons.batteryThreeQuarters,
"batteryThreeQuarters",
),
new IconDefinition(FontAwesomeIcons.batteryHalf, "batteryHalf"),
new IconDefinition(FontAwesomeIcons.batteryQuarter, "batteryQuarter"),
new IconDefinition(FontAwesomeIcons.batteryEmpty, "batteryEmpty"),
......@@ -821,9 +828,13 @@ final List<IconDefinition> icons = (<IconDefinition>[
new IconDefinition(FontAwesomeIcons.volumeControlPhone, "volumeControlPhone"),
new IconDefinition(FontAwesomeIcons.braille, "braille"),
new IconDefinition(
FontAwesomeIcons.assistiveListeningSystems, "assistiveListeningSystems"),
new IconDefinition(FontAwesomeIcons.americanSignLanguageInterpreting,
"americanSignLanguageInterpreting"),
FontAwesomeIcons.assistiveListeningSystems,
"assistiveListeningSystems",
),
new IconDefinition(
FontAwesomeIcons.americanSignLanguageInterpreting,
"americanSignLanguageInterpreting",
),
new IconDefinition(FontAwesomeIcons.deaf, "deaf"),
new IconDefinition(FontAwesomeIcons.glide, "glide"),
new IconDefinition(FontAwesomeIcons.glideG, "glideG"),
......@@ -864,7 +875,9 @@ final List<IconDefinition> icons = (<IconDefinition>[
new IconDefinition(FontAwesomeIcons.thermometer, "thermometer"),
new IconDefinition(FontAwesomeIcons.thermometerFull, "thermometerFull"),
new IconDefinition(
FontAwesomeIcons.thermometerThreeQuarters, "thermometerThreeQuarters"),
FontAwesomeIcons.thermometerThreeQuarters,
"thermometerThreeQuarters",
),
new IconDefinition(FontAwesomeIcons.thermometerHalf, "thermometerHalf"),
new IconDefinition(FontAwesomeIcons.thermometerQuarter, "thermometerQuarter"),
new IconDefinition(FontAwesomeIcons.thermometerEmpty, "thermometerEmpty"),
......
......@@ -10,9 +10,3 @@ dependencies:
flutter:
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 {
}
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
author: Brian Egan <brian@brianegan.com>
description: The Font Awesome Icon pack available as Flutter Icons
author: Brian Egan <brian@brianegan.com>
homepage: https://github.com/brianegan/font_awesome_flutter
version: 4.7.2
version: 4.7.3
dependencies:
flutter:
sdk: 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