From f53921fa5d3e3fa4c70a57041751d0c0cb59f9b5 Mon Sep 17 00:00:00 2001 From: Daisy <> Date: Sat, 29 Jul 2023 10:58:26 +0800 Subject: [PATCH] =?UTF-8?q?1=EF=BC=8C=E6=9B=B4=E6=96=B0=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E3=80=81=E6=B3=A8=E5=86=8C=E3=80=81=E5=BF=98=E8=AE=B0=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E6=A8=A1=E5=9D=97UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/images/icon_login_account.png | Bin 0 -> 1612 bytes star_lock/images/icon_login_password.png | Bin 0 -> 1481 bytes star_lock/images/icon_select_circle.png | Bin 0 -> 2248 bytes star_lock/images/lan/lan_keys.json | 2 +- .../starLock_forgetPassword_page.dart | 162 ++++++---- .../lib/login/login/starLock_login_page.dart | 266 ++++++++-------- .../register/starLock_register_page.dart | 286 ++++++++++++------ 7 files changed, 440 insertions(+), 276 deletions(-) create mode 100644 star_lock/images/icon_login_account.png create mode 100644 star_lock/images/icon_login_password.png create mode 100644 star_lock/images/icon_select_circle.png diff --git a/star_lock/images/icon_login_account.png b/star_lock/images/icon_login_account.png new file mode 100644 index 0000000000000000000000000000000000000000..75986a0355dcf20b55dc5b73264c7d2d8c4aad0b GIT binary patch literal 1612 zcmV-S2DABzP)kyRG)<5sX-JmkRJB^YRw3R!+qAVDplMo~5Yn@C!IKGu5RtZ!!wvMmjBZLfJJ2`|W z6F83Br7h%(_<%8P_}Rx{Jed#-2G=-_qpbx1K92%H5axKE@7aaQlL>u&eUcyu4{3`5 zIJi))T)cQu^&|e5JbCgY?a73(v9XoDzP=1?K>z?O%PvGBk*9vd{uYkoaGsCNXV0E} ziZQ015D5l@n`2{RE41T&56>nflgZ`&{{BUpJ4G-UoR7!j^V9-%Kp+sME%+Iy$=3YPIGZ$AR75-8)|6V2qc~pFcl; z>((t_7TX{8-)(^L@$pv}<3^!SP-I!Y=k_=)isJmhz`(*$82~^r(VER>!^L7TU8z)V z=(?UJgg`q(Fvh@f+=3{IYXbuV3)in-@97ly5~?Y80DxRBCzeX3$x5Y?R8@6E*Y#=B zG-0pquqX(^W+)WOoI7{!pI+|*?VxVLVb<5zIYLO-vMi2a7{C~-mo8oUDGDx!@zsRm zg6D-XpU-oero}W(>(_NXY#2s(|5tY$hjSbU9LM2o+h%Rs<^TW~hA|LAgkczP90w3W z2FtQ4%d!f`aSG4#N+1x}>UANez!(F|vcU8F1D@wgfk0sA^y$+(qA0Elg0PuLBz(JC|ImcDZ{H5>FLd>K{f=px zerfq8fj|I4q0pbvXmlwWjV}3NMq3kJzI>V5-rk;SHk(7bu1^y}X!qSQ2qEA&4tSn_ z7!HSD4Gs>@U%7IH+LZaqgj_Bs7K_ChS(a0(s!r4Dh!zMTh(sa};_>)At%~;lOjuoA z4QDc$`?4(il1`@y&-07J!^016-n{vDx3La(hj;JZ#Ux3(U#V1PyA9e4bX}j!=kpvP zM7(|bc2}3UgIi>wP?#x~%d^Mn++Y|+YHMpN{o=)ouIix(;B$4kTrT&t^hFE9Fj9p= zVMdaqA+IqI06?i!N;R9!DSFa+ORZK*@9gY&9t}v6q@hNmF+x++QBW?IZ@hW)#?$ve zilQVf%R08BU>{XgXJlFS^jHMdYPDZ_eG2pg(=_4Jr%#@q3!ql3_o*gJoInb_c)290hyHUDxeSlnMK|H3BgV)3XOsy}-6@a2$tq(+2td60O(Rwhg9f zx>^(PN!lU-05nYlgpjK(5(|Q`X<62h{q=@6qA0Ef0)dj7Hva*O3e?pH47}F>0000< KMNUMnLSTZCJo*#> literal 0 HcmV?d00001 diff --git a/star_lock/images/icon_login_password.png b/star_lock/images/icon_login_password.png new file mode 100644 index 0000000000000000000000000000000000000000..b3bf1c7290f7a3d68e20217ebad3525caa398482 GIT binary patch literal 1481 zcmV;)1vdJLP)M_7J(zMBKo4$Gw+0f+1zK9e5T$9jppASC zDb+B@>|v)06*?cCQe*rlJ@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2j~NOBaZzT%mko^ShW>>>fhPMgLt#R6|M#%VE$j}N6Bllk zFIQbv16m0cERy2{XTi&+q!1I;_WjM}255+hYB%H<)1yLzADq8Lg#sILjOniAfC09! zhelB2x*T(+Q4C&i{$dn?bvfqDp%Hgp3w?1bNJO@=2~@Qr+mz>NKj3~qV64bC<&90C zs)2G~k7XpxEFG^X6(?LGF3-Cbq2`@F<2 zMF8t_&6ARcQMEU-7oSSGnr#5*f@@#<*6*-y5i(Q7cQaGOqKB createState() => _StarLockForgetPasswordPageState(); + State createState() => + _StarLockForgetPasswordPageState(); } -class _StarLockForgetPasswordPageState extends State { +class _StarLockForgetPasswordPageState + extends State { final TextEditingController _phoneController = TextEditingController(); final TextEditingController _pwdController = TextEditingController(); final TextEditingController _codeController = TextEditingController(); @@ -34,89 +35,129 @@ class _StarLockForgetPasswordPageState extends State return Scaffold( resizeToAvoidBottomInset: false, backgroundColor: const Color(0xFFFFFFFF), - appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys!.reset!.tr} ${TranslationLoader.lanKeys!.password!.tr}", haveBack:true, backgroundColor: AppColors.mainColor), - body:ListView( - padding: EdgeInsets.only( - top: 40.h, - left: 40.w, - right: 40.w - ), + appBar: TitleAppBar( + barTitle: + "${TranslationLoader.lanKeys!.reset!.tr}${TranslationLoader.lanKeys!.password!.tr}", + haveBack: true, + backgroundColor: AppColors.mainColor), + body: ListView( + padding: EdgeInsets.only(top: 40.h, left: 40.w, right: 40.w), children: [ - LoginInput(controller: _phoneController, - leftWidget:Padding( - padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w), - child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + LoginInput( + controller: _phoneController, + leftWidget: Padding( + padding: EdgeInsets.only( + top: 30.w, bottom: 20.w, right: 20.w, left: 5.w), + child: Image.asset( + 'images/icon_login_account.png', + width: 36.w, + height: 36.w, + ), ), - hintText: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, + hintText: + TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, keyboardType: TextInputType.number, inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), LengthLimitingTextInputFormatter(20), - ]), - SizedBox(height: 10.w), + ]), + SizedBox(height: 10.h), LoginInput( controller: _pwdController, isPwd: true, - leftWidget:Padding( - padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w), - child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + leftWidget: Padding( + padding: EdgeInsets.only( + top: 30.w, bottom: 20.w, right: 20.w, left: 5.w), + child: Image.asset( + 'images/icon_login_password.png', + width: 36.w, + height: 36.w, + ), ), - hintText: "${TranslationLoader.lanKeys!.pleaseEnter!.tr} ${TranslationLoader.lanKeys!.password!.tr}", + hintText: + "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}", inputFormatters: [ LengthLimitingTextInputFormatter(20), - ]), + ]), SizedBox(height: 15.w), - Text(TranslationLoader.lanKeys!.registerPasswordTip!.tr, style: TextStyle(color: const Color(0xFF999999), fontSize: 26.sp),), - SizedBox(height: 10.w), - LoginInput( - controller: _pwdController, - isPwd: true, - leftWidget:Padding( - padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w), - child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), - ), - hintText: "${TranslationLoader.lanKeys!.sure!.tr} ${TranslationLoader.lanKeys!.password!.tr}", - inputFormatters: [ - LengthLimitingTextInputFormatter(20), - ] + Text( + TranslationLoader.lanKeys!.registerPasswordTip!.tr, + style: TextStyle( + color: AppColors.placeholderTextColor, fontSize: 20.sp), ), SizedBox(height: 10.w), + LoginInput( + controller: _pwdController, + isPwd: true, + leftWidget: Padding( + padding: EdgeInsets.only( + top: 30.w, bottom: 20.w, right: 20.w, left: 5.w), + child: Image.asset( + 'images/icon_login_password.png', + width: 36.w, + height: 36.w, + ), + ), + hintText: + "${TranslationLoader.lanKeys!.sure!.tr}${TranslationLoader.lanKeys!.password!.tr}", + inputFormatters: [ + LengthLimitingTextInputFormatter(20), + ]), + SizedBox(height: 10.h), Row( children: [ Expanded( child: LoginInput( controller: _codeController, isPwd: true, - leftWidget:Padding( - padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w), - child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), - ), - hintText: "${TranslationLoader.lanKeys!.pleaseEnter!.tr} ${TranslationLoader.lanKeys!.verificationCode!.tr}", + leftWidget: Padding( + padding: EdgeInsets.only( + top: 30.w, bottom: 20.w, right: 20.w, left: 5.w), + child: SizedBox( + width: 36.w, + height: 36.w, + ) + // Image.asset( + // 'images/main/icon_main_search.png', + // width: 40.w, + // height: 40.w, + // ), + ), + hintText: + "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}", inputFormatters: [ LengthLimitingTextInputFormatter(20), - ]), + ]), + ), + SizedBox( + width: 20.w, ), - SizedBox(width: 20.w,), GestureDetector( child: Container( - width: 180.w, + width: 160.w, height: 60.h, padding: EdgeInsets.all(5.h), decoration: BoxDecoration( color: AppColors.mainColor, - borderRadius: BorderRadius.circular(5) - ), + borderRadius: BorderRadius.circular(5)), child: Center( - child: Text(_seconds==60?'${TranslationLoader.lanKeys!.getTip!.tr} ${TranslationLoader.lanKeys!.verificationCode!.tr}': (_seconds<10)?'0$_seconds s':'$_seconds s', textAlign:TextAlign.center, style: TextStyle( - color: Colors.white, - fontSize: 26.sp, - )), + child: Text( + _seconds == 60 + ? '${TranslationLoader.lanKeys!.getTip!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}' + : (_seconds < 10) + ? '0$_seconds s' + : '$_seconds s', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 26.sp, + )), ), ), - onTap: (){ - if(_seconds==60){ + onTap: () { + if (_seconds == 60) { // _setVerify(); - }else{ + } else { // Toast.show(msg: '正在获取验证码'); } }, @@ -124,13 +165,14 @@ class _StarLockForgetPasswordPageState extends State ], ), SizedBox(height: 50.w), - SubmitBtn(btnName: "${TranslationLoader.lanKeys!.reset!.tr} ${TranslationLoader.lanKeys!.password!.tr}", fontSize: 30.sp, borderRadius: 20.w, padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ - - }), + SubmitBtn( + btnName: + "${TranslationLoader.lanKeys!.reset!.tr}${TranslationLoader.lanKeys!.password!.tr}", + fontSize: 30.sp, + borderRadius: 20.w, + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () {}), ], - ) - ); + )); } - - -} \ No newline at end of file +} diff --git a/star_lock/lib/login/login/starLock_login_page.dart b/star_lock/lib/login/login/starLock_login_page.dart index 79eaeb87..9c2f0d62 100644 --- a/star_lock/lib/login/login/starLock_login_page.dart +++ b/star_lock/lib/login/login/starLock_login_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -25,133 +24,148 @@ class _StarLockLoginPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - resizeToAvoidBottomInset: false, - backgroundColor: const Color(0xFFFFFFFF), - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.login!.tr, haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ - TextButton( - child: Text(TranslationLoader.lanKeys!.register!.tr, style: const TextStyle(color: Colors.white),), - onPressed: (){ - Navigator.pushNamed(context, Routers.starLockRegisterPage); - },), - ],), - body:ListView( - padding: EdgeInsets.only( - top: 120.h, - left: 40.w, - right: 40.w + resizeToAvoidBottomInset: false, + backgroundColor: const Color(0xFFFFFFFF), + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.login!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor, + actionsList: [ + TextButton( + child: Text( + TranslationLoader.lanKeys!.register!.tr, + style: const TextStyle(color: Colors.white), + ), + onPressed: () { + Navigator.pushNamed(context, Routers.starLockRegisterPage); + }, + ), + ], ), - children: [ - Container( - padding: EdgeInsets.all(10.w), - child: Center( - child: Image.asset('images/icon_main_1024.png', width: 150.w, height: 150.w) - ) - ), - SizedBox(height: 50.w), - LoginInput( - controller: _phoneController, - leftWidget:Padding( - padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w), - child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), - ), - hintText: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, - keyboardType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.allow(RegExp('[0-9]')), - LengthLimitingTextInputFormatter(20), - ] - ), - SizedBox(height: 50.w), - LoginInput( - controller: _pwdController, - isPwd: true, - leftWidget:Padding( - padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w), - child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), - ), - hintText: "${TranslationLoader.lanKeys!.pleaseEnter!.tr} ${TranslationLoader.lanKeys!.password!.tr}", - inputFormatters: [ - LengthLimitingTextInputFormatter(20), - ] - ), - SizedBox(height: 20.h), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 20.h, - width: 26.w, - child: Checkbox(value: false, onChanged: (value){ - - }) - ), - SizedBox(width: 15.w,), - Flexible( - child: RichText( - text: TextSpan( - text: TranslationLoader.lanKeys!.readAndAgree!.tr, - style: TextStyle( - color: const Color(0xff333333), - fontSize: 26.sp - ), - children: [ - WidgetSpan( - alignment: PlaceholderAlignment.middle, - child: GestureDetector( - child: Text('《${TranslationLoader.lanKeys!.userAgreement!.tr}》',style: TextStyle( - color: AppColors.mainColor, - fontSize: 26.sp - )), - onTap: (){ - - }, - ) - ), - WidgetSpan( - alignment: PlaceholderAlignment.middle, - child: GestureDetector( - child: Text('《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》',style: TextStyle( - color: AppColors.mainColor, - fontSize: 26.sp - )), - onTap: (){ - - }, - ) - ), - ], - ) - ), - ) - ], - ), - SizedBox(height: 50.w), - SubmitBtn(btnName: TranslationLoader.lanKeys!.login!.tr, fontSize: 28.sp, borderRadius: 20.w, padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){ - - }), - SizedBox(height: 50.w), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - GestureDetector( - child: SizedBox( - // width: 150.w, - height: 50.h, - // color: Colors.red, - child: Center( - child: Text('${TranslationLoader.lanKeys!.forgetPassword!.tr}?',style: TextStyle(fontSize: 24.sp)), + body: ListView( + padding: EdgeInsets.only(top: 120.h, left: 40.w, right: 40.w), + children: [ + Container( + padding: EdgeInsets.all(10.w), + child: Center( + child: Image.asset('images/icon_main_1024.png', + width: 110.w, height: 110.w))), + SizedBox(height: 50.w), + LoginInput( + controller: _phoneController, + leftWidget: Padding( + padding: EdgeInsets.only( + top: 30.w, bottom: 20.w, right: 20.w, left: 5.w), + child: Image.asset( + 'images/icon_login_account.png', + width: 36.w, + height: 36.w, ), ), - onTap: (){ - Navigator.pushNamed(context, Routers.starLockForgetPasswordPage); - }, - ) - ], - ), - ], - ) - ); + hintText: + TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, + keyboardType: TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp('[0-9]')), + LengthLimitingTextInputFormatter(20), + ]), + SizedBox(height: 10.h), + LoginInput( + controller: _pwdController, + isPwd: true, + leftWidget: Padding( + padding: EdgeInsets.only( + top: 30.w, bottom: 20.w, right: 20.w, left: 5.w), + child: Image.asset( + 'images/icon_login_password.png', + width: 36.w, + height: 36.w, + ), + ), + hintText: + "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}", + inputFormatters: [ + LengthLimitingTextInputFormatter(20), + ]), + SizedBox(height: 20.h), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Image.asset( + 'images/icon_select_circle.png', + width: 28.w, + height: 28.w, + ), + // SizedBox( + // height: 20.h, + // width: 26.w, + // child: Checkbox(value: false, onChanged: (value) {})), + SizedBox( + width: 15.w, + ), + Flexible( + child: RichText( + text: TextSpan( + text: TranslationLoader.lanKeys!.readAndAgree!.tr, + style: TextStyle( + color: const Color(0xff333333), fontSize: 20.sp), + children: [ + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: GestureDetector( + child: Text( + '《${TranslationLoader.lanKeys!.userAgreement!.tr}》', + style: TextStyle( + color: AppColors.mainColor, + fontSize: 20.sp)), + onTap: () {}, + )), + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: GestureDetector( + child: Text( + '《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》', + style: TextStyle( + color: AppColors.mainColor, + fontSize: 20.sp)), + onTap: () {}, + )), + ], + )), + ) + ], + ), + SizedBox(height: 50.w), + SubmitBtn( + btnName: TranslationLoader.lanKeys!.login!.tr, + fontSize: 28.sp, + borderRadius: 20.w, + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () {}), + SizedBox(height: 50.w), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + child: SizedBox( + // width: 150.w, + height: 50.h, + // color: Colors.red, + child: Center( + child: Text( + '${TranslationLoader.lanKeys!.forgetPassword!.tr}?', + style: TextStyle( + fontSize: 22.sp, color: AppColors.mainColor)), + ), + ), + onTap: () { + Navigator.pushNamed( + context, Routers.starLockForgetPasswordPage); + }, + ) + ], + ), + ], + )); } - - } diff --git a/star_lock/lib/login/register/starLock_register_page.dart b/star_lock/lib/login/register/starLock_register_page.dart index 0b162c41..ecccf893 100644 --- a/star_lock/lib/login/register/starLock_register_page.dart +++ b/star_lock/lib/login/register/starLock_register_page.dart @@ -1,5 +1,5 @@ - import 'dart:async'; +import 'dart:ffi'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -22,7 +22,6 @@ class StarLockRegisterPage extends StatefulWidget { } class _StarLockRegisterPageState extends State { - final logic = Get.find(); final state = Get.find().state; @@ -34,13 +33,12 @@ class _StarLockRegisterPageState extends State { return Scaffold( resizeToAvoidBottomInset: false, backgroundColor: const Color(0xFFFFFFFF), - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.register!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body:ListView( - padding: EdgeInsets.only( - top: 40.h, - left: 40.w, - right: 40.w - ), + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.register!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: ListView( + padding: EdgeInsets.only(top: 40.h, left: 40.w, right: 40.w), children: [ topSeletCountryAndRegionWidget(), middleTFWidget(), @@ -53,64 +51,73 @@ class _StarLockRegisterPageState extends State { borderRadius: 20.w, padding: EdgeInsets.only(top: 25.w, bottom: 25.w), isDisabled: state.canSub.value, - onClick: state.canSub.value ? (){ - logic.register(); - }:null - ); + onClick: state.canSub.value + ? () { + logic.register(); + } + : null); }), + SizedBox( + height: 20.h, + ), + _buildBottomAgreement() ], - ) - ); + )); } - Widget topSeletCountryAndRegionWidget (){ + Widget topSeletCountryAndRegionWidget() { return Column( children: [ - SizedBox(height:50.h), + SizedBox(height: 50.h), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - width: 420.w, + width: 340.w, height: 60.h, // color: Colors.red, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(30.h)), border: const Border( - top: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), - left: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), - right: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), - bottom: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), - ) - ), + top: BorderSide(width: 1.0, color: AppColors.greyLineColor), + left: + BorderSide(width: 1.0, color: AppColors.greyLineColor), + right: + BorderSide(width: 1.0, color: AppColors.greyLineColor), + bottom: + BorderSide(width: 1.0, color: AppColors.greyLineColor), + )), child: Row( children: [ GestureDetector( - onTap: (){ - - }, + onTap: () {}, child: Container( - width: 210.w, + width: 170.w, height: 60.h, // color: Colors.red, decoration: BoxDecoration( - color: AppColors.mainColor, - borderRadius: BorderRadius.all(Radius.circular(30.h)), + color: AppColors.mainColor, + borderRadius: + BorderRadius.all(Radius.circular(30.h)), border: const Border( - top: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), - left: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), - right: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), - bottom: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), - ) - ), - child: Center(child: Text(TranslationLoader.lanKeys!.iphone!.tr, style: TextStyle(color: Colors.white),)) - ), + top: BorderSide( + width: 1.0, color: AppColors.greyLineColor), + left: BorderSide( + width: 1.0, color: AppColors.greyLineColor), + right: BorderSide( + width: 1.0, color: AppColors.greyLineColor), + bottom: BorderSide( + width: 1.0, color: AppColors.greyLineColor), + )), + child: Center( + child: Text( + TranslationLoader.lanKeys!.iphone!.tr, + style: TextStyle(color: Colors.white), + ))), ), Expanded( child: GestureDetector( - onTap: (){ - - }, + onTap: () {}, child: Container( height: 60.h, // color: Colors.red, @@ -123,22 +130,26 @@ class _StarLockRegisterPageState extends State { // bottom: BorderSide(width: 1.0, color: Color(0xffC0C0C0)), // ) // ), - child: Center(child: Text(TranslationLoader.lanKeys!.email!.tr, style: const TextStyle(color: Colors.black),)) - ), + child: Center( + child: Text( + TranslationLoader.lanKeys!.email!.tr, + style: const TextStyle(color: Colors.black), + ))), ), ), ], ), ), - ], ), - SizedBox(height:60.h), + SizedBox(height: 60.h), GestureDetector( onTap: () async { Navigator.pushNamed(context, Routers.seletCountryRegionPage); - var result = await Navigator.pushNamed(context, Routers.seletCountryRegionPage); - logic.state.countryCode.value = (result as Map)['code']; + var result = await Navigator.pushNamed( + context, Routers.seletCountryRegionPage); + logic.state.countryCode.value = + (result as Map)['code']; logic.state.countryId.value = result["countryId"]; // print("路由返回值: ${result}, countryCode:${logic.state.countryCode} ,countryId:${logic.state.countryId}"); }, @@ -148,27 +159,42 @@ class _StarLockRegisterPageState extends State { // padding: EdgeInsets.only(left:20.w, right: 10.w, top: 20.w, bottom: 20.w), child: Row( children: [ - SizedBox(width:5.w), - Expanded(child: Text(TranslationLoader.lanKeys!.countryAndRegion!.tr, style: TextStyle(fontSize: 26.sp))), - SizedBox(width:20.w), + SizedBox(width: 5.w), + Expanded( + child: Text(TranslationLoader.lanKeys!.countryAndRegion!.tr, + style: TextStyle( + fontSize: 26.sp, color: AppColors.blackColor))), + SizedBox(width: 20.w), Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - Text("中国+86", textAlign: TextAlign.end, style: TextStyle(fontSize: 26.sp),) + Text( + "中国+86", + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 26.sp, color: AppColors.blackColor), + ) ], ), - SizedBox(width:5.w), - Image.asset('images/icon_right.png', width: 50.w, height: 50.w,), + SizedBox(width: 5.w), + Image.asset( + 'images/icon_right.png', + width: 50.w, + height: 50.w, + ), ], ), ), ), - Container(height: 0.5.h, color: Colors.grey,) + Container( + height: 0.5.h, + color: Colors.grey, + ) ], ); } - Widget middleTFWidget (){ + Widget middleTFWidget() { return Column( children: [ LoginInput( @@ -177,17 +203,21 @@ class _StarLockRegisterPageState extends State { print("3333333:${v}"); logic.checkNext(state.phoneOrEmailController); }, - leftWidget:Padding( - padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w), - child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + leftWidget: Padding( + padding: EdgeInsets.only( + top: 30.w, bottom: 20.w, right: 20.w, left: 5.w), + child: Image.asset( + 'images/icon_login_account.png', + width: 40.w, + height: 40.w, + ), ), hintText: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, keyboardType: TextInputType.number, inputFormatters: [ FilteringTextInputFormatter.allow(RegExp('[0-9]')), LengthLimitingTextInputFormatter(20), - ] - ), + ]), SizedBox(height: 10.w), LoginInput( controller: state.pwdController, @@ -195,17 +225,26 @@ class _StarLockRegisterPageState extends State { logic.checkNext(state.pwdController); }, isPwd: true, - leftWidget:Padding( - padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w), - child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + leftWidget: Padding( + padding: EdgeInsets.only( + top: 30.w, bottom: 20.w, right: 20.w, left: 5.w), + child: Image.asset( + 'images/icon_login_password.png', + width: 40.w, + height: 40.w, + ), ), - hintText: "${TranslationLoader.lanKeys!.pleaseEnter!.tr} ${TranslationLoader.lanKeys!.password!.tr}", + hintText: + "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.password!.tr}", inputFormatters: [ LengthLimitingTextInputFormatter(20), - ] - ), + ]), SizedBox(height: 15.w), - Text(TranslationLoader.lanKeys!.registerPasswordTip!.tr, style: TextStyle(color: const Color(0xFF999999), fontSize: 26.sp),), + Text( + TranslationLoader.lanKeys!.registerPasswordTip!.tr, + style: + TextStyle(color: AppColors.placeholderTextColor, fontSize: 20.sp), + ), SizedBox(height: 10.w), LoginInput( controller: state.sureController, @@ -213,15 +252,20 @@ class _StarLockRegisterPageState extends State { logic.checkNext(state.sureController); }, isPwd: true, - leftWidget:Padding( - padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w), - child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + leftWidget: Padding( + padding: EdgeInsets.only( + top: 30.w, bottom: 20.w, right: 20.w, left: 5.w), + child: Image.asset( + 'images/icon_login_password.png', + width: 40.w, + height: 40.w, + ), ), - hintText: "${TranslationLoader.lanKeys!.sure!.tr} ${TranslationLoader.lanKeys!.password!.tr}", + hintText: + "${TranslationLoader.lanKeys!.sure!.tr}${TranslationLoader.lanKeys!.password!.tr}", inputFormatters: [ LengthLimitingTextInputFormatter(20), - ] - ), + ]), SizedBox(height: 10.w), Row( children: [ @@ -232,17 +276,28 @@ class _StarLockRegisterPageState extends State { onchangeAction: (v) { logic.checkNext(state.codeController); }, - leftWidget:Padding( - padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w), - child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), + leftWidget: Padding( + padding: EdgeInsets.only( + top: 30.w, bottom: 20.w, right: 20.w, left: 5.w), + child: SizedBox( + width: 36.w, + height: 36.w, + ), + // Image.asset( + // 'images/main/icon_main_search.png', + // width: 40.w, + // height: 40.w, + // ), ), - hintText: "${TranslationLoader.lanKeys!.pleaseEnter!.tr} ${TranslationLoader.lanKeys!.verificationCode!.tr}", + hintText: + "${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}", inputFormatters: [ LengthLimitingTextInputFormatter(20), - ] - ), + ]), + ), + SizedBox( + width: 20.w, ), - SizedBox(width: 20.w,), GestureDetector( child: Container( width: 180.w, @@ -250,20 +305,26 @@ class _StarLockRegisterPageState extends State { padding: EdgeInsets.all(5.h), decoration: BoxDecoration( color: AppColors.mainColor, - borderRadius: BorderRadius.circular(5) - ), + borderRadius: BorderRadius.circular(5)), child: Center( - child: Text(_seconds==60?'${TranslationLoader.lanKeys!.getTip!.tr} ${TranslationLoader.lanKeys!.verificationCode!.tr}': (_seconds<10)?'0$_seconds s':'$_seconds s', textAlign:TextAlign.center, style: TextStyle( - color: Colors.white, - fontSize: 26.sp, - )), + child: Text( + _seconds == 60 + ? '${TranslationLoader.lanKeys!.getTip!.tr}${TranslationLoader.lanKeys!.verificationCode!.tr}' + : (_seconds < 10) + ? '0$_seconds s' + : '$_seconds s', + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontSize: 26.sp, + )), ), ), - onTap: (){ + onTap: () { Navigator.pushNamed(context, Routers.safetyVerificationPage); - if(_seconds==60){ + if (_seconds == 60) { // _setVerify(); - }else{ + } else { // Toast.show(msg: '正在获取验证码'); } }, @@ -274,4 +335,51 @@ class _StarLockRegisterPageState extends State { ], ); } + + Widget _buildBottomAgreement() { + return Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Image.asset( + 'images/icon_select_circle.png', + width: 28.w, + height: 28.w, + ), + // SizedBox( + // height: 20.h, + // width: 26.w, + // child: Checkbox(value: false, onChanged: (value) {})), + SizedBox( + width: 15.w, + ), + Flexible( + child: RichText( + text: TextSpan( + text: TranslationLoader.lanKeys!.readAndAgree!.tr, + style: TextStyle(color: const Color(0xff333333), fontSize: 20.sp), + children: [ + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: GestureDetector( + child: Text( + '《${TranslationLoader.lanKeys!.userAgreement!.tr}》', + style: TextStyle( + color: AppColors.mainColor, fontSize: 20.sp)), + onTap: () {}, + )), + WidgetSpan( + alignment: PlaceholderAlignment.middle, + child: GestureDetector( + child: Text( + '《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》', + style: TextStyle( + color: AppColors.mainColor, fontSize: 20.sp)), + onTap: () {}, + )), + ], + )), + ) + ], + ); + } }