SliverToolBar constructor

const SliverToolBar({
  1. Key? key,
  2. double height = _kToolbarHeight,
  3. Alignment alignment = Alignment.center,
  4. Widget? title,
  5. double titleWidth = _kTitleWidth,
  6. EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 8, vertical: 4.0),
  7. BoxDecoration? decoration,
  8. Widget? leading,
  9. bool automaticallyImplyLeading = true,
  10. List<ToolbarItem>? actions,
  11. bool centerTitle = false,
  12. Color? dividerColor,
  13. bool pinned = true,
  14. bool floating = false,
  15. double toolbarOpacity = 0.9,
  16. bool allowWallpaperTintingOverrides = true,
})

A variant of ToolBar that is compatible with slivers.

It is nearly identical to ToolBar, with the exception that this widget must only be used ScrollViews that allow slivers, such as CustomScrollView and NestedScrollView. It contains three additional properties that are relevant to its usage in such ScrollViews: pinned, floating, and toolbarOpacity.

See also:

Implementation

const SliverToolBar({
  super.key,
  this.height = _kToolbarHeight,
  this.alignment = Alignment.center,
  this.title,
  this.titleWidth = _kTitleWidth,
  this.padding = const EdgeInsets.symmetric(horizontal: 8, vertical: 4.0),
  this.decoration,
  this.leading,
  this.automaticallyImplyLeading = true,
  this.actions,
  this.centerTitle = false,
  this.dividerColor,
  this.pinned = true,
  this.floating = false,
  this.toolbarOpacity = 0.9,
  this.allowWallpaperTintingOverrides = true,
});