buildAppBar static method
SliverAppBar
buildAppBar(
- BuildContext context, {
- double? headerHeight,
- bool? centerTitle,
- Widget? pageTitle,
- Widget? leading,
- bool pinned = true,
- bool floating = false,
- List<
Widget> ? actions, - Color? appBarColor,
- Color? pageBackground,
- AsyncCallback? onStretch,
- bool? showAppBarDivider,
- HeroBar? expanded,
- bool? isImpliedLeading,
Implementation
static SliverAppBar buildAppBar(
BuildContext context, {
double? headerHeight,
bool? centerTitle,
Widget? pageTitle,
Widget? leading,
bool pinned = true,
bool floating = false,
List<Widget>? actions,
Color? appBarColor,
Color? pageBackground,
AsyncCallback? onStretch,
bool? showAppBarDivider,
HeroBar? expanded,
bool? isImpliedLeading,
}) {
return SliverAppBar(
toolbarHeight: headerHeight ?? sunnySpacing.appBarHeight,
centerTitle: centerTitle,
pinned: pinned,
title: pageTitle,
floating: floating,
actions: actions,
leading: leading,
automaticallyImplyLeading:
!context.isInModal && isImpliedLeading != false,
backgroundColor:
appBarColor ?? pageBackground ?? sunnyColors.appBarBackground,
elevation: 0,
stretch: onStretch != null,
onStretchTrigger: onStretch,
expandedHeight: expanded?.expandedSize?.height,
bottom: showAppBarDivider == true ? DividingLine.preferredSize() : null,
flexibleSpace: expanded == null
? null
: FlexibleSpaceBar(
background: expanded,
stretchModes:
onStretch == null ? [] : [StretchMode.zoomBackground],
),
);
}