CustomToast constructor
CustomToast({
- Key? key,
- required IconData icon,
- required String description,
- required Color color,
- String title = '',
- TextStyle descriptionStyle = const TextStyle(color: Colors.black),
- TextStyle titleStyle = const TextStyle(color: Colors.black),
- 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,
Used to create a custom toast with given icon, description and color
Implementation
CustomToast({
Key? key,
required this.icon,
required this.description,
required this.color,
this.title = '',
this.descriptionStyle = const TextStyle(color: Colors.black),
this.titleStyle = const TextStyle(color: Colors.black),
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) {
_assertValidValues();
motionToastType = MOTION_TOAST_TYPE.custom;
iconType = ICON_TYPE.materialDesign;
}