FlexibleSpaceBar constructor Null safety

const FlexibleSpaceBar(
  1. {Key? key,
  2. Widget? title,
  3. Widget? background,
  4. bool? centerTitle,
  5. EdgeInsetsGeometry? titlePadding,
  6. CollapseMode collapseMode = CollapseMode.parallax,
  7. List<StretchMode> stretchModes = const <StretchMode>[StretchMode.zoomBackground],
  8. double expandedTitleScale = 1.5}
)

Creates a flexible space bar.

Most commonly used in the AppBar.flexibleSpace field.

Implementation

const FlexibleSpaceBar({
  super.key,
  this.title,
  this.background,
  this.centerTitle,
  this.titlePadding,
  this.collapseMode = CollapseMode.parallax,
  this.stretchModes = const <StretchMode>[StretchMode.zoomBackground],
  this.expandedTitleScale = 1.5,
}) : assert(collapseMode != null),
     assert(expandedTitleScale >= 1);