MaterialBanner constructor Null safety

const MaterialBanner(
  1. {Key? key,
  2. required Widget content,
  3. TextStyle? contentTextStyle,
  4. required List<Widget> actions,
  5. double? elevation,
  6. Widget? leading,
  7. Color? backgroundColor,
  8. EdgeInsetsGeometry? padding,
  9. EdgeInsetsGeometry? leadingPadding,
  10. bool forceActionsBelow = false,
  11. OverflowBarAlignment overflowAlignment = OverflowBarAlignment.end,
  12. Animation<double>? animation,
  13. VoidCallback? onVisible}
)

Creates a MaterialBanner.

The actions, content, and forceActionsBelow must be non-null. The actions.length must be greater than 0. The elevation must be null or non-negative.

Implementation

const MaterialBanner({
  super.key,
  required this.content,
  this.contentTextStyle,
  required this.actions,
  this.elevation,
  this.leading,
  this.backgroundColor,
  this.padding,
  this.leadingPadding,
  this.forceActionsBelow = false,
  this.overflowAlignment = OverflowBarAlignment.end,
  this.animation,
  this.onVisible
}) : assert(elevation == null || elevation >= 0.0),
     assert(content != null),
     assert(actions != null),
     assert(forceActionsBelow != null);