MotionToast.warning constructor
MotionToast.warning({
- Key? key,
- required Widget description,
- Widget? title,
- IconType? iconType = IconType.materialDesign,
- double? width = 350,
- double? height = 80,
- BoxConstraints? constraints,
- double iconSize = 40,
- bool enableAnimation = true,
- ToastOrientation layoutOrientation = ToastOrientation.ltr,
- AnimationType animationType = AnimationType.fromBottom,
- Duration animationDuration = const Duration(milliseconds: 1500),
- Duration toastDuration = const Duration(seconds: 3),
- Curve animationCurve = Curves.ease,
- MotionToastPosition position = MotionToastPosition.bottom,
- double borderRadius = 20,
- Function? onClose,
- bool dismissable = true,
- Color barrierColor = Colors.transparent,
- EdgeInsets margin = EdgeInsets.zero,
- bool displayBorder = false,
- bool displaySideBar = true,
- EdgeInsets contentPadding = EdgeInsets.zero,
Render a warning motion toast
primaryColor is set to warningColor
icon is set to MOTION_TOAST_ICONS_MD[MOTION_TOAST_TYPE.WARNING]
or MOTION_TOAST_ICONS_CUPERTINO[MOTION_TOAST_TYPE.WARNING]
description is required
the text style by default: TextStyle(color: Colors.black)
Implementation
MotionToast.warning({
Key? key,
required this.description,
this.title,
this.iconType = IconType.materialDesign,
this.width = 350,
this.height = 80,
this.constraints,
this.iconSize = 40,
this.enableAnimation = true,
this.layoutOrientation = ToastOrientation.ltr,
this.animationType = AnimationType.fromBottom,
this.animationDuration = const Duration(
milliseconds: 1500,
),
this.toastDuration = const Duration(
seconds: 3,
),
this.animationCurve = Curves.ease,
this.position = MotionToastPosition.bottom,
this.borderRadius = 20,
this.onClose,
this.dismissable = true,
this.barrierColor = Colors.transparent,
this.margin = EdgeInsets.zero,
this.displayBorder = false,
this.displaySideBar = true,
this.contentPadding = EdgeInsets.zero,
}) : super(key: key) {
motionToastType = MotionToastType.warning;
_initializeAnimationType();
_assertValidValues();
_initializeParameters();
}