|
|
|
@ -17,12 +17,13 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
// 显示确认弹窗 |
|
|
|
await Get.dialog( |
|
|
|
AlertDialog( |
|
|
|
title: Text('提示'), |
|
|
|
content: Text('当前正在升级,退出将中断升级进程,确定要退出吗?'), |
|
|
|
title: Text('tip'.tr), // 提示 |
|
|
|
content: |
|
|
|
Text('upgradeExitConfirm'.tr), // 当前正在升级,退出将中断升级进程,确定要退出吗? |
|
|
|
actions: [ |
|
|
|
TextButton( |
|
|
|
onPressed: () => Get.back(), // 关闭弹窗 |
|
|
|
child: Text('取消'), |
|
|
|
child: Text('cancel'.tr), // 取消 |
|
|
|
), |
|
|
|
TextButton( |
|
|
|
onPressed: () { |
|
|
|
@ -30,7 +31,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
Get.back(); // 关闭弹窗 |
|
|
|
Get.back(); // 返回上一页 |
|
|
|
}, |
|
|
|
child: Text('确定'), |
|
|
|
child: Text('confirm'.tr), // 确定 |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
@ -57,12 +58,13 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
// 显示确认弹窗 |
|
|
|
Get.dialog( |
|
|
|
AlertDialog( |
|
|
|
title: Text('提示'), |
|
|
|
content: Text('当前正在升级,退出将中断升级进程,确定要退出吗?'), |
|
|
|
title: Text('tip'.tr), // 提示 |
|
|
|
content: Text( |
|
|
|
'upgradeExitConfirm'.tr), // 当前正在升级,退出将中断升级进程,确定要退出吗? |
|
|
|
actions: [ |
|
|
|
TextButton( |
|
|
|
onPressed: () => Get.back(), // 关闭弹窗 |
|
|
|
child: Text('取消'), |
|
|
|
child: Text('cancel'.tr), // 取消 |
|
|
|
), |
|
|
|
TextButton( |
|
|
|
onPressed: () { |
|
|
|
@ -70,7 +72,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
Get.back(); // 关闭弹窗 |
|
|
|
Get.back(); // 返回上一页 |
|
|
|
}, |
|
|
|
child: Text('确定'), |
|
|
|
child: Text('confirm'.tr), // 确定 |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
@ -81,7 +83,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
}, |
|
|
|
), |
|
|
|
title: Text( |
|
|
|
'固件升级'.tr, |
|
|
|
'firmwareUpgrade'.tr, //固件升级 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 20.sp, |
|
|
|
color: isDarkMode ? Colors.white : Colors.black, |
|
|
|
@ -217,8 +219,8 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
// 设备型号信息 |
|
|
|
_buildDeviceInfoRow( |
|
|
|
icon: Icons.headset, |
|
|
|
label: '设备型号', |
|
|
|
value: deviceInfo?.name ?? '未知设备', |
|
|
|
label: 'deviceModel'.tr, // 设备型号 |
|
|
|
value: deviceInfo?.name ?? 'unknownDevice'.tr, // 未知设备 |
|
|
|
isDarkMode: isDarkMode, |
|
|
|
), |
|
|
|
// SizedBox(height: 10.h), |
|
|
|
@ -361,7 +363,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
if (isCharging) ...[ |
|
|
|
SizedBox(height: 1.h), |
|
|
|
Text( |
|
|
|
'充电中', |
|
|
|
'charging'.tr, // 充电中 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 10.sp, |
|
|
|
color: batteryColor, |
|
|
|
@ -380,7 +382,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
children: [ |
|
|
|
// 当前版本信息 |
|
|
|
_buildVersionInfoRow( |
|
|
|
label: '当前固件版本'.tr, |
|
|
|
label: 'currentFirmwareVersion'.tr, //当前固件版本 |
|
|
|
version: controller.currentVersion, |
|
|
|
isDarkMode: isDarkMode, |
|
|
|
isLatest: false, |
|
|
|
@ -388,7 +390,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
SizedBox(height: 8.h), |
|
|
|
// 最新版本信息 |
|
|
|
_buildVersionInfoRow( |
|
|
|
label: '最新固件版本'.tr, |
|
|
|
label: 'latestFirmwareVersion'.tr, //最新固件版本 |
|
|
|
version: controller.latestVersion, |
|
|
|
isDarkMode: isDarkMode, |
|
|
|
isLatest: true, |
|
|
|
@ -499,7 +501,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
), |
|
|
|
SizedBox(width: 6.w), |
|
|
|
Text( |
|
|
|
'发现新版本', |
|
|
|
'newVersionFound'.tr, // 发现新版本 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
@ -530,7 +532,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
), |
|
|
|
SizedBox(width: 6.w), |
|
|
|
Text( |
|
|
|
'已是最新版本', |
|
|
|
'latestVersion'.tr, // 已是最新版本 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
@ -596,7 +598,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
), |
|
|
|
SizedBox(width: 12.w), |
|
|
|
Text( |
|
|
|
'更新内容'.tr, |
|
|
|
'updateContent'.tr, //更新内容 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
@ -667,7 +669,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
), |
|
|
|
SizedBox(height: 24.h), |
|
|
|
Text( |
|
|
|
'正在获取设备信息...', |
|
|
|
'gettingDeviceInfo'.tr, // 正在获取设备信息... |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
@ -676,7 +678,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
), |
|
|
|
SizedBox(height: 8.h), |
|
|
|
Text( |
|
|
|
'请保持设备连接', |
|
|
|
'keepDeviceConnected'.tr, // 请保持设备连接 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: isDarkMode ? Colors.grey[500] : Colors.grey[500], |
|
|
|
@ -731,7 +733,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
SizedBox(height: 16.h), |
|
|
|
// 错误标题 |
|
|
|
Text( |
|
|
|
'连接失败', |
|
|
|
'connectionFailed'.tr, // 连接失败 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 18.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
@ -756,7 +758,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
child: ElevatedButton.icon( |
|
|
|
icon: Icon(Icons.refresh, size: 18.sp), |
|
|
|
label: Text( |
|
|
|
'重试连接'.tr, |
|
|
|
'retryConnection'.tr, //重试连接 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
@ -832,7 +834,9 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
size: 20.sp, |
|
|
|
), |
|
|
|
label: Text( |
|
|
|
controller.isUpdateAvailable.value ? '立即更新' : '已是最新版本', |
|
|
|
controller.isUpdateAvailable.value |
|
|
|
? 'updateNow'.tr |
|
|
|
: 'latestVersion'.tr, // 立即更新 : 已是最新版本 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16.sp, |
|
|
|
fontWeight: FontWeight.w600, |
|
|
|
@ -877,7 +881,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
SizedBox(width: 12.w), |
|
|
|
Expanded( |
|
|
|
child: Text( |
|
|
|
'取出双耳机,并保证电量均为30%以上的状态'.tr, |
|
|
|
'removeEarbudsEnsureBattery'.tr, //取出双耳机,并保证电量均为30%以上的状态 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 13.sp, |
|
|
|
color: isDarkMode |
|
|
|
@ -965,10 +969,10 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
], |
|
|
|
), |
|
|
|
SizedBox(height: 16.h), |
|
|
|
|
|
|
|
|
|
|
|
// 提示信息 |
|
|
|
Text( |
|
|
|
'请保持设备连接,不要关闭应用', |
|
|
|
'keepConnectedDontClose'.tr, // 请保持设备连接,不要关闭应用 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[600], |
|
|
|
@ -1081,7 +1085,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> { |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
'请勿断开连接', |
|
|
|
'doNotDisconnect'.tr, // 请勿断开连接 |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12.sp, |
|
|
|
color: isDarkMode ? Colors.grey[400] : Colors.grey[600], |
|
|
|
|