Unverified Commit 952e65fe authored by Michael Spiss's avatar Michael Spiss Committed by GitHub

Fix duotone icons in example app

Duotone icons were not displayed correctly (only the primary part) in the example app.
parent 005cb981
...@@ -65,10 +65,7 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> { ...@@ -65,10 +65,7 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> {
alignment: Alignment.center, alignment: Alignment.center,
child: Hero( child: Hero(
tag: icon, tag: icon,
child: FaIcon( child: _icon(icon.iconData, size: 100),
icon.iconData,
size: 100,
),
), ),
), ),
); );
...@@ -79,11 +76,11 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> { ...@@ -79,11 +76,11 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Hero(tag: icon, child: FaIcon(icon.iconData)), Hero(tag: icon, child: _icon(icon.iconData)),
Container( Container(
padding: EdgeInsets.only(top: 16.0), padding: EdgeInsets.only(top: 16.0),
child: Text(icon.title), child: Text(icon.title),
) ),
], ],
), ),
); );
...@@ -92,6 +89,18 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> { ...@@ -92,6 +89,18 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> {
); );
} }
Widget _icon(IconData icon, {double size}) {
if(icon is IconDataDuotone) {
return FaDuotoneIcon(
icon,
size: size,
primaryColor: Theme.of(context).iconTheme.color.withOpacity(.3),
secondaryColor: Theme.of(context).iconTheme.color,
);
}
return FaIcon(icon, size: size);
}
AppBar _titleBar() { AppBar _titleBar() {
return AppBar( return AppBar(
title: Text("Font Awesome Flutter Gallery"), title: Text("Font Awesome Flutter Gallery"),
......
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