port plugin to package

This commit is contained in:
Phani Pavan K
2024-01-21 12:20:46 +05:30
parent a29f39fcfb
commit f963256834
75 changed files with 653 additions and 1243 deletions

View File

@@ -1,35 +1,28 @@
# modal_progress_hud(_nsn)
# modal_progress_hud_nsn
[![pub package](https://img.shields.io/pub/v/modal_progress_hud_nsn.svg)](https://pub.dartlang.org/packages/modal_progress_hud_nsn)
A simple widget wrapper to enable modal progress HUD (a modal progress indicator, HUD = Heads Up Display)
[![pub package](https://img.shields.io/pub/v/modal_progress_hud_nsn.svg)](https://pub.dartlang.org/packages/modal_progress_hud_nsn)
~~Inspired by [this](https://codingwithjoe.com/flutter-how-to-build-a-modal-progress-indicator/) article.~~ Link broken, Dont click.
A fork of [this](https://github.com/mmcc007/modal_progress_hud) with support for Null Safety.
## Demo
![Demo](https://raw.githubusercontent.com/kphanipavan/modal_progress_hud_nsn/master/demo.mp4)
_See example for details_
A fork of [the original modal_progress_hud by mmcc007](https://github.com/mmcc007/modal_progress_hud) with Null Safety and additional features.
## Usage
Add the package to your `pubspec.yml` file.
Add the `modal_progress_hud_nsn` to dependencies in `pubspec.yaml`.
```yml
dependencies:
modal_progress_hud_nsn: ^0.4.0
```
Next, import the library into your widget.
Next, import the library into your app.
```dart
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.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.
Now, wrap your widget as a child of `ModalProgressHUD`, typically a form, together with a boolean variable that is maintained in local state.
```dart
...
@@ -48,7 +41,7 @@ Widget build(BuildContext context) {
## Options
The current parameters are customizable in the constructor
Below parameters can be customised accordingly.
```dart
ModalProgressHUD(
@@ -63,21 +56,16 @@ ModalProgressHUD(
);
```
## Similar Packages
* [modal_progress_hud](https://pub.dev/packages/modal_progress_hud) : Original
* [modal_progress_hud_alt](https://pub.dev/packages/modal_progress_hud_alt) : Alternative
* [blurry_modal_progress_hud](https://pub.dev/packages/blurry_modal_progress_hud) : With blur
* [flutter_progress_hud](https://pub.dev/packages/flutter_progress_hud) : Light weight and with fade
* [loading_overlay](https://pub.dev/packages/loading_overlay) : Another fork of original with fade
## Example
Here is an example app that demonstrates the usage.
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
1. On initial load, `_saving` defaults to 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.
<details>
<summary>Example Code </summary>
```dart
class SettingsPage extends StatefulWidget {
@@ -137,10 +125,22 @@ class _SettingsPageState extends State<SettingsPage> {
);
}
}
```
</details>
Update: See this [article](https://medium.com/@nocnoc/the-secret-to-async-validation-on-flutter-forms-4b273c667c03) on Medium about async form validation
## Similar Alternatives
* [modal_progress_hud](https://pub.dev/packages/modal_progress_hud) : Original
* [modal_progress_hud_alt](https://pub.dev/packages/modal_progress_hud_alt) : Alternative
* [blurry_modal_progress_hud](https://pub.dev/packages/blurry_modal_progress_hud) : With blur
* [flutter_progress_hud](https://pub.dev/packages/flutter_progress_hud) : Light weight and with fade
* [loading_overlay](https://pub.dev/packages/loading_overlay) : Another fork of original with fade
## Useful Resources
See this [article](https://medium.com/@nocnoc/the-secret-to-async-validation-on-flutter-forms-4b273c667c03) on Medium about async form validation
See the [example application](https://github.com/kphanipavan/modal_progress_hud_nsn/tree/master/example) source
for a complete sample app using the modal progress HUD. Included in the