show static method

void show(
  1. BuildContext context, {
  2. String? message,
  3. double? progress,
  4. RistoLoaderStyle loaderStyle = RistoLoaderStyle.pulsingDots,
  5. double blurSigma = 6.0,
  6. Color? barrierColor,
  7. Color? loaderColor,
  8. EdgeInsetsGeometry? padding,
  9. EdgeInsetsGeometry? margin,
})

Shows the loading panel as a full-screen, modal dialog. Prevents user interaction while loading.

Implementation

static void show(
  BuildContext context, {
  String? message,
  double? progress,
  RistoLoaderStyle loaderStyle = RistoLoaderStyle.pulsingDots,
  double blurSigma = 6.0,
  Color? barrierColor,
  Color? loaderColor,
  EdgeInsetsGeometry? padding,
  EdgeInsetsGeometry? margin,
}) {
  if (_isShowing) return;
  _isShowing = true;

  showGeneralDialog(
    context: context,
    useRootNavigator: true,
    barrierDismissible: false,
    barrierColor: Colors.transparent,
    pageBuilder: (_, _, _) => PopScope(
      canPop: false,
      child: LoadingPanel(
        isLoading: true,
        message: message,
        progress: progress,
        loaderStyle: loaderStyle,
        blurSigma: blurSigma,
        barrierColor: barrierColor ?? Colors.black.withCustomOpacity(0.25),
        loaderColor: loaderColor,
        padding: padding,
        margin: margin,
      ),
    ),
    transitionBuilder: (ctx, anim, _, child) => FadeTransition(
      opacity: CurvedAnimation(parent: anim, curve: Curves.easeOutCubic),
      child: child,
    ),
  ).then((_) => _isShowing = false);
}