showNotification function

void showNotification(
  1. BuildContext context,
  2. String title,
  3. String bodyText,
  4. TypeOfNotification typeOfNotification,
  5. 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,
  );
}