fix:修复闭锁时,提示语一直闪动

This commit is contained in:
anfe 2024-06-03 15:27:15 +08:00
parent 1c36f11194
commit 22d6388bff
3 changed files with 5 additions and 3 deletions

View File

@ -2,6 +2,7 @@ import 'dart:async';
import 'package:flutter/scheduler.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:permission_handler/permission_handler.dart';
@ -66,6 +67,7 @@ class LockDetailLogic extends BaseGetXController {
state.iSClosedUnlockSuccessfulPopup.value = true;
cancelBlueConnetctToastTimer();
state.closedUnlockSuccessfulTimer?.cancel();
EasyLoading.dismiss();
// 3
state.closedUnlockSuccessfulTimer =
Timer.periodic(3.seconds, (Timer timer) {

View File

@ -51,9 +51,10 @@ class BaseProvider extends GetConnect with Api {
query: query,
decoder: decoder,
uploadProgress: uploadProgress);
if (EasyLoading.isShow && !isUnShowLoading!) {
await EasyLoading.dismiss(animation: true);
}
if (res.body == null) {
if (EasyLoading.isShow) await EasyLoading.dismiss(animation: true);
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
if (res.statusCode == null && isShowErrMsg!) {
EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr,

View File

@ -6,6 +6,5 @@ import 'package:star_lock/app_settings/app_settings.dart';
FutureOr<dynamic> responseLogInterceptor(Request request, Response response) {
AppLog.log('HTTP request:${request.url}\n RESPONSE => stataCode:${response.statusCode} ${response.bodyString}'); // \n ${response.headers}
EasyLoading.dismiss(animation: true);
return response;
}