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:date_format/date_format.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_state.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 '../../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../../tools/commonItem.dart';
|
import '../../../../../tools/commonItem.dart';
|
||||||
@ -43,9 +45,7 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
setHeight: false,
|
setHeight: false,
|
||||||
rightWidget: getTFWidget(
|
rightWidget: getTFWidget('(${"必填".tr})', maxSize: 50)),
|
||||||
'(${"必填".tr})',
|
|
||||||
maxSize: 50)),
|
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: '开始日期'.tr,
|
leftTitel: '开始日期'.tr,
|
||||||
rightTitle: state.beginDate.value.isEmpty
|
rightTitle: state.beginDate.value.isEmpty
|
||||||
@ -54,18 +54,10 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: false,
|
isHaveDirection: false,
|
||||||
action: () async {
|
action: () async {
|
||||||
await showDialog(
|
Pickers.showDatePicker(context,
|
||||||
context: context,
|
selectDate: PDuration.now(),
|
||||||
builder: (BuildContext context) {
|
mode: DateMode.YMD, onConfirm: (PDuration p) {
|
||||||
return ShowCalendar(
|
state.beginDate.value = formatDate(p);
|
||||||
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);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
})),
|
})),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
@ -76,17 +68,10 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: false,
|
isHaveDirection: false,
|
||||||
action: () async {
|
action: () async {
|
||||||
await showDialog(
|
Pickers.showDatePicker(context,
|
||||||
context: context,
|
selectDate: PDuration.now(),
|
||||||
builder: (BuildContext context) {
|
mode: DateMode.YMD, onConfirm: (PDuration p) {
|
||||||
return ShowCalendar(
|
state.endDate.value = formatDate(p);
|
||||||
datePickerMode: DatePickerMode.day,
|
|
||||||
selectAction: (DateTime dateTime) {
|
|
||||||
final String endDate = formatDate(
|
|
||||||
dateTime, <String>[yyyy, '-', mm, '-', dd]);
|
|
||||||
state.endDate.value = endDate;
|
|
||||||
Get.back();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
})),
|
})),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
@ -95,17 +80,10 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
|||||||
isHaveLine: false,
|
isHaveLine: false,
|
||||||
isHaveDirection: false,
|
isHaveDirection: false,
|
||||||
action: () async {
|
action: () async {
|
||||||
await showDialog(
|
Pickers.showDatePicker(context,
|
||||||
context: context,
|
selectDate: PDuration.now(),
|
||||||
builder: (BuildContext context) {
|
mode: DateMode.YMD, onConfirm: (PDuration p) {
|
||||||
return ShowCalendar(
|
state.makeUpWorkDate.value = formatDate(p);
|
||||||
datePickerMode: DatePickerMode.day,
|
|
||||||
selectAction: (DateTime dateTime) {
|
|
||||||
final String makeUpWorkDate = formatDate(
|
|
||||||
dateTime, <String>[yyyy, '-', mm, '-', dd]);
|
|
||||||
state.makeUpWorkDate.value = makeUpWorkDate;
|
|
||||||
Get.back();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
})),
|
})),
|
||||||
SizedBox(
|
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/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@ -219,8 +218,6 @@ class _CheckingInSetHolidaysPageState extends State<CheckingInSetHolidaysPage> {
|
|||||||
context,
|
context,
|
||||||
// 模式,详见下方
|
// 模式,详见下方
|
||||||
mode: DateMode.Y,
|
mode: DateMode.Y,
|
||||||
// 后缀 默认Suffix.normal(),为空的话Suffix()
|
|
||||||
suffix: Suffix(years: ' 年'.tr),
|
|
||||||
// 样式 详见下方样式
|
// 样式 详见下方样式
|
||||||
pickerStyle: PickerStyle(
|
pickerStyle: PickerStyle(
|
||||||
cancelButton: GestureDetector(
|
cancelButton: GestureDetector(
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
import 'package:cached_network_image/cached_network_image.dart';
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:date_format/date_format.dart';
|
import 'package:date_format/date_format.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@ -101,7 +102,8 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
// SizedBox(width: 30.w,),
|
// SizedBox(width: 30.w,),
|
||||||
Row(
|
Expanded(
|
||||||
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 20.w,
|
width: 20.w,
|
||||||
@ -127,7 +129,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 90.w,
|
|
||||||
// height: 100.h,
|
// height: 100.h,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Obx(() => Column(
|
child: Obx(() => Column(
|
||||||
@ -153,7 +155,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
|||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// SizedBox(width: 20.w,),
|
SizedBox(width: 20.w,),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final bool? isDemoMode =
|
final bool? isDemoMode =
|
||||||
@ -175,7 +177,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 90.w,
|
|
||||||
// height: 100.h,
|
// height: 100.h,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Obx(() => Column(
|
child: Obx(() => Column(
|
||||||
@ -202,6 +204,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@ -19,8 +18,10 @@ class CheckingInSetWorkdaySet extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||||
final CheckingInSetWorkdaySetLogic logic = Get.put(CheckingInSetWorkdaySetLogic());
|
final CheckingInSetWorkdaySetLogic logic =
|
||||||
final CheckingInSetWorkdaySetState state = Get.find<CheckingInSetWorkdaySetLogic>().state;
|
Get.put(CheckingInSetWorkdaySetLogic());
|
||||||
|
final CheckingInSetWorkdaySetState state =
|
||||||
|
Get.find<CheckingInSetWorkdaySetLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -33,12 +34,19 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
body: ListView(
|
body: ListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
topBtnWidget(),
|
topBtnWidget(),
|
||||||
Obx(() => Visibility(visible: state.isCustom.value, child: bottomCustomSelectBtn())),
|
Obx(() => Visibility(
|
||||||
Obx(() => Visibility(visible: !state.isCustom.value, child: bottomOddOrEvenDaysOffSelectBtn())),
|
visible: state.isCustom.value, child: bottomCustomSelectBtn())),
|
||||||
SizedBox(height: 50.h,),
|
Obx(() => Visibility(
|
||||||
|
visible: !state.isCustom.value,
|
||||||
|
child: bottomOddOrEvenDaysOffSelectBtn())),
|
||||||
|
SizedBox(
|
||||||
|
height: 50.h,
|
||||||
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||||
child: SubmitBtn(btnName: '确定'.tr, onClick: () {
|
child: SubmitBtn(
|
||||||
|
btnName: '确定'.tr,
|
||||||
|
onClick: () {
|
||||||
if (state.pushType.value == '2') {
|
if (state.pushType.value == '2') {
|
||||||
logic.editCheckInSetInfoData();
|
logic.editCheckInSetInfoData();
|
||||||
} else {
|
} else {
|
||||||
@ -47,7 +55,6 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
'weekDays': state.weekDays.value,
|
'weekDays': state.weekDays.value,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -58,7 +65,7 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
Widget topBtnWidget() {
|
Widget topBtnWidget() {
|
||||||
return Container(
|
return Container(
|
||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
height: 100.h,
|
constraints: BoxConstraints(minHeight: 100.h),
|
||||||
// color: Colors.red,
|
// color: Colors.red,
|
||||||
padding: EdgeInsets.all(10.w),
|
padding: EdgeInsets.all(10.w),
|
||||||
child: Obx(() => Row(
|
child: Obx(() => Row(
|
||||||
@ -73,11 +80,16 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: (1.sw - 5.w * 2) / 2,
|
width: (1.sw - 5.w * 2) / 2,
|
||||||
height: 100.h,
|
height: 100.h,
|
||||||
color: state.isCustom.value ? AppColors.mainColor : AppColors.btnDisableColor,
|
color: state.isCustom.value
|
||||||
|
? AppColors.mainColor
|
||||||
|
: AppColors.btnDisableColor,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
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(
|
child: Container(
|
||||||
width: (1.sw - 10 * 3) / 2,
|
width: (1.sw - 10 * 3) / 2,
|
||||||
height: 100.h,
|
color: state.isCustom.value
|
||||||
color: state.isCustom.value ? AppColors.btnDisableColor : AppColors.mainColor,
|
? AppColors.btnDisableColor
|
||||||
|
: AppColors.mainColor,
|
||||||
padding: EdgeInsets.all(10.w),
|
padding: EdgeInsets.all(10.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@ -137,10 +150,15 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
},
|
},
|
||||||
rightWidget: Row(
|
rightWidget: Row(
|
||||||
children: <Widget>[
|
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(
|
Obx(() => CommonItem(
|
||||||
leftTitel: '双休'.tr,
|
leftTitel: '双休'.tr,
|
||||||
rightTitle: '',
|
rightTitle: '',
|
||||||
@ -155,10 +173,15 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
|||||||
},
|
},
|
||||||
rightWidget: Row(
|
rightWidget: Row(
|
||||||
children: <Widget>[
|
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(
|
rightWidget: Row(
|
||||||
children: <Widget>[
|
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/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -32,7 +31,7 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
barTitle: '面容开锁设置'.tr,
|
barTitle: '面容开锁设置'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Obx(() => Column(
|
body: Obx(() => ListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(left: 20.w),
|
margin: EdgeInsets.only(left: 20.w),
|
||||||
@ -58,11 +57,15 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
'防误开'.tr,
|
'防误开'.tr,
|
||||||
state.antiMisoperation.value == 0
|
state.antiMisoperation.value == 0
|
||||||
? '防误开已关闭,关门后仍可使用面容开锁'.tr
|
? '防误开已关闭,关门后仍可使用面容开锁'.tr
|
||||||
:'防误开已打开,开锁后'.tr + state.antiMisoperation.value.toString() + '秒内不可使用面容开锁'.tr,
|
: '防误开已打开,开锁后'.tr +
|
||||||
|
state.antiMisoperation.value.toString() +
|
||||||
|
'秒内不可使用面容开锁'.tr,
|
||||||
// state.antiMisoperation.value == 0 ? '关闭' :
|
// state.antiMisoperation.value == 0 ? '关闭' :
|
||||||
'${state.antiMisoperation.value}' + '秒'.tr,
|
'${state.antiMisoperation.value}' + '秒'.tr,
|
||||||
state.faceOn.value, () {
|
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');
|
AppLog.log('data = $data, position = $position');
|
||||||
state.antiMisoperation.value = position;
|
state.antiMisoperation.value = position;
|
||||||
state.setType.value = 2;
|
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(
|
return GestureDetector(
|
||||||
onTap: isAble ? action : null,
|
onTap: isAble ? action : null,
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -99,7 +103,11 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Text(
|
child: Text(
|
||||||
leftStr,
|
leftStr,
|
||||||
style: TextStyle(fontSize: 24.sp, color: isAble ? Colors.black : AppColors.placeholderTextColor),
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp,
|
||||||
|
color: isAble
|
||||||
|
? Colors.black
|
||||||
|
: AppColors.placeholderTextColor),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -109,8 +117,6 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Text(
|
child: Text(
|
||||||
subTitle,
|
subTitle,
|
||||||
maxLines: 2,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.sp, color: AppColors.btnDisableColor),
|
fontSize: 20.sp, color: AppColors.btnDisableColor),
|
||||||
),
|
),
|
||||||
@ -123,7 +129,9 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
Text(
|
Text(
|
||||||
rightStr,
|
rightStr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22.sp, color: isAble ? Colors.black : AppColors.placeholderTextColor),
|
fontSize: 22.sp,
|
||||||
|
color:
|
||||||
|
isAble ? Colors.black : AppColors.placeholderTextColor),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 10.w,
|
width: 10.w,
|
||||||
@ -159,7 +167,8 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
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) {
|
onChanged: (bool value) {
|
||||||
if (getIndex == 1) {
|
if (getIndex == 1) {
|
||||||
//设置面容开锁开关
|
//设置面容开锁开关
|
||||||
@ -181,8 +190,7 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
topTitle: '',
|
topTitle: '',
|
||||||
items: bottomItemList,
|
items: bottomItemList,
|
||||||
chooseCallback: (int value) {
|
chooseCallback: (int value) {
|
||||||
state.senseDistance.value =
|
state.senseDistance.value = state.senseDistanceList.value[value];
|
||||||
state.senseDistanceList.value[value];
|
|
||||||
state.setType.value = 1;
|
state.setType.value = 1;
|
||||||
logic.sendFaceUnlock();
|
logic.sendFaceUnlock();
|
||||||
},
|
},
|
||||||
|
|||||||
@ -532,7 +532,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
/// 以下为删除逻辑
|
/// 以下为删除逻辑
|
||||||
void deleyLockLogicOfRoles() {
|
void deleyLockLogicOfRoles() {
|
||||||
if (state.lockBasicInfo.value.isLockOwner == 1) {
|
if (state.lockBasicInfo.value.isLockOwner == 1) {
|
||||||
// 超级管理员必须通过连接蓝牙删除
|
// 超级管理员必须通过连接蓝牙删除q
|
||||||
state.showTipView.showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, () {
|
state.showTipView.showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, () {
|
||||||
// 删除锁
|
// 删除锁
|
||||||
state.showTipView.resetGetController();
|
state.showTipView.resetGetController();
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
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/flavors.dart';
|
||||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_logic.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/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 'package:star_lock/tools/wechat/customer_tool.dart';
|
||||||
import '../../../appRouters.dart';
|
import '../../../appRouters.dart';
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
@ -149,6 +151,8 @@ class _MineSetPageState extends State<MineSetPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget getListDataView() {
|
Widget getListDataView() {
|
||||||
|
// 检测系统语言是否为中文
|
||||||
|
bool isChinese = LanguageTool.instance.isChinese;
|
||||||
return Column(
|
return Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
/* 2024-01-12 会议确定去掉“提示音、触摸开锁” by DaisyWu
|
/* 2024-01-12 会议确定去掉“提示音、触摸开锁” by DaisyWu
|
||||||
@ -192,6 +196,7 @@ class _MineSetPageState extends State<MineSetPage>
|
|||||||
height: 50.h,
|
height: 50.h,
|
||||||
child: Obx(_isPushNotificationSwitch))),
|
child: Obx(_isPushNotificationSwitch))),
|
||||||
// if (F.appFlavor == Flavor.sky)
|
// if (F.appFlavor == Flavor.sky)
|
||||||
|
if (isChinese)
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: '微信公众号推送'.tr,
|
leftTitel: '微信公众号推送'.tr,
|
||||||
rightTitle: '',
|
rightTitle: '',
|
||||||
@ -200,9 +205,11 @@ class _MineSetPageState extends State<MineSetPage>
|
|||||||
rightWidget: SizedBox(
|
rightWidget: SizedBox(
|
||||||
width: 60.w,
|
width: 60.w,
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
child: Obx(_isWechatPublicAccountPushSwitch))),
|
child: Obx(_isWechatPublicAccountPushSwitch),
|
||||||
// else
|
),
|
||||||
// Container(),
|
)
|
||||||
|
else
|
||||||
|
Container(),
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: '锁用户管理'.tr,
|
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