ExtendedSliverAppBar constructor

ExtendedSliverAppBar({
  1. Key? key,
  2. bool automaticallyImplyLeading = true,
  3. Widget? leading,
  4. double? leadingWidth,
  5. Widget? title,
  6. bool? centerTitle = true,
  7. List<Widget>? actions,
  8. Widget? bottom,
  9. Size bottomSize = const Size(double.infinity, kToolbarHeight),
  10. double? elevation,
  11. bool forceElevated = false,
  12. Widget? flexibleSpaceTitle,
  13. Widget? flexibleSpace,
  14. Widget? background,
  15. bool flexibleCenterTitle = true,
  16. EdgeInsetsGeometry? titlePadding,
  17. CollapseMode collapseMode = CollapseMode.pin,
  18. List<StretchMode> stretchModes = const <StretchMode>[StretchMode.zoomBackground],
  19. double? expandedHeight,
  20. Color? backgroundColor,
  21. IconThemeData? iconTheme,
  22. TextStyle? titleTextStyle,
  23. TextStyle? toolbarTextStyle,
  24. IconThemeData? actionsIconTheme,
  25. double? titleSpacing = NavigationToolbar.kMiddleSpacing,
  26. bool primary = true,
  27. SystemUiOverlayStyle? systemOverlayStyle,
  28. AsyncCallback? onStretchTrigger,
  29. bool pinned = false,
  30. bool floating = false,
  31. bool snap = false,
  32. bool stretch = true,
  33. double stretchTriggerOffset = 100,
  34. ShapeBorder? shape,
  35. double toolbarHeight = kToolbarHeight,
  36. double? collapsedHeight,
  37. Color? foregroundColor,
  38. Color? shadowColor,
  39. 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));