MySnackBar constructor
const
MySnackBar({
- Key? key,
- required Widget content,
- Color? backgroundColor,
- double? elevation,
- EdgeInsetsGeometry? margin,
- EdgeInsetsGeometry? padding,
- double? width,
- ShapeBorder? shape,
- SnackBarBehavior? behavior,
- SnackBarAction? action,
- Duration duration = _snackBarDisplayDuration,
- Animation<
double> ? animation, - VoidCallback? onVisible,
- SnackPlacement? placement,
Creates a snack bar.
The content argument must be non-null. The elevation must be null or non-negative.
Implementation
const MySnackBar(
{Key? key,
required this.content,
this.backgroundColor,
this.elevation,
this.margin,
this.padding,
this.width,
this.shape,
this.behavior,
this.action,
this.duration = _snackBarDisplayDuration,
this.animation,
this.onVisible,
this.placement})
: assert(elevation == null || elevation >= 0.0),
assert(
margin == null || behavior == SnackBarBehavior.floating,
'Margin can only be used with floating behavior',
),
assert(
width == null || behavior == SnackBarBehavior.floating,
'Width can only be used with floating behavior',
),
assert(
width == null || margin == null,
'Width and margin can not be used together',
),
assert(placement == null || behavior == SnackBarBehavior.floating,
'Placement cant use with floating behavior'),
super(key: key);