project03 - The third knockdown
A Flutter project to showcase adding a Title and Floating Action Button (FAB)
This app focuses on adding a custom app title (app name) and FAB customisation by following these steps:
project03 > lib > main.dart
floatingActionButton: FloatingActionButtonWe first use the
floatingActionButtonvariable to store all the information about FAB. The FAB is used to allow user to start a primary action to the app.
child: Icon(Icons.polymer, color: fabIconColor,)The
childis used when we need to store some information into a bigger item. So here, we have FAB inside which we have its child for declaring the
Iconsis a class under the
Iconwidget class. We give it a property of
colorand assign it to the
fabIconColordeclared in line 6. See how to do this. As for the icon, we choose the polymer icon from the Material Icon asset.
onPressed: ()This method is called when we tap the FAB and want something to happen by the tap action. As for this project, it's kept blank. See docs.