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. Color? shadowColor,
  11. bool forceElevated = false,
  12. Color? backgroundColor,
  13. Color? foregroundColor,
  14. IconThemeData? iconTheme,
  15. IconThemeData? actionsIconTheme,
  16. bool primary = true,
  17. bool? centerTitle,
  18. bool excludeHeaderSemantics = false,
  19. double? titleSpacing,
  20. double? collapsedHeight,
  21. double? expandedHeight,
  22. bool floating = false,
  23. bool pinned = false,
  24. bool snap = false,
  25. bool stretch = false,
  26. double stretchTriggerOffset = 100.0,
  27. AsyncCallback? onStretchTrigger,
  28. ShapeBorder? shape,
  29. double toolbarHeight = kToolbarHeight,
  30. double? leadingWidth,
  31. TextStyle? toolbarTextStyle,
  32. TextStyle? titleTextStyle,
  33. SystemUiOverlayStyle? systemOverlayStyle,
})

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.shadowColor,
  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,
})  : 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].',
      );