MorphingSliverAppBar constructor

const MorphingSliverAppBar({
  1. Key? key,
  2. Object heroTag = 'MorphingAppBar',
  3. Widget? leading,
  4. bool automaticallyImplyLeading = true,
  5. Widget? title,
  6. List<Widget>? actions,
  7. Widget? flexibleSpace,
  8. PreferredSizeWidget? bottom,
  9. double? elevation,
  10. double? scrolledUnderElevation,
  11. Color? shadowColor,
  12. Color? surfaceTintColor,
  13. bool forceElevated = false,
  14. Color? backgroundColor,
  15. Color? foregroundColor,
  16. IconThemeData? iconTheme,
  17. IconThemeData? actionsIconTheme,
  18. bool primary = true,
  19. bool? centerTitle,
  20. bool excludeHeaderSemantics = false,
  21. double? titleSpacing,
  22. double? collapsedHeight,
  23. double? expandedHeight,
  24. bool floating = false,
  25. bool pinned = false,
  26. bool snap = false,
  27. bool stretch = false,
  28. double stretchTriggerOffset = 100.0,
  29. AsyncCallback? onStretchTrigger,
  30. ShapeBorder? shape,
  31. double toolbarHeight = kToolbarHeight,
  32. double? leadingWidth,
  33. TextStyle? toolbarTextStyle,
  34. TextStyle? titleTextStyle,
  35. SystemUiOverlayStyle? systemOverlayStyle,
  36. bool forceMaterialTransparency = false,
  37. 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].',
      );