fix:修复部分国际化bug、增加切换系统语言时更换到对应语言应用昵称
This commit is contained in:
parent
f562eb085e
commit
50b6cbd655
4
android/app/src/dev/res/values-en-rUS/string.xml
Normal file
4
android/app/src/dev/res/values-en-rUS/string.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Star Lock</string>
|
||||
</resources>
|
||||
4
android/app/src/dev/res/values-zh-rCN/string.xml
Normal file
4
android/app/src/dev/res/values-zh-rCN/string.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">星锁</string>
|
||||
</resources>
|
||||
4
android/app/src/local/res/values-en-rUS/string.xml
Normal file
4
android/app/src/local/res/values-en-rUS/string.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Star Lock</string>
|
||||
</resources>
|
||||
4
android/app/src/local/res/values-zh-rCN/string.xml
Normal file
4
android/app/src/local/res/values-zh-rCN/string.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">星锁</string>
|
||||
</resources>
|
||||
4
android/app/src/main/res/values/values-en-rUS/string.xml
Normal file
4
android/app/src/main/res/values/values-en-rUS/string.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Star Lock</string>
|
||||
</resources>
|
||||
4
android/app/src/main/res/values/values-zh-rCN/string.xml
Normal file
4
android/app/src/main/res/values/values-zh-rCN/string.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">星锁</string>
|
||||
</resources>
|
||||
4
android/app/src/pre/res/values-en-rUS/string.xml
Normal file
4
android/app/src/pre/res/values-en-rUS/string.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Star Lock</string>
|
||||
</resources>
|
||||
4
android/app/src/pre/res/values-zh-rCN/string.xml
Normal file
4
android/app/src/pre/res/values-zh-rCN/string.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">星锁</string>
|
||||
</resources>
|
||||
4
android/app/src/sky/res/values-en-rUS/string.xml
Normal file
4
android/app/src/sky/res/values-en-rUS/string.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Star Lock</string>
|
||||
</resources>
|
||||
4
android/app/src/sky/res/values-zh-rCN/string.xml
Normal file
4
android/app/src/sky/res/values-zh-rCN/string.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">星锁</string>
|
||||
</resources>
|
||||
4
android/app/src/xhj/res/values-en-rUS/string.xml
Normal file
4
android/app/src/xhj/res/values-en-rUS/string.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">Star Lock</string>
|
||||
</resources>
|
||||
4
android/app/src/xhj/res/values-zh-rCN/string.xml
Normal file
4
android/app/src/xhj/res/values-zh-rCN/string.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">星锁</string>
|
||||
</resources>
|
||||
23
ios/Runner/InfoPlist.xcstrings
Normal file
23
ios/Runner/InfoPlist.xcstrings
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"sourceLanguage" : "zh-Hans",
|
||||
"strings" : {
|
||||
"CFBundleDisplayName" : {
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Star Lock"
|
||||
}
|
||||
},
|
||||
"zh-Hans" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "星锁"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"version" : "1.0"
|
||||
}
|
||||
8
ios/Runner/en.lproj/InfoPlist.strings
Normal file
8
ios/Runner/en.lproj/InfoPlist.strings
Normal file
@ -0,0 +1,8 @@
|
||||
/*
|
||||
InfoPlist.strings
|
||||
Runner
|
||||
|
||||
Created by mac on 2024/11/21.
|
||||
|
||||
*/
|
||||
"AppName"="Star Lock";
|
||||
8
ios/Runner/zh-Hans.lproj/InfoPlist.strings
Normal file
8
ios/Runner/zh-Hans.lproj/InfoPlist.strings
Normal file
@ -0,0 +1,8 @@
|
||||
/*
|
||||
InfoPlist.strings
|
||||
Runner
|
||||
|
||||
Created by mac on 2024/11/21.
|
||||
|
||||
*/
|
||||
"AppName"="星锁";
|
||||
@ -1087,7 +1087,8 @@
|
||||
"离线": "离线",
|
||||
"购买记录": "购买记录",
|
||||
"使用记录": "使用记录",
|
||||
|
||||
"失效时间要大于当前时间": "失效时间要大于当前时间",
|
||||
"修改名字": "修改名字"
|
||||
"修改名字": "修改名字",
|
||||
"时": "时",
|
||||
"分": "分"
|
||||
}
|
||||
|
||||
@ -1087,7 +1087,8 @@
|
||||
"离线": "离线",
|
||||
"购买记录": "购买记录",
|
||||
"使用记录": "使用记录",
|
||||
|
||||
"失效时间要大于当前时间": "失效时间要大于当前时间",
|
||||
"修改名字": "修改名字"
|
||||
"修改名字": "修改名字",
|
||||
"时": "时",
|
||||
"分": "分"
|
||||
}
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
|
||||
import 'package:date_format/date_format.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_state.dart';
|
||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||
import 'package:star_lock/tools/pickers/time_picker/model/pduration.dart';
|
||||
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
import '../../../../../tools/commonItem.dart';
|
||||
@ -43,9 +45,7 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
setHeight: false,
|
||||
rightWidget: getTFWidget(
|
||||
'(${"必填".tr})',
|
||||
maxSize: 50)),
|
||||
rightWidget: getTFWidget('(${"必填".tr})', maxSize: 50)),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: '开始日期'.tr,
|
||||
rightTitle: state.beginDate.value.isEmpty
|
||||
@ -54,18 +54,10 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
||||
isHaveLine: true,
|
||||
isHaveDirection: false,
|
||||
action: () async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return ShowCalendar(
|
||||
datePickerMode: DatePickerMode.day,
|
||||
selectAction: (DateTime dateTime) {
|
||||
final String beginDate = formatDate(
|
||||
dateTime, <String>[yyyy, '-', mm, '-', dd]);
|
||||
state.beginDate.value = beginDate;
|
||||
Get.back();
|
||||
// Navigator.of(context).pop(true);
|
||||
});
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: PDuration.now(),
|
||||
mode: DateMode.YMD, onConfirm: (PDuration p) {
|
||||
state.beginDate.value = formatDate(p);
|
||||
});
|
||||
})),
|
||||
Obx(() => CommonItem(
|
||||
@ -76,17 +68,10 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
||||
isHaveLine: true,
|
||||
isHaveDirection: false,
|
||||
action: () async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return ShowCalendar(
|
||||
datePickerMode: DatePickerMode.day,
|
||||
selectAction: (DateTime dateTime) {
|
||||
final String endDate = formatDate(
|
||||
dateTime, <String>[yyyy, '-', mm, '-', dd]);
|
||||
state.endDate.value = endDate;
|
||||
Get.back();
|
||||
});
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: PDuration.now(),
|
||||
mode: DateMode.YMD, onConfirm: (PDuration p) {
|
||||
state.endDate.value = formatDate(p);
|
||||
});
|
||||
})),
|
||||
Obx(() => CommonItem(
|
||||
@ -95,17 +80,10 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
||||
isHaveLine: false,
|
||||
isHaveDirection: false,
|
||||
action: () async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return ShowCalendar(
|
||||
datePickerMode: DatePickerMode.day,
|
||||
selectAction: (DateTime dateTime) {
|
||||
final String makeUpWorkDate = formatDate(
|
||||
dateTime, <String>[yyyy, '-', mm, '-', dd]);
|
||||
state.makeUpWorkDate.value = makeUpWorkDate;
|
||||
Get.back();
|
||||
});
|
||||
Pickers.showDatePicker(context,
|
||||
selectDate: PDuration.now(),
|
||||
mode: DateMode.YMD, onConfirm: (PDuration p) {
|
||||
state.makeUpWorkDate.value = formatDate(p);
|
||||
});
|
||||
})),
|
||||
SizedBox(
|
||||
@ -168,4 +146,21 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String formatDate(PDuration p) {
|
||||
if (p == null) {
|
||||
throw ArgumentError('Input must be a valid DateTime object');
|
||||
}
|
||||
|
||||
String formatPart(int part) {
|
||||
return part.toString().padLeft(2, '0');
|
||||
}
|
||||
|
||||
String monthFormatted = formatPart(p.month!);
|
||||
String dayFormatted = formatPart(p.day!);
|
||||
String hourFormatted = formatPart(p.hour!);
|
||||
String minuteFormatted = formatPart(p.minute!);
|
||||
|
||||
return '${p.year}-${monthFormatted}-${dayFormatted}';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -219,8 +218,6 @@ class _CheckingInSetHolidaysPageState extends State<CheckingInSetHolidaysPage> {
|
||||
context,
|
||||
// 模式,详见下方
|
||||
mode: DateMode.Y,
|
||||
// 后缀 默认Suffix.normal(),为空的话Suffix()
|
||||
suffix: Suffix(years: ' 年'.tr),
|
||||
// 样式 详见下方样式
|
||||
pickerStyle: PickerStyle(
|
||||
cancelButton: GestureDetector(
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:date_format/date_format.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -101,7 +102,8 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
// SizedBox(width: 30.w,),
|
||||
Row(
|
||||
Expanded(
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
width: 20.w,
|
||||
@ -127,7 +129,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: 90.w,
|
||||
|
||||
// height: 100.h,
|
||||
color: Colors.white,
|
||||
child: Obx(() => Column(
|
||||
@ -153,7 +155,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
)),
|
||||
),
|
||||
),
|
||||
// SizedBox(width: 20.w,),
|
||||
SizedBox(width: 20.w,),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
final bool? isDemoMode =
|
||||
@ -175,7 +177,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
width: 90.w,
|
||||
|
||||
// height: 100.h,
|
||||
color: Colors.white,
|
||||
child: Obx(() => Column(
|
||||
@ -202,6 +204,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -19,8 +18,10 @@ class CheckingInSetWorkdaySet extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
final CheckingInSetWorkdaySetLogic logic = Get.put(CheckingInSetWorkdaySetLogic());
|
||||
final CheckingInSetWorkdaySetState state = Get.find<CheckingInSetWorkdaySetLogic>().state;
|
||||
final CheckingInSetWorkdaySetLogic logic =
|
||||
Get.put(CheckingInSetWorkdaySetLogic());
|
||||
final CheckingInSetWorkdaySetState state =
|
||||
Get.find<CheckingInSetWorkdaySetLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -33,12 +34,19 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
body: ListView(
|
||||
children: <Widget>[
|
||||
topBtnWidget(),
|
||||
Obx(() => Visibility(visible: state.isCustom.value, child: bottomCustomSelectBtn())),
|
||||
Obx(() => Visibility(visible: !state.isCustom.value, child: bottomOddOrEvenDaysOffSelectBtn())),
|
||||
SizedBox(height: 50.h,),
|
||||
Obx(() => Visibility(
|
||||
visible: state.isCustom.value, child: bottomCustomSelectBtn())),
|
||||
Obx(() => Visibility(
|
||||
visible: !state.isCustom.value,
|
||||
child: bottomOddOrEvenDaysOffSelectBtn())),
|
||||
SizedBox(
|
||||
height: 50.h,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||
child: SubmitBtn(btnName: '确定'.tr, onClick: () {
|
||||
child: SubmitBtn(
|
||||
btnName: '确定'.tr,
|
||||
onClick: () {
|
||||
if (state.pushType.value == '2') {
|
||||
logic.editCheckInSetInfoData();
|
||||
} else {
|
||||
@ -47,7 +55,6 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
'weekDays': state.weekDays.value,
|
||||
});
|
||||
}
|
||||
|
||||
}),
|
||||
),
|
||||
],
|
||||
@ -58,7 +65,7 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
Widget topBtnWidget() {
|
||||
return Container(
|
||||
width: 1.sw,
|
||||
height: 100.h,
|
||||
constraints: BoxConstraints(minHeight: 100.h),
|
||||
// color: Colors.red,
|
||||
padding: EdgeInsets.all(10.w),
|
||||
child: Obx(() => Row(
|
||||
@ -73,11 +80,16 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
child: Container(
|
||||
width: (1.sw - 5.w * 2) / 2,
|
||||
height: 100.h,
|
||||
color: state.isCustom.value ? AppColors.mainColor : AppColors.btnDisableColor,
|
||||
color: state.isCustom.value
|
||||
? AppColors.mainColor
|
||||
: AppColors.btnDisableColor,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Center(child: Text('自定义'.tr, style: TextStyle(fontSize: 26.sp, color: Colors.white))),
|
||||
Center(
|
||||
child: Text('自定义'.tr,
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp, color: Colors.white))),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -91,8 +103,9 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
},
|
||||
child: Container(
|
||||
width: (1.sw - 10 * 3) / 2,
|
||||
height: 100.h,
|
||||
color: state.isCustom.value ? AppColors.btnDisableColor : AppColors.mainColor,
|
||||
color: state.isCustom.value
|
||||
? AppColors.btnDisableColor
|
||||
: AppColors.mainColor,
|
||||
padding: EdgeInsets.all(10.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -137,10 +150,15 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
},
|
||||
rightWidget: Row(
|
||||
children: <Widget>[
|
||||
Image.asset(state.isSingledayWeekend.value == 0 ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', width: 30.w, height: 30.w,),
|
||||
Image.asset(
|
||||
state.isSingledayWeekend.value == 0
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
),
|
||||
],
|
||||
)
|
||||
)),
|
||||
))),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: '双休'.tr,
|
||||
rightTitle: '',
|
||||
@ -155,10 +173,15 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
},
|
||||
rightWidget: Row(
|
||||
children: <Widget>[
|
||||
Image.asset(state.isSingledayWeekend.value == 1 ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', width: 30.w, height: 30.w,),
|
||||
Image.asset(
|
||||
state.isSingledayWeekend.value == 1
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
),
|
||||
],
|
||||
)
|
||||
)),
|
||||
))),
|
||||
],
|
||||
),
|
||||
);
|
||||
@ -219,13 +242,16 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
},
|
||||
rightWidget: Row(
|
||||
children: <Widget>[
|
||||
Image.asset(state.weekDays.value.contains(index) ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', width: 30.w, height: 30.w,),
|
||||
],
|
||||
)
|
||||
));
|
||||
}
|
||||
Image.asset(
|
||||
state.weekDays.value.contains(index)
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
),
|
||||
],
|
||||
)));
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -32,7 +31,7 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
||||
barTitle: '面容开锁设置'.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Obx(() => Column(
|
||||
body: Obx(() => ListView(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 20.w),
|
||||
@ -58,11 +57,15 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
||||
'防误开'.tr,
|
||||
state.antiMisoperation.value == 0
|
||||
? '防误开已关闭,关门后仍可使用面容开锁'.tr
|
||||
:'防误开已打开,开锁后'.tr + state.antiMisoperation.value.toString() + '秒内不可使用面容开锁'.tr,
|
||||
: '防误开已打开,开锁后'.tr +
|
||||
state.antiMisoperation.value.toString() +
|
||||
'秒内不可使用面容开锁'.tr,
|
||||
// state.antiMisoperation.value == 0 ? '关闭' :
|
||||
'${state.antiMisoperation.value}' + '秒'.tr,
|
||||
state.faceOn.value, () {
|
||||
Pickers.showSinglePicker(Get.context!, data: state.antiMisoperationStrList.value, onConfirm: (var data, int position) {
|
||||
Pickers.showSinglePicker(Get.context!,
|
||||
data: state.antiMisoperationStrList.value,
|
||||
onConfirm: (var data, int position) {
|
||||
AppLog.log('data = $data, position = $position');
|
||||
state.antiMisoperation.value = position;
|
||||
state.setType.value = 2;
|
||||
@ -79,7 +82,8 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
||||
)));
|
||||
}
|
||||
|
||||
Widget _buildSubTitleItem(String leftStr, String subTitle, String rightStr, bool isAble, Function()? action) {
|
||||
Widget _buildSubTitleItem(String leftStr, String subTitle, String rightStr,
|
||||
bool isAble, Function()? action) {
|
||||
return GestureDetector(
|
||||
onTap: isAble ? action : null,
|
||||
child: Container(
|
||||
@ -99,7 +103,11 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
leftStr,
|
||||
style: TextStyle(fontSize: 24.sp, color: isAble ? Colors.black : AppColors.placeholderTextColor),
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp,
|
||||
color: isAble
|
||||
? Colors.black
|
||||
: AppColors.placeholderTextColor),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
@ -109,8 +117,6 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
subTitle,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp, color: AppColors.btnDisableColor),
|
||||
),
|
||||
@ -123,7 +129,9 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
||||
Text(
|
||||
rightStr,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: isAble ? Colors.black : AppColors.placeholderTextColor),
|
||||
fontSize: 22.sp,
|
||||
color:
|
||||
isAble ? Colors.black : AppColors.placeholderTextColor),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10.w,
|
||||
@ -159,7 +167,8 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.faceOn.value, // getIndex == 1 ? state.faceOn.value : state.autoBright.value,
|
||||
value: state.faceOn.value,
|
||||
// getIndex == 1 ? state.faceOn.value : state.autoBright.value,
|
||||
onChanged: (bool value) {
|
||||
if (getIndex == 1) {
|
||||
//设置面容开锁开关
|
||||
@ -181,8 +190,7 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
||||
topTitle: '',
|
||||
items: bottomItemList,
|
||||
chooseCallback: (int value) {
|
||||
state.senseDistance.value =
|
||||
state.senseDistanceList.value[value];
|
||||
state.senseDistance.value = state.senseDistanceList.value[value];
|
||||
state.setType.value = 1;
|
||||
logic.sendFaceUnlock();
|
||||
},
|
||||
|
||||
@ -532,7 +532,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
/// 以下为删除逻辑
|
||||
void deleyLockLogicOfRoles() {
|
||||
if (state.lockBasicInfo.value.isLockOwner == 1) {
|
||||
// 超级管理员必须通过连接蓝牙删除
|
||||
// 超级管理员必须通过连接蓝牙删除q
|
||||
state.showTipView.showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, () {
|
||||
// 删除锁
|
||||
state.showTipView.resetGetController();
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
@ -10,6 +11,7 @@ import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/flavors.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.dart';
|
||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_state.dart';
|
||||
import 'package:star_lock/tools/langue/langue_tool.dart';
|
||||
import 'package:star_lock/tools/wechat/customer_tool.dart';
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
@ -149,6 +151,8 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
}
|
||||
|
||||
Widget getListDataView() {
|
||||
// 检测系统语言是否为中文
|
||||
bool isChinese = LanguageTool.instance.isChinese;
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
/* 2024-01-12 会议确定去掉“提示音、触摸开锁” by DaisyWu
|
||||
@ -192,6 +196,7 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
height: 50.h,
|
||||
child: Obx(_isPushNotificationSwitch))),
|
||||
// if (F.appFlavor == Flavor.sky)
|
||||
if (isChinese)
|
||||
CommonItem(
|
||||
leftTitel: '微信公众号推送'.tr,
|
||||
rightTitle: '',
|
||||
@ -200,9 +205,11 @@ class _MineSetPageState extends State<MineSetPage>
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w,
|
||||
height: 50.h,
|
||||
child: Obx(_isWechatPublicAccountPushSwitch))),
|
||||
// else
|
||||
// Container(),
|
||||
child: Obx(_isWechatPublicAccountPushSwitch),
|
||||
),
|
||||
)
|
||||
else
|
||||
Container(),
|
||||
SizedBox(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: '锁用户管理'.tr,
|
||||
|
||||
13
lib/tools/langue/langue_tool.dart
Normal file
13
lib/tools/langue/langue_tool.dart
Normal file
@ -0,0 +1,13 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class LanguageTool {
|
||||
LanguageTool._();
|
||||
|
||||
static LanguageTool? _instance;
|
||||
|
||||
static LanguageTool get instance => _instance ??= LanguageTool._();
|
||||
|
||||
String get currentLanguage => Get.locale?.languageCode ?? 'zh';
|
||||
|
||||
bool get isChinese => currentLanguage == 'zh';
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user