import 'package:flutter/material.dart'; import 'package:toastification/toastification.dart'; class AppToast { static void success(BuildContext context, String message) { toastification.show( context: context, type: ToastificationType.success, style: ToastificationStyle.flatColored, title: Text( message, maxLines: 5, softWrap: true, overflow: TextOverflow.ellipsis, ), autoCloseDuration: const Duration(seconds: 3), ); } static void error(BuildContext context, String message) { toastification.show( context: context, type: ToastificationType.error, style: ToastificationStyle.flatColored, title: Text( message, maxLines: 5, softWrap: true, overflow: TextOverflow.ellipsis, ), autoCloseDuration: const Duration(seconds: 3), ); } static void notification( BuildContext context, String title, String description, ) { toastification.show( context: context, type: ToastificationType.info, style: ToastificationStyle.flatColored, title: Text( title, maxLines: 2, softWrap: true, overflow: TextOverflow.ellipsis, ), description: Text( description, maxLines: 5, softWrap: true, overflow: TextOverflow.ellipsis, ), autoCloseDuration: const Duration(seconds: 6), ); } }