LoadingModalOptions class

Configuration for the loading-modal overlay blocking user interaction during async operations.

  • isVisible - Boolean controlling overlay visibility; when true, displays full-screen loading overlay.
  • backgroundColor - Background color for modal overlay (default: semi-transparent black Color.fromRGBO(0, 0, 0, 0.5)).
  • displayColor - Color for spinner and loading text (default: Colors.black).
  • overlayColor - Optional override for overlay background; if provided, replaces backgroundColor.
  • loadingText - Custom widget for loading message; if provided, textBuilder is ignored.
  • showSpinner - Boolean controlling spinner visibility (default: true).
  • spinner - Custom spinner widget; if not provided, defaults to CircularProgressIndicator with displayColor.
  • spinnerTextSpacing - Vertical spacing between spinner and text in logical pixels (default: 10).
  • contentWidth - Fixed width for content area; if not provided, defaults to 60% of screen width (min: 300px, max: 600px).
  • contentPadding - Padding for content area (default: 20px all sides).
  • contentDecoration - Decoration for content container (background, border, border radius); if not provided, defaults to white rounded rectangle with shadow.
  • contentAlignment - Alignment for content within modal (default: Alignment.center).
  • containerBuilder - Override entire modal container; receives LoadingModalContainerContext with content and defaultContainer.
  • contentBuilder - Override content area; receives LoadingModalContentContext with spinner, text, and defaultContent.
  • spinnerBuilder - Override spinner widget; receives LoadingModalSpinnerContext and defaultSpinner.
  • textBuilder - Override loading text; receives LoadingModalTextContext and defaultText.

Usage

  1. Modal displays full-screen overlay blocking interaction when isVisible == true.
  2. Content area centered with spinner (if showSpinner == true) above loading text "Loading...".
  3. Content container defaults to white rounded rectangle with shadow, 60% screen width (clamped to 300-600px).
  4. Override via MediasfuUICustomOverrides.loadingModal to inject branded spinners, custom animations, or progress indicators.

Constructors

LoadingModalOptions.new({required bool isVisible, Color backgroundColor = const Color.fromRGBO(0, 0, 0, 0.5), Color displayColor = Colors.black, Color? overlayColor, Widget? loadingText, bool showSpinner = true, Widget? spinner, double spinnerTextSpacing = 10, double? contentWidth, EdgeInsetsGeometry? contentPadding, Decoration? contentDecoration, AlignmentGeometry contentAlignment = Alignment.center, LoadingModalContainerBuilder? containerBuilder, LoadingModalContentBuilder? contentBuilder, LoadingModalSpinnerBuilder? spinnerBuilder, LoadingModalTextBuilder? textBuilder})
Constructs a LoadingModalOptions object with the given configuration.
const

Properties

backgroundColor → Color
The background color of the loading modal overlay.
final
containerBuilder → LoadingModalContainerBuilder?
Custom builder for the entire modal container.
final
contentAlignment → AlignmentGeometry
Alignment for the content within the modal.
final
contentBuilder → LoadingModalContentBuilder?
Custom builder for the content area of the modal.
final
contentDecoration → Decoration?
Decoration for the content container, including color, border, and shape.
final
contentPadding → EdgeInsetsGeometry?
Padding for the content area.
final
contentWidth → double?
Fixed width for the content area. If not provided, defaults to 60% of screen width.
final
displayColor → Color
The color of the loading indicator and loading text.
final
hashCode → int
The hash code for this object.
no setterinherited
isVisible → bool
A boolean indicating whether the loading modal is visible.
final
loadingText → Widget?
Custom widget for loading text. If provided, textBuilder will be ignored.
final
overlayColor → Color?
The color of the modal overlay, defaults to semi-transparent black.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showSpinner → bool
Whether to show the spinner/loading indicator.
final
spinner → Widget?
Custom spinner widget. If provided, defaults to CircularProgressIndicator.
final
spinnerBuilder → LoadingModalSpinnerBuilder?
Custom builder for the spinner/loading indicator.
final
spinnerTextSpacing → double
Space between the spinner and the text, in logical pixels.
final
textBuilder → LoadingModalTextBuilder?
Custom builder for the loading text.
final

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