SliverAppBar constructor

const SliverAppBar(
  1. {Key key,
  2. Widget leading,
  3. bool automaticallyImplyLeading: true,
  4. Widget title,
  5. List<Widget> actions,
  6. Widget flexibleSpace,
  7. PreferredSizeWidget bottom,
  8. double elevation,
  9. Color shadowColor,
  10. bool forceElevated: false,
  11. Color backgroundColor,
  12. Brightness brightness,
  13. IconThemeData iconTheme,
  14. IconThemeData actionsIconTheme,
  15. TextTheme textTheme,
  16. bool primary: true,
  17. bool centerTitle,
  18. bool excludeHeaderSemantics: false,
  19. double titleSpacing: NavigationToolbar.kMiddleSpacing,
  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}
)

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 SliverAppBar({
  Key key,
  this.leading,
  this.automaticallyImplyLeading = true,
  this.title,
  this.actions,
  this.flexibleSpace,
  this.bottom,
  this.elevation,
  this.shadowColor,
  this.forceElevated = false,
  this.backgroundColor,
  this.brightness,
  this.iconTheme,
  this.actionsIconTheme,
  this.textTheme,
  this.primary = true,
  this.centerTitle,
  this.excludeHeaderSemantics = false,
  this.titleSpacing = NavigationToolbar.kMiddleSpacing,
  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,
}) : assert(automaticallyImplyLeading != null),
     assert(forceElevated != null),
     assert(primary != null),
     assert(titleSpacing != null),
     assert(floating != null),
     assert(pinned != null),
     assert(snap != null),
     assert(stretch != null),
     assert(toolbarHeight != null),
     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 [toolbarHeight].'),
     super(key: key);