loading_overlay 0.2.0

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.opacity,
    @required this.isLoading,
    @required this.child,
    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!

[Unreleased]

[0.2.0]

  • Add fading effect
  • Rename to loading_overlay
  • Remove optional offset
  • Rename isInAsyncCall to isLoading

[0.1.3]

  • Performance optimization
  • Improved docs

[0.1.2]

  • Added option to dismiss modal
  • Refactored example

[0.1.1]

  • Added option to position progress indicator
  • Refactored example

[0.1.0]

  • Added support for Dart 2.0

[0.0.6]

  • Pass any progress indicator
  • Added tests and code coverage
  • Refactoring for tests

[0.0.5]

  • Changed layout of README and corrected spelling

[0.0.4]

  • Updated README

[0.0.3]

  • Fixed location of demo gif file

[0.0.2]

  • Added example of use of modal progress hud with login screen, form and async calls.

[0.0.1] - July 10, 2018

  • Simple countainer widget to enable modal progress hud (progress indicator)

example/README.md

example #

Update: see this article on Medium about async form validation

Sample app showing how to use loading_overlay in a login screen that makes calls to a backend. Also shows method to manage form verification with async calls (see flutter/issues/9688 for details).

Demo #

Demo

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  loading_overlay: ^0.2.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:loading_overlay/loading_overlay.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
64
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
82
Learn more about scoring.

We analyzed this package on Aug 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/loading_overlay.dart.

Run flutter format to format lib/loading_overlay.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test