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