showLoadingDialogWithCustomWidget static method
YYDialog
showLoadingDialogWithCustomWidget(})
Implementation
static YYDialog showLoadingDialogWithCustomWidget(
BuildContext context, {
String? message = "",
Widget? widgetContent,
String loadingMsg = "Loading...",
double totalHeight = 200,
double totalWidth = 300,
}) {
totalHeight = MediaQuery.of(Get.context!).size.height;
totalWidth = MediaQuery.of(Get.context!).size.width;
YYDialog yydialog = YYDialog();
Widget defaultWidget = Container(
// color: Colors.red,
width: totalWidth,
height: totalHeight,
color: Colors.black12,
child: const Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.blue), // 设置颜色为蓝色
// backgroundColor: Colors.grey, // 设置背景颜色为灰色
),
),
);
yydialog = YYDialog().build(context)
..width = totalWidth
..height = totalHeight
..borderRadius = 20.r
..backgroundColor = Colors.transparent
..widget(widgetContent ?? defaultWidget)
..show();
return yydialog;
}