AppBar可用属性
AppBar({
Key key,
this.leading,
this.automaticallyImplyLeading = true,
this.title,
this.actions,
this.flexibleSpace,
this.bottom,
this.elevation,
this.shadowColor,
this.shape,
this.backgroundColor,
this.brightness,
this.iconTheme,
this.actionsIconTheme,
this.textTheme,
this.primary = true,
this.centerTitle,
this.excludeHeaderSemantics = false,
this.titleSpacing = NavigationToolbar.kMiddleSpacing,
this.toolbarOpacity = 1.0,
this.bottomOpacity = 1.0,
this.toolbarHeight,
})
**
属性说明:
**
leading:
类型:Widget
描述:AppBar左侧小部件,通常用做返回按钮,如果不显示的指定,则会默认给其进行默认指定。
automaticallyImplyLeading :
类型:bool
描述:与leading部件有关,当leading为null时是否隐含前导小部件
title:
类型:Widget
描述:AppBar主要小部件,通常为Text
actions:
类型:List< Widget >
描述:在[title]小部件之后连续显示的小部件
flexibleSpace:
类型:Widget
描述:此小部件堆叠在工具栏和选项卡栏的后面。它的高度将与应用栏的整体高度相同
bottom:
类型:PreferredSizeWidget
描述:位于AppBar底部的子组件
elevation:
类型:double
描述:应用栏阴影大小
shadowColor:
类型:color
描述:应用栏阴影颜色
shape:
类型:ShapeBorder
描述:组件的形状
backgroundColor:
类型:Color
描述:应用栏背景色
brightness:
类型:Brightness枚举
描述:状态栏图标颜色
iconTheme:
类型:IconThemeData
描述:应用栏图标大小,颜色,阴影控制
actionsIconTheme:
类型:IconThemeData
描述:title右侧小部件图标颜色、大小、阴影控制
textTheme:
类型:TextTheme
描述:应用栏文字文本样式
primary:
类型:bool
描述:应用栏是否显示在状态栏的底部
true
false
centerTitle:
类型:bool
描述:标题title是否应该居中
true
excludeHeaderSemantics:
类型:bool
描述:不是很明白这个具体做什么
titleSpacing:
类型:double
描述:水平轴上[title]内容周围的间距
toolbarOpacity:
类型:double
描述:应用栏部件的透明度
bottomOpacity:
类型:double
描述:应用栏底部bottom的透明度
toolbarHeight:
类型:double
描述:应用栏高度