showPersistentToast function

OverlayEntry showPersistentToast(
  1. {required Widget toast,
  2. required BuildContext context,
  3. bool interactive = true}
)

Implementation

OverlayEntry showPersistentToast({
  required Widget toast,
  required BuildContext context,
  bool interactive = true,
}) {
  assert(debugCheckHasOverlay(context));
  final entry = OverlayEntry(
    builder: (context) => IgnorePointer(
      child: toast,
      ignoring: !interactive,
    ),
  );
  Overlay.of(context).insert(entry);

  ToastManager.insert(entry);

  return entry;
}