showLoading static method

CancelFunc showLoading({
  1. bool clickClose = false,
  2. bool allowClick = false,
  3. bool ignoreContentClick = false,
  4. bool useSafeArea = true,
  5. Color backgroundColor = const Color(0x33000000),
  6. Duration? duration,
  7. Duration? animationDuration,
  8. Duration? animationReverseDuration,
  9. VoidCallback? onClose,
})

ignoreContentClick 是否忽视ToastContext区域 这个参数如果为true时,用户点击该ToastContext区域时,用户可以的点击事件可以正常到达到Page上 换一句话说就是透明的(即便是Toast背景颜色不是透明),如果为false,则情况反之

Implementation

static CancelFunc showLoading({
  bool clickClose = false,
  bool allowClick = false,
  bool ignoreContentClick = false,
  bool useSafeArea = true,
  Color backgroundColor = const Color(0x33000000),
  Duration? duration,
  Duration? animationDuration,
  Duration? animationReverseDuration,
  VoidCallback? onClose,
}) {
  return BotToast.showCustomLoading(
    toastBuilder: (context) {
      return Container(
        padding: const EdgeInsets.all(20),
        decoration: const BoxDecoration(
          boxShadow: [
            BoxShadow(
                color: Colors.black26, //阴影xy轴偏移量
                blurRadius: 3, //阴影模糊程度
                spreadRadius: 3 //阴影扩散程度
            )
          ],
          color: Colors.white,
          borderRadius: BorderRadius.all(
            Radius.circular(10),
          ),
        ),
        child: const CircularProgressIndicator(
          valueColor: AlwaysStoppedAnimation<Color>(Colors.blueAccent),
          backgroundColor: Colors.white,
        ),
      );
    },
    backgroundColor: backgroundColor,
    clickClose: clickClose,
    allowClick: allowClick,
    ignoreContentClick: ignoreContentClick,
    useSafeArea: useSafeArea,
    backButtonBehavior: BackButtonBehavior.ignore,
    duration: duration,
    animationDuration: animationDuration,
    animationReverseDuration: animationReverseDuration,
    onClose: onClose,
  );
}