Flutter之AppBar属性分析

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
描述:应用栏高度

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值