From ee5772da0212e7947b5571fb46dbb980896d2b25 Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 11 Mar 2025 15:47:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=B0=83=E6=95=B4=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=AF=86=E7=A0=81=E8=BE=93=E5=85=A5=E6=A1=86=E7=9A=84=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tools/tf_loginInput.dart | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/lib/tools/tf_loginInput.dart b/lib/tools/tf_loginInput.dart index 4c7230c3..ba08fb72 100755 --- a/lib/tools/tf_loginInput.dart +++ b/lib/tools/tf_loginInput.dart @@ -28,7 +28,7 @@ class LoginInput extends StatefulWidget { BlockStrCallback? onchangeAction; BlockStrCallback? onSubmitted; BlockClickCallback? onTapAction; - bool? isLogin;// 是否是登录之前,因为登录之前的密码框文字显示缩在左上角 默认是false + bool? isLogin; // 是否是登录之前,因为登录之前的密码框文字显示缩在左上角 默认是false LoginInput({ Key? key, @@ -94,19 +94,16 @@ class _LoginInputState extends State { autofocus: false, inputFormatters: widget.inputFormatters, textInputAction: TextInputAction.next, - keyboardType: isPwd ? TextInputType.emailAddress : null, - style: isPwd - ? TextStyle( - fontSize: 22.sp, - color: Colors.transparent, - letterSpacing: 2.5, - fontFamily: 'Monospace', - ) - : null, + // 修改键盘类型为密码类型 + keyboardType: isPwd + ? TextInputType.visiblePassword + : TextInputType.emailAddress, + // 添加密码隐藏属性 + obscureText: isPwd, decoration: InputDecoration( //输入里面输入文字内边距设置 - contentPadding: const EdgeInsets.only( - top: 8.0, right: -10.0, bottom: 8.0), + // contentPadding: const EdgeInsets.only( + // top: 8.0, right: -10.0, bottom: 8.0), labelText: widget.label, labelStyle: TextStyle( fontSize: 22.sp, color: AppColors.darkGrayTextColor), @@ -122,20 +119,6 @@ class _LoginInputState extends State { : null, ), ), - if (isPwd) - Padding( - padding: EdgeInsets.only( - top: F.sw(skyCall: () => 27.h, xhjCall: () => widget.isLogin! ? 27.h : 39.h)), - child: Text( - pwd, - style: TextStyle( - fontSize: 22.sp, - color: AppColors.darkGrayTextColor, - letterSpacing: 2.0, - fontFamily: 'Monospace', - ), - ), - ), ], ), ),