Merge branch 'develop_liyi' into canary_release
This commit is contained in:
commit
80e2b62724
@ -173,9 +173,9 @@
|
|||||||
"接收人信息": "收件人",
|
"接收人信息": "收件人",
|
||||||
"转移网关": "傳輸網關",
|
"转移网关": "傳輸網關",
|
||||||
"锁屏": "屏幕鎖定",
|
"锁屏": "屏幕鎖定",
|
||||||
"已关闭": "關閉",
|
"已关闭": "已關閉",
|
||||||
"已开启": "上",
|
"已开启": "已開啟",
|
||||||
"开启": "開",
|
"开启": "開啟",
|
||||||
"确定要开启重置键?": "繼續啟用Reset掣?",
|
"确定要开启重置键?": "繼續啟用Reset掣?",
|
||||||
"确定要关闭重置键?": "繼續禁用Reset掣?",
|
"确定要关闭重置键?": "繼續禁用Reset掣?",
|
||||||
"隐藏无效开锁权限": "隱藏無效訪問權限",
|
"隐藏无效开锁权限": "隱藏無效訪問權限",
|
||||||
|
|||||||
@ -172,9 +172,9 @@
|
|||||||
"接收人信息": "收件人",
|
"接收人信息": "收件人",
|
||||||
"转移网关": "傳輸網關",
|
"转移网关": "傳輸網關",
|
||||||
"锁屏": "屏幕鎖定",
|
"锁屏": "屏幕鎖定",
|
||||||
"已关闭": "關",
|
"已关闭": "已關閉",
|
||||||
"已开启": "開啟",
|
"已开启": "已開啟",
|
||||||
"开启": "打開",
|
"开启": "開啟",
|
||||||
"确定要开启重置键?": "是否繼續啟用重置按鈕?",
|
"确定要开启重置键?": "是否繼續啟用重置按鈕?",
|
||||||
"确定要关闭重置键?": "是否繼續禁用重置按鈕?",
|
"确定要关闭重置键?": "是否繼續禁用重置按鈕?",
|
||||||
"隐藏无效开锁权限": "隱藏無效訪問",
|
"隐藏无效开锁权限": "隱藏無效訪問",
|
||||||
|
|||||||
@ -140,11 +140,11 @@ class F {
|
|||||||
case Flavor.dev:
|
case Flavor.dev:
|
||||||
case Flavor.xhj_dev:
|
case Flavor.xhj_dev:
|
||||||
case Flavor.sky_dev:
|
case Flavor.sky_dev:
|
||||||
return 'https://dev.lock.star-lock.cn';
|
return 'https://lock.dev.star-lock.cn';
|
||||||
case Flavor.pre:
|
case Flavor.pre:
|
||||||
case Flavor.xhj_pre:
|
case Flavor.xhj_pre:
|
||||||
case Flavor.sky_pre:
|
case Flavor.sky_pre:
|
||||||
return 'https://pre.lock.star-lock.cn';
|
return 'https://lock.pre.star-lock.cn';
|
||||||
case Flavor.sky:
|
case Flavor.sky:
|
||||||
return 'https://lock.skychip.top';
|
return 'https://lock.skychip.top';
|
||||||
case Flavor.xhj:
|
case Flavor.xhj:
|
||||||
|
|||||||
@ -1,18 +1,17 @@
|
|||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/apm/apm_helper.dart';
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
import 'package:jverify/jverify.dart';
|
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
import 'package:star_lock/blue/blue_manage.dart';
|
import 'package:star_lock/blue/blue_manage.dart';
|
||||||
|
import 'package:star_lock/blue/io_tool/manager_event_bus.dart';
|
||||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/mine/mine/starLockMine_state.dart';
|
import 'package:star_lock/mine/mine/starLockMine_state.dart';
|
||||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
||||||
import 'package:star_lock/network/start_chart_api.dart';
|
import 'package:star_lock/network/start_chart_api.dart';
|
||||||
import 'package:star_lock/talk/starChart/entity/star_chart_register_node_entity.dart';
|
import 'package:star_lock/talk/starChart/entity/star_chart_register_node_entity.dart';
|
||||||
|
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
import '../../main/lockMian/lockMain/lockMain_logic.dart';
|
import '../../main/lockMian/lockMain/lockMain_logic.dart';
|
||||||
@ -143,7 +142,7 @@ class StarLockLoginLogic extends BaseGetXController {
|
|||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
if (state.countryName != entity.data!.name) {
|
if (state.countryName != entity.data!.name) {
|
||||||
ShowTipView().showSureAlertDialog(
|
ShowTipView().showSureAlertDialog(
|
||||||
'国家地区的选择将影响数据安全,你当前选择的是'+state.countryName+'请确认后再继续'.tr,
|
'国家地区的选择将影响数据安全,你当前选择的是' + state.countryName + '请确认后再继续'.tr,
|
||||||
tipTitle: '确认国家或地区'.tr,
|
tipTitle: '确认国家或地区'.tr,
|
||||||
sureStr: '我知道了'.tr);
|
sureStr: '我知道了'.tr);
|
||||||
}
|
}
|
||||||
@ -175,11 +174,22 @@ class StarLockLoginLogic extends BaseGetXController {
|
|||||||
state.canNext.value = state.pwdIsOK && state.isEmailOrPhone;
|
state.canNext.value = state.pwdIsOK && state.isEmailOrPhone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _initEventListen() {
|
||||||
|
eventBus
|
||||||
|
.on<AgreePrivacyAgreement>()
|
||||||
|
.listen((AgreePrivacyAgreement event) async {
|
||||||
|
await JverifyOneClickLoginManage();
|
||||||
|
oneClickLoginAction();
|
||||||
|
state.isCheckVerifyEnable.value =
|
||||||
|
await JverifyOneClickLoginManage().checkVerifyEnable();
|
||||||
|
AppLog.log('一键登录初始化认证结果:${state.isCheckVerifyEnable.value}');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> onInit() async {
|
Future<void> onInit() async {
|
||||||
|
_initEventListen();
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import 'package:star_lock/talk/starChart/handle/impl/debug_Info_model.dart';
|
|||||||
import 'package:star_lock/talk/starChart/status/appLifecycle_observer.dart';
|
import 'package:star_lock/talk/starChart/status/appLifecycle_observer.dart';
|
||||||
import 'package:star_lock/tools/bugly/bugly_tool.dart';
|
import 'package:star_lock/tools/bugly/bugly_tool.dart';
|
||||||
import 'package:star_lock/tools/device_info_service.dart';
|
import 'package:star_lock/tools/device_info_service.dart';
|
||||||
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
import 'package:star_lock/tools/jverify_one_click_login.dart';
|
import 'package:star_lock/tools/jverify_one_click_login.dart';
|
||||||
import 'package:star_lock/tools/platform_info_services.dart';
|
import 'package:star_lock/tools/platform_info_services.dart';
|
||||||
import 'package:star_lock/tools/push/notification_service.dart';
|
import 'package:star_lock/tools/push/notification_service.dart';
|
||||||
@ -104,8 +105,9 @@ Future<void> privacySDKInitialization() async {
|
|||||||
|
|
||||||
// 初始化一键登录服务
|
// 初始化一键登录服务
|
||||||
final StarLockLoginLogic loginLogic = Get.put(StarLockLoginLogic());
|
final StarLockLoginLogic loginLogic = Get.put(StarLockLoginLogic());
|
||||||
JverifyOneClickLoginManage();
|
await JverifyOneClickLoginManage();
|
||||||
loginLogic.oneClickLoginAction();
|
loginLogic.oneClickLoginAction();
|
||||||
loginLogic.state.isCheckVerifyEnable.value =
|
loginLogic.state.isCheckVerifyEnable.value =
|
||||||
await JverifyOneClickLoginManage().checkVerifyEnable();
|
await JverifyOneClickLoginManage().checkVerifyEnable();
|
||||||
|
eventBus.fire(AgreePrivacyAgreement());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ class FaceListLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
|
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription =
|
_replySubscription =
|
||||||
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
|
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
|
||||||
@ -77,11 +78,15 @@ class FaceListLogic extends BaseGetXController {
|
|||||||
userID: (await Storage.getUid())!,
|
userID: (await Storage.getUid())!,
|
||||||
faceNo: state.deletFaceNo,
|
faceNo: state.deletFaceNo,
|
||||||
useCountLimit: 0xffff,
|
useCountLimit: 0xffff,
|
||||||
operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部
|
operate: state.isDeletAll == true ? 3 : 2,
|
||||||
|
// 0:注册 1:修改 2:删除 3:删除全部
|
||||||
isAdmin: 0,
|
isAdmin: 0,
|
||||||
isForce: 0, // 是否是胁迫
|
isForce: 0,
|
||||||
isRound: 0, // 是否是循环
|
// 是否是胁迫
|
||||||
weekRound: 0, // 周循环
|
isRound: 0,
|
||||||
|
// 是否是循环
|
||||||
|
weekRound: 0,
|
||||||
|
// 周循环
|
||||||
startDate: 0x11223344,
|
startDate: 0x11223344,
|
||||||
endDate: 0x11223344,
|
endDate: 0x11223344,
|
||||||
startTime: '0',
|
startTime: '0',
|
||||||
@ -277,11 +282,15 @@ class FaceListLogic extends BaseGetXController {
|
|||||||
userID: (await Storage.getUid())!,
|
userID: (await Storage.getUid())!,
|
||||||
faceNo: state.deletFaceNo,
|
faceNo: state.deletFaceNo,
|
||||||
useCountLimit: 0xffff,
|
useCountLimit: 0xffff,
|
||||||
operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部
|
operate: state.isDeletAll == true ? 3 : 2,
|
||||||
|
// 0:注册 1:修改 2:删除 3:删除全部
|
||||||
isAdmin: 0,
|
isAdmin: 0,
|
||||||
isForce: 0, // 是否是胁迫
|
isForce: 0,
|
||||||
isRound: 0, // 是否是循环
|
// 是否是胁迫
|
||||||
weekRound: 0, // 周循环
|
isRound: 0,
|
||||||
|
// 是否是循环
|
||||||
|
weekRound: 0,
|
||||||
|
// 周循环
|
||||||
startDate: 0x11223344,
|
startDate: 0x11223344,
|
||||||
endDate: 0x11223344,
|
endDate: 0x11223344,
|
||||||
startTime: '0',
|
startTime: '0',
|
||||||
@ -348,8 +357,8 @@ class FaceListLogic extends BaseGetXController {
|
|||||||
lockId: state.lockId.value,
|
lockId: state.lockId.value,
|
||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast('删除成功'.tr, something: () {
|
showToast('删除成功'.tr, something: () async {
|
||||||
getFaceListData(isRefresh: true);
|
await getFaceListData(isRefresh: true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -366,8 +375,8 @@ class FaceListLogic extends BaseGetXController {
|
|||||||
lockId: state.lockId.value,
|
lockId: state.lockId.value,
|
||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast('重置成功'.tr, something: () {
|
showToast('重置成功'.tr, something: () async{
|
||||||
getFaceListData(isRefresh: true);
|
await getFaceListData(isRefresh: true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -403,11 +412,12 @@ class FaceListLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 监听修改完详情之后刷新列表
|
// 监听修改完详情之后刷新列表
|
||||||
late StreamSubscription _teamEvent;
|
late StreamSubscription _teamEvent;
|
||||||
|
|
||||||
void _initRefreshAction() {
|
void _initRefreshAction() {
|
||||||
_teamEvent = eventBus
|
_teamEvent = eventBus
|
||||||
.on<OtherTypeRefreshListEvent>()
|
.on<OtherTypeRefreshListEvent>()
|
||||||
.listen((OtherTypeRefreshListEvent event) {
|
.listen((OtherTypeRefreshListEvent event) async {
|
||||||
getFaceListData(isRefresh: true);
|
await getFaceListData(isRefresh: true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -434,6 +444,7 @@ class FaceListLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// senderCheckingUserInfoCount();
|
// senderCheckingUserInfoCount();
|
||||||
}
|
}
|
||||||
|
getFaceListData(isRefresh: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -31,24 +30,6 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
final FaceListLogic logic = Get.put(FaceListLogic());
|
final FaceListLogic logic = Get.put(FaceListLogic());
|
||||||
final FaceListState state = Get.find<FaceListLogic>().state;
|
final FaceListState state = Get.find<FaceListLogic>().state;
|
||||||
|
|
||||||
Future<void> getHttpData({required bool isRefresh}) async {
|
|
||||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
|
||||||
if (isDemoMode == false) {
|
|
||||||
logic.getFaceListData(isRefresh: isRefresh).then((FingerprintListDataEntity value) {
|
|
||||||
if (mounted) {
|
|
||||||
setState(() {});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
|
|
||||||
getHttpData(isRefresh: true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -92,17 +73,17 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
),
|
),
|
||||||
body: EasyRefreshTool(
|
body: EasyRefreshTool(
|
||||||
onRefresh: () {
|
onRefresh: () {
|
||||||
getHttpData(isRefresh: true);
|
logic.getFaceListData(isRefresh: true);
|
||||||
},
|
},
|
||||||
onLoad: () {
|
onLoad: () {
|
||||||
getHttpData(isRefresh: false);
|
logic.getFaceListData(isRefresh: false);
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
KeySearchWidget(
|
KeySearchWidget(
|
||||||
editingController: state.searchController,
|
editingController: state.searchController,
|
||||||
onSubmittedAction: () {
|
onSubmittedAction: () {
|
||||||
getHttpData(isRefresh: true);
|
logic.getFaceListData(isRefresh: true);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -110,14 +91,15 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
),
|
),
|
||||||
Expanded(child: _buildMainUI()),
|
Expanded(child: _buildMainUI()),
|
||||||
AddBottomWhiteBtn(
|
AddBottomWhiteBtn(
|
||||||
btnName:
|
btnName: '添加人脸'.tr,
|
||||||
'添加人脸'.tr,
|
|
||||||
onClick: () async {
|
onClick: () async {
|
||||||
await Get.toNamed(Routers.addFaceTypePage, arguments: <String, int>{
|
await Get.toNamed(Routers.addFaceTypePage,
|
||||||
|
arguments: <String, int>{
|
||||||
'lockId': state.lockId.value,
|
'lockId': state.lockId.value,
|
||||||
'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||||
})!.then((value) {
|
})!
|
||||||
getHttpData(isRefresh: true);
|
.then((value) {
|
||||||
|
logic.getFaceListData(isRefresh: true);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -154,9 +136,11 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
|||||||
logic.getKeyType(getFaceItemData),
|
logic.getKeyType(getFaceItemData),
|
||||||
logic.getKeyDateType(getFaceItemData), () async {
|
logic.getKeyDateType(getFaceItemData), () async {
|
||||||
await Get.toNamed(Routers.faceDetailPage,
|
await Get.toNamed(Routers.faceDetailPage,
|
||||||
arguments: <String, FingerprintItemData>{
|
arguments: <String, FingerprintItemData>{
|
||||||
'faceItemData': getFaceItemData,
|
'faceItemData': getFaceItemData,
|
||||||
})!.then((value) => getHttpData(isRefresh: true));
|
})!
|
||||||
|
.then((value) =>
|
||||||
|
logic.getFaceListData(isRefresh: true));
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -105,6 +105,13 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
token: token,
|
token: token,
|
||||||
isBeforeAddUser: false);
|
isBeforeAddUser: false);
|
||||||
break;
|
break;
|
||||||
|
case 0xFE:
|
||||||
|
// 管理员已满
|
||||||
|
state.ifAddState.value = false;
|
||||||
|
showToast('管理员已满'.tr, something: () {
|
||||||
|
Get.back();
|
||||||
|
});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
//失败
|
//失败
|
||||||
state.ifAddState.value = false;
|
state.ifAddState.value = false;
|
||||||
|
|||||||
@ -285,7 +285,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
final List<int> publicKeyData =
|
final List<int> publicKeyData =
|
||||||
state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
|
state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
|
||||||
final List<String> saveStrList = changeIntListToStringList(publicKeyData);
|
final List<String> saveStrList = changeIntListToStringList(publicKeyData);
|
||||||
await Storage.setStringList(saveBluePublicKey, saveStrList);
|
await Storage.setStringList(saveBluePublicKey, saveStrList);
|
||||||
|
|
||||||
// 私钥
|
// 私钥
|
||||||
final List<int> privateKeyData =
|
final List<int> privateKeyData =
|
||||||
@ -298,7 +298,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
final List<int> signKeyData =
|
final List<int> signKeyData =
|
||||||
state.keyInfos.value.bluetooth!.signKey!.cast<int>();
|
state.keyInfos.value.bluetooth!.signKey!.cast<int>();
|
||||||
final List<String> saveSignKeyList = changeIntListToStringList(signKeyData);
|
final List<String> saveSignKeyList = changeIntListToStringList(signKeyData);
|
||||||
await Storage.setStringList(saveBlueSignKey, saveSignKeyList);
|
await Storage.setStringList(saveBlueSignKey, saveSignKeyList);
|
||||||
|
|
||||||
final bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken);
|
final bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken);
|
||||||
if (!ifHaveKey) {
|
if (!ifHaveKey) {
|
||||||
@ -838,5 +838,12 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
state.keyInfos.refresh();
|
state.keyInfos.refresh();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
eventBus
|
||||||
|
.on<SuccessfulDistributionNetwork>()
|
||||||
|
.listen((SuccessfulDistributionNetwork event) {
|
||||||
|
// 配网成功获取一下配网信息
|
||||||
|
requestDeviceNetworkInfo();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,7 +89,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
|
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
|
||||||
state.isOpenLockNeedOnline.refresh();
|
state.isOpenLockNeedOnline.refresh();
|
||||||
|
|
||||||
logic.requestDeviceNetworkInfo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StreamSubscription? _lockRefreshLockDetailInfoDataEvent;
|
StreamSubscription? _lockRefreshLockDetailInfoDataEvent;
|
||||||
@ -1024,7 +1023,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
Widget widget = getBottomWidget()[index];
|
Widget widget = getBottomWidget()[index];
|
||||||
return widget;
|
return widget;
|
||||||
},
|
},
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
// physics: const NeverScrollableScrollPhysics(),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -62,10 +62,8 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
|||||||
peerId: peerId,
|
peerId: peerId,
|
||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
await _getUploadLockSet();
|
|
||||||
showToast('配网成功'.tr, something: () async {
|
showToast('配网成功'.tr, something: () async {
|
||||||
eventBus
|
|
||||||
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
|
||||||
// 设置锁的peerID
|
// 设置锁的peerID
|
||||||
StartChartManage().lockNetworkInfo = DeviceNetworkInfo(
|
StartChartManage().lockNetworkInfo = DeviceNetworkInfo(
|
||||||
wifiName: wifiName,
|
wifiName: wifiName,
|
||||||
@ -74,6 +72,7 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
|||||||
peerId: peerId,
|
peerId: peerId,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
_getUploadLockSet();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +134,7 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
|||||||
// 保存到缓存
|
// 保存到缓存
|
||||||
await Storage.saveLockNetWorkInfo(jsonMap);
|
await Storage.saveLockNetWorkInfo(jsonMap);
|
||||||
// 上报服务器
|
// 上报服务器
|
||||||
updateNetworkInfo(
|
updateNetworkInfo(
|
||||||
peerId: peerId ?? '',
|
peerId: peerId ?? '',
|
||||||
wifiName: wifiName ?? '',
|
wifiName: wifiName ?? '',
|
||||||
secretKey: secretKey ?? '',
|
secretKey: secretKey ?? '',
|
||||||
@ -231,6 +230,13 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
|||||||
password: state.wifiPWDController.text,
|
password: state.wifiPWDController.text,
|
||||||
gatewayConfigurationStr: state.getGatewayConfigurationStr,
|
gatewayConfigurationStr: state.getGatewayConfigurationStr,
|
||||||
);
|
);
|
||||||
|
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
||||||
|
dismissEasyLoading();
|
||||||
|
cancelBlueConnetctToastTimer();
|
||||||
|
state.sureBtnState.value = 0;
|
||||||
|
if (state.ifCurrentScreen.value == true) {
|
||||||
|
showBlueConnetctToast();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isAddEquipment: true,
|
isAddEquipment: true,
|
||||||
@ -391,10 +397,10 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 上传数据获取设置
|
// 上传数据获取设置
|
||||||
Future<void> _getUploadLockSet() async {
|
Future<void> _getUploadLockSet() async {
|
||||||
showEasyLoading();
|
// showEasyLoading();
|
||||||
showBlueConnetctToastTimer(action: () {
|
// showBlueConnetctToastTimer(action: () {
|
||||||
dismissEasyLoading();
|
// dismissEasyLoading();
|
||||||
});
|
// });
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
(BluetoothConnectionState connectionState) async {
|
(BluetoothConnectionState connectionState) async {
|
||||||
if (connectionState == BluetoothConnectionState.connected) {
|
if (connectionState == BluetoothConnectionState.connected) {
|
||||||
@ -476,6 +482,10 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
|||||||
Get.offAllNamed(Routers.starLockMain);
|
Get.offAllNamed(Routers.starLockMain);
|
||||||
}
|
}
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
|
eventBus
|
||||||
|
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||||
|
eventBus
|
||||||
|
.fire(SuccessfulDistributionNetwork());
|
||||||
if (state.loadingTimer != null) {
|
if (state.loadingTimer != null) {
|
||||||
state.loadingTimer!.cancel();
|
state.loadingTimer!.cancel();
|
||||||
state.loadingTimer = null;
|
state.loadingTimer = null;
|
||||||
@ -493,6 +503,5 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
|||||||
state.loadingTimer!.cancel();
|
state.loadingTimer!.cancel();
|
||||||
state.loadingTimer = null;
|
state.loadingTimer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -456,10 +456,10 @@ class _MineSetPageState extends State<MineSetPage>
|
|||||||
// showLoginOutAlertTipDialog();
|
// showLoginOutAlertTipDialog();
|
||||||
}),
|
}),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(right: 30.w, top: 30.h),
|
padding: EdgeInsets.only(left: 30.w, top: 30.h),
|
||||||
// color: Colors.red,
|
// color: Colors.red,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
TextButton(
|
TextButton(
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|||||||
@ -25,8 +25,24 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
|
|||||||
RxString currentLanguage =
|
RxString currentLanguage =
|
||||||
CurrentLocaleTool.getCurrentLocaleString().obs; // 当前选择语言
|
CurrentLocaleTool.getCurrentLocaleString().obs; // 当前选择语言
|
||||||
|
|
||||||
|
// 添加上次处理请求的时间戳
|
||||||
|
int _lastRequestTime = 0;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void handleReq(ScpMessage scpMessage) async {
|
void handleReq(ScpMessage scpMessage) async {
|
||||||
|
|
||||||
|
final currentTime = DateTime.now().millisecondsSinceEpoch;
|
||||||
|
// 确保与上次请求间隔至少1秒
|
||||||
|
if (currentTime - _lastRequestTime < 1000) {
|
||||||
|
// 如果间隔小于1秒,直接拒绝请求
|
||||||
|
replyErrorMessage(scpMessage);
|
||||||
|
AppLog.log('对讲请求过于频繁,已拒绝');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新最后处理时间
|
||||||
|
_lastRequestTime = currentTime;
|
||||||
|
|
||||||
// 判断是否登录账户
|
// 判断是否登录账户
|
||||||
final loginData = await Storage.getLoginData();
|
final loginData = await Storage.getLoginData();
|
||||||
|
|
||||||
@ -47,6 +63,7 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle
|
|||||||
} else {
|
} else {
|
||||||
// 拒绝接听,回复失败
|
// 拒绝接听,回复失败
|
||||||
replyErrorMessage(scpMessage);
|
replyErrorMessage(scpMessage);
|
||||||
|
AppLog.log('正在接听,回复拒绝');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,17 +28,16 @@ class AppLifecycleObserver extends WidgetsBindingObserver {
|
|||||||
|
|
||||||
void onAppPaused() {
|
void onAppPaused() {
|
||||||
// 处理应用程序进入后台的逻辑
|
// 处理应用程序进入后台的逻辑
|
||||||
print('App has entered the background.');
|
|
||||||
if (StartChartManage().talkStatus.status ==
|
final status = StartChartManage().talkStatus.status;
|
||||||
TalkStatus.passiveCallWaitingAnswer ||
|
|
||||||
StartChartManage().talkStatus.status ==
|
if (status == TalkStatus.passiveCallWaitingAnswer ||
|
||||||
TalkStatus.proactivelyCallWaitingAnswer) {
|
status == TalkStatus.proactivelyCallWaitingAnswer ||
|
||||||
StartChartManage().startTalkHangupMessageTimer();
|
status == TalkStatus.answeredSuccessfully ||
|
||||||
StartChartManage().startTalkRejectMessageTimer();
|
status == TalkStatus.uninitialized) {
|
||||||
// 如果是等待接听时就退出页面
|
StartChartManage().destruction();
|
||||||
Get.back();
|
Get.back();
|
||||||
}
|
}
|
||||||
StartChartManage().destruction();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void onAppResumed() async {
|
void onAppResumed() async {
|
||||||
|
|||||||
@ -56,6 +56,9 @@ class TalkViewLogic extends BaseGetXController {
|
|||||||
|
|
||||||
final Map<String, ui.Image> _imageCache = {};
|
final Map<String, ui.Image> _imageCache = {};
|
||||||
|
|
||||||
|
// 添加一个变量用于记录上一帧的时间戳
|
||||||
|
int _lastFrameTimestamp = 0; // 初始值为 0
|
||||||
|
|
||||||
// 添加帧率计算相关变量
|
// 添加帧率计算相关变量
|
||||||
int _frameCount = 0;
|
int _frameCount = 0;
|
||||||
int _lastFpsUpdateTime = 0;
|
int _lastFpsUpdateTime = 0;
|
||||||
@ -100,11 +103,11 @@ class TalkViewLogic extends BaseGetXController {
|
|||||||
// 判断数据类型,进行分发处理
|
// 判断数据类型,进行分发处理
|
||||||
switch (contentType) {
|
switch (contentType) {
|
||||||
case TalkData_ContentTypeE.G711:
|
case TalkData_ContentTypeE.G711:
|
||||||
// 第一帧到达时记录开始时间
|
// // 第一帧到达时记录开始时间
|
||||||
if (_isFirstAudioFrame) {
|
// if (_isFirstAudioFrame) {
|
||||||
_startAudioTime = currentTime;
|
// _startAudioTime = currentTime;
|
||||||
_isFirstAudioFrame = false;
|
// _isFirstAudioFrame = false;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 计算音频延迟
|
// 计算音频延迟
|
||||||
final expectedTime = _startAudioTime + talkData.durationMs;
|
final expectedTime = _startAudioTime + talkData.durationMs;
|
||||||
@ -130,15 +133,16 @@ class TalkViewLogic extends BaseGetXController {
|
|||||||
if (_isFirstFrame) {
|
if (_isFirstFrame) {
|
||||||
_startTime = currentTime;
|
_startTime = currentTime;
|
||||||
_isFirstFrame = false;
|
_isFirstFrame = false;
|
||||||
// AppLog.log('记录第一帧的时间戳${currentTime},${talkData.durationMs}');
|
AppLog.log('第一帧帧的时间戳:${talkData.durationMs}');
|
||||||
}
|
}
|
||||||
|
// AppLog.log('其他帧的时间戳:${talkData.durationMs}');
|
||||||
|
// 计算帧间间隔
|
||||||
|
if (_lastFrameTimestamp != 0) {
|
||||||
|
final int frameInterval = talkData.durationMs - _lastFrameTimestamp;
|
||||||
|
_adjustBufferSize(frameInterval); // 根据帧间间隔调整缓冲区
|
||||||
|
}
|
||||||
|
_lastFrameTimestamp = talkData.durationMs; // 更新上一帧时间戳
|
||||||
|
|
||||||
// 计算实际延迟:当前时间 - 预期播放时间
|
|
||||||
final expectedTime = _startTime + talkData.durationMs;
|
|
||||||
final videoDelay = currentTime - expectedTime; // 修改延迟计算方式
|
|
||||||
|
|
||||||
// 动态调整缓冲区
|
|
||||||
_adjustBufferSize(videoDelay);
|
|
||||||
// 然后添加到播放缓冲区
|
// 然后添加到播放缓冲区
|
||||||
if (state.videoBuffer.length >= bufferSize) {
|
if (state.videoBuffer.length >= bufferSize) {
|
||||||
state.videoBuffer.removeAt(0);
|
state.videoBuffer.removeAt(0);
|
||||||
@ -257,19 +261,21 @@ class TalkViewLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 新增:动态调整缓冲区大小的方法
|
// 新增:动态调整缓冲区大小的方法
|
||||||
void _adjustBufferSize(int delay) {
|
void _adjustBufferSize(int frameInterval) {
|
||||||
const int delayThresholdHigh = 250; // 高延迟阈值(约3帧的时间)
|
const int frameDuration = 83; // 假设每帧的时间间隔为 83ms(12fps)
|
||||||
const int delayThresholdLow = 166; // 低延迟阈值(约2帧的时间)
|
const int delayThresholdHigh = frameDuration * 2; // 高延迟阈值(2帧时间)
|
||||||
|
const int delayThresholdLow = frameDuration; // 低延迟阈值(1帧时间)
|
||||||
const int adjustInterval = 1; // 每次调整1帧
|
const int adjustInterval = 1; // 每次调整1帧
|
||||||
|
|
||||||
if (delay > delayThresholdHigh && bufferSize < maxBufferSize) {
|
if (frameInterval > delayThresholdHigh && bufferSize < maxBufferSize) {
|
||||||
// 延迟较大,增加缓冲区
|
// 帧间间隔较大,增加缓冲区
|
||||||
bufferSize = min(bufferSize + adjustInterval, maxBufferSize);
|
bufferSize = min(bufferSize + adjustInterval, maxBufferSize);
|
||||||
// AppLog.log('📈 增加缓冲区 - 当前大小: $bufferSize, 延迟: ${delay}ms');
|
AppLog.log('📈 增加缓冲区 - 当前大小: $bufferSize, 帧间间隔: ${frameInterval}ms');
|
||||||
} else if (delay < delayThresholdLow && bufferSize > minBufferSize) {
|
} else if (frameInterval < delayThresholdLow &&
|
||||||
// 延迟较小,减少缓冲区
|
bufferSize > minBufferSize) {
|
||||||
|
// 帧间间隔较小,减少缓冲区
|
||||||
bufferSize = max(bufferSize - adjustInterval, minBufferSize);
|
bufferSize = max(bufferSize - adjustInterval, minBufferSize);
|
||||||
// AppLog.log('📉 减少缓冲区 - 当前大小: $bufferSize, 延迟: ${delay}ms');
|
AppLog.log('📉 减少缓冲区 - 当前大小: $bufferSize, 帧间间隔: ${frameInterval}ms');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -195,3 +195,12 @@ class RogerThatLockInfoDataEvent {
|
|||||||
class GetGatewayListRefreshUI {
|
class GetGatewayListRefreshUI {
|
||||||
GetGatewayListRefreshUI();
|
GetGatewayListRefreshUI();
|
||||||
}
|
}
|
||||||
|
/// 同意隐私协议
|
||||||
|
class AgreePrivacyAgreement {
|
||||||
|
AgreePrivacyAgreement();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 配网成功
|
||||||
|
class SuccessfulDistributionNetwork {
|
||||||
|
SuccessfulDistributionNetwork();
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user