showToast method

Future<ExtendedOverlayEntry?> showToast(
  1. Toast toast
)

Toast 关闭 closeToast();

Implementation

Future<ExtendedOverlayEntry?> showToast(Toast toast) async {
  if (_toast != null) return _toast;
  _toast = showOverlay(toast, autoOff: true);
  _toast?.addListener(_toastListener);
  final duration = toast.duration ??
      toast.options?.duration ??
      FlExtended().toastOptions.duration;
  await duration.delayed();
  closeToast();
  return _toast;
}