feat: 修复ios上未检测到账号,弹窗没显示问题
This commit is contained in:
parent
56c7fd6921
commit
4f6be35f61
21
lib/app/utils/account_guard.dart
Normal file
21
lib/app/utils/account_guard.dart
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:kaer_with_panels/app/common/app_run_data.dart';
|
||||||
|
import 'package:kaer_with_panels/app/widgets/dialogs/hi_dialog.dart';
|
||||||
|
import 'package:kaer_with_panels/app/routes/app_pages.dart';
|
||||||
|
|
||||||
|
Future<bool> ensureAccountExists() async {
|
||||||
|
final rawAccount = KRAppRunData.getInstance().kr_account.value;
|
||||||
|
final account = rawAccount?.trim();
|
||||||
|
if (account == null || account.isEmpty || account.toLowerCase() == 'null') {
|
||||||
|
await HIDialog.show(
|
||||||
|
message: '未检测到账号信息,请重试初始化',
|
||||||
|
confirmText: '重试',
|
||||||
|
preventBackDismiss: true,
|
||||||
|
onConfirm: () {
|
||||||
|
Get.offAllNamed(Routes.KR_SPLASH);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user