showSuccessToast static method

void showSuccessToast(
  1. BuildContext context,
  2. String title,
  3. String message
)

Implementation

static void showSuccessToast(
    BuildContext context, String title, String message) {
  if (toastTimer == null || !toastTimer!.isActive) {
    _overlayEntry = createOverlayEntry(context, title, message,
        const Color(0xFF009C49), const Color(0xFFD6EBE0));
    Overlay.of(context).insert(_overlayEntry!);
    toastTimer = Timer(const Duration(seconds: 2), () {
      if (_overlayEntry != null) {
        _overlayEntry?.remove();
      }
    });
  }
}