MaterialBanner constructor Null safety
- {Key? key,
- required Widget content,
- TextStyle? contentTextStyle,
- required List<
Widget> actions, - double? elevation,
- Widget? leading,
- Color? backgroundColor,
- EdgeInsetsGeometry? padding,
- EdgeInsetsGeometry? leadingPadding,
- bool forceActionsBelow = false,
- OverflowBarAlignment overflowAlignment = OverflowBarAlignment.end,
- Animation<
double> ? animation, - 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);