Skip to content

A simple modal progress HUD (heads-up display, or progress indicator) for flutter

License

Notifications You must be signed in to change notification settings

Aneesh1990/loading_overlay

 
 

Repository files navigation

loading_overlay

A simple widget wrapper to enable modal progress HUD (a modal progress indicator, HUD = Heads Up Display)

A fork of mobile_progress_hud Inspired by this article.

Demo

Demo

See example for details

Usage

Add the package to your pubspec.yml file.

dependencies:
  loading_overlay: ^0.2.0

Next, import the library into your widget.

import 'package:loading_overlay/loading_overlay.dart';

Now, all you have to do is simply wrap your widget as a child of ModalProgressHUD, typically a form, together with a boolean that is maintained in local state.

...
bool _saving = false
...

@override
Widget build(BuildContext context) {
  return Scaffold(
     body: LoadingOverlay(child: Container(
       Form(...)
     ), isLoading: _saving),
  );
}

Options

The current parameters are customizable in the constructor

LoadingOverlay({
    @required this.isLoading,
    @required this.child,
    this.opacity = 0.5,
    this.progressIndicator = const CircularProgressIndicator(),
    this.color,
});

Update: See this article on Medium about async form validation

See the example application source for a complete sample app using the modal progress HUD. Included in the example is a method for using a form's validators while making async calls (see flutter/issues/9688 for details).

Issues and feedback

Please file issues to send feedback or report a bug. Thank you!

About

A simple modal progress HUD (heads-up display, or progress indicator) for flutter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 74.0%
  • Shell 13.8%
  • Java 9.1%
  • Objective-C 3.1%