{"id":10933,"date":"2021-11-12T10:00:00","date_gmt":"2021-11-12T01:00:00","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=10933"},"modified":"2021-11-11T19:30:20","modified_gmt":"2021-11-11T10:30:20","slug":"how-to-use-flutter-font-awesome-icon","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/10933","title":{"rendered":"How to use Flutter font awesome icon ?"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" src=\"https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2021\/11\/Screenshot_1636619725.png\" alt=\"\" class=\"wp-image-10934\" width=\"270\" height=\"570\" \/><\/figure>\n\n\n\n<h3>Need an icon not in Material? <\/h3>\n\n\n\n<p>The material design offers many helpful patterns, including a great set of icons. But they are not the only icons out there. Font awesome&#8217;s icon are truly, well, iconic. Luckily, with <strong>font_awesome_flutter<\/strong> package, including them in our flutter app.<\/p>\n\n\n\n<p>It&#8217;s too simple so let&#8217;s build with simple app including flutter font awesome icon.<\/p>\n\n\n\n<p>Firstly, we need to add <strong><a href=\"https:\/\/pub.dev\/packages\/font_awesome_flutter\" data-type=\"URL\" data-id=\"https:\/\/pub.dev\/packages\/font_awesome_flutter\">font_awesome_flutter<\/a><\/strong> package in our pubspec.yaml file. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span class=\"has-inline-color has-pale-cyan-blue-color\">dependencies:<\/span>\n  <strong><span class=\"has-inline-color has-pale-cyan-blue-color\">font_awesome_flutter: ^9.2.0<\/span><\/strong><\/code><\/pre>\n\n\n\n<p>For use font_awesome_flutter package, we will need to import this package .<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>import 'package:font_awesome_flutter\/font_awesome_flutter.dart';<\/strong><\/code><\/pre>\n\n\n\n<p>To start the two components of Material Icons&#8211; wrapping with Icon and the inner icon_data value. <strong>Icons.men<\/strong>u is a default material icon. We will use this icon in our app. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>Icon(Icons.menu)<\/strong><\/code><\/pre>\n\n\n\n<p>To change icon size and color: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Icon(FontAwesomeIcons.user,\n    size: 50, \/\/Icon Size\n    color: Colors.white, \n)<\/code><\/pre>\n\n\n\n<p>Use with <strong>FaIcon<\/strong> widget and let&#8217;s build a simple app then find out fond awesome icon usage!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><span style=\"color:#677a89\" class=\"has-inline-color\">return Scaffold(\n      appBar: AppBar(\n          centerTitle: true,\n          leading: Icon(Icons.menu),\n          title: const Text(\"Font Awesome Icons\")\n      ),\n      body: Center(\n        child: Column(\n          mainAxisAlignment: MainAxisAlignment.center,\n          children: &#091;\n\n            const Text(\" Font Awesome Flutter package\",textAlign:TextAlign.center,style: TextStyle(fontSize: 30),),\n            const SizedBox(height: 20,),\n            \/\/brand Icons\n            const Text(\"Brand Icons\",textAlign: TextAlign.start,style: TextStyle(fontWeight: FontWeight.bold,fontStyle:FontStyle.italic,fontSize: 20),),\n            Row(\n              mainAxisAlignment: MainAxisAlignment.center,\n              children: const &#091;\n                FaIcon(FontAwesomeIcons.amazon,color: Colors.deepOrange,size: 35,),\n                SizedBox(width: 15,),\n                FaIcon(FontAwesomeIcons.facebook,color: Colors.blue,size: 35,),\n                SizedBox(width: 15,),\n                FaIcon(FontAwesomeIcons.github,color: Colors.black,size: 35,),\n                SizedBox(width: 15,),\n                FaIcon(FontAwesomeIcons.twitter,color: Colors.blueAccent,size: 35,),\n                SizedBox(width: 15,),\n                FaIcon(FontAwesomeIcons.aws,color: Colors.deepOrange,size: 35,),\n                SizedBox(width: 15,),\n                FaIcon(FontAwesomeIcons.pinterest,color: Colors.red,size: 35,),\n                SizedBox(width: 15,),\n                FaIcon(FontAwesomeIcons.wordpress,color: Colors.deepPurple,size: 35,),\n              ],\n            ),\n          ],\n        ),\n      ),\n    )<\/span>;<\/code><\/pre>\n\n\n\n<p>Hope you enjoy  flutter new things!<\/p>\n\n\n\n<p>By Ami<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/10933\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/10933\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"How to use Flutter font awesome icon ?\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/10933\" data-text=\"How to use Flutter font awesome icon ?\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/10933\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/10933\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>Need an icon not in Material? The material design offers many helpful patterns, including a great set of icons [&hellip;]<\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/10933"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=10933"}],"version-history":[{"count":4,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/10933\/revisions"}],"predecessor-version":[{"id":10944,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/10933\/revisions\/10944"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=10933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=10933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=10933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}