LoadingOverlay class

A global loading overlay manager that renders a semi-transparent backdrop with a CircularProgressIndicator and optional message, blocking all user interaction while an async operation is in progress.

Usage:

// Show and hide manually
LoadingOverlay.show(context, message: 'Saving...');
await doWork();
LoadingOverlay.hide(context);

// Or use wrap to handle show/hide automatically
final result = await LoadingOverlay.wrap(
  context,
  fetchData(),
  message: 'Loading...',
);

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

hide(BuildContext context) → void
Removes the currently visible loading overlay.
show(BuildContext context, {String? message}) → void
Shows the loading overlay anchored to the nearest Overlay.
wrap<T>(BuildContext context, Future<T> future, {String? message}) Future<T>
Shows the overlay, awaits future, then hides the overlay.