/flutter_progress_dialog

Flutter progress dialog, support Android and iOS platform.

Primary LanguageDartApache License 2.0Apache-2.0

Flutter Progress Dialog

[pub packages] | 中文说明

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

Example

Usage

1. Depend

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

dependencies:
  flutter_progress_dialog: ^0.1.0

2. Install

Run command:

$ flutter packages get

3. Import

Import in Dart code:

import 'package:flutter_progress_dialog/flutter_progress_dialog.dart';

4. Display Progress Dialog

Support two ways to display a progress dialog.

Wrap app widget
  1. Wrap your app widget
ProgressDialog(
  child: MaterialApp(),
);
  1. Exec showProgressDialog() and dismissProgressDialog() without parameters.
showProgressDialog();
//dismissProgressDialog();
Exec showProgressDialog() directly

You can exec showProgressDialog() without wrap app widget, should specify the param: context: BuildContext.

var dialog = showProgressDialog(context: context);
//dismissProgressDialog();

5. Properties

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

Example

Example sources

Example APK

Example APK Download