showNotification function
void
showNotification(
- BuildContext context,
- String title,
- String bodyText,
- TypeOfNotification typeOfNotification,
- Duration duration,
Implementation
void showNotification(BuildContext context, String title, String bodyText,
TypeOfNotification typeOfNotification, Duration duration) {
toastification.show(
context: context,
title: title,
backgroundColor: dominantColor,
primaryColor: accentColor,
description: bodyText,
style: ToastificationStyle.flat,
progressBarTheme: ProgressIndicatorThemeData(
color: accentColor,
),
animationBuilder: (context, animation, alignment, child) {
return ScaleTransition(
scale: animation,
child: FadeTransition(
opacity: animation,
child: child,
),
);
},
borderRadius: const BorderRadius.all(Radius.circular(15)),
animationDuration: const Duration(milliseconds: 300),
autoCloseDuration: duration,
);
}