AppBar
AppBar is a Material Design widget in Flutter that is used to display a toolbar at the top of the screen. It provides a space to display the app's title, icon, actions, navigation menu, or other widgets, depending on the app's needs.
Example:
AppBar(
title: Text('My App'),
actions: [
IconButton(
icon: Icon(Icons.search),
onPressed: () {
// Do something when pressed
},
),
IconButton(
icon: Icon(Icons.more_vert),
onPressed: () {
// Do something when pressed
},
),
],
)
Parameters
Some common parameters that are used with AppBar() include:
title: A widget to display the app's title.
actions: A list of widgets to display as icons on the right side of the app bar.
backgroundColor: The color to use for the app bar's background.
elevation: The elevation of the app bar, which controls the shadow displayed below it.
brightness: The brightness of the app bar, which affects the color of the text and icons displayed on it.
centerTitle: Whether to center the title of the app bar.
automaticallyImplyLeading: Whether to automatically include a back button on the app bar.