1 AppBar
A typical AppBar, with drop-down menus for titles, actions, and spills.
2. Constructors
AppBar({ Key key, this.leading, this.automaticallyImplyLeading = true, this.title, this.actions, this.flexibleSpace, this.bottom, this.backgroundColor, this.brightness, this.iconTheme, this.textTheme, this.primary = true, This centerTitle, enclosing titleSpacing = NavigationToolbar. KMiddleSpacing, enclosing toolbarOpacity = 1.0, Enclosing bottomOpacity = 1.0,})Copy the code
3 Common Attributes
3.1 tleading: a control displayed in front of the title, usually showing the application logo on the home page; It is usually displayed as a back button on other screens
leading: IconButton(
icon: Icon(Icons.menu),
onPressed: () {},
),
Copy the code
3.2 Title: Title, usually displayed as the title text of the current interface, can put components
title: "AppBarWidget",
Copy the code
3.3 Actions: IconButton is usually used to represent groups of buttons
actions: <Widget>[
IconButton(
icon: Icon(Icons.search),
onPressed: () {},
),
IconButton(
icon: Icon(Icons.more_horiz),
onPressed: () {},
)
],
Copy the code
3.4 Bottom: Usually put a tabBar with a Tab navigation bar under the title
bottom:<Widget>[],
Copy the code
3.5 backgroundColor: navigation backgroundColor
backgroundColor: Colors.redAccent,
Copy the code
3.6 centerTitle: Specifies whether to center the title. The default value varies with the OPERATING system (OS)
centerTitle: true,
Copy the code
For more information
For more quality content, please pay attention to “Youth code farmers”