CustomToast.error constructor
CustomToast.error({
- Key? key,
- required String description,
- String title = '',
- TextStyle descriptionStyle = const TextStyle(color: Colors.black),
- TextStyle titleStyle = const TextStyle(color: Colors.black),
- ICON_TYPE? iconType = ICON_TYPE.materialDesign,
- double width = defaultToastWidth,
- double height = motionToastHeight,
- double iconSize = defaultIconSize,
- bool enableAnimation = true,
- ORIENTATION layoutOrientation = ORIENTATION.ltr,
- ANIMATION animationType = ANIMATION.fromBottom,
- Duration animationDuration = const Duration(milliseconds: 1500),
- Duration toastDuration = const Duration(seconds: 3),
- Curve animationCurve = Curves.ease,
- MOTION_TOAST_POSITION position = MOTION_TOAST_POSITION.bottom,
- double borderRadius = defaultRadius,
- Function? onClose,
- bool dismissable = false,
Render an error toast
color is set to errorColor
icon is set to MOTION_TOAST_ICONS_MD[MOTION_TOAST_TYPE.ERROR]
or MOTION_TOAST_ICONS_CUPERTINO[MOTION_TOAST_TYPE.ERROR]
description is required
the text style by default: TextStyle(color: Colors.black)
Implementation
CustomToast.error({
Key? key,
required this.description,
this.title = '',
this.descriptionStyle = const TextStyle(color: Colors.black),
this.titleStyle = const TextStyle(color: Colors.black),
this.iconType = ICON_TYPE.materialDesign,
this.width = defaultToastWidth,
this.height = motionToastHeight,
this.iconSize = defaultIconSize,
this.enableAnimation = true,
this.layoutOrientation = ORIENTATION.ltr,
this.animationType = ANIMATION.fromBottom,
this.animationDuration = const Duration(milliseconds: 1500),
this.toastDuration = const Duration(seconds: 3),
this.animationCurve = Curves.ease,
this.position = MOTION_TOAST_POSITION.bottom,
this.borderRadius = defaultRadius,
this.onClose,
this.dismissable = false,
}) : super(key: key) {
motionToastType = MOTION_TOAST_TYPE.error;
_assertValidValues();
_initializeParameters();
}