From d125a2b47010cfb7969a319eb4c02913cd63a1e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B1=8C=E6=9D=82?= <1147192855@qq.com> Date: Thu, 18 Dec 2025 13:57:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86IOS=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=BE=93=E5=85=A5=E9=9D=9E=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E7=9A=84=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/page/login_page/login_view.dart | 125 ++++++++++++------ 1 file changed, 84 insertions(+), 41 deletions(-) diff --git a/making_school_asignment_app/lib/page/login_page/login_view.dart b/making_school_asignment_app/lib/page/login_page/login_view.dart index 7bca5b1..a38b8bf 100644 --- a/making_school_asignment_app/lib/page/login_page/login_view.dart +++ b/making_school_asignment_app/lib/page/login_page/login_view.dart @@ -81,16 +81,19 @@ class _LoginPageState extends State { child: SizedBox( height: 77.w, width: 77.w, - child: Image.asset('assets/images/login_logo_icon.png', fit: BoxFit.cover), + child: Image.asset('assets/images/login_logo_icon.png', + fit: BoxFit.cover), ), ), Container( margin: EdgeInsets.only(top: 90.r), - padding: EdgeInsets.only(top: 50.h, bottom: 16.h, left: 40.w, right: 40.w), + padding: EdgeInsets.only( + top: 50.h, bottom: 16.h, left: 40.w, right: 40.w), decoration: BoxDecoration( color: Colors.white, - borderRadius: - BorderRadius.only(topLeft: Radius.circular(30.r), topRight: Radius.circular(30.r)), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(30.r), + topRight: Radius.circular(30.r)), /*boxShadow: const [ BoxShadow( color: Color.fromRGBO(46, 91, 255, 0.1), @@ -107,8 +110,10 @@ class _LoginPageState extends State { ), decoration: BoxDecoration( color: Colors.transparent, - border: Border.all(width: 1.w, color: const Color(0xFF434343)), - borderRadius: BorderRadius.all(Radius.circular(17.w)), + border: Border.all( + width: 1.w, color: const Color(0xFF434343)), + borderRadius: + BorderRadius.all(Radius.circular(17.w)), ), child: TextField( controller: state.userNameController, @@ -160,24 +165,29 @@ class _LoginPageState extends State { padding: EdgeInsets.symmetric(horizontal: 15.w), decoration: BoxDecoration( color: Colors.transparent, - border: Border.all(width: 1.w, color: const Color(0xFF434343)), - borderRadius: BorderRadius.all(Radius.circular(17.w)), + border: Border.all( + width: 1.w, color: const Color(0xFF434343)), + borderRadius: + BorderRadius.all(Radius.circular(17.w)), ), child: TextField( focusNode: state.pwdFocus, controller: state.passwordController, - keyboardType: TextInputType.number, + // keyboardType: TextInputType.number, maxLines: 1, obscureText: state.isShowPwd.value, //隐藏密码显示 // textInputAction: state.isShowPwd.value?TextInputAction.go:TextInputAction.next, textInputAction: TextInputAction.send, enableInteractiveSelection: false, - onSubmitted: (_) => easyThrottle('LOGIN_EASYTHROTTLE', () async { + onSubmitted: (_) => + easyThrottle('LOGIN_EASYTHROTTLE', () async { Utils.hideKeyboard(); - await Future.delayed(const Duration(milliseconds: 300)); - WidgetsBinding.instance - .addPostFrameCallback((_) => logic.toLogin(context, upgradeLogic)); + await Future.delayed( + const Duration(milliseconds: 300)); + WidgetsBinding.instance.addPostFrameCallback( + (_) => + logic.toLogin(context, upgradeLogic)); }), style: TextStyle( color: const Color(0xFF434343), @@ -203,7 +213,8 @@ class _LoginPageState extends State { ), suffixIcon: InkWell( onTap: () { - state.isShowPwd.value = !state.isShowPwd.value; + state.isShowPwd.value = + !state.isShowPwd.value; }, child: Padding( padding: EdgeInsets.only(right: 5.r), @@ -246,24 +257,35 @@ class _LoginPageState extends State { child: Checkbox( // activeColor: Colors.transparent, //去掉勾选时背景颜色 - activeColor: Theme.of(context).primaryColor, + activeColor: + Theme.of(context).primaryColor, // checkColor: Colors.white, value: state.keepPwd.value, onChanged: (value) { // Get.focusScope?.nextFocus(); - FocusScope.of(context).requestFocus(state.pwdFocus); - FocusScope.of(context).requestFocus(state.theFocus); - state.keepPwd.value = value ?? false; + FocusScope.of(context) + .requestFocus(state.pwdFocus); + FocusScope.of(context) + .requestFocus(state.theFocus); + state.keepPwd.value = + value ?? false; }, - side: WidgetStateBorderSide.resolveWith( + side: WidgetStateBorderSide + .resolveWith( (Set states) { - if (states.contains(WidgetState.selected)) { + if (states.contains( + WidgetState.selected)) { //修改勾选时边框颜色为红色 return BorderSide( - width: 1.5.r, color: Theme.of(context).primaryColor); + width: 1.5.r, + color: Theme.of(context) + .primaryColor); } //修改默认时边框颜色为绿色 - return BorderSide(width: 1.r, color: const Color(0xFF434343)); + return BorderSide( + width: 1.r, + color: const Color( + 0xFF434343)); }, )), ); @@ -274,9 +296,12 @@ class _LoginPageState extends State { Utils.hideKeyboard(); Get.focusScope?.nextFocus(); Get.focusScope?.nextFocus(); - FocusScope.of(context).requestFocus(state.pwdFocus); - FocusScope.of(context).requestFocus(state.theFocus); - state.keepPwd.value = !state.keepPwd.value; + FocusScope.of(context) + .requestFocus(state.pwdFocus); + FocusScope.of(context) + .requestFocus(state.theFocus); + state.keepPwd.value = + !state.keepPwd.value; }, child: Text( '记住密码', @@ -291,21 +316,26 @@ class _LoginPageState extends State { ), InkWell( onTap: () => Get.toNamed(Routes.register), - child: quickText('账号注册', color: const Color(0xFF434343)), + child: quickText('账号注册', + color: const Color(0xFF434343)), ) ], ), InkWell( - onTap: () => easyThrottle('LOGIN_EASYTHROTTLE', () async { + onTap: () => + easyThrottle('LOGIN_EASYTHROTTLE', () async { Utils.hideKeyboard(); await Future.delayed(Duration.zero); - WidgetsBinding.instance.addPostFrameCallback((_) => logic.toLogin(context, upgradeLogic)); + WidgetsBinding.instance.addPostFrameCallback( + (_) => logic.toLogin(context, upgradeLogic)); }), child: Obx(() { return Container( margin: EdgeInsets.symmetric(vertical: 10.h), decoration: BoxDecoration( - color: state.canLogin.value ? const Color(0xFF8C68FF) : const Color(0xFFdddddd), + color: state.canLogin.value + ? const Color(0xFF8C68FF) + : const Color(0xFFdddddd), /*boxShadow: [ BoxShadow( color: @@ -322,7 +352,8 @@ class _LoginPageState extends State { alignment: Alignment.center, width: double.infinity, height: 50.h, - child: quickText('登 录', size: 18.sp, color: Colors.white)); + child: quickText('登 录', + size: 18.sp, color: Colors.white)); }), ), Row( @@ -343,16 +374,23 @@ class _LoginPageState extends State { state.pwdFocus); FocusScope.of(context).requestFocus( state.theFocus);*/ - state.readAgreement.value = value ?? false; + state.readAgreement.value = + value ?? false; }, side: WidgetStateBorderSide.resolveWith( (Set states) { - if (states.contains(WidgetState.selected)) { + if (states + .contains(WidgetState.selected)) { //修改勾选时边框颜色为红色 - return BorderSide(width: 1.5.r, color: Theme.of(context).primaryColor); + return BorderSide( + width: 1.5.r, + color: Theme.of(context) + .primaryColor); } //修改默认时边框颜色为绿色 - return BorderSide(width: 1.r, color: const Color(0xFF434343)); + return BorderSide( + width: 1.r, + color: const Color(0xFF434343)); }, ), ), @@ -361,8 +399,9 @@ class _LoginPageState extends State { ), InkWell( onTap: () { - Get.toNamed(Routes.agreementPage, - arguments: {"type": AGREEMENT_KEY.USER_AGREEMENT.name}); + Get.toNamed(Routes.agreementPage, arguments: { + "type": AGREEMENT_KEY.USER_AGREEMENT.name + }); }, child: quickText( '请仔细阅读', @@ -371,18 +410,22 @@ class _LoginPageState extends State { ), InkWell( onTap: () { - Get.toNamed(Routes.agreementPage, - arguments: {"type": AGREEMENT_KEY.USER_AGREEMENT.name}); + Get.toNamed(Routes.agreementPage, arguments: { + "type": AGREEMENT_KEY.USER_AGREEMENT.name + }); }, child: Text( '《用户协议》', - style: TextStyle(fontSize: 12.r, color: Theme.of(context).primaryColor), + style: TextStyle( + fontSize: 12.r, + color: Theme.of(context).primaryColor), ), ), InkWell( onTap: () { - Get.toNamed(Routes.agreementPage, - arguments: {"type": AGREEMENT_KEY.PRIVACY_GREEMENT.name}); + Get.toNamed(Routes.agreementPage, arguments: { + "type": AGREEMENT_KEY.PRIVACY_GREEMENT.name + }); }, child: quickText( '《隐私协议》',