SliverAppBar属性
const SliverAppBar({Key key,this.leading, //左侧控件 通常是个返回按钮// 如果没有leading,automaticallyImplyLeading为true,就会默认返回箭头// 如果 没有leading 且为false,空间留给title// 如果有leading,这个参数就无效了 默认为 truethis.automaticallyImplyLeading = false,//标题 接收 widget 一般为 textthis.title,//右侧控件组this.actions,this.bottom,//底部控件 例如通常是个 tabBarthis.flexibleSpace, //展开折叠的区域 通常使用 FlexibleSpaceBarthis.expandedHeight,//展开的高度this.elevation,//阴影this.shadowColor,//阴影颜色this.forceElevated = false, //是否显示阴影this.backgroundColor,//背景颜色this.brightness,// 应用栏材质的亮度this.iconTheme,//icon样式this.actionsIconTheme,//actionsIcon样式this.textTheme, //字体样式//appbar是否浸入状态栏,为false是为浸入,为true就显示在状态栏的下面this.primary = true,this.centerTitle,//标题是否居中this.excludeHeaderSemantics = false,this.titleSpacing = NavigationToolbar.kMiddleSpacing, //标题间距this.collapsedHeight,//折叠之后的高度 默认 toolbarHeight 的高度//是否应该在用户滚动时变得可见 比如pinned 为false可滑出屏幕 当向下滑时可先滑出 状态栏this.floating = false,//appBar是否置顶 是否固定在顶部 为true是固定,为false是不固定可滑出屏幕this.pinned = false,//当手指放开时,SliverAppBar是否会根据当前的位置展开/收起this.snap = false,//拉伸一般会设置 FlexibleSpaceBar 的stretchModes 使用this.stretch = false, //是否可拉伸伸展this.stretchTriggerOffset = 100.0, //触发拉伸偏移量this.onStretchTrigger,//拉伸监听this.shape,this.toolbarHeight = kToolbarHeight,})
FlexibleSpaceBar属性
const FlexibleSpaceBar({Key key,this.title, //标题 同样接收的是Widget 固不局限于Text 此处设置的标题会根据 拉伸量移动 在SliverAppbar 设置的标题 不会移动this.background,//背景this.centerTitle,//是否居中this.titlePadding,//标题Paddingthis.collapseMode = CollapseMode.parallax, //折叠模式 = parallax pin none//StretchMode.zoomBackground- >背景小部件将展开以填充额外的空间。// StretchMode.blurBackground- >使用[ImageFilter.blur]效果,背景将模糊。// StretchMode.fadeTitle- >随着用户过度滚动,标题将消失。this.stretchModes = const <StretchMode>[StretchMode.zoomBackground],