MotionToast constructor

MotionToast({
  1. Key? key,
  2. required Widget description,
  3. required Color primaryColor,
  4. IconData? icon,
  5. Widget? title,
  6. double? width,
  7. double? height,
  8. BoxConstraints? constraints,
  9. double iconSize = 40,
  10. bool enableAnimation = true,
  11. ToastOrientation layoutOrientation = ToastOrientation.ltr,
  12. AnimationType animationType = AnimationType.fromBottom,
  13. Duration animationDuration = const Duration(milliseconds: 1500),
  14. Duration toastDuration = const Duration(seconds: 3),
  15. Curve animationCurve = Curves.ease,
  16. MotionToastPosition position = MotionToastPosition.bottom,
  17. double borderRadius = 20,
  18. Function? onClose,
  19. bool dismissable = true,
  20. Color? secondaryColor,
  21. Color barrierColor = Colors.transparent,
  22. EdgeInsets margin = EdgeInsets.zero,
  23. bool displayBorder = false,
  24. bool displaySideBar = true,
  25. EdgeInsets contentPadding = EdgeInsets.zero,
  26. double opacity = .9,
})

Used to create a custom motion toast with given icon, description and primaryColor

Implementation

MotionToast({
  Key? key,
  required this.description,
  required this.primaryColor,
  this.icon,
  this.title,
  this.width,
  this.height,
  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.secondaryColor,
  this.barrierColor = Colors.transparent,
  this.margin = EdgeInsets.zero,
  this.displayBorder = false,
  this.displaySideBar = true,
  this.contentPadding = EdgeInsets.zero,
  this.opacity = .9,
}) : super(key: key) {
  _initializeAnimationType();
  _assertValidValues();
}