import 'package:flutter/material.dart'; import 'package:get/get.dart'; /// Loading工具 class LoadingUtil { LoadingUtil() {} init() {} static Future show({String? status}) async { return showLoading(status: status ?? 'Loading...'); } static Future dismiss() async { return hideLoading(); } static showLoading({String? status}) { Get.dialog( GestureDetector( child: Container( color: Colors.black54, child: const Center( child: CircularProgressIndicator( valueColor: AlwaysStoppedAnimation(Colors.white), ), ), ), onTap: () { // 点击是否退出模态框 Get.back(); }, ), barrierDismissible: false, ); } static hideLoading() { Get.back(); } }