diff --git a/lan/lan_en.json b/lan/lan_en.json index a11d4597..8b0f69a2 100755 --- a/lan/lan_en.json +++ b/lan/lan_en.json @@ -163,16 +163,14 @@ "已入住": "Checked In", "英文": "English", - "lanChinese": "Chinese", - "multilingual": "Multilingual", - "addLock": "Add Lock", - "lockAddress": "Lock Address", - "selectLockType": "Select lock type", - "videoIntercomDoorLock": "Video intercom door lock", - "NFCPassiveLock": "NFC Passive Lock", - "addDevice": "Add device", - "gateway": "Gateway", - "message": "Message", + "中文": "Chinese", + "多语言": "Multilingual", + "添加锁": "Add Lock", + "锁地址": "Lock Address", + "选择锁类型": "Select lock type", + "NFC无源锁": "NFC Passive Lock", + "添加设备": "Add device", + "网关": "Gateway", "supportStaff": "Support Staff", "set": "Setting", "moreServices": "More Services", diff --git a/lan/lan_keys.json b/lan/lan_keys.json index d56a7eb9..fb32ff86 100755 --- a/lan/lan_keys.json +++ b/lan/lan_keys.json @@ -162,16 +162,14 @@ "已入住":"已入住", "英文":"英文", - "lanChinese":"lanChinese", - "multilingual":"multilingual", - "addLock":"addLock", - "lockAddress":"lockAddress", - "selectLockType":"selectLockType", - "videoIntercomDoorLock":"videoIntercomDoorLock", - "NFCPassiveLock":"NFCPassiveLock", - "addDevice":"addDevice", - "gateway":"gateway", - "message":"message", + "中文":"中文", + "多语言":"多语言", + "添加锁":"添加锁", + "锁地址":"锁地址", + "选择锁类型":"选择锁类型", + "NFC无源锁":"NFC无源锁", + "添加设备":"添加设备", + "网关":"网关", "supportStaff":"supportStaff", "set":"set", "moreServices":"moreServices", diff --git a/lan/lan_zh.json b/lan/lan_zh.json index d04f1892..7aa81579 100755 --- a/lan/lan_zh.json +++ b/lan/lan_zh.json @@ -161,16 +161,15 @@ "已入住": "已入住", "英文": "英文", - "lanChinese": "中文", - "multilingual": "多语言", - "addLock": "添加锁", - "lockAddress": "锁地址", - "selectLockType": "选择锁类型", - "videoIntercomDoorLock": "可视对讲门锁", - "NFCPassiveLock": "NFC无源锁", - "addDevice": "添加设备", - "gateway": "网关", - "message": "消息", + "中文": "中文", + "多语言": "多语言", + "添加锁": "添加锁", + "锁地址": "锁地址", + "选择锁类型": "选择锁类型", + "NFC无源锁": "NFC无源锁", + "添加设备": "添加设备", + "网关": "网关", + "supportStaff": "客服", "set": "设置", "moreServices": "更多服务", diff --git a/lib/main/lockDetail/fingerprint/addFingerprintTip/addFingerprintTip_page.dart b/lib/main/lockDetail/fingerprint/addFingerprintTip/addFingerprintTip_page.dart index 816537b4..6dbd280d 100755 --- a/lib/main/lockDetail/fingerprint/addFingerprintTip/addFingerprintTip_page.dart +++ b/lib/main/lockDetail/fingerprint/addFingerprintTip/addFingerprintTip_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:star_lock/main/lockDetail/fingerprint/addFingerprintTip/addFingerprintTip_state.dart'; import '../../../../../appRouters.dart'; import '../../../../../app_settings/app_colors.dart'; @@ -18,21 +19,21 @@ class AddFingerprintTipPage extends StatefulWidget { } class _AddFingerprintTipPageState extends State { - final logic = Get.put(AddFingerprintTipLogic()); - final state = Get.find().state; + final AddFingerprintTipLogic logic = Get.put(AddFingerprintTipLogic()); + final AddFingerprintTipState state = Get.find().state; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.addLock!.tr, + barTitle: '添加锁'.tr, haveBack: true, backgroundColor: AppColors.mainColor), body: ListView( // mainAxisAlignment: MainAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center, - children: [ + children: [ SizedBox( height: 50.h, ), @@ -40,10 +41,10 @@ class _AddFingerprintTipPageState extends State { padding: EdgeInsets.only(left: 20.w, right: 20.w), child: Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: [ Expanded( child: Text( - "添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压".tr, + '添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压'.tr, // TranslationLoader.lanKeys!.lightTouchScreenTip!.tr, textAlign: TextAlign.center, maxLines:null, @@ -67,20 +68,20 @@ class _AddFingerprintTipPageState extends State { Container( padding: EdgeInsets.only(left: 20.w, right: 20.w), child: SubmitBtn( - btnName: "开始添加".tr,//TranslationLoader.lanKeys!.next!.tr, + btnName: '开始添加'.tr,//TranslationLoader.lanKeys!.next!.tr, borderRadius: 20.w, onClick: () { - Get.toNamed(Routers.addFingerprintPage, arguments: { - "lockId": state.lockId.value, - "endDate": state.endDate.value, - "addType": state.addType.value, - "fingerprintName": state.fingerprintName.value, - "fingerprintNumber": state.fingerprintNumber.value, - "fingerprintType": state.fingerprintType.value, - "isCoerced": state.isCoerced.value, - "startDate": state.startDate.value, - "weekDay": state.weekDay.value, - "fromType": state.fromType.value, + Get.toNamed(Routers.addFingerprintPage, arguments: { + 'lockId': state.lockId.value, + 'endDate': state.endDate.value, + 'addType': state.addType.value, + 'fingerprintName': state.fingerprintName.value, + 'fingerprintNumber': state.fingerprintNumber.value, + 'fingerprintType': state.fingerprintType.value, + 'isCoerced': state.isCoerced.value, + 'startDate': state.startDate.value, + 'weekDay': state.weekDay.value, + 'fromType': state.fromType.value, }); }), ), diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index d3b922db..5a12b1f4 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -839,7 +839,7 @@ class _LockDetailPageState extends State ), ), Text( - TranslationLoader.lanKeys!.addDevice!.tr, + '添加设备'.tr, style: TextStyle( fontSize: 20.sp, color: AppColors.darkGrayTextColor), ) diff --git a/lib/mine/addLock/addLock/addLock_page.dart b/lib/mine/addLock/addLock/addLock_page.dart index 94facfc2..09bc1fa6 100755 --- a/lib/mine/addLock/addLock/addLock_page.dart +++ b/lib/mine/addLock/addLock/addLock_page.dart @@ -28,12 +28,12 @@ class _AddLockPageState extends State with BaseWidget { backgroundColor: Colors.white, appBar: F.sw( skyCall: () => TitleAppBar( - barTitle: TranslationLoader.lanKeys!.addLock!.tr, + barTitle: '添加锁'.tr, haveBack: true, backgroundColor: AppColors.mainColor, ), xhjCall: () => TitleAppBar( - barTitle: TranslationLoader.lanKeys!.addLock!.tr, + barTitle: '添加锁'.tr, haveBack: true, backgroundColor: Colors.white, iconColor: AppColors.blackColor, diff --git a/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart b/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart index a1c783ae..4b8a6d28 100755 --- a/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart +++ b/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart @@ -1,15 +1,15 @@ import 'dart:async'; import 'dart:io'; -import 'package:flutter/material.dart'; +import 'package:amap_flutter_base/amap_flutter_base.dart'; import 'package:amap_flutter_location/amap_flutter_location.dart'; import 'package:amap_flutter_location/amap_location_option.dart'; - +import 'package:amap_flutter_map/amap_flutter_map.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:amap_flutter_map/amap_flutter_map.dart'; -import 'package:amap_flutter_base/amap_flutter_base.dart'; +import 'package:star_lock/mine/addLock/lockAddress/gaode/lockAddressGaoDe_state.dart'; import 'package:star_lock/widget/permission/permission_dialog.dart'; import '../../../../appRouters.dart'; @@ -30,8 +30,8 @@ class LockAddressGaoDePage extends StatefulWidget { class _LockAddressGaoDePageState extends State with RouteAware { - final logic = Get.put(LockAddressGaoDeLogic()); - final state = Get.find().state; + final LockAddressGaoDeLogic logic = Get.put(LockAddressGaoDeLogic()); + final LockAddressGaoDeState state = Get.find().state; // 高德地图 static AMapApiKey amapApiKeys = @@ -90,7 +90,7 @@ class _LockAddressGaoDePageState extends State // } Future requestPermission() async { - final status = await PermissionDialog.request(Permission.location); + final bool status = await PermissionDialog.request(Permission.location); if(Platform.isIOS){ _setLocationOption(); requestIOSLocation(); @@ -103,7 +103,7 @@ class _LockAddressGaoDePageState extends State } Future requestAndroidLocation() async { - location.onLocationChanged().listen((event) { + location.onLocationChanged().listen((Map event) { if (event.isNotEmpty) { setState(() { addressInfo = event; @@ -116,7 +116,7 @@ class _LockAddressGaoDePageState extends State Future requestIOSLocation() async { location = AMapFlutterLocation() ..setLocationOption(AMapLocationOption()) - ..onLocationChanged().listen((event) { + ..onLocationChanged().listen((Map event) { // AppLog.log("listenLocationChanged$event"); // EasyLoading.dismiss(); if (event.isNotEmpty) { @@ -134,39 +134,39 @@ class _LockAddressGaoDePageState extends State return Scaffold( backgroundColor: Colors.white, appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.lockAddress!.tr, + barTitle: '锁地址'.tr, haveBack: true, backgroundColor: AppColors.mainColor, ), body: ListView( - children: [ + children: [ Container( margin: EdgeInsets.only(left: 25.w, top: 40.h, bottom: 40.w), child: Row( mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text("地理位置".tr, style: TextStyle(fontSize: 50.sp)), + children: [ + Text('地理位置'.tr, style: TextStyle(fontSize: 50.sp)), ], ), ), SizedBox( - child: (addressInfo != null && addressInfo!.containsKey("latitude")) + child: (addressInfo != null && addressInfo!.containsKey('latitude')) ? Column( - children: [ + children: [ SizedBox( height: 1.sw / 5 * 4, width: 1.sw, child: AMapWidget( apiKey: amapApiKeys, // 初始化地图中心 - initialCameraPosition: (CameraPosition( + initialCameraPosition: CameraPosition( target: LatLng( double.parse( addressInfo!['latitude'].toString()), double.parse( addressInfo!['longitude'].toString())), zoom: 10.0, - )), + ), //定位小蓝点 myLocationStyleOptions: MyLocationStyleOptions( true, @@ -191,9 +191,9 @@ class _LockAddressGaoDePageState extends State EdgeInsets.only(left: 25.w, top: 20.h, right: 25.w), child: Row( mainAxisAlignment: MainAxisAlignment.start, - children: [ + children: [ Flexible( - child: Text("检查以确保以下地址是正确的".tr, + child: Text('检查以确保以下地址是正确的'.tr, style: TextStyle(fontSize: 24.sp))), ], ), @@ -205,13 +205,13 @@ class _LockAddressGaoDePageState extends State margin: EdgeInsets.only( left: 25.w, top: 20.h, right: 25.w), child: Column( - children: [ + children: [ Row( - children: [ + children: [ Expanded( child: Text( - addressInfo!["address"].toString() ?? - "", + addressInfo!['address'].toString() ?? + '', style: const TextStyle( color: Colors.grey, fontSize: 16, @@ -235,20 +235,20 @@ class _LockAddressGaoDePageState extends State SizedBox(height: 200.h), Row( mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ + children: [ TextButton( child: Text( - "跳过".tr, + '跳过'.tr, style: TextStyle(color: Colors.black, fontSize: 24.sp), ), onPressed: () { - Get.toNamed(Routers.addLockSelectCountryPage, arguments: { - "addressInfo": {}, - "pwdTimestamp": state.pwdTimestamp.value, - "lockInfo": state.lockInfo, - "featureValue": state.featureValue, - "featureSettingValue": state.featureSettingValue, - "featureSettingParams": state.featureSettingParams, + Get.toNamed(Routers.addLockSelectCountryPage, arguments: { + 'addressInfo': {}, + 'pwdTimestamp': state.pwdTimestamp.value, + 'lockInfo': state.lockInfo, + 'featureValue': state.featureValue, + 'featureSettingValue': state.featureSettingValue, + 'featureSettingParams': state.featureSettingParams, }); }, ), @@ -259,17 +259,17 @@ class _LockAddressGaoDePageState extends State ), onPressed: () { if (addressInfo!.isEmpty) { - logic.showToast("还未获取到位置信息哦,请耐心等待一下!".tr); + logic.showToast('还未获取到位置信息哦,请耐心等待一下!'.tr); return; } - Get.toNamed(Routers.saveLockPage, arguments: { - "addressInfo": addressInfo, - "pwdTimestamp": state.pwdTimestamp.value, - "lockInfo": state.lockInfo, - "featureValue": state.featureValue, - "featureSettingValue": state.featureSettingValue, - "featureSettingParams": state.featureSettingParams, - "isFromMap": 1, + Get.toNamed(Routers.saveLockPage, arguments: { + 'addressInfo': addressInfo, + 'pwdTimestamp': state.pwdTimestamp.value, + 'lockInfo': state.lockInfo, + 'featureValue': state.featureValue, + 'featureSettingValue': state.featureSettingValue, + 'featureSettingParams': state.featureSettingParams, + 'isFromMap': 1, }); // Navigator.pushNamed(context, Routers.saveLockPage); }, @@ -297,7 +297,7 @@ class _LockAddressGaoDePageState extends State locationOption.desiredLocationAccuracyAuthorizationMode = AMapLocationAccuracyAuthorizationMode.ReduceAccuracy; - locationOption.fullAccuracyPurposeKey = "AMapLocationScene"; + locationOption.fullAccuracyPurposeKey = 'AMapLocationScene'; ///设置Android端连续定位的定位间隔 locationOption.locationInterval = 2000; diff --git a/lib/mine/addLock/lockAddress/lockAddress/lockAddress_page.dart b/lib/mine/addLock/lockAddress/lockAddress/lockAddress_page.dart index df739b71..09b08049 100755 --- a/lib/mine/addLock/lockAddress/lockAddress/lockAddress_page.dart +++ b/lib/mine/addLock/lockAddress/lockAddress/lockAddress_page.dart @@ -24,7 +24,7 @@ class _LockAddressPageState extends State with RouteAware{ return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.lockAddress!.tr, + barTitle: '锁地址'.tr, haveBack: true, backgroundColor: AppColors.mainColor, actionsList: [ @@ -35,7 +35,7 @@ class _LockAddressPageState extends State with RouteAware{ ), onPressed: () { if(addressInfo!.isEmpty){ - EasyLoading.showToast("请先获取到位置信息哦!", duration: 2000.milliseconds); + EasyLoading.showToast('请先获取到位置信息哦!', duration: 2000.milliseconds); return; } Get.toNamed(Routers.saveLockPage, arguments: addressInfo); diff --git a/lib/mine/addLock/saveLock/saveLock_page.dart b/lib/mine/addLock/saveLock/saveLock_page.dart index b8cc25cf..ad29c7f1 100755 --- a/lib/mine/addLock/saveLock/saveLock_page.dart +++ b/lib/mine/addLock/saveLock/saveLock_page.dart @@ -29,7 +29,7 @@ class _SaveLockPageState extends State with RouteAware { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.addLock!.tr, + barTitle: '添加锁'.tr, haveBack: true, backgroundColor: AppColors.mainColor), body: Column( diff --git a/lib/mine/addLock/selectLockType/selectLockType_page.dart b/lib/mine/addLock/selectLockType/selectLockType_page.dart index c7646ac5..a64de22d 100755 --- a/lib/mine/addLock/selectLockType/selectLockType_page.dart +++ b/lib/mine/addLock/selectLockType/selectLockType_page.dart @@ -29,12 +29,12 @@ class _SelectLockTypePageState extends State with BaseWidget backgroundColor: AppColors.mainBackgroundColor, appBar: F.sw( skyCall: () => TitleAppBar( - barTitle: TranslationLoader.lanKeys!.selectLockType!.tr, + barTitle: '选择锁类型'.tr, haveBack: true, backgroundColor: AppColors.mainColor, ), xhjCall: () => TitleAppBar( - barTitle: TranslationLoader.lanKeys!.selectLockType!.tr, + barTitle: '选择锁类型'.tr, haveBack: true, backgroundColor: Colors.white, iconColor: AppColors.blackColor, @@ -85,7 +85,7 @@ class _SelectLockTypePageState extends State with BaseWidget }), if (!F.isLite) lockTypeItem('images/lockType/lockType_NFCLock.png', - TranslationLoader.lanKeys!.NFCPassiveLock!.tr, () { + 'NFC无源锁'.tr, () { CommonDataManage().seletLockType = 2; // Navigator.pushNamed(context, Routers.addLockPage); }), @@ -120,7 +120,7 @@ class _SelectLockTypePageState extends State with BaseWidget // }), if (!F.isLite) lockTypeItem('images/lockType/lockType_gatewayLock.png', - TranslationLoader.lanKeys!.gateway!.tr, () { + '网关'.tr, () { CommonDataManage().seletLockType = 7; // Navigator.pushNamed(context, Routers.gatewayListPage); }), diff --git a/lib/mine/gateway/addGateway/gatewayConfigurationWifi/gatewayConfigurationWifi_page.dart b/lib/mine/gateway/addGateway/gatewayConfigurationWifi/gatewayConfigurationWifi_page.dart index 660ed8b4..16efc235 100755 --- a/lib/mine/gateway/addGateway/gatewayConfigurationWifi/gatewayConfigurationWifi_page.dart +++ b/lib/mine/gateway/addGateway/gatewayConfigurationWifi/gatewayConfigurationWifi_page.dart @@ -17,21 +17,20 @@ class GatewayConfigurationWifiPage extends StatefulWidget { _GatewayConfigurationWifiPageState(); } -class _GatewayConfigurationWifiPageState - extends State { - final _wifiPassward = TextEditingController(); - final _gatewayNamePassward = TextEditingController(); +class _GatewayConfigurationWifiPageState extends State { + final TextEditingController _wifiPassward = TextEditingController(); + final TextEditingController _gatewayNamePassward = TextEditingController(); @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.gateway!.tr, + barTitle: '网关'.tr, haveBack: true, backgroundColor: AppColors.mainColor), body: Column( - children: [ + children: [ Container( width: 1.sw, color: const Color(0xFFF2F6F9), @@ -43,10 +42,10 @@ class _GatewayConfigurationWifiPageState )), Expanded( child: ListView( - children: [ + children: [ CommonItem( leftTitel: TranslationLoader.lanKeys!.wifiName!.tr, - rightTitle: "XinHongJia", + rightTitle: 'XinHongJia', allHeight: 100.h, isHaveLine: true, isHaveDirection: true, @@ -55,7 +54,7 @@ class _GatewayConfigurationWifiPageState }), CommonItem( leftTitel: TranslationLoader.lanKeys!.wifiPassward!.tr, - rightTitle: "", + rightTitle: '', isHaveRightWidget: true, rightWidget: getTFWidget( _wifiPassward, @@ -66,7 +65,7 @@ class _GatewayConfigurationWifiPageState ), CommonItem( leftTitel: TranslationLoader.lanKeys!.gatewayName!.tr, - rightTitle: "", + rightTitle: '', isHaveRightWidget: true, rightWidget: getTFWidget(_gatewayNamePassward, TranslationLoader.lanKeys!.pleaseEnterGatewayName!.tr)), @@ -75,7 +74,7 @@ class _GatewayConfigurationWifiPageState ), CommonItem( leftTitel: TranslationLoader.lanKeys!.wifiMAC!.tr, - rightTitle: "48:55:19:7d:84:7a", + rightTitle: '48:55:19:7d:84:7a', allHeight: 100.h, isHaveLine: false), SizedBox( @@ -84,22 +83,22 @@ class _GatewayConfigurationWifiPageState Visibility( visible: true, child: Column( - children: [ + children: [ CommonItem( leftTitel: TranslationLoader.lanKeys!.ipAddress!.tr, - rightTitle: "192.168.1.1", + rightTitle: '192.168.1.1', allHeight: 100.h, isHaveLine: true), CommonItem( leftTitel: TranslationLoader.lanKeys!.subnetMask!.tr, - rightTitle: "255.255.255.0", + rightTitle: '255.255.255.0', allHeight: 100.h, isHaveLine: true), CommonItem( leftTitel: TranslationLoader.lanKeys!.defaultGateway!.tr, - rightTitle: "192.168.1.1", + rightTitle: '192.168.1.1', allHeight: 100.h, isHaveLine: true), SizedBox( @@ -108,7 +107,7 @@ class _GatewayConfigurationWifiPageState CommonItem( leftTitel: TranslationLoader.lanKeys! .automaticallyGetTheDNSServerAddress!.tr, - rightTitle: "", + rightTitle: '', isHaveLine: true, isHaveRightWidget: true, rightWidget: SizedBox( @@ -116,11 +115,11 @@ class _GatewayConfigurationWifiPageState Visibility( visible: true, child: Column( - children: [ + children: [ CommonItem( leftTitel: TranslationLoader .lanKeys!.preferredDNS!.tr, - rightTitle: "", + rightTitle: '', isHaveLine: true, isHaveRightWidget: true, rightWidget: getTFWidget( @@ -129,7 +128,7 @@ class _GatewayConfigurationWifiPageState CommonItem( leftTitel: TranslationLoader .lanKeys!.alternativeDNS!.tr, - rightTitle: "", + rightTitle: '', isHaveLine: false, isHaveRightWidget: true, rightWidget: getTFWidget( @@ -159,7 +158,7 @@ class _GatewayConfigurationWifiPageState ), Row( mainAxisAlignment: MainAxisAlignment.end, - children: [ + children: [ GestureDetector( child: SizedBox( // width: 150.w, @@ -196,7 +195,7 @@ class _GatewayConfigurationWifiPageState height: 50.h, width: 300.w, child: Row( - children: [ + children: [ Expanded( child: TextField( //输入框一行 @@ -229,7 +228,7 @@ class _GatewayConfigurationWifiPageState trackColor: CupertinoColors.systemGrey5, thumbColor: CupertinoColors.white, value: _isOn, - onChanged: (value) { + onChanged: (bool value) { setState(() { _isOn = value; }); diff --git a/lib/mine/gateway/gatewayConnectionLock/gatewayConnectionLockList_page.dart b/lib/mine/gateway/gatewayConnectionLock/gatewayConnectionLockList_page.dart index e8fc166b..639b9bf5 100755 --- a/lib/mine/gateway/gatewayConnectionLock/gatewayConnectionLockList_page.dart +++ b/lib/mine/gateway/gatewayConnectionLock/gatewayConnectionLockList_page.dart @@ -20,7 +20,7 @@ class _GatewayConnectionLockListPageState extends State { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.gateway!.tr, + barTitle: '网关'.tr, haveBack: true, backgroundColor: AppColors.mainColor), body: ListView( diff --git a/lib/mine/gateway/gatewayList/gatewayList_page.dart b/lib/mine/gateway/gatewayList/gatewayList_page.dart index 7721c875..690efd61 100755 --- a/lib/mine/gateway/gatewayList/gatewayList_page.dart +++ b/lib/mine/gateway/gatewayList/gatewayList_page.dart @@ -5,7 +5,6 @@ import 'package:get/get.dart'; import '../../../appRouters.dart'; import '../../../app_settings/app_colors.dart'; import '../../../tools/titleAppBar.dart'; -import '../../../translations/trans_lib.dart'; class GatewayListPage extends StatefulWidget { const GatewayListPage({Key? key}) : super(key: key); @@ -20,7 +19,7 @@ class _GatewayListPageState extends State { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.gateway!.tr, + barTitle: '网关'.tr, haveBack: true, backgroundColor: AppColors.mainColor, actionsList: [ @@ -43,9 +42,9 @@ class _GatewayListPageState extends State { itemBuilder: (c, index) { return _gatewatListItem( 'images/mine/icon_mine_gatewayListMainIcon.png', - "星锁网关", - "在线", - "2", () { + '星锁网关', + '在线', + '2', () { Navigator.pushNamed(context, Routers.gatewayDetailPage); }); }, @@ -91,53 +90,48 @@ class _GatewayListPageState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - Container( - // color: Colors.red, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - gateWayName, - style: TextStyle(fontSize: 24.sp), - ), - ], - ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + gateWayName, + style: TextStyle(fontSize: 24.sp), + ), + ], ), SizedBox(height: 5.h), - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Image.asset( - 'images/mine/icon_mine_gatewayListOnline.png', - width: 22.w, - height: 22.w, - ), - SizedBox( - width: 10.w, - ), - Text( - "在线", - style: TextStyle(fontSize: 18.sp), - ), - SizedBox( - width: 80.w, - ), - Image.asset( - 'images/mine/icon_mine_gatewayListNumber.png', - width: 22.w, - height: 22.w, - ), - SizedBox( - width: 10.w, - ), - Text( - "2", - style: TextStyle( - fontSize: 18.sp, fontWeight: FontWeight.w500), - ), - ], - ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Image.asset( + 'images/mine/icon_mine_gatewayListOnline.png', + width: 22.w, + height: 22.w, + ), + SizedBox( + width: 10.w, + ), + Text( + '在线', + style: TextStyle(fontSize: 18.sp), + ), + SizedBox( + width: 80.w, + ), + Image.asset( + 'images/mine/icon_mine_gatewayListNumber.png', + width: 22.w, + height: 22.w, + ), + SizedBox( + width: 10.w, + ), + Text( + '2', + style: TextStyle( + fontSize: 18.sp, fontWeight: FontWeight.w500), + ), + ], ), SizedBox(width: 20.h), ], diff --git a/lib/mine/message/messageList/messageList_page.dart b/lib/mine/message/messageList/messageList_page.dart index c6d5aba9..c6e2c049 100755 --- a/lib/mine/message/messageList/messageList_page.dart +++ b/lib/mine/message/messageList/messageList_page.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:star_lock/mine/message/messageList/messageList_state.dart'; import 'package:star_lock/tools/noData.dart'; import '../../../appRouters.dart'; @@ -25,8 +26,8 @@ class MessageListPage extends StatefulWidget { class _MessageListPageState extends State with TickerProviderStateMixin { - final logic = Get.put(MessageListLogic()); - final state = Get.find().state; + final MessageListLogic logic = Get.put(MessageListLogic()); + final MessageListState state = Get.find().state; void getHttpData() { logic.messageListDataRequest().then((MessageListEntity value) { @@ -47,22 +48,22 @@ class _MessageListPageState extends State backgroundColor: AppColors.mainBackgroundColor, appBar: widget.showAppBar ? TitleAppBar( - barTitle: TranslationLoader.lanKeys!.message!.tr, + barTitle: '消息'.tr, haveBack: true, - actionsList: [ + actionsList: [ TextButton( child: Text( - "清空".tr, + '清空'.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp), ), onPressed: () async { - var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); + final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { - ShowTipView().showIosTipWithContentDialog("是否清空?".tr, () async { + ShowTipView().showIosTipWithContentDialog('是否清空?'.tr, () async { logic.deletAllMessageDataRequest(); }); } else { - logic.showToast("演示模式".tr); + logic.showToast('演示模式'.tr); } }, ), @@ -80,15 +81,15 @@ class _MessageListPageState extends State : SlidableAutoCloseBehavior( child: ListView.builder( itemCount: state.itemDataList.value.length, - itemBuilder: (c, index) { - MessageItemEntity messageItemEntity = + itemBuilder: (BuildContext c, int index) { + final MessageItemEntity messageItemEntity = state.itemDataList.value[index]; return Slidable( key: ValueKey(messageItemEntity.id), endActionPane: ActionPane( extentRatio: 0.2, motion: const ScrollMotion(), - children: [ + children: [ SlidableAction( onPressed: (BuildContext context) { logic.deletMessageDataRequest( @@ -105,8 +106,8 @@ class _MessageListPageState extends State ], ), child: _messageListItem(messageItemEntity, () { - Get.toNamed(Routers.messageDetailPage, arguments: { - "messageItemEntity": messageItemEntity + Get.toNamed(Routers.messageDetailPage, arguments: { + 'messageItemEntity': messageItemEntity }); }), ); @@ -133,18 +134,18 @@ class _MessageListPageState extends State margin: EdgeInsets.only(left: 20.w, right: 20.w), child: Column( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: [ Row( - children: [ - messageItemEntity.readAt! == 0 ? Container( + children: [ + if (messageItemEntity.readAt! == 0) Container( width: 10.w, height: 10.w, decoration: BoxDecoration( color: Colors.red, borderRadius: BorderRadius.circular(5.w), ), - ):Container(), - messageItemEntity.readAt! == 0 ? SizedBox(width: 5.w) : Container(), + ) else Container(), + if (messageItemEntity.readAt! == 0) SizedBox(width: 5.w) else Container(), Flexible( child: Text( messageItemEntity.data!, @@ -162,7 +163,7 @@ class _MessageListPageState extends State SizedBox(height: 10.h), Row( mainAxisAlignment: MainAxisAlignment.start, - children: [ + children: [ // Image.asset('images/mine/icon_mine_gatewaySignal_strong.png', width: 40.w, height: 40.w,), // SizedBox(width: 10.w,), Text( diff --git a/lib/mine/mine/starLockMine_page.dart b/lib/mine/mine/starLockMine_page.dart index 13aba2be..9f387eab 100755 --- a/lib/mine/mine/starLockMine_page.dart +++ b/lib/mine/mine/starLockMine_page.dart @@ -4,7 +4,6 @@ import 'package:get/get.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/flavors.dart'; import 'package:star_lock/mine/mine/starLockMine_state.dart'; -import 'package:star_lock/tools/commonItem.dart'; import 'package:star_lock/tools/customer_tool.dart'; import '../../appRouters.dart'; @@ -164,7 +163,7 @@ class StarLockMinePageState extends State with BaseWidget { // Navigator.pushNamed(context, Routers.minePersonInfoPage); // }), mineItem('images/mine/icon_mine_main_addLock.png', - TranslationLoader.lanKeys!.addDevice!.tr, () { + '添加设备'.tr, () { Get.back(); Get.toNamed(Routers.selectLockTypePage); }), @@ -173,7 +172,7 @@ class StarLockMinePageState extends State with BaseWidget { // Navigator.pushNamed(context, Routers.gatewayListPage); // }), mineItem('images/mine/icon_mine_main_message.png', - TranslationLoader.lanKeys!.message!.tr, () { + '消息'.tr, () { Get.back(); Get.toNamed(Routers.messageListPage); // Toast.show(msg: "功能暂未开放"); diff --git a/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart b/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart index 623bcdc2..b02caa3e 100755 --- a/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart +++ b/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:star_lock/mine/mineMultiLanguage/mineMultiLanguage_state.dart'; import '../../app_settings/app_colors.dart'; import '../../tools/commonItem.dart'; @@ -18,15 +19,15 @@ class MineMultiLanguagePage extends StatefulWidget { } class _MineMultiLanguagePageState extends State { - final logic = Get.put(MineMultiLanguageLogic()); - final state = Get.find().state; + final MineMultiLanguageLogic logic = Get.put(MineMultiLanguageLogic()); + final MineMultiLanguageState state = Get.find().state; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.multilingual!.tr, + barTitle: '多语言'.tr, haveBack: true, backgroundColor: AppColors.mainColor), body: Column( @@ -38,7 +39,7 @@ class _MineMultiLanguagePageState extends State { } List _children() { - List l = []; + List l = []; // l.add( // CommonItem( // leftTitel: '跟随系统', @@ -52,18 +53,18 @@ class _MineMultiLanguagePageState extends State { // }), // ); for (int i = 0; i < state.languages.length; i++) { - var e = state.languages[i]; - var lanType = ExtensionLanguageType.fromLanguageCode(e.languageCode); + Locale e = state.languages[i]; + LanguageType lanType = ExtensionLanguageType.fromLanguageCode(e.languageCode); l.add( CommonItem( leftTitel: lanType.lanTitle, - rightTitle: "", + rightTitle: '', isHaveLine: true, isHaveDirection: false, isHaveRightWidget: true, rightWidget: Obx(() => state.currentLanguageType.value == lanType ? Image( - image: const AssetImage("images/icon_item_checked.png"), + image: const AssetImage('images/icon_item_checked.png'), width: 30.w, height: 30.w, fit: BoxFit.contain, diff --git a/lib/translations/app_dept.dart b/lib/translations/app_dept.dart index 2b538e20..9c288185 100755 --- a/lib/translations/app_dept.dart +++ b/lib/translations/app_dept.dart @@ -55,7 +55,7 @@ extension ExtensionLanguageType on LanguageType { str = '英文'.tr; break; case LanguageType.chinese: - str = TranslationLoader.lanKeys!.lanChinese!.tr; + str = '中文'.tr; break; } diff --git a/lib/translations/lanKeyEntity.dart b/lib/translations/lanKeyEntity.dart index f7959073..1d84bd0e 100755 --- a/lib/translations/lanKeyEntity.dart +++ b/lib/translations/lanKeyEntity.dart @@ -193,16 +193,16 @@ class LanKeyEntity { // this.noCardPunched, // this.holidayInfo, // this.lanEnglish, - this.lanChinese, - this.multilingual, - this.addLock, - this.lockAddress, - this.selectLockType, - this.videoIntercomDoorLock, - this.NFCPassiveLock, - this.addDevice, - this.gateway, - this.message, + // this.lanChinese, + // this.multilingual, + // this.addLock, + // this.lockAddress, + // this.selectLockType, + // this.videoIntercomDoorLock, + // this.NFCPassiveLock, + // this.addDevice, + // this.gateway, + // this.message, this.supportStaff, this.set, this.moreServices, @@ -656,16 +656,16 @@ class LanKeyEntity { // holidayInfo = json['holidayInfo']; // lanEnglish = json['lanEnglish']; - lanChinese = json['lanChinese']; - multilingual = json['multilingual']; - addLock = json['addLock']; - lockAddress = json["lockAddress"]; - selectLockType = json['selectLockType']; - videoIntercomDoorLock = json['videoIntercomDoorLock']; - NFCPassiveLock = json['NFCPassiveLock']; - addDevice = json['addDevice']; - gateway = json['gateway']; - message = json['message']; + // lanChinese = json['lanChinese']; + // multilingual = json['multilingual']; + // addLock = json['addLock']; + // lockAddress = json['lockAddress']; + // selectLockType = json['selectLockType']; + // videoIntercomDoorLock = json['videoIntercomDoorLock']; + // NFCPassiveLock = json['NFCPassiveLock']; + // addDevice = json['addDevice']; + // gateway = json['gateway']; + // message = json['message']; supportStaff = json['supportStaff']; set = json['set']; moreServices = json['moreServices']; @@ -1161,16 +1161,16 @@ class LanKeyEntity { // String? doorMagneticListTopTip; // String? lanEnglish; - String? lanChinese; - String? multilingual; - String? addLock; - String? lockAddress; - String? selectLockType; - String? videoIntercomDoorLock; - String? NFCPassiveLock; - String? addDevice; - String? gateway; - String? message; + // String? lanChinese; + // String? multilingual; + // String? addLock; + // String? lockAddress; + // String? selectLockType; + // String? videoIntercomDoorLock; + // String? NFCPassiveLock; + // String? addDevice; + // String? gateway; + // String? message; String? supportStaff; String? set; String? moreServices; @@ -1661,15 +1661,15 @@ class LanKeyEntity { // map['lanEnglish'] = lanEnglish; // map['lanChinese'] = lanChinese; - map['multilingual'] = multilingual; - map['addLock'] = addLock; - map['lockAddress'] = lockAddress; - map['selectLockType'] = selectLockType; - map['videoIntercomDoorLock'] = videoIntercomDoorLock; - map['NFCPassiveLock'] = NFCPassiveLock; - map['addDevice'] = addDevice; - map['gateway'] = gateway; - map['message'] = message; + // map['multilingual'] = multilingual; + // map['addLock'] = addLock; + // map['lockAddress'] = lockAddress; + // map['selectLockType'] = selectLockType; + // map['videoIntercomDoorLock'] = videoIntercomDoorLock; + // map['NFCPassiveLock'] = NFCPassiveLock; + // map['addDevice'] = addDevice; + // map['gateway'] = gateway; + // map['message'] = message; map['supportStaff'] = supportStaff; map['set'] = set; map['moreServices'] = moreServices;