Flutter User Interface Using Scaffolds
Flutter User Interface Using Scaffolds
Marlon L. Castro
Learning OUTCOMES
At the end of this lesson, learners should be able to:
• Design a Flutter mobile app using Scaffold widgets
FLUTTER WIDGETS
What is a widget?
1. appBar
• appBar is primarily visible at the top of the Scaffold
widget and is a horizontal bar.
• It appears at the top of the screen and is the primary
component of the Scaffold widget.
• It makes use of the AppBar widget, which also has a
number of properties.
USING
appBar
Scaffold properties (2)
• 2. body
• The other essential and necessary properties of the
Scaffold widget is body, which will be used to display the
Scaffold's major content.
• By default, the widgets inside the body are put in the
top-left corner of the available area.
• The next slide shows an example of the use of the
Scaffold body property to center its content using the
Center widget.
Example codes using appBar
SCAFFOLD PROPERTIES (3)
3. floatingActionButton
• A button called floatingActionButton is visible in the bottom
right corner and floats above the body.
• It is a circle icon button that floats over the screen's content at a
specific location to highlight the application's main activity.
• The next slide shows an example of the use of the Scaffold
floatingActionButton property for creating the button.
Using floatingActionButton PROPERTY
SCAFFOLD PROPERTIES (4)
4. drawer
• A slider panel that is visible at the side of the body is called a
drawer.
• On mobile devices, it is often concealed, but the user can swipe it
from right to left or left to right to reveal the drawer menu.
• The next slide shows an example of the use of the Scaffold drawer
property for creating a drawer. The example also uses ListView,
Header, Menu, and ListTile widgets to make it attractive.
USING drawer PROPERTY
SCAFFOLD PROPERTIES (5)
5. drawer
• A navigation bar appears at the bottom of the scaffold when the
bottomNavigationBar property is used.
• The majority of mobile applications has a bottom navigation bar.
Developers can add several icons or texts as elements in the bar using
this property.
• The next slide shows an example using the Scaffold
bottomNavigationBar property for creating a bottom navigation
bar.
USING bottomNavigationBar
NavigationBar Class
• A material widget that's displayed at the bottom of
an app for selecting among a small number of views,
typically between three and five.
NavigationBar Class
• NavigationBar constructor
onDestinationSelected property
• Called when one of the destinations is selected.