style:格式化整理

This commit is contained in:
liyi 2025-03-13 15:07:26 +08:00
parent face4dfd45
commit f4c55687f5

View File

@ -1,4 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -87,7 +87,8 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
onTap: () {
state.isIphoneType.value = true;
},
child: Obx(() => Container(
child: Obx(
() => Container(
width: 170.w,
height: 60.h,
decoration: state.isIphoneType.value
@ -99,39 +100,52 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
width: 1.0, color: AppColors.greyLineColor))
: null,
child: Center(
child: Text(
'手机'.tr,
style: TextStyle(
color: state.isIphoneType.value
? Colors.white
: Colors.black),
)))),
child: Text(
'手机'.tr,
style: TextStyle(
color: state.isIphoneType.value
? Colors.white
: Colors.black),
),
),
),
),
),
Expanded(
child: GestureDetector(
onTap: () {
state.isIphoneType.value = false;
},
child: Obx(() => Container(
child: Obx(
() => Container(
height: 60.h,
// color: Colors.red,
decoration: state.isIphoneType.value
? null
: BoxDecoration(
color: AppColors.mainColor,
borderRadius:
BorderRadius.all(Radius.circular(30.h)),
borderRadius: BorderRadius.all(
Radius.circular(
30.h,
),
),
border: Border.all(
width: 1.0,
color: AppColors.greyLineColor)),
width: 1.0,
color: AppColors.greyLineColor,
),
),
child: Center(
child: Text(
'邮箱'.tr,
style: TextStyle(
child: Text(
'邮箱'.tr,
style: TextStyle(
color: state.isIphoneType.value
? Colors.black
: Colors.white),
)))),
: Colors.white,
),
),
),
),
),
),
),
],
@ -157,8 +171,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
children: <Widget>[
SizedBox(width: 5.w),
Expanded(
child: Text(
'你所在的国家/地区'.tr,
child: Text('你所在的国家/地区'.tr,
style: TextStyle(
fontSize: 26.sp, color: AppColors.blackColor))),
SizedBox(width: 20.w),
@ -213,8 +226,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
height: 30.w,
),
),
hintText:
state.isIphoneType.value ? '请输入手机号'.tr : '请输入邮箱'.tr,
hintText: state.isIphoneType.value ? '请输入手机号'.tr : '请输入邮箱'.tr,
keyboardType: TextInputType.number,
inputFormatters: <TextInputFormatter>[
// FilteringTextInputFormatter.allow(RegExp('[0-9]')),
@ -236,7 +248,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
height: 30.w,
),
),
hintText:'请输入密码'.tr,
hintText: '请输入密码'.tr,
inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(20),
]),
@ -282,8 +294,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
height: 30.w,
),
),
hintText:
'请输入验证码'.tr,
hintText: '请输入验证码'.tr,
inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(20),
]),
@ -292,29 +303,29 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
width: 20.w,
),
Obx(() => GestureDetector(
onTap:
(state.canSendCode.value && state.canResend.value)
? () async {
// Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value});
final Object? result = await Navigator.pushNamed(
context, Routers.safetyVerificationPage,
arguments: <String, Object>{
'countryCode': state.countryCode,
'account': state.phoneOrEmailStr.value
});
state.xWidth.value =
(result! as Map<String, dynamic>)['xWidth'];
logic.sendValidationCode();
}
: null,
onTap: (state.canSendCode.value && state.canResend.value)
? () async {
// Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value});
final Object? result = await Navigator.pushNamed(
context, Routers.safetyVerificationPage,
arguments: <String, Object>{
'countryCode': state.countryCode,
'account': state.phoneOrEmailStr.value
});
state.xWidth.value =
(result! as Map<String, dynamic>)['xWidth'];
logic.sendValidationCode();
}
: null,
child: Container(
width: 180.w,
// height: 60.h,
padding: EdgeInsets.all(10.h),
decoration: BoxDecoration(
color: (state.canSendCode.value && state.canResend.value)
? AppColors.mainColor
: Colors.grey,
color:
(state.canSendCode.value && state.canResend.value)
? AppColors.mainColor
: Colors.grey,
borderRadius: BorderRadius.circular(5)),
child: Center(
child: Text(state.btnText.value,
@ -361,29 +372,29 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: GestureDetector(
child: Text(
'${'用户协议'.tr}',
child: Text('${'用户协议'.tr}',
style: TextStyle(
color: AppColors.mainColor, fontSize: 20.sp)),
onTap: () {
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
'url': XSConstantMacro.userAgreementURL,
'title': '用户协议'.tr
});
Get.toNamed(Routers.webviewShowPage,
arguments: <String, String>{
'url': XSConstantMacro.userAgreementURL,
'title': '用户协议'.tr
});
},
)),
WidgetSpan(
alignment: PlaceholderAlignment.middle,
child: GestureDetector(
child: Text(
'${'隐私政策'.tr}',
child: Text('${'隐私政策'.tr}',
style: TextStyle(
color: AppColors.mainColor, fontSize: 20.sp)),
onTap: () {
Get.toNamed(Routers.webviewShowPage, arguments: <String, String>{
'url': XSConstantMacro.privacyPolicyURL,
'title': '隐私政策'.tr
});
Get.toNamed(Routers.webviewShowPage,
arguments: <String, String>{
'url': XSConstantMacro.privacyPolicyURL,
'title': '隐私政策'.tr
});
},
)),
],