diff --git a/lib/tools/tf_loginInput.dart b/lib/tools/tf_loginInput.dart index 3ab4c6b8..e4627341 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, @@ -93,17 +93,20 @@ class _LoginInputState extends State { onTap: widget.onTapAction, autofocus: false, inputFormatters: widget.inputFormatters, - textInputAction: isPwd ? TextInputAction.done : TextInputAction.next, - // 修改键盘类型为密码类型 - keyboardType: isPwd - ? TextInputType.visiblePassword - : TextInputType.emailAddress, - // 添加密码隐藏属性 - obscureText: isPwd, + textInputAction: TextInputAction.next, + keyboardType: isPwd ? TextInputType.emailAddress : null, + style: isPwd + ? TextStyle( + fontSize: 22.sp, + color: Colors.transparent, + letterSpacing: 2.5, + fontFamily: 'Monospace', + ) + : null, 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), @@ -113,12 +116,26 @@ class _LoginInputState extends State { border: InputBorder.none, suffixIcon: (widget.isSuffixIcon ?? false) ? IconButton( - icon: const Icon(Icons.clear), - onPressed: widget.controller!.clear, - ) + icon: const Icon(Icons.clear), + onPressed: widget.controller!.clear, + ) : 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', + ), + ), + ), ], ), ), @@ -146,24 +163,24 @@ class _LoginInputState extends State { top: 8.0, left: -10.0, right: -10.0, bottom: 8.0), labelText: widget.label, labelStyle: - TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor), + TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor), hintStyle: TextStyle(fontSize: 22.sp), hintText: widget.hintText, //不需要输入框下划线 border: InputBorder.none, suffixIcon: (widget.isSuffixIcon ?? false) ? IconButton( - icon: const Icon(Icons.clear), - onPressed: widget.controller!.clear, - ) + icon: const Icon(Icons.clear), + onPressed: widget.controller!.clear, + ) : null, //左边图标设置 icon: widget.isHaveLeftWidget == true ? widget.leftWidget : SizedBox( - width: 20.w, - height: 40.w, - ), + width: 20.w, + height: 40.w, + ), ), obscureText: widget.isPwd ?? false, ),