nslogx/flutter_easyloading

✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web

Dart

1,339

130 commits

updated Jul 30, 2026

See the code

README

Flutter EasyLoading

pub package CI pub points likes license

🌐 English | 简体中文

A lightweight, customizable loading, progress, result, and toast overlay for Flutter. Display calls do not require a BuildContext.

  • Loading, determinate progress, result states, and toast messages
  • Global calls without passing a BuildContext
  • Built-in indicators, custom widgets, and custom transitions
  • Global defaults with immutable per-call overrides
  • Material and Cupertino application support

🎬 Preview

Loading indicator preview Progress preview Result preview Toast preview

Open the interactive Flutter EasyLoading preview

🧰 Requirements

  • Dart 3.6.0 or later, below Dart 4.0.0
  • Flutter 3.27.0 or later

Read the 4.0 migration guide before upgrading from 3.x.

📦 Installation

flutter pub add flutter_easyloading

Or add the dependency manually:

dependencies:
  flutter_easyloading: ^4.0.2
import 'package:flutter_easyloading/flutter_easyloading.dart';

🚀 Quick Start

Install one EasyLoading Host at the root MaterialApp or CupertinoApp:

MaterialApp(
  builder: EasyLoading.init(),
  home: const HomePage(),
);

Display and dismiss content from anywhere after the Host is mounted:

await EasyLoading.show(status: 'Loading...');
await EasyLoading.showProgress(0.5, status: 'Downloading...');

await EasyLoading.showSuccess('Completed');
await EasyLoading.showError('Request failed');
await EasyLoading.showInfo('Update available');
await EasyLoading.showToast('Saved');

await EasyLoading.dismiss();

All display and dismissal methods return Future<void> and can be awaited.

If the application already has a root builder, compose it through init:

MaterialApp(
  builder: EasyLoading.init(
    builder: (context, child) => ExistingRoot(child: child),
  ),
  home: const HomePage(),
);

📖 API Reference

Initialization and state

APIReturnsDescription
EasyLoading()EasyLoadingReturns the shared configuration instance.
EasyLoading.instanceEasyLoadingAccesses the shared configuration instance.
EasyLoading.isShowboolReports whether an EasyLoading overlay is active.
EasyLoading.init({builder})TransitionBuilderCreates the application-level Host builder and optionally composes another builder.
FlutterEasyLoading(child: child)FlutterEasyLoadingCreates the Host widget directly. Most applications should use EasyLoading.init().

Display and dismissal

APIParametersDescription
EasyLoading.show(...)status, indicator, maskType, dismissOnTap, duration, optionsShows or updates an indeterminate loading indicator.
EasyLoading.showProgress(value, ...)status, maskType, indicator, duration, dismissOnTap, optionsShows or updates determinate progress from 0.0 to 1.0.
EasyLoading.showSuccess(status, ...)duration, maskType, dismissOnTap, optionsShows a success result.
EasyLoading.showError(status, ...)duration, maskType, dismissOnTap, optionsShows an error result.
EasyLoading.showInfo(status, ...)duration, maskType, dismissOnTap, optionsShows an information result.
EasyLoading.showToast(status, ...)duration, toastPosition, maskType, dismissOnTap, optionsShows a text-only toast.
EasyLoading.showCustom(content, ...)duration, maskType, dismissOnTap, optionsShows arbitrary widget content.
EasyLoading.dismiss({animation})animation defaults to trueDismisses the active overlay.

Callbacks

APIDescription
EasyLoading.addStatusCallback(callback)Adds an EasyLoadingStatusCallback.
EasyLoading.removeCallback(callback)Removes one status callback.
EasyLoading.removeAllCallbacks()Removes every status callback.
EasyLoading.addDismissCallback(callback)Adds an EasyLoadingDismissCallback.
EasyLoading.removeDismissCallback(callback)Removes one dismissal callback.
EasyLoading.removeAllDismissCallbacks()Removes every dismissal callback.
void onStatus(EasyLoadingStatus status) {
  // EasyLoadingStatus.show or EasyLoadingStatus.dismiss
}

void onDismiss(EasyLoadingDismissReason reason) {
  // programmatic, tap, timeout, or hostDetached
}

EasyLoading.addStatusCallback(onStatus);
EasyLoading.addDismissCallback(onDismiss);

// Remove callbacks when their owner is disposed.
EasyLoading.removeCallback(onStatus);
EasyLoading.removeDismissCallback(onDismiss);

⚙️ Configuration

Set global defaults once during application startup:

EasyLoading.instance
  ..loadingStyle = EasyLoadingStyle.dark
  ..indicatorType = EasyLoadingIndicatorType.fadingCircle
  ..maskType = EasyLoadingMaskType.none
  ..toastPosition = EasyLoadingToastPosition.bottom
  ..displayDuration = const Duration(seconds: 2)
  ..animationDuration = const Duration(milliseconds: 200);

General

PropertyTypeDefaultDescription
loadingStyleEasyLoadingStyledarkPanel color style.
indicatorTypeEasyLoadingIndicatorTypefadingCircleBuilt-in loading indicator.
maskTypeEasyLoadingMaskTypenoneDefault barrier style and interaction mode.
toastPositionEasyLoadingToastPositioncenterDefault toast placement.
animationStyleEasyLoadingAnimationStyleopacityPanel transition style.
displayDurationDuration2000 msDefault result and toast duration.
animationDurationDuration200 msPresentation and dismissal transition duration.
userInteractionsbool?nullOptional override for input reaching the application below the overlay.
dismissOnTapbool?null (false)Default tap-to-dismiss override.

Layout and text

PropertyTypeDefaultDescription
textAlignTextAligncenterStatus text alignment.
contentPaddingEdgeInsetsvertical: 15, horizontal: 20Panel content padding.
textPaddingEdgeInsetsbottom: 10Space between the indicator and status text.
indicatorSizedouble40Built-in indicator width and height.
radiusdouble5Panel corner radius.
fontSizedouble15Status font size when textStyle is not set.
progressWidthdouble2Determinate progress stroke width.
lineWidthdouble4Stroke width for supported built-in indicators.
textStyleTextStyle?nullComplete status text style.

Colors and effects

PropertyTypeDefaultDescription
textColorColor?nullStatus color for EasyLoadingStyle.custom.
indicatorColorColor?nullIndicator color for EasyLoadingStyle.custom.
progressColorColor?nullProgress color for EasyLoadingStyle.custom.
backgroundColorColor?nullPanel color for EasyLoadingStyle.custom.
boxShadowList<BoxShadow>?nullPanel shadows for EasyLoadingStyle.custom.
maskColorColor?nullBarrier color for EasyLoadingMaskType.custom.

Custom widgets and animation

PropertyTypeDefaultDescription
customAnimationEasyLoadingAnimation?nullTransition used by EasyLoadingAnimationStyle.custom.
indicatorWidgetWidget?nullGlobal replacement for the loading indicator.
successWidgetWidget?nullGlobal replacement for the success icon.
errorWidgetWidget?nullGlobal replacement for the error icon.
infoWidgetWidget?nullGlobal replacement for the information icon.

Custom modes require their corresponding values:

  • EasyLoadingStyle.custom: backgroundColor, indicatorColor, and textColor; progress also requires progressColor.
  • EasyLoadingMaskType.custom: maskColor.
  • EasyLoadingAnimationStyle.custom: customAnimation.

🎛️ Per-call Options

EasyLoadingOptions is an immutable snapshot for one display call. Every field is optional and inherits the corresponding global value when omitted.

GroupSupported fields
AppearanceloadingStyle, indicatorType, animationStyle, backgroundColor, boxShadow
Indicator and progressindicatorSize, indicatorColor, progressColor, progressWidth, lineWidth
TexttextAlign, textStyle, textColor, fontSize, textPadding
Layoutalignment, constraints, contentPadding, radius
AnimationanimationDuration, customAnimation
Mask and interactionmaskColor, userInteractions

maskType, dismissOnTap, and duration remain direct method parameters. toastPosition is a direct parameter of showToast.

await EasyLoading.show(
  status: 'Uploading',
  maskType: EasyLoadingMaskType.black,
  duration: const Duration(seconds: 10),
  options: const EasyLoadingOptions(
    loadingStyle: EasyLoadingStyle.auto,
    alignment: AlignmentDirectional.topEnd,
    constraints: BoxConstraints(maxWidth: 320),
    indicatorType: EasyLoadingIndicatorType.ring,
  ),
);

🧩 Public Types

TypeValues or purpose
EasyLoadingStylelight, dark, custom, auto
EasyLoadingToastPositiontop, center, bottom
EasyLoadingAnimationStyleopacity, offset, scale, custom
EasyLoadingMaskTypenone, clear, black, custom
EasyLoadingIndicatorType30 built-in indicators listed below.
EasyLoadingStatusshow, dismiss
EasyLoadingDismissReasonprogrammatic, tap, timeout, hostDetached
EasyLoadingStatusCallbackvoid Function(EasyLoadingStatus status)
EasyLoadingDismissCallbackvoid Function(EasyLoadingDismissReason reason)
EasyLoadingOptionsImmutable visual and layout overrides for one call.
EasyLoadingAnimationBase class for custom transitions; implement buildWidget.
FlutterEasyLoadingApplication-level Host widget created by EasyLoading.init().
All EasyLoadingIndicatorType values

fadingCircle, circle, threeBounce, chasingDots, wave, wanderingCubes, rotatingPlain, doubleBounce, fadingFour, fadingCube, pulse, cubeGrid, rotatingCircle, foldingCube, pumpingHeart, dualRing, hourGlass, pouringHourGlass, fadingGrid, ring, ripple, spinningCircle, squareCircle, dancingSquare, pianoWave, pouringHourGlassRefined, pulsingGrid, spinningLines, threeInOut, and waveSpinner.

🎨 Custom Content

await EasyLoading.showCustom(
  const Material(
    child: Padding(
      padding: EdgeInsets.all(16),
      child: Text('Custom content'),
    ),
  ),
  maskType: EasyLoadingMaskType.black,
  options: const EasyLoadingOptions(
    alignment: AlignmentDirectional.bottomCenter,
    constraints: BoxConstraints(maxWidth: 320),
  ),
);

See the example application's custom animation for an EasyLoadingAnimation implementation.

🔄 Migrating From 3.x

Common init, show..., dismiss, status callback, and EasyLoading.instance call forms remain valid. Review the SDK baseline and removed undocumented internals in the 4.0 migration guide.

🗂️ Project

⚖️ License

Flutter EasyLoading is available under the MIT License.

🙏 Credits

Built-in loading indicators are provided by flutter_spinkit.

android
custom-animation
dart
dartlang
flutter
flutter-easyloading
flutter-package
flutter-plugin
flutter-toast
flutter-widget
indicator
ios
loading
spinkit
toast
widget

nslogx/flutter_easyloading

✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web

Dart

1,339

130 commits

updated Jul 30, 2026

See the code

README

Flutter EasyLoading

pub package CI pub points likes license

🌐 English | 简体中文

A lightweight, customizable loading, progress, result, and toast overlay for Flutter. Display calls do not require a BuildContext.

  • Loading, determinate progress, result states, and toast messages
  • Global calls without passing a BuildContext
  • Built-in indicators, custom widgets, and custom transitions
  • Global defaults with immutable per-call overrides
  • Material and Cupertino application support

🎬 Preview

Loading indicator preview Progress preview Result preview Toast preview

Open the interactive Flutter EasyLoading preview

🧰 Requirements

  • Dart 3.6.0 or later, below Dart 4.0.0
  • Flutter 3.27.0 or later

Read the 4.0 migration guide before upgrading from 3.x.

📦 Installation

flutter pub add flutter_easyloading

Or add the dependency manually:

dependencies:
  flutter_easyloading: ^4.0.2
import 'package:flutter_easyloading/flutter_easyloading.dart';

🚀 Quick Start

Install one EasyLoading Host at the root MaterialApp or CupertinoApp:

MaterialApp(
  builder: EasyLoading.init(),
  home: const HomePage(),
);

Display and dismiss content from anywhere after the Host is mounted:

await EasyLoading.show(status: 'Loading...');
await EasyLoading.showProgress(0.5, status: 'Downloading...');

await EasyLoading.showSuccess('Completed');
await EasyLoading.showError('Request failed');
await EasyLoading.showInfo('Update available');
await EasyLoading.showToast('Saved');

await EasyLoading.dismiss();

All display and dismissal methods return Future<void> and can be awaited.

If the application already has a root builder, compose it through init:

MaterialApp(
  builder: EasyLoading.init(
    builder: (context, child) => ExistingRoot(child: child),
  ),
  home: const HomePage(),
);

📖 API Reference

Initialization and state

APIReturnsDescription
EasyLoading()EasyLoadingReturns the shared configuration instance.
EasyLoading.instanceEasyLoadingAccesses the shared configuration instance.
EasyLoading.isShowboolReports whether an EasyLoading overlay is active.
EasyLoading.init({builder})TransitionBuilderCreates the application-level Host builder and optionally composes another builder.
FlutterEasyLoading(child: child)FlutterEasyLoadingCreates the Host widget directly. Most applications should use EasyLoading.init().

Display and dismissal

APIParametersDescription
EasyLoading.show(...)status, indicator, maskType, dismissOnTap, duration, optionsShows or updates an indeterminate loading indicator.
EasyLoading.showProgress(value, ...)status, maskType, indicator, duration, dismissOnTap, optionsShows or updates determinate progress from 0.0 to 1.0.
EasyLoading.showSuccess(status, ...)duration, maskType, dismissOnTap, optionsShows a success result.
EasyLoading.showError(status, ...)duration, maskType, dismissOnTap, optionsShows an error result.
EasyLoading.showInfo(status, ...)duration, maskType, dismissOnTap, optionsShows an information result.
EasyLoading.showToast(status, ...)duration, toastPosition, maskType, dismissOnTap, optionsShows a text-only toast.
EasyLoading.showCustom(content, ...)duration, maskType, dismissOnTap, optionsShows arbitrary widget content.
EasyLoading.dismiss({animation})animation defaults to trueDismisses the active overlay.

Callbacks

APIDescription
EasyLoading.addStatusCallback(callback)Adds an EasyLoadingStatusCallback.
EasyLoading.removeCallback(callback)Removes one status callback.
EasyLoading.removeAllCallbacks()Removes every status callback.
EasyLoading.addDismissCallback(callback)Adds an EasyLoadingDismissCallback.
EasyLoading.removeDismissCallback(callback)Removes one dismissal callback.
EasyLoading.removeAllDismissCallbacks()Removes every dismissal callback.
void onStatus(EasyLoadingStatus status) {
  // EasyLoadingStatus.show or EasyLoadingStatus.dismiss
}

void onDismiss(EasyLoadingDismissReason reason) {
  // programmatic, tap, timeout, or hostDetached
}

EasyLoading.addStatusCallback(onStatus);
EasyLoading.addDismissCallback(onDismiss);

// Remove callbacks when their owner is disposed.
EasyLoading.removeCallback(onStatus);
EasyLoading.removeDismissCallback(onDismiss);

⚙️ Configuration

Set global defaults once during application startup:

EasyLoading.instance
  ..loadingStyle = EasyLoadingStyle.dark
  ..indicatorType = EasyLoadingIndicatorType.fadingCircle
  ..maskType = EasyLoadingMaskType.none
  ..toastPosition = EasyLoadingToastPosition.bottom
  ..displayDuration = const Duration(seconds: 2)
  ..animationDuration = const Duration(milliseconds: 200);

General

PropertyTypeDefaultDescription
loadingStyleEasyLoadingStyledarkPanel color style.
indicatorTypeEasyLoadingIndicatorTypefadingCircleBuilt-in loading indicator.
maskTypeEasyLoadingMaskTypenoneDefault barrier style and interaction mode.
toastPositionEasyLoadingToastPositioncenterDefault toast placement.
animationStyleEasyLoadingAnimationStyleopacityPanel transition style.
displayDurationDuration2000 msDefault result and toast duration.
animationDurationDuration200 msPresentation and dismissal transition duration.
userInteractionsbool?nullOptional override for input reaching the application below the overlay.
dismissOnTapbool?null (false)Default tap-to-dismiss override.

Layout and text

PropertyTypeDefaultDescription
textAlignTextAligncenterStatus text alignment.
contentPaddingEdgeInsetsvertical: 15, horizontal: 20Panel content padding.
textPaddingEdgeInsetsbottom: 10Space between the indicator and status text.
indicatorSizedouble40Built-in indicator width and height.
radiusdouble5Panel corner radius.
fontSizedouble15Status font size when textStyle is not set.
progressWidthdouble2Determinate progress stroke width.
lineWidthdouble4Stroke width for supported built-in indicators.
textStyleTextStyle?nullComplete status text style.

Colors and effects

PropertyTypeDefaultDescription
textColorColor?nullStatus color for EasyLoadingStyle.custom.
indicatorColorColor?nullIndicator color for EasyLoadingStyle.custom.
progressColorColor?nullProgress color for EasyLoadingStyle.custom.
backgroundColorColor?nullPanel color for EasyLoadingStyle.custom.
boxShadowList<BoxShadow>?nullPanel shadows for EasyLoadingStyle.custom.
maskColorColor?nullBarrier color for EasyLoadingMaskType.custom.

Custom widgets and animation

PropertyTypeDefaultDescription
customAnimationEasyLoadingAnimation?nullTransition used by EasyLoadingAnimationStyle.custom.
indicatorWidgetWidget?nullGlobal replacement for the loading indicator.
successWidgetWidget?nullGlobal replacement for the success icon.
errorWidgetWidget?nullGlobal replacement for the error icon.
infoWidgetWidget?nullGlobal replacement for the information icon.

Custom modes require their corresponding values:

  • EasyLoadingStyle.custom: backgroundColor, indicatorColor, and textColor; progress also requires progressColor.
  • EasyLoadingMaskType.custom: maskColor.
  • EasyLoadingAnimationStyle.custom: customAnimation.

🎛️ Per-call Options

EasyLoadingOptions is an immutable snapshot for one display call. Every field is optional and inherits the corresponding global value when omitted.

GroupSupported fields
AppearanceloadingStyle, indicatorType, animationStyle, backgroundColor, boxShadow
Indicator and progressindicatorSize, indicatorColor, progressColor, progressWidth, lineWidth
TexttextAlign, textStyle, textColor, fontSize, textPadding
Layoutalignment, constraints, contentPadding, radius
AnimationanimationDuration, customAnimation
Mask and interactionmaskColor, userInteractions

maskType, dismissOnTap, and duration remain direct method parameters. toastPosition is a direct parameter of showToast.

await EasyLoading.show(
  status: 'Uploading',
  maskType: EasyLoadingMaskType.black,
  duration: const Duration(seconds: 10),
  options: const EasyLoadingOptions(
    loadingStyle: EasyLoadingStyle.auto,
    alignment: AlignmentDirectional.topEnd,
    constraints: BoxConstraints(maxWidth: 320),
    indicatorType: EasyLoadingIndicatorType.ring,
  ),
);

🧩 Public Types

TypeValues or purpose
EasyLoadingStylelight, dark, custom, auto
EasyLoadingToastPositiontop, center, bottom
EasyLoadingAnimationStyleopacity, offset, scale, custom
EasyLoadingMaskTypenone, clear, black, custom
EasyLoadingIndicatorType30 built-in indicators listed below.
EasyLoadingStatusshow, dismiss
EasyLoadingDismissReasonprogrammatic, tap, timeout, hostDetached
EasyLoadingStatusCallbackvoid Function(EasyLoadingStatus status)
EasyLoadingDismissCallbackvoid Function(EasyLoadingDismissReason reason)
EasyLoadingOptionsImmutable visual and layout overrides for one call.
EasyLoadingAnimationBase class for custom transitions; implement buildWidget.
FlutterEasyLoadingApplication-level Host widget created by EasyLoading.init().
All EasyLoadingIndicatorType values

fadingCircle, circle, threeBounce, chasingDots, wave, wanderingCubes, rotatingPlain, doubleBounce, fadingFour, fadingCube, pulse, cubeGrid, rotatingCircle, foldingCube, pumpingHeart, dualRing, hourGlass, pouringHourGlass, fadingGrid, ring, ripple, spinningCircle, squareCircle, dancingSquare, pianoWave, pouringHourGlassRefined, pulsingGrid, spinningLines, threeInOut, and waveSpinner.

🎨 Custom Content

await EasyLoading.showCustom(
  const Material(
    child: Padding(
      padding: EdgeInsets.all(16),
      child: Text('Custom content'),
    ),
  ),
  maskType: EasyLoadingMaskType.black,
  options: const EasyLoadingOptions(
    alignment: AlignmentDirectional.bottomCenter,
    constraints: BoxConstraints(maxWidth: 320),
  ),
);

See the example application's custom animation for an EasyLoadingAnimation implementation.

🔄 Migrating From 3.x

Common init, show..., dismiss, status callback, and EasyLoading.instance call forms remain valid. Review the SDK baseline and removed undocumented internals in the 4.0 migration guide.

🗂️ Project

⚖️ License

Flutter EasyLoading is available under the MIT License.

🙏 Credits

Built-in loading indicators are provided by flutter_spinkit.

android
custom-animation
dart
dartlang
flutter
flutter-easyloading
flutter-package
flutter-plugin
flutter-toast
flutter-widget
indicator
ios
loading
spinkit
toast
widget

Significant stargazers

Tomo Suzuki

133 followers · starred Sep 2020

simon gao

68 followers · starred Jan 2021

GMFTBY

235 followers · starred May 2023

probe

79 followers · starred Oct 2024