ExtendedSliverAppBar constructor
ExtendedSliverAppBar({
- Key? key,
- bool automaticallyImplyLeading = true,
- Widget? leading,
- double? leadingWidth,
- Widget? title,
- bool? centerTitle = true,
- List<
Widget> ? actions, - Widget? bottom,
- Size bottomSize = const Size(double.infinity, kToolbarHeight),
- double? elevation,
- bool forceElevated = false,
- Widget? flexibleSpaceTitle,
- Widget? flexibleSpace,
- Widget? background,
- bool flexibleCenterTitle = true,
- EdgeInsetsGeometry? titlePadding,
- CollapseMode collapseMode = CollapseMode.pin,
- List<
StretchMode> stretchModes = const <StretchMode>[StretchMode.zoomBackground], - double? expandedHeight,
- Color? backgroundColor,
- IconThemeData? iconTheme,
- TextStyle? titleTextStyle,
- TextStyle? toolbarTextStyle,
- IconThemeData? actionsIconTheme,
- double? titleSpacing = NavigationToolbar.kMiddleSpacing,
- bool primary = true,
- SystemUiOverlayStyle? systemOverlayStyle,
- AsyncCallback? onStretchTrigger,
- bool pinned = false,
- bool floating = false,
- bool snap = false,
- bool stretch = true,
- double stretchTriggerOffset = 100,
- ShapeBorder? shape,
- double toolbarHeight = kToolbarHeight,
- double? collapsedHeight,
- Color? foregroundColor,
- Color? shadowColor,
- bool excludeHeaderSemantics = false,
Implementation
ExtendedSliverAppBar({
super.key,
/// 是否提供控件占位。
super.automaticallyImplyLeading = true,
/// 左侧的图标或文字,多为返回箭头
super.leading,
super.leadingWidth,
/// 已被显示最高为 [kToolbarHeight]
super.title,
/// 标题是否居中显示
super.centerTitle = true,
/// 标题右侧的操作
super.actions,
/// 已被限制显示最高为 [kToolbarHeight]
/// SliverAppBar的底部区
Widget? bottom,
Size bottomSize = const Size(double.infinity, kToolbarHeight),
/// 阴影
super.elevation,
/// 是否显示阴影
super.forceElevated = false,
/// FlexibleSpaceBar
/// 可以理解为SliverAppBar的背景内容区
Widget? flexibleSpaceTitle,
Widget? flexibleSpace,
Widget? background,
bool flexibleCenterTitle = true,
EdgeInsetsGeometry? titlePadding,
CollapseMode collapseMode = CollapseMode.pin,
List<StretchMode> stretchModes = const <StretchMode>[
StretchMode.zoomBackground
],
super.expandedHeight,
/// 背景颜色
super.backgroundColor,
/// SliverAppBar图标主题
super.iconTheme,
super.titleTextStyle,
super.toolbarTextStyle,
/// action图标主题
super.actionsIconTheme,
/// 如果希望title占用所有可用空间,请将此值设置为0.0。
super.titleSpacing = NavigationToolbar.kMiddleSpacing,
/// 是否显示在状态栏的下面,false就会占领状态栏的高度
super.primary = true,
/// 状态栏主题
super.systemOverlayStyle,
super.onStretchTrigger,
/// [pinned]=true AppBar[title]不消失
super.pinned = false,
/// [floating]=true,AppBar下拉手势时立即展开(即使下面滚动组件不在顶部)
super.floating = false,
/// [floating]&&[snap] is true,AppBar下拉手势时立即全部展开
super.snap = false,
super.stretch = true,
super.stretchTriggerOffset = 100,
super.shape,
super.toolbarHeight = kToolbarHeight,
super.collapsedHeight,
super.foregroundColor,
super.shadowColor,
super.excludeHeaderSemantics = false,
}) : super(
bottom: bottom == null
? null
: PreferredSize(preferredSize: bottomSize, child: bottom),
flexibleSpace: flexibleSpace ??
(flexibleSpaceTitle != null || background != null
? FlexibleSpaceBar(
title: flexibleSpaceTitle,
centerTitle: flexibleCenterTitle,
titlePadding: titlePadding,
collapseMode: collapseMode,
stretchModes: stretchModes,
background: background)
: null));