38 lines
1.0 KiB
Dart
38 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:hgdj/assets_tool/app_colors.dart';
|
|
import 'package:hgdj/hj_utils/screen.dart';
|
|
import 'package:hgdj/tools_base/loading/loading_center_widget.dart';
|
|
|
|
import '../../hj_utils/widget_util.dart';
|
|
|
|
class LoadingHelper {
|
|
static void showLoading({bool dismissiable = false, String msg = ''}) {
|
|
Get.dialog(
|
|
Scaffold(
|
|
backgroundColor: Colors.transparent,
|
|
body: Center(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
const LoadingCenterWidget(),
|
|
if (msg.isNotEmpty) ...[
|
|
4.sizeBoxH,
|
|
Text(
|
|
msg,
|
|
style:
|
|
textStyle(16, AppColors.mainTextColor33, FontWeight.w500),
|
|
),
|
|
]
|
|
],
|
|
),
|
|
),
|
|
),
|
|
barrierColor: Colors.transparent,
|
|
barrierDismissible: dismissiable,
|
|
);
|
|
}
|
|
|
|
static void dismissLoading() => Get.back();
|
|
}
|