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> {
alignment: Alignment.center,
child: Hero(
tag: icon,
child: FaIcon(
icon.iconData,
size: 100,
),
child: _icon(icon.iconData, size: 100),
),
),
);
......@@ -79,11 +76,11 @@ class FontAwesomeGalleryHomeState extends State<FontAwesomeGalleryHome> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Hero(tag: icon, child: FaIcon(icon.iconData)),
Hero(tag: icon, child: _icon(icon.iconData)),
Container(
padding: EdgeInsets.only(top: 16.0),
child: Text(icon.title),
)
),
],
),
);
......@@ -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() {
return AppBar(
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