loading_hud 0.2.0 copy "loading_hud: ^0.2.0" to clipboard
loading_hud: ^0.2.0 copied to clipboard

A dialog with a loading indicator.

LoadingHud #

A dialog with a loading indicator.

showcase

Getting Started #

Add dependency #

dependencies:
  loading_hud: ^0.2.0

Examples #

var loadingHud = LoadingHud(
  context,
  cancelable: true,                  // Cancelable when pressing Android back key
  canceledOnTouchOutside: true,      // Cancelable when touch outside of the LoadingHud
  dimBackground: true,               // Dimming background when LoadingHud is showing
  hudColor: Color(0x99000000),       // Color of the ProgressHud
  indicator: DefaultLoadingIndicator(
    color: Colors.white,
  ),
  iconSuccess: Icon(                 // Success icon
    Icons.done,
    color: Colors.white,
  ),
  iconError: Icon(                   // Error icon
    Icons.error,
    color: Colors.white,
  ),
  future: loadingSomething();
);

Future<Text> loadingSomething() async {
  try {
    var data = await loadingSomthingTimeConsuming();
    return Text('That was great!');
  } catch (e) {
    throw Text('Something went wrong.');
  }
}
  
/// Show LoadingHud
loadingHud.show();

/// Dismiss LoadingHud
loadingHud.dismiss();
7
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A dialog with a loading indicator.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on loading_hud