多语言
This commit is contained in:
@@ -38,7 +38,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
//todo 初始化传感器id
|
||||
// Initialize person A
|
||||
peopleList.add({
|
||||
'mac': device?.macA,
|
||||
'mac'.tr: device?.macA,
|
||||
'gender': 1,
|
||||
'id': device!.macAID,
|
||||
});
|
||||
@@ -46,7 +46,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
// Initialize person B if exists
|
||||
if (device?.macB != null && device!.macB!.isNotEmpty) {
|
||||
peopleList.add({
|
||||
'mac': device.macB,
|
||||
'mac'.tr: device.macB,
|
||||
'gender': 1,
|
||||
'id': device!.macBID,
|
||||
});
|
||||
@@ -105,7 +105,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
|
||||
try {
|
||||
var body = {
|
||||
'mac': personData['mac'],
|
||||
'mac'.tr: personData['mac'.tr],
|
||||
'name': personData['name'],
|
||||
'gender': personData['gender'],
|
||||
'height': personData['height'],
|
||||
@@ -117,7 +117,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
'id': personData['id'],
|
||||
};
|
||||
await requestWithLog(
|
||||
logTitle: "保存用户信息",
|
||||
logTitle: "保存用户信息".tr,
|
||||
method: MyHttpMethod.put,
|
||||
queryUrl: queryUrl,
|
||||
data: body,
|
||||
@@ -171,7 +171,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'人员资料',
|
||||
'人员资料'.tr,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
@@ -192,7 +192,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
for (var person in peopleList) {
|
||||
await _savePersonData(person, context);
|
||||
}
|
||||
TopSlideNotification.show(context, text: "保存成功");
|
||||
TopSlideNotification.show(context, text: "保存成功".tr);
|
||||
MHTHomeController mhtHomeController = Get.find();
|
||||
mhtHomeController.getPersonList();
|
||||
// Get.offNamed("/bindDeviceSuccess");
|
||||
@@ -214,7 +214,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
height: 60.rpx,
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
"下一步",
|
||||
"下一步".tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0XFF011D33),
|
||||
@@ -251,7 +251,9 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
top: index == 0 ? 30.rpx : 90.rpx,
|
||||
bottom: 20.rpx),
|
||||
child: Text(
|
||||
"人员资料${index == 0 ? "A" : "B"}",
|
||||
index == 0
|
||||
? 'person_info_A'.tr
|
||||
: 'person_info_B'.tr,
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 30.rpx),
|
||||
),
|
||||
@@ -272,7 +274,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'姓名',
|
||||
'姓名'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
@@ -289,10 +291,10 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
color: Colors.white),
|
||||
decoration: const InputDecoration(
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.transparent,
|
||||
filled: true,
|
||||
hintText: "请输入姓名",
|
||||
hintText: "请输入姓名".tr,
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.white),
|
||||
border: InputBorder.none,
|
||||
@@ -323,12 +325,11 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
const Duration(milliseconds: 250),
|
||||
() {
|
||||
showOneSelectionDialog(context,
|
||||
arr: ["女", "男"],
|
||||
title: "选择性别".tr,
|
||||
arr: ["女".tr, "男".tr],
|
||||
checkIndex: peopleList[index]
|
||||
['gender'] ==
|
||||
"女"
|
||||
? 0
|
||||
: 1, checkChange: (sindex) {
|
||||
['gender'],
|
||||
checkChange: (sindex) {
|
||||
setState(() {
|
||||
peopleList[index]['gender'] =
|
||||
sindex;
|
||||
@@ -342,7 +343,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'性别',
|
||||
'性别'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
@@ -356,7 +357,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
Container(
|
||||
width: 200.rpx,
|
||||
child: Text(
|
||||
'${peopleList[index]['gender'] == 1 ? '男' : '女'}',
|
||||
'${peopleList[index]['gender'] == 1 ? '男'.tr : '女'.tr}',
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
@@ -413,7 +414,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'身高(cm)',
|
||||
'身高(cm)'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
@@ -476,7 +477,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'体重(kg)',
|
||||
'体重(kg)'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
@@ -543,7 +544,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'生日',
|
||||
'生日'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: Color(0xFF9EA4B7),
|
||||
@@ -563,7 +564,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
? time_08_Formatter_pattern(
|
||||
peopleList[index]
|
||||
['birthday'],
|
||||
"yyyy年MM月dd日")
|
||||
"yyyy年MM月dd日".tr)
|
||||
: '',
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
@@ -622,7 +623,7 @@ class _MHTPeopleInfoPageState extends State<MHTPeopleInfoPage> {
|
||||
decoration: InputDecoration(
|
||||
fillColor: Colors.transparent,
|
||||
filled: true,
|
||||
hintText: "请输入联系方式",
|
||||
hintText: "请输入联系方式".tr,
|
||||
hintStyle: TextStyle(
|
||||
color: Colors.white),
|
||||
border: InputBorder.none,
|
||||
|
||||
Reference in New Issue
Block a user