Skip to main content

loading_overlay 0.6.0 copy "loading_overlay: ^0.6.0" to clipboard
loading_overlay: ^0.6.0 copied to clipboard

A Flutter loading overlay with a dimmed backdrop and a fade animation, controlled by a boolean or a Future.

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.

pub.dev · API reference

Loading overlay on a login form

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.

Changelog · Report an issue

MIT licensed. Forked from modal_progress_hud.

192
likes
160
points
27.3k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter loading overlay with a dimmed backdrop and a fade animation, controlled by a boolean or a Future.

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

flutter, material_ui

More

Packages that depend on loading_overlay