MotionToast constructor
MotionToast({
- Key? key,
- required Widget description,
- required Color primaryColor,
- IconData? icon,
- Widget? title,
- double? width,
- double? height,
- 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? secondaryColor,
- Color barrierColor = Colors.transparent,
- EdgeInsets margin = EdgeInsets.zero,
- bool displayBorder = false,
- bool displaySideBar = true,
- EdgeInsets contentPadding = EdgeInsets.zero,
- 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();
}