MorphingSliverAppBar constructor
const
MorphingSliverAppBar({
- Key? key,
- Object heroTag = 'MorphingAppBar',
- Widget? leading,
- bool automaticallyImplyLeading = true,
- Widget? title,
- List<
Widget> ? actions, - Widget? flexibleSpace,
- PreferredSizeWidget? bottom,
- double? elevation,
- double? scrolledUnderElevation,
- Color? shadowColor,
- Color? surfaceTintColor,
- bool forceElevated = false,
- Color? backgroundColor,
- Color? foregroundColor,
- IconThemeData? iconTheme,
- IconThemeData? actionsIconTheme,
- bool primary = true,
- bool? centerTitle,
- bool excludeHeaderSemantics = false,
- double? titleSpacing,
- double? collapsedHeight,
- double? expandedHeight,
- bool floating = false,
- bool pinned = false,
- bool snap = false,
- bool stretch = false,
- double stretchTriggerOffset = 100.0,
- AsyncCallback? onStretchTrigger,
- ShapeBorder? shape,
- double toolbarHeight = kToolbarHeight,
- double? leadingWidth,
- TextStyle? toolbarTextStyle,
- TextStyle? titleTextStyle,
- SystemUiOverlayStyle? systemOverlayStyle,
- bool forceMaterialTransparency = false,
- Clip? clipBehavior,
Creates a material design app bar that can be placed in a CustomScrollView.
The arguments forceElevated
, primary
, floating
, pinned
, snap
and automaticallyImplyLeading
must not be null.
Implementation
const MorphingSliverAppBar({
super.key,
this.heroTag = 'MorphingAppBar',
this.leading,
this.automaticallyImplyLeading = true,
this.title,
this.actions,
this.flexibleSpace,
this.bottom,
this.elevation,
this.scrolledUnderElevation,
this.shadowColor,
this.surfaceTintColor,
this.forceElevated = false,
this.backgroundColor,
this.foregroundColor,
this.iconTheme,
this.actionsIconTheme,
this.primary = true,
this.centerTitle,
this.excludeHeaderSemantics = false,
this.titleSpacing,
this.collapsedHeight,
this.expandedHeight,
this.floating = false,
this.pinned = false,
this.snap = false,
this.stretch = false,
this.stretchTriggerOffset = 100.0,
this.onStretchTrigger,
this.shape,
this.toolbarHeight = kToolbarHeight,
this.leadingWidth,
this.toolbarTextStyle,
this.titleTextStyle,
this.systemOverlayStyle,
this.forceMaterialTransparency = false,
this.clipBehavior,
}) : assert(
floating || !snap,
'The "snap" argument only makes sense for floating app bars.',
),
assert(stretchTriggerOffset > 0.0),
assert(
collapsedHeight == null || collapsedHeight >= toolbarHeight,
'The "collapsedHeight" argument has to be larger than or equal to [toolbarHeight].',
);