hyzp_ybqx-Commit080:解决以下两个问题:
1、对长度小于等于2的区县名称(“高县”、“珙县”等)不进行去尾操作 2、在线升级测试OK。使用app_installer: 0.5.0插件,准备解决Android11允许“安装未知来源”后应用重启的问题,https://pub.dev/packages/app_installer。
This commit is contained in:
@@ -115,7 +115,11 @@ class UserInfo {
|
|||||||
|
|
||||||
// 去除末尾的区县
|
// 去除末尾的区县
|
||||||
String trim_county(String _name) {
|
String trim_county(String _name) {
|
||||||
return _name.substring(0, _name.length - 1);
|
// 对长度小于等于2的区县名称(“高县”、“珙县”等)不进行去尾操作
|
||||||
|
if (_name.length > 2) {
|
||||||
|
_name = _name.substring(0, _name.length - 1);
|
||||||
|
}
|
||||||
|
return _name;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map mapUserInfoRet = {
|
Map mapUserInfoRet = {
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ import 'dart:io';
|
|||||||
import 'dart:isolate';
|
import 'dart:isolate';
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'package:app_installer/app_installer.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_downloader/flutter_downloader.dart';
|
import 'package:flutter_downloader/flutter_downloader.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:hyzp_ybqx/components/dioFun.dart';
|
import 'package:hyzp_ybqx/components/dioFun.dart';
|
||||||
import 'package:open_file/open_file.dart';
|
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
import 'package:progress_dialog/progress_dialog.dart';
|
import 'package:progress_dialog/progress_dialog.dart';
|
||||||
|
|
||||||
import '../../../components/commonFun.dart';
|
import '../../../components/commonFun.dart';
|
||||||
@@ -314,7 +315,17 @@ class MyUpdatedNew {
|
|||||||
|
|
||||||
/// 安装apk
|
/// 安装apk
|
||||||
Future<Null> _installApk() async {
|
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存储位置
|
/// 获取apk存储位置
|
||||||
|
|||||||
@@ -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
|
//获取已审核黑烟车统计数据:App.Car_Statis.GetStaHyc
|
||||||
//{
|
//{
|
||||||
// "ret": 200,
|
// "ret": 200,
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
# Generated by pub
|
# Generated by pub
|
||||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||||
packages:
|
packages:
|
||||||
|
app_installer:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: app_installer
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "0.5.0"
|
||||||
archive:
|
archive:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -153,6 +153,9 @@ dependencies:
|
|||||||
flutter_downloader: ^1.5.2 # 下载文件
|
flutter_downloader: ^1.5.2 # 下载文件
|
||||||
package_info: ^0.4.3+2 # 检测版本号
|
package_info: ^0.4.3+2 # 检测版本号
|
||||||
progress_dialog: ^1.2.0 # 显示进度对话框
|
progress_dialog: ^1.2.0 # 显示进度对话框
|
||||||
|
# app_installer: ^1.1.0 # Flutter 2.12,修复 Android 11 上允许权限后应用重启的问题
|
||||||
|
app_installer: ^0.5.0 # Flutter 2.1,修复 Android 11 上允许权限后应用重启的问题,https://pub.dev/packages/app_installer
|
||||||
|
# install_plugin: ^2.0.1 # 不行,https://pub.dev/packages/install_plugin
|
||||||
|
|
||||||
#flutter_app_badger and flutter_app_icon_badge Not working on android devices of Samsung Galaxy S7 and Samsung Galaxy S10
|
#flutter_app_badger and flutter_app_icon_badge Not working on android devices of Samsung Galaxy S7 and Samsung Galaxy S10
|
||||||
#flutter_app_badger: ^1.1.2 # 桌面App图标红点
|
#flutter_app_badger: ^1.1.2 # 桌面App图标红点
|
||||||
|
|||||||
Reference in New Issue
Block a user