集成接口 开始执行任务的领域层和数据层和UI层的开发啊(待测试)
集成功能 暂停 取消功能 恢复功能的接口的领域层和数据层的开发 下一步待集成到页面上 优化功能,优化了接口异常和未知异常对页面渲染的影响对用户的体验的不好情况。具体通过弹窗友好提示! 优化更新了tcp指示灯点击出现机器状态中添加选中设备的编号 方便用户使用的明白明了!。 优化更新关闭了tcp重连操作内链条中的获取用户设备和切换设备操作项。 调整了获取无人机状态信息的更新频率 为14秒一次
This commit is contained in:
@@ -126,14 +126,14 @@ class UpdateDialog extends StatelessWidget {
|
||||
label: const Text('去安装'),
|
||||
);
|
||||
} else if (state is UpdateInstalling) {
|
||||
return const Column(
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text('📦 正在打开安装页面...', style: TextStyle(fontSize: 13, fontWeight: FontWeight.bold)),
|
||||
SizedBox(height: 4),
|
||||
Text('请在系统安装界面确认安装', style: TextStyle(fontSize: 12)),
|
||||
SizedBox(height: 8),
|
||||
CircularProgressIndicator(),
|
||||
const Text('📦 正在打开安装页面...', style: TextStyle(fontSize: 13, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 4),
|
||||
const Text('请在系统安装界面确认安装', style: TextStyle(fontSize: 12)),
|
||||
const SizedBox(height: 8),
|
||||
const CircularProgressIndicator(),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
@@ -259,23 +259,25 @@ class FullApkUpdateDialog extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue.shade50,
|
||||
color: Colors.orange.shade50,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: Colors.blue.shade200),
|
||||
border: Border.all(color: Colors.orange.shade200),
|
||||
),
|
||||
child: const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'📱 整包更新说明',
|
||||
'📱 整包更新步骤',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
'• 点击"立即下载"将在浏览器中打开下载链接\n'
|
||||
'• 下载完成后请手动安装 APK\n'
|
||||
'• 安装完成后重启应用即可',
|
||||
style: TextStyle(fontSize: 13, height: 1.5),
|
||||
'1️⃣ 点击"立即下载"打开浏览器\n'
|
||||
'2️⃣ 等待 APK 下载完成\n'
|
||||
'3️⃣ 手动安装新版本的 APK\n'
|
||||
'4️⃣ 安装完成后,卸载旧版本 APP\n'
|
||||
'5️⃣ 重新打开新版本 APP',
|
||||
style: TextStyle(fontSize: 13, height: 1.6),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -301,15 +303,12 @@ class FullApkUpdateDialog extends StatelessWidget {
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
if (versionInfo.apkUrl != null) {
|
||||
context.read<UpdateCubit>().downloadAndInstallApk(versionInfo.apkUrl!);
|
||||
// 🔥 调用新方法:浏览器下载 + 清除补丁记录
|
||||
context.read<UpdateCubit>().fullApkUpdateWithBrowser(versionInfo.apkUrl!);
|
||||
Navigator.of(context).pop();
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('正在浏览器中打开下载链接...'),
|
||||
duration: Duration(seconds: 2),
|
||||
),
|
||||
);
|
||||
// 显示后续引导弹窗
|
||||
_showManualInstallGuide(context);
|
||||
}
|
||||
},
|
||||
child: const Text('立即下载'),
|
||||
@@ -317,4 +316,57 @@ class FullApkUpdateDialog extends StatelessWidget {
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/// 显示手动安装引导弹窗
|
||||
void _showManualInstallGuide(BuildContext context) {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (ctx) => AlertDialog(
|
||||
title: const Text('🔔 重要提示'),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'请在浏览器中完成以下操作:',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
const Text('✅ 等待 APK 下载完成'),
|
||||
const SizedBox(height: 8),
|
||||
const Text('✅ 点击 APK 文件进行安装'),
|
||||
const SizedBox(height: 8),
|
||||
const Text('✅ 安装完成后,卸载当前旧版本'),
|
||||
const SizedBox(height: 8),
|
||||
const Text('✅ 重新打开新版本 APP'),
|
||||
const SizedBox(height: 12),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red.shade50,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(color: Colors.red.shade200),
|
||||
),
|
||||
child: const Text(
|
||||
'⚠️ 注意:必须先卸载旧版本,否则无法正常使用新功能!',
|
||||
style: TextStyle(color: Colors.red, fontSize: 12),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
child: const Text('我知道了'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user