showErrorToast static method

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

Implementation

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