kshowLoading function

void kshowLoading({
  1. String? text,
  2. bool dismissOnTap = false,
  3. EasyLoadingMaskType maskType = EasyLoadingMaskType.black,
})

提示对话框 显示loading时,不允许用户交互 dismissOnTap:点击空白区域是否可以取消 maskType:背景遮罩颜色

Implementation

/// 显示loading时,不允许用户交互
/// dismissOnTap:点击空白区域是否可以取消
/// maskType:背景遮罩颜色
void kshowLoading({
  String? text,
  bool dismissOnTap = false,
  EasyLoadingMaskType maskType = EasyLoadingMaskType.black,
}) {
  var config = UiPlatform.get.getEasyLoadingConfig();
  EasyLoading.instance
    ..dismissOnTap = dismissOnTap //空白是否支持取消
    ..userInteractions = false //弹窗是否支持继续操作
    ..indicatorType = EasyLoadingIndicatorType.circle
    ..indicatorColor = config.loadingIndicatorColor //指示器的颜色
    ..backgroundColor = config.loadingBackgroundColor //对话框背景颜色
    ..indicatorSize = config.loadingIndicatorSize ?? 64.h
    ..fontSize = config.fontSize ?? 15.sp
    ..textColor = config.loadingTextColor
    // ..boxShadow = [
    //   BoxShadow(
    //     color: Colors.black.withOpacity(0.3), // 阴影的颜色
    //     offset: const Offset(0, 0), // 阴影与容器的距离
    //     blurRadius: 45.0, // 高斯的标准偏差与盒子的形状卷积。
    //     spreadRadius: 0.0, // 在应用模糊之前,框应该膨胀的量。
    //   )
    // ]
    ..textPadding =
        EdgeInsets.only(top: 16.h, bottom: 16.h, left: 32.w, right: 32.w)
    ..loadingStyle = EasyLoadingStyle.custom;
  EasyLoading.show(status: config.loadingText, maskType: maskType);
}