多语言后端数据

This commit is contained in:
czz
2025-08-01 22:25:47 +08:00
parent 12a53ac36c
commit a199606f80
52 changed files with 1736 additions and 1142 deletions

View File

@@ -143,6 +143,8 @@ class ShareDeviceDetailWidget extends GetView {
} catch (e) {
ef.log("[h5]通知列表更新错误:$e");
}
isProgrammaticPop = true; // 设置为程序触发,避免再次触发 PopScope
Get.back(); // 或 Navigator.pop(context);
},
onFailure: (res) {
TopSlideNotification.show(context,
@@ -152,12 +154,12 @@ class ShareDeviceDetailWidget extends GetView {
} catch (e) {
print(e);
}
if (Platform.isAndroid) {
var flag = await _handleBackPressed(context); // 自定义返回逻辑
if (flag) {
SystemNavigator.pop();
}
}
// if (Platform.isAndroid) {
// var flag = await _handleBackPressed(context); // 自定义返回逻辑
// if (flag) {
// SystemNavigator.pop();
// }
// }
},
child: Container(
width: MediaQuery.sizeOf(context).width,
@@ -423,7 +425,9 @@ class ShareDeviceDetailWidget extends GetView {
gradientDirection: GradientDirection.vertical,
onTap: () async {
deviceListController.unbindShareDevice(
data['info'][5]['uid'], data['mac'.tr], context);
data['info'][5]['uid'],
data['mac'.tr],
context);
},
colors: const [
Color(0xFFFCFCFC),
@@ -456,20 +460,4 @@ class ShareDeviceDetailWidget extends GetView {
),
));
}
Future<bool> _handleBackPressed(BuildContext context) async {
final currentTime = DateTime.now();
// 如果上次点击返回键时间为空,或者间隔超过 1 秒
if (_lastBackPressedTime == null ||
currentTime.difference(_lastBackPressedTime!) > Duration(seconds: 2)) {
_lastBackPressedTime = currentTime;
TopSlideNotification.show(
context,
text: "再按一次退出程序".tr,
);
return false; // 阻止退出程序
} else {
return true; // 允许退出程序
}
}
}