1, the constructor
public the AppBar ( Key Key = null , Widget leading = null , // shown previously BOOL automaticallyImplyLeading = to true , Widget title = null , // content List <Widget> Actions = null , // a Widget list, as displayed in the representative Toolbar menu, the menu for the commonly used, usually expressed IconButton; unusual menu for PopupMenuButton usually displayed as three points, two pop-up menu after clicking the Widget flexibleSpace = null , // a display control AppBar below, AppBar and height as the height, can achieve some special effects, this property is often used in the SliverAppBar Bottom = PreferredSizeWidget null , // a AppBarBottomWidget object, usually TabBar. Toolbar used to display a heading Tab navigation bar a float ? Elevation = null , // Z coordinates order control design, the default value is 4, for scrollable SliverAppBar, when SliverAppBar content and the same level, the value 0, when the contents of the scroll SliverAppBar become Toolbar, modify elevation values color backgroundColor = null , // background color Brightness? Brightness = null , // button topic Brightness.dark black Brightness.light, light IconThemeData IconTheme = null , / / icon on the App bar color, transparency, and size information. TextTheme textTheme =null , // text style on the App bar. BOOL Primary = to true , // this app bar is displayed at the top of the screen BOOL ? centerTitle = null , // if title is centered, default values based on different operating systems, display a different way, true false Habitat left center float titleSpacing = NavigationToolbar. kMiddleSpacing, float toolbarOpacity = 1.0f , // transparency of the application toolbar float bottomOpacity = 1.0f // transparency at the bottom app bar )
2, an example
new MaterialApp( home:new AppBar( title:new Text("标题"), centerTitle:true, leading:new Icon(Icons.arrow_back), backgroundColor:new Color(0xffDE331F), actions:new List<Widget>(){ new IconButton( icon:new Icon(Icons.playlist_play), tooltip:"Air it", onPressed:()=>{} ), new IconButton( icon:new Icon(Icons.playlist_add), tooltip: "Restitch it", onPressed:()=>{} ), new IconButton( icon:new Icon(Icons.playlist_add_check), tooltip: "Repair it", onPressed: ()=>{} ) } ) );