Flutter progress dialog. Support both Android and iOS platform.
The progress dialog just display one at the same time.
The usage inspired by OpenFlutter/flutter_oktoast
Add this to you package's pubspec.yaml
file:
dependencies:
flutter_progress_dialog: ^0.1.0
Run command:
$ flutter packages get
Import in Dart code:
import 'package:flutter_progress_dialog/flutter_progress_dialog.dart';
Support two ways to display a progress dialog.
- Wrap your app widget
ProgressDialog(
child: MaterialApp(),
);
- Exec
showProgressDialog()
anddismissProgressDialog()
without parameters.
showProgressDialog();
//dismissProgressDialog();
You can exec showProgressDialog()
without wrap app widget, should specify the param: context: BuildContext
.
var dialog = showProgressDialog(context: context);
//dismissProgressDialog();
ProgressDialog have default style, and you also can custom style or other behavior.
Name | Type | Desc |
---|---|---|
loading | Widget | If specified, default widget will not show |
loadingText | String | Hint text, just for default widget |
textStyle | TextStyle | Hint text's style, just for default widget |
backgroundColor | Color | Background color of the progress dialog |
radius | double | Radius of the progress dialog |
onDismiss | Function | Callback for dismissed |
textDirection | TextDirection | Loading hint text's direction |
orientation | ProgressOrientation | The direction of spin kit and hint text |