更新ui
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
@@ -14,6 +15,7 @@ import 'package:vbvs_app/controller/message/message_controller.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/controller/user_info_controller.dart';
|
||||
import 'package:vbvs_app/enum/LoginStatus.dart';
|
||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||
import 'package:vbvs_app/pages/main_bottom/e_page.dart';
|
||||
import 'package:vbvs_app/pages/main_bottom/home_page.dart';
|
||||
import 'package:vbvs_app/pages/main_bottom/message_page.dart';
|
||||
@@ -75,16 +77,56 @@ class MainPageBottomChange extends GetView<MainPageController> {
|
||||
];
|
||||
|
||||
DateTime? _lastBackPressedTime; // 记录上一次返回的时间
|
||||
final getStorage = GetStorage();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Future.delayed(const Duration(milliseconds: 0), () {
|
||||
String? isShowYingShiDialog = getStorage.read("isShowYingShiDialog");
|
||||
if (isShowYingShiDialog == null || isShowYingShiDialog != "true") {
|
||||
String btnName = "同意".tr;
|
||||
String cancelName = "取消".tr;
|
||||
if (Platform.isAndroid) {
|
||||
cancelName = "退出".tr;
|
||||
}
|
||||
showCustomConfirmOfWebViewDialog(context, "隐私协议".tr, getPrivacy(1),
|
||||
btnName: btnName, showCancel: true, cancelName: cancelName)
|
||||
.then((e) {
|
||||
if (e == "confirm") {
|
||||
getStorage.write("isShowYingShiDialog", "true");
|
||||
} else {
|
||||
if (cancelName == "退出") {
|
||||
SystemNavigator.pop();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
|
||||
// onPopInvokedWithResult: (disposition, result) async {
|
||||
// if (Platform.isAndroid) {
|
||||
// var flag = await _handleBackPressed(context); // 自定义返回逻辑
|
||||
// if (flag) {
|
||||
// SystemNavigator.pop();
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
onPopInvokedWithResult: (disposition, result) async {
|
||||
UserInfoController userInfoController = Get.find();
|
||||
if (userInfoController.model.isProgrammaticPop) {
|
||||
// 如果是程序触发,重置标记并忽略
|
||||
userInfoController.model.isProgrammaticPop = false;
|
||||
return; // 阻止处理
|
||||
}
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
var flag = await _handleBackPressed(context); // 自定义返回逻辑
|
||||
if (flag) {
|
||||
SystemNavigator.pop();
|
||||
}
|
||||
// var flag = await _handleBackPressed(context); // 自定义返回逻辑
|
||||
// if (flag) {
|
||||
// SystemNavigator.pop();
|
||||
// }
|
||||
Get.back();
|
||||
}
|
||||
},
|
||||
child: Obx(
|
||||
@@ -170,7 +212,6 @@ class MainPageBottomChange extends GetView<MainPageController> {
|
||||
controller.updateAll();
|
||||
});
|
||||
},
|
||||
|
||||
items: [
|
||||
getBottomNavigationBarItem("assets/img/menu/home.svg",
|
||||
"assets/img/menu/n_home.svg", "菜单.首页".tr),
|
||||
|
||||
Reference in New Issue
Block a user