flutter_progress_hud 2.0.2

SDKflutter
Platformandroidioswindowslinuxmacosweb

Highly customizable modal progress indicator with fade animation.

pub package

Flutter Progress HUD

Highly customizable modal progress indicator with fade animation.

Preview

Usage

Wrap with ProgressHUD the widget on top of which you want to show the modal indicator.

ProgressHUD(
  child: HomePage(),
)

Get a reference of ProgressHUD

final progress = ProgressHUD.of(context);

Show indeterminate progress

progress.show();

Or a progress with text

progress.showWithText('Loading...');

Then dismiss

progress.dismiss();

Example (full)

ProgressHUD(
        child: Builder(
          builder: (context) => Center(
                child: Column(
                  children: <Widget>[
                    RaisedButton(
                      child: Text('Show for a second'),
                      onPressed: () {
                        final progress = ProgressHUD.of(context);
                        progress.show();
                        Future.delayed(Duration(seconds: 1), () {
                          progress.dismiss();
                        });
                      },
                    ),
                    RaisedButton(
                      child: Text('Show with text'),
                      onPressed: () {
                        final progress = ProgressHUD.of(context);
                        progress.showWithText('Loading...');
                        Future.delayed(Duration(seconds: 1), () {
                          progress.dismiss();
                        });
                      },
                    ),
                  ],
                ),
              ),
        ),
      ),

Customization

Attribute NameDefault ValueDescription
indicatorColorColors.whiteWhen using the default indicator widget, this is how you set its color
indicatorWidgetA basic CircularProgressIndicatorCustom indicator widget
backgroundColorColors.black54Indicator background color
backgroundRadiusRadius.circular(8.0)Indicator background radius
borderColorColors.whiteIndicator background border color
borderWidth0.0Indicator background border width
barrierEnabledtrueYou can disable the modal barrier if you want to allow touches while the progress is shown
barrierColorColors.black12Color of the Barrier displayed behind the indicator
textStyleTextStyle(color: Colors.white, fontSize: 14.0)TextStyle for the Text displayed below the indicator
paddingEdgeInsets.all(16.0)}Indicator content padding