CustomToast constructor

CustomToast({
  1. Key? key,
  2. required IconData icon,
  3. required String description,
  4. required Color color,
  5. String title = '',
  6. TextStyle descriptionStyle = const TextStyle(color: Colors.black),
  7. TextStyle titleStyle = const TextStyle(color: Colors.black),
  8. double width = defaultToastWidth,
  9. double height = motionToastHeight,
  10. double iconSize = defaultIconSize,
  11. bool enableAnimation = true,
  12. ORIENTATION layoutOrientation = ORIENTATION.ltr,
  13. ANIMATION animationType = ANIMATION.fromBottom,
  14. Duration animationDuration = const Duration(milliseconds: 1500),
  15. Duration toastDuration = const Duration(seconds: 3),
  16. Curve animationCurve = Curves.ease,
  17. MOTION_TOAST_POSITION position = MOTION_TOAST_POSITION.bottom,
  18. double borderRadius = defaultRadius,
  19. Function? onClose,
  20. 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;
}