SmoothFloatingSnackbar.error constructor
SmoothFloatingSnackbar.error({ - required BuildContext context,
- required String text,
- double? elevation,
- EdgeInsetsGeometry? padding,
- double? width,
- ShapeBorder? shape,
- HitTestBehavior? hitTestBehavior,
- SnackBarAction? action,
- double? actionOverflowThreshold,
- bool? showCloseIcon,
- Color? closeIconColor,
- Animation<double>? animation,
- VoidCallback? onVisible,
- DismissDirection? dismissDirection,
- Clip clipBehavior = Clip.hardEdge,
- Duration? duration,
- Key? key,
})
Implementation
SmoothFloatingSnackbar.error({
required BuildContext context,
required String text,
super.elevation,
super.padding,
super.width,
super.shape,
super.hitTestBehavior,
SnackBarAction? action,
super.actionOverflowThreshold,
super.showCloseIcon,
super.closeIconColor,
super.animation,
super.onVisible,
super.dismissDirection,
super.clipBehavior = Clip.hardEdge,
Duration? duration,
super.key,
}) : super(
margin: const EdgeInsetsDirectional.all(SMALL_SPACE),
duration:
duration ??
(action != null
? const Duration(seconds: 10)
: SnackBarDuration.short),
behavior: SnackBarBehavior.floating,
backgroundColor: context.extension<SmoothColorsThemeExtension>().error,
action: action?.copyWith(
backgroundColor: Colors.white38,
textColor: Colors.white,
),
content: Row(
children: <Widget>[
ExcludeSemantics(
child: DecoratedBox(
decoration: const BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
child: Padding(
padding: const EdgeInsetsDirectional.only(
start: 6.0,
end: SMALL_SPACE,
top: 6.5,
bottom: SMALL_SPACE,
),
child: Builder(
builder: (BuildContext context) {
return icons.Warning(
color: context
.extension<SmoothColorsThemeExtension>()
.error,
size: 15.0,
);
},
),
),
),
),
const SizedBox(width: LARGE_SPACE),
Expanded(child: Text(text)),
],
),
);