From 6eeb2e9fe3c911640d46e3fb4f0e8b23e9c485d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Sat, 19 Oct 2024 09:38:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BD=E9=99=85=E5=8C=96bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lan/lan_en.json | 32 ++-- lan/lan_keys.json | 6 +- lan/lan_zh.json | 6 +- .../io_protocol/io_addStressPassword.dart | 7 +- .../io_readSupportFunctionsNoParameters.dart | 5 +- .../authorizedAdminList_page.dart | 41 +++-- .../electronicKeyList_page.dart | 71 ++++----- .../massSendLockGroupCell.dart | 28 ++-- lib/main/lockMian/lockMain/lockMain_page.dart | 3 +- .../addAuthorizedAdministrator_logic.dart | 3 +- .../addAuthorizedAdministrator_page.dart | 9 -- .../addAuthorizedAdministrator_state.dart | 2 +- .../administratorDetails_logic.dart | 6 +- .../authorizedAdministratorList_page.dart | 30 ++-- .../groupEditLock/groupEditLock_logic.dart | 2 +- .../lockGroupList/lockGroupList_page.dart | 147 ++++++++++-------- lib/tools/ExpandedListView.dart | 18 ++- .../pickers/time_picker/model/pduration.dart | 2 +- .../time_picker/route/date_picker_route.dart | 28 ++-- lib/tools/showCupertinoAlertView.dart | 18 ++- ...eleteAdministratorIsHaveAllDataWidget.dart | 5 +- lib/versionUndate/versionUndateTool.dart | 8 +- lib/versionUndate/versionUndate_entity.dart | 17 +- lib/widget/flavors_img.dart | 10 +- pubspec.yaml | 3 +- 25 files changed, 257 insertions(+), 250 deletions(-) diff --git a/lan/lan_en.json b/lan/lan_en.json index d0b73a9c..3f2b932f 100644 --- a/lan/lan_en.json +++ b/lan/lan_en.json @@ -41,7 +41,7 @@ "周六": "Sat", "周日": "Sun", "群发钥匙": "Send multiple ekeys", - "锁": "Lock", + "锁": "Locks", "请添加": "Recipient", "允许远程开锁": "Remote Unlock", "请输入验证码": "Verification Code", @@ -324,7 +324,7 @@ "电机功率设置": "MotorPower Setting", "开锁时是否需联网": "If Internet Is Required When Unlocking", "选择要加入分组的锁": "Select lockS to add to this group", - "锁数量": "Lock Count", + "锁数量": "Lock amount", "小米IOT平台": "Xiaomi IOT Platform", "面容开锁设置": "Face Unlocks Set", "感应距离": "Sensing distance", @@ -346,8 +346,8 @@ "录像时段": "Video slot", "密码": "Passcodes", "卡": "Cards", - "指纹": "Fingerprint", - "人脸": "Face", + "指纹": "Fingerprints", + "人脸": "Faces", "配件商城": "Lock Mall", "公司名称": "Company Name", "请输入公司名字": "Enter Company Name", @@ -394,8 +394,8 @@ "重置成功": "Reset success", "确定要退出吗?": "Exit?", "功能暂未开放": "Function is not yet open", - "设置成功": "Set up successfully", - "删除成功": "Delete successfully", + "设置成功": "Set up successful", + "删除成功": "Delete successful", "单次": "One-time", "永久": "Permanent", "限时": "Timed", @@ -410,17 +410,17 @@ "已过期": "Invalid", "该锁的电子钥匙都将被删除": "All eKeys for this Lock will be DELETED", "同时删除其发送的所有钥匙,钥匙删除后不能恢复": "DELETE All ekeys associated with this ekey.This Step cannot be UNDONE!", - "删除钥匙会在用户APP连网后生效": "The ekey will be DELETED", + "删除钥匙会在用户APP连网后生效": "The eKey will be DELETED when the User's APP connects to a Network", "有效时间": "Effective time", "接收者": "Recipient", "仅管理自己创建的用户": "Manage his own users only", "远程开锁": "Remote unlock", "请输入钥匙名称": "Please enter the key name", - "修改成功": "Modify success", + "修改成功": "Modify successful", "冻结": "Freeze", "解除冻结": "Thaw", "授权": "Authorize", - "取消授权": "De-Authorize", + "取消授权": "De-authorize", "同时解冻其发送的钥匙": "Thaw all ekeys issued by this user", "会在用户APP连网后生效": "This ekey will be THAWED when the User's APP connects to a Network", "同时冻结其发送的钥匙": "Freeze all ekeys issued by this user", @@ -446,7 +446,7 @@ "请选择开始时间": "Please select the start time", "选择用户": "Select recipients", "已选中": "Selected", - "确定": "OK", + "确定": "Sure", "请选择要发送的锁": "Please select locks", "人脸实名认证指的是用户在使用手机APP开锁时,需要先进行本人人脸验证,验证通过才能开锁。": "Face real-name authentication refers to the user's need to verify his face before unlocking the phone APP, and the verification can be unlocked.", "分享": "Share", @@ -482,7 +482,7 @@ "开始添加": "Start", "请将您的手指按下": "Place your Finger on the Sensor", "根据提示,抬起手指后再进行下一次指纹采集": "Follow the prompts...You will be required to Remove and Place your Finger to the Sensor for Next Record", - "添加成功": "Add success", + "添加成功": "Add successful", "更新成功": "Update success", "搜索": "Search", "重置后,该锁的卡都将被删除哦,确认要重置吗?": "After resetting, the card of the lock will be deleted, do you want to reset?", @@ -509,7 +509,7 @@ "您的钥匙已过期": "Your key has expired", "常开模式开启": "The lock is in Passage Mode", "超级管理员": "Super admin", - "授权管理员": "Authorized admin", + "授权管理员": "Make admin", "普通用户": "Ordinary user", "余": "Balance", "天": "Day", @@ -556,7 +556,7 @@ "网络摄像头": "Camera", "重命名": "Rename", "分组下的锁将被移到未分组里": "Locks under the group will be moved to ungrouped", - "编辑成功": "Edit success", + "编辑成功": "Edit successful", "厂商": "Manufacturer", "型号": "Model", "密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。": "After the password is generated, please use it once for activation before 23:59 on the same day, otherwise it will be invalid after 0 o'clock. After the password is activated, it can be used unlimited times within the validity period.", @@ -1084,5 +1084,9 @@ "丹麦语": "Danish", "重置后,该锁的掌静脉都将被删除哦,确认要重置吗?": "After reset, the metacarpal veins of the lock will be deleted. Are you sure you want to reset?", "在线": "Online", - "离线": "Offline" + "离线": "Offline", + "购买记录": "Purchase record", + "使用记录": "User Record", + + "失效时间要大于当前时间": "The expiration time must be longer than the current time" } diff --git a/lan/lan_keys.json b/lan/lan_keys.json index 94a74acb..8faee69d 100755 --- a/lan/lan_keys.json +++ b/lan/lan_keys.json @@ -1084,5 +1084,9 @@ "丹麦语": "丹麦语", "重置后,该锁的掌静脉都将被删除哦,确认要重置吗?": "重置后,该锁的掌静脉都将被删除哦,确认要重置吗?", "在线": "在线", - "离线": "离线" + "离线": "离线", + "购买记录": "购买记录", + "使用记录": "使用记录", + + "失效时间要大于当前时间": "失效时间要大于当前时间" } diff --git a/lan/lan_zh.json b/lan/lan_zh.json index c30f05bb..4c2f489d 100755 --- a/lan/lan_zh.json +++ b/lan/lan_zh.json @@ -1084,5 +1084,9 @@ "丹麦语": "丹麦语", "重置后,该锁的掌静脉都将被删除哦,确认要重置吗?": "重置后,该锁的掌静脉都将被删除哦,确认要重置吗?", "在线": "在线", - "离线": "离线" + "离线": "离线", + "购买记录": "购买记录", + "使用记录": "使用记录", + + "失效时间要大于当前时间": "失效时间要大于当前时间" } diff --git a/lib/blue/io_protocol/io_addStressPassword.dart b/lib/blue/io_protocol/io_addStressPassword.dart index 349b6566..5f6ed0f8 100755 --- a/lib/blue/io_protocol/io_addStressPassword.dart +++ b/lib/blue/io_protocol/io_addStressPassword.dart @@ -1,15 +1,14 @@ import 'dart:convert'; +import 'package:crypto/crypto.dart' as crypto; import 'package:star_lock/tools/dateTool.dart'; -import '../../app_settings/app_settings.dart'; -import '../io_tool/io_tool.dart'; -import '../sm4Encipher/sm4.dart'; import '../io_reply.dart'; import '../io_sender.dart'; +import '../io_tool/io_tool.dart'; import '../io_type.dart'; -import 'package:crypto/crypto.dart' as crypto; +import '../sm4Encipher/sm4.dart'; /// 添加胁迫密码 /* diff --git a/lib/blue/io_protocol/io_readSupportFunctionsNoParameters.dart b/lib/blue/io_protocol/io_readSupportFunctionsNoParameters.dart index d79cb100..bf50ca47 100755 --- a/lib/blue/io_protocol/io_readSupportFunctionsNoParameters.dart +++ b/lib/blue/io_protocol/io_readSupportFunctionsNoParameters.dart @@ -1,15 +1,12 @@ import 'dart:convert'; -import 'package:get/get.dart'; +import 'package:crypto/crypto.dart' as crypto; -import '../../app_settings/app_settings.dart'; import '../io_reply.dart'; import '../io_sender.dart'; import '../io_tool/io_tool.dart'; import '../io_type.dart'; -import 'package:crypto/crypto.dart' as crypto; - import '../sm4Encipher/sm4.dart'; /// 读取支持功能(不带参数)启用/禁用 diff --git a/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart b/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart index ffb8c1ad..ec5adf83 100755 --- a/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart +++ b/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart @@ -205,7 +205,7 @@ class _AuthorizedAdminListPageState extends State { padding: EdgeInsets.only(top: 20.h, bottom: 20.h), child: Row( children: [ - SizedBox(width: 30.w), + SizedBox(width: 20.w), SizedBox( width: 60.w, height: 60.w, @@ -214,36 +214,31 @@ class _AuthorizedAdminListPageState extends State { child: CustomNetworkImage( url: avatarURL, defaultUrl: 'images/controls_user.png', - width: 105.w, - height: 105.h, + width: 60.w, + height: 60.h, ), ), ), SizedBox(width: 20.w), - Expanded( + SizedBox( + width: 1.sw - 120.w, child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - SizedBox( - width: 1.sw - 110.w - 100.w, - child: Row( - children: [ - Flexible( - child: Text(receiveUser, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 24.sp, - color: AppColors.blackColor)), - ), - ], - ), - ), - SizedBox(width: 10.w), + Text(receiveUser, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 24.sp, + color: AppColors.blackColor)), + const Spacer(), Text( keyStatus, + textAlign: TextAlign.end, style: TextStyle(fontSize: 18.sp, color: Colors.red), ), ], @@ -260,11 +255,11 @@ class _AuthorizedAdminListPageState extends State { ), ], ), - SizedBox(width: 20.h), + // SizedBox(width: 20.h), ], ), ), - SizedBox(width: 20.h), + // SizedBox(width: 20.h), ], ), ), diff --git a/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart b/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart index 09cca420..4869fbf2 100755 --- a/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart +++ b/lib/main/lockDetail/electronicKey/electronicKeyList/electronicKeyList_page.dart @@ -191,7 +191,7 @@ class _ElectronicKeyListPageState extends State { }).then((Object? val) { if (val == 'deletScuess') { state.itemDataList.removeWhere( - ( ElectronicKeyListItem item) => + (ElectronicKeyListItem item) => item.keyId == indexEntity.keyId!); setState(() {}); @@ -261,7 +261,7 @@ class _ElectronicKeyListPageState extends State { padding: EdgeInsets.only(top: 20.h, bottom: 20.h), child: Row( children: [ - SizedBox(width: 30.w), + SizedBox(width: 20.w), SizedBox( width: 60.w, height: 60.w, @@ -270,56 +270,47 @@ class _ElectronicKeyListPageState extends State { child: CustomNetworkImage( url: avatarURL, defaultUrl: 'images/controls_user.png', - width: 105.w, - height: 105.h, + width: 60.w, + height: 60.h, ), ), ), SizedBox(width: 20.w), - Expanded( + SizedBox( + width: 1.sw - 120.w, child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - SizedBox( - width: 1.sw - 110.w - 34.w - 60.w, - child: Row( - children: [ - Flexible( - child: Text(receiveUser, - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 24.sp, - color: AppColors.blackColor)), - ), - SizedBox(width: 5.w), - if (isRemteUnlocking) - Image.asset( - 'images/icon_electronicKey_remteUnlocking.png', - width: 24.w, - height: 20.w, - ) - else - Container(), - SizedBox(width: 5.w), - if (isAdminKey) - Image.asset( - 'images/icon_electronicKey_admin.png', - width: 24.w, - height: 20.w, - ) - else - Container(), - ], + Text(receiveUser, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 24.sp, + color: AppColors.blackColor)), + SizedBox(width: 5.w), + if (isRemteUnlocking) + Image.asset( + 'images/icon_electronicKey_remteUnlocking.png', + width: 24.w, + height: 20.w, + ), + SizedBox(width: 5.w), + if (isAdminKey) + Image.asset( + 'images/icon_electronicKey_admin.png', + width: 24.w, + height: 20.w, ), - ), // Expanded(child: SizedBox(width: 20.w,)), - SizedBox(width: 10.w), + // SizedBox(width: 10.w), + const Spacer(), Text( keyStatus, + textAlign: TextAlign.end, style: TextStyle(fontSize: 18.sp, color: Colors.red), ), ], @@ -340,7 +331,7 @@ class _ElectronicKeyListPageState extends State { ], ), ), - SizedBox(width: 20.h), + // SizedBox(width: 20.h), ], ), ), diff --git a/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupCell.dart b/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupCell.dart index ee8e011b..1900e285 100755 --- a/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupCell.dart +++ b/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupCell.dart @@ -44,11 +44,11 @@ class massSendLockGroupCell extends StatelessWidget { child: Container( height: 60.h, color: Colors.white, - width: ScreenUtil().screenWidth, + width: 1.sw, child: Row( children: [ SizedBox( - width: 30.w, + width: 20.w, ), Image.asset( 'images/mine/icon_mine_gatewaySignal_prompt.png', @@ -56,17 +56,21 @@ class massSendLockGroupCell extends StatelessWidget { height: 36.w, ), SizedBox( - width: 10.w, - ), - Text( - itemData.lockAlias!, - style: TextStyle( - fontSize: 20.sp, color: AppColors.darkGrayTextColor), + width: 5.w, ), Expanded( - child: SizedBox( - width: 20.w, - )), + child: Text( + itemData.lockAlias!, + style: TextStyle( + fontSize: 20.sp, color: AppColors.darkGrayTextColor), + overflow: TextOverflow.ellipsis, + ), + ), + SizedBox(width: 20.w), + // Expanded( + // child: SizedBox( + // width: 20.w, + // )), Visibility( visible: isShowBtn, child: Image.asset( @@ -78,7 +82,7 @@ class massSendLockGroupCell extends StatelessWidget { color: !isVip ? Colors.grey : AppColors.mainColor, ),), SizedBox( - width: 30.w, + width: 20.w, ) ], ), diff --git a/lib/main/lockMian/lockMain/lockMain_page.dart b/lib/main/lockMian/lockMain/lockMain_page.dart index 3bf66ccf..24aef551 100755 --- a/lib/main/lockMian/lockMain/lockMain_page.dart +++ b/lib/main/lockMian/lockMain/lockMain_page.dart @@ -203,9 +203,10 @@ class _StarLockMainPageState extends State with BaseWidget, Au ], ), Container( - // padding: EdgeInsets.all(30.w), + padding: EdgeInsets.only(left:30.w, right: 30.w), child: Text( '添加锁时,手机必须在锁旁边'.tr, + textAlign: TextAlign.center, style: TextStyle( fontSize: 26.sp, // fontWeight: FontWeight.w800, diff --git a/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_logic.dart b/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_logic.dart index 6644ff9c..4c73dcc8 100755 --- a/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_logic.dart +++ b/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_logic.dart @@ -69,13 +69,12 @@ class AddAuthorizedAdministratorLogic extends BaseGetXController { isOnlyManageSelf: state.onlyManageYouCreatesUser.value == true ? 1 : 2, ); if (entity.errorCode!.codeIsSuccessful) { - state.isSendSuccess.value = true; state.isCreateUser.value = false; state.getKeyId.value = entity.data!.keyId ?? 0; // Toast.show(msg: "添加成功"); - eventBus.fire(AuthorizedAdministratorListPageRefreshUI()); + Get.back(); } else { // showToast("${entity.errorMsg}"); if (entity.errorCode == 425) { diff --git a/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_page.dart b/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_page.dart index 973b97e6..c9cdb870 100755 --- a/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_page.dart +++ b/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_page.dart @@ -54,9 +54,6 @@ class _AddAuthorizedAdministratorPageState //永久 Widget _permanentAdministrator() { - if (state.isSendSuccess.value == true) { - return sendElectronicKeySucceed(); - } else { return Column( children: [ keyInfoWidget(), @@ -109,14 +106,10 @@ class _AddAuthorizedAdministratorPageState _buildSureBtn() ], ); - } } //限时管理员 Widget _timeLimitAdministrator() { - if (state.isSendSuccess.value == true) { - return sendElectronicKeySucceed(); - } else { return Column( children: [ keyInfoWidget(), @@ -169,7 +162,6 @@ class _AddAuthorizedAdministratorPageState _buildSureBtn() ], ); - } } // 顶部钥匙信息widget @@ -477,7 +469,6 @@ class _AddAuthorizedAdministratorPageState SubmitBtn( btnName: '完成'.tr, onClick: () { - state.isSendSuccess.value = false; Navigator.pop(context, true); }), SizedBox( diff --git a/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_state.dart b/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_state.dart index c15b55e5..ca0a6f41 100755 --- a/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_state.dart +++ b/lib/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator/addAuthorizedAdministrator_state.dart @@ -27,7 +27,7 @@ class AddAuthorizedAdministratorState { RxString countryName = '中国'.tr.obs; RxString countryCode = '86'.obs; - RxBool isSendSuccess = false.obs; + // RxBool isSendSuccess = false.obs; final RxBool isRemoteUnlock = false.obs; //是否允许远程开锁 final RxBool isAuthentication = false.obs; //是否允许实名认证 final RxBool onlyManageYouCreatesUser = false.obs; //只能管理您创建的用户 diff --git a/lib/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetails_logic.dart b/lib/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetails_logic.dart index 1f6edb0b..170f8d89 100755 --- a/lib/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetails_logic.dart +++ b/lib/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetails_logic.dart @@ -123,18 +123,18 @@ class AdministratorDetailsLogic extends BaseGetXController { return AlertBottomWidget( topTitle: '', items: textList, - chooseCallback: (value) { + chooseCallback: (int value) { final int index = value; if (index == 0) { if (state.itemData.value.keyStatus == 110405) { // 解除冻结 ShowTipView().showDeleteAdministratorIsHaveAllDataDialog( - '同时解冻其发送的钥匙'.tr, (isAllData) { + '同时解冻其发送的钥匙'.tr + '?', (bool isAllData) { cancelFreeze(isAllData ? 1 : 0); }); } else { ShowTipView().showDeleteAdministratorIsHaveAllDataDialog( - '同时冻结其发送的钥匙'.tr, (isAllData) { + '同时冻结其发送的钥匙'.tr, (bool isAllData) { freezeKey(isAllData ? 1 : 0); }); } diff --git a/lib/mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdministratorList_page.dart b/lib/mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdministratorList_page.dart index 3326f731..f885fa3a 100755 --- a/lib/mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdministratorList_page.dart +++ b/lib/mine/mineSet/authorizedAdministrator/authorizedAdministrator/authorizedAdministratorList_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:get/get.dart'; @@ -190,6 +191,7 @@ class _AuthorizedAdministratorListPageState }, child: Container( height: 100.h, + width: 1.sw, color: Colors.white, child: Row( children: [ @@ -210,33 +212,29 @@ class _AuthorizedAdministratorListPageState ), ), SizedBox(width: 20.w), - Expanded( + SizedBox( + width: 1.sw - 110.w, + // color: Colors.blue, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - SizedBox( - width: 1.sw - 110.w - 100.w, - child: Row( - children: [ - Flexible( - child: Text(itemData.name ?? '', - maxLines: 1, - overflow: TextOverflow.ellipsis, - style: TextStyle( - fontSize: 24.sp, - color: AppColors.blackColor)), - ), - ], - ), + Expanded( + child: Text(itemData.name ?? '', + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 24.sp, + color: AppColors.blackColor)), ), SizedBox(width: 10.w), Text( XSConstantMacro.getKeyStatusStr(itemData.keyStatus!), style: TextStyle(fontSize: 18.sp, color: Colors.red), ), + SizedBox(width: 20.w) ], ), SizedBox(height: 5.h), @@ -255,7 +253,7 @@ class _AuthorizedAdministratorListPageState ], ), ), - SizedBox(width: 20.h), + // SizedBox(width: 20.h), ], ), ), diff --git a/lib/mine/mineSet/lockGroup/groupEditLock/groupEditLock_logic.dart b/lib/mine/mineSet/lockGroup/groupEditLock/groupEditLock_logic.dart index c13c8624..f6223eda 100755 --- a/lib/mine/mineSet/lockGroup/groupEditLock/groupEditLock_logic.dart +++ b/lib/mine/mineSet/lockGroup/groupEditLock/groupEditLock_logic.dart @@ -18,7 +18,7 @@ class GroupEditLockLogic extends BaseGetXController { var entity = await ApiRepository.to.lockGroupAddLock( lockIds: lockIds, groupId: state.selectGroupListItem.keyGroupId!); if (entity.errorCode!.codeIsSuccessful) { - showToast('添加成功', something: () { + showToast('添加成功'.tr, something: () { eventBus.fire(LockGroupEditGroupLockRefreshEvent()); eventBus.fire(RefreshLockListInfoDataEvent()); Get.close(2); diff --git a/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_page.dart b/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_page.dart index 7e050bfe..1aa02f9b 100755 --- a/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_page.dart +++ b/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_slidable/flutter_slidable.dart'; import 'package:get/get.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart'; import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList/lockGroupList_state.dart'; @@ -11,7 +12,6 @@ import 'package:star_lock/tools/showTipView.dart'; import '../../../../../../appRouters.dart'; import '../../../../../../app_settings/app_colors.dart'; import '../../../../../../tools/titleAppBar.dart'; -import '../../../../tools/left_slide/left_slide_actions.dart'; import '../../../../tools/noData.dart'; import 'lockGroupList_logic.dart'; @@ -47,7 +47,7 @@ class _LockGroupListPageState extends State { ShowTipView().showTFViewAlertDialog( state.changeNameController, '创建新分组'.tr, - '请输入'.tr, () { + '请输入姓名'.tr, () { //发送编辑钥匙名称请求 if (state.changeNameController.text.isNotEmpty) { Navigator.of(context).pop(); @@ -79,66 +79,89 @@ class _LockGroupListPageState extends State { final GroupListItem itemData = state.itemDataList[i]; state.lockNum += itemData.lockList!.length; } - return ListView.separated( - itemCount: state.itemDataList.length + 1, - itemBuilder: (BuildContext c, int index) { - if (index == state.itemDataList.length) { - return Center( - child: Column( - children: [ - SizedBox( - height: 20.h, - ), - SizedBox( - height: 40.h, - child: Text( - '${'锁数量'.tr}:${state.lockNum.toString()}', - style: TextStyle( - color: AppColors.darkGrayTextColor, fontSize: 20.sp), + return SlidableAutoCloseBehavior( + child: ListView.separated( + itemCount: state.itemDataList.length + 1, + itemBuilder: (BuildContext c, int index) { + if (index == state.itemDataList.length) { + return Center( + child: Column( + children: [ + SizedBox( + height: 20.h, ), - ) - ], - ), - ); - } else { - final GroupListItem itemData = state.itemDataList[index]; - if (itemData.groupType == 0) { - state.ungrouped = itemData; - } - if (index < state.itemDataList.length) { - return LeftSlideActions( - tag: itemData.keyGroupId!.toString(), - key: Key(itemData.keyGroupId!.toString()), - actionsWidth: itemData.groupType != 0 ? 200.w : 0, - actions: itemData.groupType != 0 - ? [ - _buildEditBtn(itemData), - _buildDeleteBtn(itemData), - ] - : [], - decoration: const BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(1)), + SizedBox( + height: 40.h, + child: Text( + '${'锁数量'.tr}:${state.lockNum.toString()}', + style: TextStyle( + color: AppColors.darkGrayTextColor, fontSize: 20.sp), + ), + ) + ], ), - child: lockDataListItem( - '${itemData.keyGroupName}(${itemData.lockList?.length})', - () { - Get.toNamed(Routers.lockItemListPage, - arguments: { - 'groupListItem': itemData, - 'ungrouped': state.ungrouped - }); - }), ); + } else { + final GroupListItem itemData = state.itemDataList[index]; + if (itemData.groupType == 0) { + state.ungrouped = itemData; + } + if (index < state.itemDataList.length) { + return Slidable( + key: ValueKey(itemData.keyGroupId), + endActionPane: ActionPane( + extentRatio: 0.4, + motion: const ScrollMotion(), + children: [ + _buildEditBtn(itemData), + _buildDeleteBtn(itemData), + ], + ), + child: lockDataListItem( + '${itemData.keyGroupName}(${itemData.lockList?.length})', + () { + Get.toNamed(Routers.lockItemListPage, + arguments: { + 'groupListItem': itemData, + 'ungrouped': state.ungrouped + }); + }), + ); + + // return LeftSlideActions( + // tag: itemData.keyGroupId!.toString(), + // key: Key(itemData.keyGroupId!.toString()), + // actionsWidth: itemData.groupType != 0 ? 200.w : 0, + // actions: itemData.groupType != 0 + // ? [ + // _buildEditBtn(itemData), + // _buildDeleteBtn(itemData), + // ] + // : [], + // decoration: const BoxDecoration( + // borderRadius: BorderRadius.all(Radius.circular(1)), + // ), + // child: lockDataListItem( + // '${itemData.keyGroupName}(${itemData.lockList?.length})', + // () { + // Get.toNamed(Routers.lockItemListPage, + // arguments: { + // 'groupListItem': itemData, + // 'ungrouped': state.ungrouped + // }); + // }), + // ); + } + return const SizedBox.shrink(); } - return const SizedBox.shrink(); - } - }, - separatorBuilder: (BuildContext context, int index) { - return const Divider( - height: 1, - color: AppColors.greyLineColor, - ); - }); + }, + separatorBuilder: (BuildContext context, int index) { + return const Divider( + height: 1, + color: AppColors.greyLineColor, + ); + }), + ); } Widget _buildDeleteBtn(GroupListItem groupListItem) { @@ -151,7 +174,7 @@ class _LockGroupListPageState extends State { }); }, child: Container( - width: 100.w, + width: 1.sw*0.2, color: const Color(0xFFF20101), alignment: Alignment.center, child: Text( @@ -175,7 +198,7 @@ class _LockGroupListPageState extends State { // showCupertinoAlertDialog(context, false, groupListItem.keyGroupId!); ShowTipView().showTFViewAlertDialog(state.changeNameController, - '修改名称'.tr, '请输入'.tr, () { + '修改名称'.tr, '请输入姓名'.tr, () { if (state.changeNameController.text.isNotEmpty) { Get.back(); logic.editLockGroupRequest(groupListItem.keyGroupId!); @@ -189,7 +212,7 @@ class _LockGroupListPageState extends State { }, isShowSuffixIcon: true); }, child: Container( - width: 100.w, + width: 1.sw*0.2, color: AppColors.mainColor, alignment: Alignment.center, child: Text( @@ -209,7 +232,7 @@ class _LockGroupListPageState extends State { return GestureDetector( onTap: action, child: Container( - // height: 70.h, + height: 70.h, padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h), decoration: BoxDecoration( diff --git a/lib/tools/ExpandedListView.dart b/lib/tools/ExpandedListView.dart index 7b4b0741..b97127cf 100755 --- a/lib/tools/ExpandedListView.dart +++ b/lib/tools/ExpandedListView.dart @@ -2,6 +2,7 @@ import 'dart:core'; import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:star_lock/app_settings/app_colors.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart'; @@ -52,6 +53,7 @@ class _ExpandedListTileState extends State { Container( color: Colors.white, height: 80.h, + width: 1.sw, child: Row( children: _buildExpandRowList(), ), @@ -110,7 +112,7 @@ class _ExpandedListTileState extends State { widgetList.add(GestureDetector( child: Container( - width: ScreenUtil().screenWidth - (widget.isShowBtn ? 80.w : 0), + width: 1.sw - (widget.isShowBtn ? 80.w : 0), color: Colors.white, child: Row( children: [ @@ -122,14 +124,14 @@ class _ExpandedListTileState extends State { SizedBox( width: widget.isShowBtn ? 10.w :30.w, ), - Text( - widget.groupItem.keyGroupName ?? '', - style: TextStyle(color: AppColors.blackColor, fontSize: 22.sp), - ), Expanded( - child: SizedBox( - width: 10.w, - )), + child: Text( + widget.groupItem.keyGroupName ?? '', + style: TextStyle(color: AppColors.blackColor, fontSize: 22.sp), + overflow: TextOverflow.ellipsis, + ), + ), + SizedBox(width: 10.w), AnimatedRotation( turns: _isExpanded ? -0.5 : 0, duration: _animationDuration, diff --git a/lib/tools/pickers/time_picker/model/pduration.dart b/lib/tools/pickers/time_picker/model/pduration.dart index ab641835..4da210dc 100755 --- a/lib/tools/pickers/time_picker/model/pduration.dart +++ b/lib/tools/pickers/time_picker/model/pduration.dart @@ -47,7 +47,7 @@ class PDuration { } PDuration.now() { - var thisInstant = new DateTime.now(); + final DateTime thisInstant = DateTime.now(); year = thisInstant.year; month = thisInstant.month; day = thisInstant.day; diff --git a/lib/tools/pickers/time_picker/route/date_picker_route.dart b/lib/tools/pickers/time_picker/route/date_picker_route.dart index 4d9d7932..f1d86e29 100755 --- a/lib/tools/pickers/time_picker/route/date_picker_route.dart +++ b/lib/tools/pickers/time_picker/route/date_picker_route.dart @@ -20,15 +20,12 @@ import 'package:star_lock/tools/pickers/time_picker/model/suffix.dart'; import '../time_utils.dart'; -typedef DateCallback(PDuration res); +typedef DateCallback = Function(PDuration res); class DatePickerRoute extends PopupRoute { DatePickerRoute({ - this.mode, - required this.initDate, + required this.initDate, required this.maxDate, required this.minDate, this.mode, this.pickerStyle, - required this.maxDate, - required this.minDate, this.suffix, this.onChanged, this.onConfirm, @@ -111,13 +108,8 @@ class DatePickerRoute extends PopupRoute { class _PickerContentView extends StatefulWidget { _PickerContentView({ - Key? key, + required this.initData, required this.pickerStyle, required this.maxDate, required this.minDate, required this.route, Key? key, this.mode, - required this.initData, - required this.pickerStyle, - required this.maxDate, - required this.minDate, - required this.route, this.hourShow24 = false, }) : super(key: key); @@ -139,6 +131,13 @@ class _PickerContentView extends StatefulWidget { } class _PickerState extends State<_PickerContentView> { + + _PickerState(DateMode? mode, this._initSelectData, this.maxDate, this.minDate, + this._pickerStyle, this.hourShow24) { + _dateItemModel = DateItemModel.parse(mode!); + pickerItemHeight = _pickerStyle.pickerItemHeight; + _init(); + } late final PickerStyle _pickerStyle; // 是否显示 [年月日时分秒] @@ -166,13 +165,6 @@ class _PickerState extends State<_PickerContentView> { // 选择器 高度 单独提出来,用来解决修改数据 不及时更新的BUG late double pickerItemHeight; - _PickerState(DateMode? mode, this._initSelectData, this.maxDate, this.minDate, - this._pickerStyle, this.hourShow24) { - _dateItemModel = DateItemModel.parse(mode!); - pickerItemHeight = _pickerStyle.pickerItemHeight; - _init(); - } - _init() { scrollCtrl.clear(); diff --git a/lib/tools/showCupertinoAlertView.dart b/lib/tools/showCupertinoAlertView.dart index d8f081a5..62a53f6f 100755 --- a/lib/tools/showCupertinoAlertView.dart +++ b/lib/tools/showCupertinoAlertView.dart @@ -110,11 +110,14 @@ class ShowCupertinoAlertView { color: AppColors.vipFeatureBgColor, padding: EdgeInsets.only(left: 20.w), height: 80.h, + width: 1.sw, child: Row( children: [ - Text(tipsText, - style: TextStyle( - color: AppColors.vipFeatureBtnTextColor, fontSize: 22.sp)), + Flexible( + child: Text(tipsText, + style: TextStyle( + color: AppColors.vipFeatureBtnTextColor, fontSize: 22.sp)), + ), SizedBox( width: 10.w, ), @@ -135,10 +138,11 @@ class ShowCupertinoAlertView { style: TextStyle(color: Colors.white, fontSize: 22.sp), )), ), - Expanded( - child: SizedBox( - width: 2.w, - )) + SizedBox(width:2.w) + // Expanded( + // child: SizedBox( + // width: 2.w, + // )) ], ), ); diff --git a/lib/tools/showDeleteAdministratorIsHaveAllDataWidget.dart b/lib/tools/showDeleteAdministratorIsHaveAllDataWidget.dart index cdf0dec0..369d9105 100755 --- a/lib/tools/showDeleteAdministratorIsHaveAllDataWidget.dart +++ b/lib/tools/showDeleteAdministratorIsHaveAllDataWidget.dart @@ -4,12 +4,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; typedef BlockIsHaveAllDataCallback = void Function(bool isAllData); class ShowDeleteAdministratorIsHaveAllDataWidget extends StatefulWidget { - BlockIsHaveAllDataCallback? blockIsHaveAllDataCallback; - String? contentStr; ShowDeleteAdministratorIsHaveAllDataWidget( {Key? key, this.contentStr, this.blockIsHaveAllDataCallback}) : super(key: key); + BlockIsHaveAllDataCallback? blockIsHaveAllDataCallback; + String? contentStr; @override State createState() => @@ -43,7 +43,6 @@ class _ShowDeleteAdministratorIsHaveAllDataWidgetState ), Expanded( child: Text(widget.contentStr!, - maxLines: 2, textAlign: TextAlign.start, style: TextStyle(fontSize: 24.sp))), ], diff --git a/lib/versionUndate/versionUndateTool.dart b/lib/versionUndate/versionUndateTool.dart index 181395a8..35d5fdbc 100755 --- a/lib/versionUndate/versionUndateTool.dart +++ b/lib/versionUndate/versionUndateTool.dart @@ -15,11 +15,11 @@ import 'versionUndate_entity.dart'; class VersionUndateTool { + factory VersionUndateTool() => shareManager()!; + VersionUndateTool._init() { // _initLoadUpdateVersionData(); } - - factory VersionUndateTool() => shareManager()!; static VersionUndateTool? _manager; static VersionUndateTool? shareManager() { @@ -35,7 +35,7 @@ class VersionUndateTool { } // 获取版本号 - void getVersionData() async { + Future getVersionData() async { final DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); String brandName = ''; if (Platform.isAndroid) { @@ -91,7 +91,7 @@ class VersionUndateTool { Container( padding: EdgeInsets.only(left: 20.w, right: 20.w, top: 10.h), alignment: Alignment.centerLeft, - child: Text(versionUndateEntity.data!.description! ?? '', + child: Text(versionUndateEntity.data!.description!, textAlign: TextAlign.start, style: TextStyle(fontSize: 20.sp))), ], diff --git a/lib/versionUndate/versionUndate_entity.dart b/lib/versionUndate/versionUndate_entity.dart index 1f8be81d..d54392c2 100755 --- a/lib/versionUndate/versionUndate_entity.dart +++ b/lib/versionUndate/versionUndate_entity.dart @@ -1,8 +1,5 @@ + class VersionUndateEntity { - int? errorCode; - String? description; - String? errorMsg; - Data? data; VersionUndateEntity( {this.errorCode, this.description, this.errorMsg, this.data}); @@ -13,6 +10,10 @@ class VersionUndateEntity { errorMsg = json['errorMsg']; data = json['data'] != null ? Data.fromJson(json['data']) : null; } + int? errorCode; + String? description; + String? errorMsg; + Data? data; Map toJson() { final Map data = {}; @@ -27,10 +28,6 @@ class VersionUndateEntity { } class Data { - int? isUpdate; - String? appDownloadUrl; - String? description; - int? isForceUpdate; Data( {this.isUpdate, @@ -44,6 +41,10 @@ class Data { description = json['description']; isForceUpdate = json['isForceUpdate']; } + int? isUpdate; + String? appDownloadUrl; + String? description; + int? isForceUpdate; Map toJson() { final Map data = {}; diff --git a/lib/widget/flavors_img.dart b/lib/widget/flavors_img.dart index 54dc7323..4d7eb325 100755 --- a/lib/widget/flavors_img.dart +++ b/lib/widget/flavors_img.dart @@ -4,20 +4,18 @@ import 'package:flutter/material.dart'; import 'package:star_lock/flavors.dart'; class FlavorsImg extends StatelessWidget { - FlavorsImg({required this.child, this.black = false, key}); + FlavorsImg({required this.child, Key? key, this.black = false}) : super(key: key); bool black; Widget child; ColorFilterGenerator myFilter = - ColorFilterGenerator(name: "xhj", filters: []); + ColorFilterGenerator(name: 'xhj', filters: >[]); @override Widget build(BuildContext context) { - myFilter = ColorFilterGenerator(name: "xhj", filters: [ - black - ? ColorFilterAddons.addictiveColor(-255, -255, -255) - : ColorFilterAddons.addictiveColor(1, 22, 93), + myFilter = ColorFilterGenerator(name: 'xhj', filters: >[ + if (black) ColorFilterAddons.addictiveColor(-255, -255, -255) else ColorFilterAddons.addictiveColor(1, 22, 93), ]); if (F.appFlavor != Flavor.xhj) { return child; diff --git a/pubspec.yaml b/pubspec.yaml index 7fb1f39f..5567f272 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -93,8 +93,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.79+2024083001:测试开完锁数据上传功能 # 1.0.80+2024091901:添加网关功能给谢敬调试 # 1.0.80+2024091902:网关功能去掉网关通信不够16倍数凑够16倍数功能 +# 1.0.80+2024091902:给欧阳打包测试国际化 -version: 1.0.80+2024100803 +version: 1.0.84+2024101601 environment: sdk: '>=2.12.0 <3.0.0'