show static method

Future<bool> show(
  1. BuildContext context, {
  2. Duration timeout = const Duration(seconds: 60),
  3. bool dismissible = false,
  4. Color barrierColor = Colors.black54,
  5. LoadingOverrideBuilder? customLoader,
})

Call this to show the loading overlay

Implementation

static Future<bool> show(
    BuildContext context, {
      Duration timeout = const Duration(seconds: 60),
      bool dismissible = false,
      Color barrierColor = Colors.black54,
      LoadingOverrideBuilder? customLoader,
    }) async {
  if (_overlayEntry != null) return false;

  _overlayEntry = OverlayEntry(
    builder: (_) => _LoaderWidget(
      dismissible: dismissible,
      barrierColor: barrierColor,
      customLoader: customLoader,
    ),
  );

  if (!context.mounted) return false;

  Overlay.of(context).insert(_overlayEntry!);

  // Auto-hide after timeout
  _timeoutTimer = Timer(timeout, hide);

  return true;
}