show static method

void show({
  1. BuildContext? context,
  2. WidgetBuilder? customLoader,
})

Show loading overlay

Implementation

static void show({BuildContext? context, WidgetBuilder? customLoader}) {
  if (_isShowing) return;

  final OverlayState? overlayState = (context != null ? Overlay.of(context) : navigatorKey.currentState?.overlay);

  if (overlayState == null) {
    debugPrint("ULoading: No Overlay found. Make sure your app has a Navigator or MaterialApp widget.");
    return;
  }

  _overlayEntry = OverlayEntry(
    builder: (BuildContext context) => _LoadingOverlay(
      customLoader: customLoader ?? _customLoaderBuilder,
    ),
  );

  overlayState.insert(_overlayEntry!);
  _isShowing = true;
}