Browse Source

修复编辑文件标题带后缀问题+ota升级没有简介问题

weicu
fdp 1 year ago
parent
commit
68406d504a
  1. 2
      lib/modules/meeting/controllers/meeting_controller.dart
  2. 9
      lib/modules/meeting/views/meeting_view.dart
  3. 4
      lib/modules/ota_upgrade/controllers/ota_upgrade_controller.dart
  4. 4
      lib/modules/ota_upgrade/model/ota_upgrade_model.dart
  5. 3
      lib/modules/ota_upgrade/views/ota_upgrade_view.dart

2
lib/modules/meeting/controllers/meeting_controller.dart

@ -36,7 +36,7 @@ class MeetingController extends GetxController {
final appDocDir = getApplicationDocumentsDirectory();
List<FileSystemEntity> files = [];
TextEditingController titleController = TextEditingController(); // 录音标题
String titleCSuffix = ""; // 录音标题后缀
RxList dataList = [].obs;
// 蓝牙服务
final bleManager = Get.find<BleManager>();

9
lib/modules/meeting/views/meeting_view.dart

@ -559,7 +559,11 @@ class MeetingView extends GetView<MeetingController> {
'edit'.tr, // 编辑
isDarkMode ? Colors.white : Colors.black87,
() {
controller.titleController.text = data.title;
final dotIndex = data.title.lastIndexOf('.');
controller.titleController.text =
dotIndex != -1 ? data.title.substring(0, dotIndex) : data.title;
controller.titleCSuffix =
data.title.substring(dotIndex, data.title.length);
_bottomSheet(context, isDarkMode, data.id);
},
),
@ -696,7 +700,8 @@ class MeetingView extends GetView<MeetingController> {
),
GestureDetector(
onTap: () {
String title = controller.titleController.text;
String title = controller.titleController.text +
controller.titleCSuffix;
controller.editMeetingTitle(id, title);
},
child: Container(

4
lib/modules/ota_upgrade/controllers/ota_upgrade_controller.dart

@ -27,6 +27,8 @@ class OtaUpgradeController extends GetxController {
// 最新版本号
final RxString latestVersion = ''.obs;
// 最新更新内容
final RxString updatedescription = ''.obs;
// 当前设备固件版本号
final RxString currentVersion = ''.obs;
@ -194,7 +196,7 @@ class OtaUpgradeController extends GetxController {
final resp = OtaConfigResp.fromJson(response);
print('getequipmentinfo,resp.systemversion: ${resp.systemversion}');
latestVersion.value = resp.systemversion!;
updatedescription.value = resp.updatedescription!;
updatepackageaddress = resp.updatepackageaddress!;
// 版本检查

4
lib/modules/ota_upgrade/model/ota_upgrade_model.dart

@ -16,6 +16,7 @@ class OtaConfigResp {
final String? equipmentname;
final String? systemversion;
final String? updatepackageaddress;
final String? updatedescription;
// 私有构造函数
OtaConfigResp._({
this.id,
@ -23,6 +24,7 @@ class OtaConfigResp {
this.equipmentname,
this.systemversion,
this.updatepackageaddress,
this.updatedescription,
});
factory OtaConfigResp.fromJson(Map<String, dynamic> json) {
@ -38,6 +40,7 @@ class OtaConfigResp {
systemversion: (infoData?['systemversion'] as String?) ?? '',
updatepackageaddress:
(infoData?['updatepackageaddress'] as String?) ?? '',
updatedescription: (infoData?['updatedescription'] as String?) ?? '',
);
}
@ -49,6 +52,7 @@ class OtaConfigResp {
'equipmentname': instance.equipmentname,
'systemversion': instance.systemversion,
'updatepackageaddress': instance.updatepackageaddress,
'updatedescription': instance.updatedescription,
}
};
}

3
lib/modules/ota_upgrade/views/ota_upgrade_view.dart

@ -218,7 +218,7 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> {
SizedBox(height: 8),
// 这里可以从controller中获取更新说明,如果有的话
Text(
'1. 优化音质表现\n2. 提升连接稳定性\n3. 修复已知问题'.tr,
controller.updatedescription.value,
style: TextStyle(
fontSize: 14,
color: isDarkMode ? Colors.grey[300] : Colors.grey[800],
@ -333,7 +333,6 @@ class OtaUpgradeView extends GetView<OtaUpgradeController> {
return Obx(() {
final progress = controller.progress.value;
final type = controller.type.value;
// // 处理升级失败状态:弹出 snackbar 并显示错误提示
// if (type == OtaUpgradeController.UPGRADE_FAILED ||
// type == OtaUpgradeController.CONNECTION_DISCONNECTION) {

Loading…
Cancel
Save