loading_overlay
A Flutter loading overlay with a dimmed backdrop and a 300 ms fade.
Control it with a boolean or let it follow a Future.

Install
Add to your pubspec.yaml, then run flutter pub get:
dependencies:
loading_overlay: ^0.6.0
Usage
Import the package:
import 'package:flutter/widgets.dart';
import 'package:loading_overlay/loading_overlay.dart';
Wrap your content and rebuild when your isSaving boolean changes:
return LoadingOverlay(
isLoading: isSaving,
child: const Center(child: Text('Your content')),
);
Follow a future
Create and retain saveFuture (Future<void>) before build, for example in
initState or an event handler:
return LoadingOverlay.withFuture(
future: saveFuture,
child: const Center(child: Text('Your content')),
);
Success and failure both dismiss the overlay. Handle errors on the original future. Only the latest future controls visibility; rebuilding with the same completed future keeps the overlay hidden.
Interaction
The overlay blocks pointer taps, including during fade-out. Keyboard and accessibility actions remain available, so guard async handlers against duplicate submissions. The login example shows how.
Customize
Both constructors accept these optional parameters:
| Parameter | Default |
|---|---|
color |
Translucent black: const Color(0x80000000) |
progressIndicator |
White CircularProgressIndicator |
Compatibility
Requires Flutter 3.50+ and Dart ^3.14.0.
Upgrading from 0.5.x: the default spinner now uses material_ui and no longer
reads themes from package:flutter/material.dart. To retain legacy spinner
styling, pass your own progressIndicator or
migrate your Material theme.
See Contributing for development requirements and checks.
MIT licensed. Forked from modal_progress_hud.