hyzp_ybqx-Commit080:解决以下两个问题:

1、对长度小于等于2的区县名称(“高县”、“珙县”等)不进行去尾操作
2、在线升级测试OK。使用app_installer: 0.5.0插件,准备解决Android11允许“安装未知来源”后应用重启的问题,https://pub.dev/packages/app_installer。
This commit is contained in:
WinUser01
2022-01-14 00:22:11 +08:00
parent e33f2da4c8
commit 87a1ed5926
5 changed files with 28 additions and 42 deletions
+13 -2
View File
@@ -6,12 +6,13 @@ import 'dart:io';
import 'dart:isolate';
import 'dart:ui';
import 'package:app_installer/app_installer.dart';
import 'package:flutter/material.dart';
import 'package:flutter_downloader/flutter_downloader.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:hyzp_ybqx/components/dioFun.dart';
import 'package:open_file/open_file.dart';
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:progress_dialog/progress_dialog.dart';
import '../../../components/commonFun.dart';
@@ -314,7 +315,17 @@ class MyUpdatedNew {
/// 安装apk
Future<Null> _installApk() async {
await OpenFile.open(appPath + '/' + apkName);
// await OpenFile.open(appPath + '/' + apkName);
// app_installer: 0.5.0 # Flutter 2.1,修复 Android 11 上允许权限后应用重启的问题,https://pub.dev/packages/app_installer
Map<Permission, PermissionStatus> permissionStatuses = await [
Permission.storage,
].request();
if (permissionStatuses[Permission.storage] == PermissionStatus.granted) {
await AppInstaller.installApk(appPath + '/' + apkName);
} else {
print('Permission request fail!');
}
}
/// 获取apk存储位置
-39
View File
@@ -606,45 +606,6 @@ Future getAllSumNew() async {
]
*/
// 实现多个基于 Page1_Works 构建的页面共享统计数据
Future startGetStatisDataOld() async {
///获取点位信息数据
//listDwinfoGetList2.clear();
if (listDwinfoGetList2.isEmpty) {
//若没有读取点位数据,便需要先读取
getThePageList(theHyshlx: 'dwxx').then((value) {
listDwinfoGetList2 = value;
print('listDwinfoGetList2 = \n$listDwinfoGetList2');
dwSum = listDwinfoGetList2.length;
getZptjStatisAlone();
getTodayShtj();
getClltjStatisAlone();
});
} else {
if (mapStatisInfo['今日抓拍'] < 0) {
getZptjStatisAlone();
} else {
//发送统计数据已更新广播
eventBus.fire(StatisDataUpdate('统计数据已更新'));
}
if (mapStatisInfo['今日初审'] < 0) {
getTodayShtj();
} else {
//发送统计数据已更新广播
eventBus.fire(StatisDataUpdate('统计数据已更新'));
}
if (mapStatisInfo['今日车流'] < 0) {
getClltjStatisAlone();
} else {
//发送统计数据已更新广播
eventBus.fire(StatisDataUpdate('统计数据已更新'));
}
}
}
//获取已审核黑烟车统计数据:App.Car_Statis.GetStaHyc
//{
// "ret": 200,