fix:修复部分国际化bug

This commit is contained in:
liyi 2024-11-26 11:14:48 +08:00
parent 4730b0ebc9
commit 860016cbf8
4 changed files with 96 additions and 97 deletions

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Star Lock</string> <string name="app_name">TTLock Pro</string>
</resources> </resources>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name"></string> <string name="app_name">通通</string>
</resources> </resources>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">星锁</string> <string name="app_name"></string>
</resources> </resources>

View File

@ -748,109 +748,108 @@ class _LockDetailPageState extends State<LockDetailPage>
Widget adminInfoView( Widget adminInfoView(
{bool center = true, bool max = true, bool add = false}) { {bool center = true, bool max = true, bool add = false}) {
return Expanded( return Row(
child: Wrap( mainAxisAlignment:
children: <Widget>[ center ? MainAxisAlignment.center : MainAxisAlignment.start,
Row( children: <Widget>[
mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min, Row(
children: [ mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min,
Image.asset( children: [
'images/icon_electronicKey_admin.png', Image.asset(
'images/icon_electronicKey_admin.png',
width: 24.w,
height: 20.w,
color: AppColors.blackColor, //
),
SizedBox(width: 6.w),
Text(
state.keyInfos.value.isLockOwner == 1
? '超级管理员'.tr
: (state.keyInfos.value.keyRight == 1
? '授权管理员'.tr
: '普通用户'.tr),
style: TextStyle(
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
),
if (add) SizedBox(width: 20.w) else SizedBox(width: 40.w),
],
),
Row(
mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min,
children: [
FlavorsImg(
child: Image.asset(
state.keyInfos.value.hasGateway == 1
? 'images/main/icon_main_remoteUnlocking.png'
: 'images/main/icon_main_remoteUnlocking_grey.png',
width: 24.w, width: 24.w,
height: 20.w, height: 20.w,
color: AppColors.blackColor, //
), ),
SizedBox(width: 6.w), ),
Text( SizedBox(width: 6.w),
state.keyInfos.value.isLockOwner == 1 Text(
? '超级管理员'.tr '网关设备'.tr,
: (state.keyInfos.value.keyRight == 1 style: TextStyle(
? '授权管理员'.tr fontSize: 20.sp,
: '普通用户'.tr), color: state.keyInfos.value.hasGateway == 1
style: TextStyle( ? AppColors.mainColor
fontSize: 20.sp, color: AppColors.darkGrayTextColor), : AppColors.btnDisableColor),
), ),
if (add) SizedBox(width: 20.w) else SizedBox(width: 40.w), if (add) SizedBox(width: 20.w) else SizedBox(width: 20.w),
], ],
), ),
Row( Row(
mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min, mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min,
children: [ children: [
FlavorsImg( FlavorsImg(
child: Image.asset( child: Image.asset('images/main/icon_lockDetail_needNetwork.png',
state.keyInfos.value.hasGateway == 1
? 'images/main/icon_main_remoteUnlocking.png'
: 'images/main/icon_main_remoteUnlocking_grey.png',
width: 24.w, width: 24.w,
height: 20.w, height: 20.w,
), color: state.isOpenLockNeedOnline.value == 1
), ? AppColors.mainColor
SizedBox(width: 6.w), : AppColors.btnDisableColor),
Text( ),
'网关设备'.tr, SizedBox(width: 6.w),
style: TextStyle( Text(
fontSize: 20.sp, '手机需联网'.tr,
color: state.keyInfos.value.hasGateway == 1 style: TextStyle(
? AppColors.mainColor fontSize: 20.sp,
: AppColors.btnDisableColor), color: state.isOpenLockNeedOnline.value == 1
), ? AppColors.mainColor
if (add) SizedBox(width: 20.w) else SizedBox(width: 20.w), : AppColors.btnDisableColor),
], ),
), if (add) ...<Widget>[
Row( const Spacer(),
mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min, GestureDetector(
children: [ onTap: () {
FlavorsImg( Get.toNamed(Routers.selectLockTypePage);
child: Image.asset( },
'images/main/icon_lockDetail_needNetwork.png', child: Padding(
width: 24.w, padding: const EdgeInsets.all(8.0),
height: 20.w, child: Row(
color: state.isOpenLockNeedOnline.value == 1 mainAxisSize: MainAxisSize.min,
? AppColors.mainColor children: <Widget>[
: AppColors.btnDisableColor), FlavorsImg(
), child: Image.asset(
SizedBox(width: 6.w), 'images/mine/icon_mine_main_addLock.png',
Text( width: 24.w,
'手机需联网'.tr, height: 20.w,
style: TextStyle(
fontSize: 20.sp,
color: state.isOpenLockNeedOnline.value == 1
? AppColors.mainColor
: AppColors.btnDisableColor),
),
if (add) ...<Widget>[
const Spacer(),
GestureDetector(
onTap: () {
Get.toNamed(Routers.selectLockTypePage);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
FlavorsImg(
child: Image.asset(
'images/mine/icon_mine_main_addLock.png',
width: 24.w,
height: 20.w,
),
), ),
Text( ),
'添加设备'.tr, Text(
style: TextStyle( '添加设备'.tr,
fontSize: 20.sp, style: TextStyle(
color: AppColors.darkGrayTextColor), fontSize: 20.sp,
) color: AppColors.darkGrayTextColor),
], )
), ],
), ),
), ),
], ),
], ],
) ],
], )
), ],
); );
} }