showLoadingDialog static method

YYDialog showLoadingDialog(
  1. BuildContext context,
  2. String message, {
  3. String loadingMsg = "Loading...",
})

Implementation

static YYDialog showLoadingDialog(
  BuildContext context,
  String message, {
  String loadingMsg = "Loading...",
}) {
  var totalHeight = MediaQuery.of(Get.context!).size.height;
  var totalWidth = MediaQuery.of(Get.context!).size.width;

  YYDialog yydialog = YYDialog();
  yydialog = YYDialog().build(context)
    ..width = totalWidth
    ..height = totalHeight
    ..borderRadius = 20.r
    ..backgroundColor = Colors.transparent
    ..widget(Container(
      // color: Colors.red,
      width: totalWidth,
      height: totalHeight,
      color: Colors.black12,
      child: const Center(
        child: CircularProgressIndicator(
          valueColor: AlwaysStoppedAnimation<Color>(Colors.blue), // 设置颜色为蓝色
          // backgroundColor: Colors.grey, // 设置背景颜色为灰色
        ),
      ),
    ))
    ..show();

  return yydialog;
}