show static method
Future<bool>
show(
- BuildContext context, {
- Duration timeout = const Duration(seconds: 60),
- bool dismissible = false,
- Color barrierColor = Colors.black54,
- 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;
}