Fixes #84 by exporting icon_data.dart

This allows dynamic loading of icons based on their code point without the use of maps.

Also adds simple documentation to icon_data.dart
parent 0bcf63ef
## 8.8.1
* Fix icon_data.dart not being accessible
## 8.8.0 ## 8.8.0
* Upgrade to Font Awesome Icons 5.13 * Upgrade to Font Awesome Icons 5.13
......
...@@ -3,6 +3,7 @@ library font_awesome_flutter; ...@@ -3,6 +3,7 @@ library font_awesome_flutter;
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:font_awesome_flutter/src/icon_data.dart'; import 'package:font_awesome_flutter/src/icon_data.dart';
export 'package:font_awesome_flutter/src/fa_icon.dart'; export 'package:font_awesome_flutter/src/fa_icon.dart';
export 'package:font_awesome_flutter/src/icon_data.dart';
// THIS FILE IS AUTOMATICALLY GENERATED! // THIS FILE IS AUTOMATICALLY GENERATED!
......
...@@ -38,13 +38,13 @@ class FaDuotoneIcon extends StatelessWidget { ...@@ -38,13 +38,13 @@ class FaDuotoneIcon extends StatelessWidget {
final String semanticLabel; final String semanticLabel;
const FaDuotoneIcon( const FaDuotoneIcon(
this.icon, { this.icon, {
Key key, Key key,
this.size, this.size,
this.primaryColor, this.primaryColor,
this.secondaryColor, this.secondaryColor,
this.semanticLabel, this.semanticLabel,
}) : assert(icon != null), }) : assert(icon != null),
super(key: key); super(key: key);
@override @override
......
...@@ -2,6 +2,9 @@ library font_awesome_flutter; ...@@ -2,6 +2,9 @@ library font_awesome_flutter;
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
/// [IconData] for a font awesome brand icon from a code point
///
/// Code points can be obtained from fontawesome.com
class IconDataBrands extends IconData { class IconDataBrands extends IconData {
const IconDataBrands(int codePoint) const IconDataBrands(int codePoint)
: super( : super(
...@@ -11,6 +14,9 @@ class IconDataBrands extends IconData { ...@@ -11,6 +14,9 @@ class IconDataBrands extends IconData {
); );
} }
/// [IconData] for a font awesome solid icon from a code point
///
/// Code points can be obtained from fontawesome.com
class IconDataSolid extends IconData { class IconDataSolid extends IconData {
const IconDataSolid(int codePoint) const IconDataSolid(int codePoint)
: super( : super(
...@@ -20,6 +26,9 @@ class IconDataSolid extends IconData { ...@@ -20,6 +26,9 @@ class IconDataSolid extends IconData {
); );
} }
/// [IconData] for a font awesome regular icon from a code point
///
/// Code points can be obtained from fontawesome.com
class IconDataRegular extends IconData { class IconDataRegular extends IconData {
const IconDataRegular(int codePoint) const IconDataRegular(int codePoint)
: super( : super(
...@@ -29,6 +38,10 @@ class IconDataRegular extends IconData { ...@@ -29,6 +38,10 @@ class IconDataRegular extends IconData {
); );
} }
/// [IconData] for a font awesome light icon from a code point. Only works if
/// light icons (pro) have been installed.
///
/// Code points can be obtained from fontawesome.com
class IconDataLight extends IconData { class IconDataLight extends IconData {
const IconDataLight(int codePoint) const IconDataLight(int codePoint)
: super( : super(
...@@ -38,6 +51,10 @@ class IconDataLight extends IconData { ...@@ -38,6 +51,10 @@ class IconDataLight extends IconData {
); );
} }
/// [IconData] for a font awesome duotone icon from a code point. Only works if
/// duotone icons (pro) have been installed.
///
/// Code points can be obtained from fontawesome.com
class IconDataDuotone extends IconData { class IconDataDuotone extends IconData {
const IconDataDuotone(int codePoint) const IconDataDuotone(int codePoint)
: super( : super(
......
...@@ -5,7 +5,7 @@ authors: ...@@ -5,7 +5,7 @@ authors:
- Flutter Community <community@flutter.zone> - Flutter Community <community@flutter.zone>
- Brian Egan <brian@brianegan.com> - Brian Egan <brian@brianegan.com>
homepage: https://github.com/fluttercommunity/font_awesome_flutter homepage: https://github.com/fluttercommunity/font_awesome_flutter
version: 8.8.0 version: 8.8.1
environment: environment:
sdk: ">=2.0.0-dev.28.0 <3.0.0" sdk: ">=2.0.0-dev.28.0 <3.0.0"
......
...@@ -32,7 +32,7 @@ void main(List<String> arguments) { ...@@ -32,7 +32,7 @@ void main(List<String> arguments) {
); );
} }
if(styles.contains('duotone')) { if (styles.contains('duotone')) {
hasDuotone = true; hasDuotone = true;
} }
...@@ -59,10 +59,12 @@ void main(List<String> arguments) { ...@@ -59,10 +59,12 @@ void main(List<String> arguments) {
"import 'package:flutter/widgets.dart';", "import 'package:flutter/widgets.dart';",
"import 'package:font_awesome_flutter/src/icon_data.dart';", "import 'package:font_awesome_flutter/src/icon_data.dart';",
"export 'package:font_awesome_flutter/src/fa_icon.dart';", "export 'package:font_awesome_flutter/src/fa_icon.dart';",
"export 'package:font_awesome_flutter/src/icon_data.dart';",
]; ];
if(hasDuotone) { if (hasDuotone) {
generatedOutput.add("export 'package:font_awesome_flutter/src/fa_duotone_icon.dart';"); generatedOutput
.add("export 'package:font_awesome_flutter/src/fa_duotone_icon.dart';");
} }
generatedOutput.addAll([ generatedOutput.addAll([
......
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