{"id":2069,"date":"2022-04-07T14:41:45","date_gmt":"2022-04-07T14:41:45","guid":{"rendered":"https:\/\/mdr.foobrdigital.com\/?p=2069"},"modified":"2022-04-07T14:41:45","modified_gmt":"2022-04-07T14:41:45","slug":"floating-action-button","status":"publish","type":"post","link":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/2022\/04\/07\/floating-action-button\/","title":{"rendered":"Floating Action Button:"},"content":{"rendered":"\n<p><strong>floatingActionButton:<\/strong>\u00a0It is a button displayed at the bottom right corner and floating above the body. It is a circular icon button that floats over the content of a screen at a fixed place to promote a primary action in the application. While scrolling the page, its position cannot be changed. It uses the FloatingActionButton widget properties using\u00a0<strong>Scaffold.floatingActionButton<\/strong>. See the below code:<a href=\"https:\/\/www.javatpoint.com\/flutter-scaffold#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/flutter-scaffold#\"><\/a><a href=\"https:\/\/www.javatpoint.com\/flutter-scaffold#\"><\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Widget build(BuildContext context) {   \n         return Scaffold(   \n    appBar: AppBar(title: Text('First Flutter Application')),   \n    body: Center(   \n        child: Text(\"Welcome to Javatpoint!!\"),   \n    ),   \n    floatingActionButton: FloatingActionButton(   \n        elevation: 8.0,   \n        child: Icon(Icons.add),   \n        onPressed: (){   \n           print('I am Floating Action Button');  \n        }   \n    );   \n}  <\/code><\/pre>\n\n\n\n<p>In the above code, we have used the&nbsp;<strong>elevation<\/strong>&nbsp;property that gives a&nbsp;<strong>shadow effect<\/strong>&nbsp;to the button. We have also used the Icon widget to give an icon to the button using preloaded Flutter SDK icons. The&nbsp;<strong>onPressed()<\/strong>&nbsp;property will be called when the user taps the button, and the statements&nbsp;<strong>&#8220;I am Floating Action Button&#8221;<\/strong>&nbsp;will be printed on the console.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>floatingActionButton:\u00a0It is a button displayed at the bottom right corner and floating above the body. It is a circular icon button that floats over the content of a screen at a fixed place to promote a primary action in the application. While scrolling the page, its position cannot be changed. It uses the FloatingActionButton widget [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[305],"tags":[],"_links":{"self":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/2069"}],"collection":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/comments?post=2069"}],"version-history":[{"count":0,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/2069\/revisions"}],"wp:attachment":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=2069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=2069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=2069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}