All Projects → mmcc007 → Modal_progress_hud

mmcc007 / Modal_progress_hud

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

Programming Languages

dart
5743 projects

Projects that are alternatives of or similar to Modal progress hud

React Reactive Form
Angular like reactive forms in React.
Stars: ✭ 259 (+89.05%)
Mutual labels:  form-validation, forms
Formidable
PHP 7 form library for handling user input
Stars: ✭ 27 (-80.29%)
Mutual labels:  form-validation, forms
React Hook Form
📋 React Hooks for form state management and validation (Web + React Native)
Stars: ✭ 24,831 (+18024.82%)
Mutual labels:  form-validation, forms
formio
Formio, form definition and binding library for Java platform
Stars: ✭ 24 (-82.48%)
Mutual labels:  forms, form-validation
Jafar
🌟!(Just another form application renderer)
Stars: ✭ 107 (-21.9%)
Mutual labels:  form-validation, forms
CustomFormViews
A clean collection of views used for forms.
Stars: ✭ 12 (-91.24%)
Mutual labels:  forms, form-validation
React Final Form
🏁 High performance subscription-based form state management for React
Stars: ✭ 6,781 (+4849.64%)
Mutual labels:  form-validation, forms
survey kit
Flutter library to create beautiful surveys (aligned with ResearchKit on iOS)
Stars: ✭ 68 (-50.36%)
Mutual labels:  forms, flutter-plugin
Rsformview
A Cocoapods library designed to easily create forms with multiple data entry fields
Stars: ✭ 84 (-38.69%)
Mutual labels:  form-validation, forms
Use Form
Build great forms without effort. 🚀
Stars: ✭ 42 (-69.34%)
Mutual labels:  form-validation, forms
nglp-angular-material-landing-page
NGLP is an Angular Material Landing Page.
Stars: ✭ 32 (-76.64%)
Mutual labels:  modal, form-validation
Form For
ReactJS forms made easy
Stars: ✭ 118 (-13.87%)
Mutual labels:  form-validation, forms
react-apple-signin-auth
 Apple signin for React using the official Apple JS SDK
Stars: ✭ 58 (-57.66%)
Mutual labels:  login, modal
grav-plugin-form
Grav Form Plugin
Stars: ✭ 48 (-64.96%)
Mutual labels:  forms, form-validation
vue-use-form
✅ A Vue.js composition API function to validate forms
Stars: ✭ 97 (-29.2%)
Mutual labels:  forms, form-validation
Flutter form builder
Simple form maker for Flutter Framework
Stars: ✭ 715 (+421.9%)
Mutual labels:  form-validation, forms
form-data-json
A zero dependency, cross browser library to easily get or set/manipulate form input values as/from a json object.
Stars: ✭ 37 (-72.99%)
Mutual labels:  forms, form-validation
react-cool-form
😎 📋 React hooks for forms state and validation, less code more performant.
Stars: ✭ 246 (+79.56%)
Mutual labels:  forms, form-validation
Usetheform
React library for composing declarative forms, manage their state, handling their validation and much more.
Stars: ✭ 40 (-70.8%)
Mutual labels:  form-validation, forms
React Forms
React library for rendering forms.
Stars: ✭ 111 (-18.98%)
Mutual labels:  form-validation, forms

modal_progress_hud

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

pub package Build Status Coverage Status

Inspired by this article.

Demo

Demo

See example for details

Usage

Add the package to your pubspec.yml file.

dependencies:
  modal_progress_hud: ^0.1.3

Next, import the library into your widget.

import 'package:modal_progress_hud/modal_progress_hud.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: ModalProgressHUD(child: Container(
       Form(...)
     ), inAsyncCall: _saving),
  );
}

Options

The current parameters are customizable in the constructor

ModalProgressHUD(
  @required inAsyncCall: bool,
  @required child: Widget,
  opacity: double,
  color: Color,
  progressIndicator: CircularProgressIndicator,
  offset: double
  dismissible: bool,
);

Example

Here is an example app that demonstrates the usage.

  1. On initial load, _saving is false which causes your child widget to display
  2. When the form is submitted, _saving is set to true, which will display the modal
  3. Once the async call is complete, _saving is set back to false, hiding the modal
class SettingsPage extends StatefulWidget {
  @override
  _SettingsPageState createState() => new _SettingsPageState();
}

class _SettingsPageState extends State<SettingsPage> {
  bool _saving = false;

  void _submit() {

    setState(() {
      _saving = true;
    });

    //Simulate a service call
    print('submitting to backend...');
    new Future.delayed(new Duration(seconds: 4), () {
      setState(() {
        _saving = false;
      });
    });
  }

  Widget _buildWidget() {
    return new Form(
      child: new Column(
        children: [
          new SwitchListTile(
            title: const Text('Bedroom'),
            value: _bedroom,
            onChanged: (bool value) {
              setState(() {
                _bedroom = value;
              });
            },
            secondary: const Icon(Icons.hotel),
          ),
          new RaisedButton(
            onPressed: _submit,
            child: new Text('Save'),
          ),
        ],
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text('Flutter Progress Indicator Demo'),
        backgroundColor: Colors.blue,
      ),
      body: ModalProgressHUD(child: _buildWidget(), inAsyncCall: _saving),
    );
  }
}

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!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].