feat:调整登录密码输入框的密码样式
This commit is contained in:
parent
982a41cffe
commit
ee5772da02
@ -28,7 +28,7 @@ class LoginInput extends StatefulWidget {
|
|||||||
BlockStrCallback? onchangeAction;
|
BlockStrCallback? onchangeAction;
|
||||||
BlockStrCallback? onSubmitted;
|
BlockStrCallback? onSubmitted;
|
||||||
BlockClickCallback? onTapAction;
|
BlockClickCallback? onTapAction;
|
||||||
bool? isLogin;// 是否是登录之前,因为登录之前的密码框文字显示缩在左上角 默认是false
|
bool? isLogin; // 是否是登录之前,因为登录之前的密码框文字显示缩在左上角 默认是false
|
||||||
|
|
||||||
LoginInput({
|
LoginInput({
|
||||||
Key? key,
|
Key? key,
|
||||||
@ -94,19 +94,16 @@ class _LoginInputState extends State<LoginInput> {
|
|||||||
autofocus: false,
|
autofocus: false,
|
||||||
inputFormatters: widget.inputFormatters,
|
inputFormatters: widget.inputFormatters,
|
||||||
textInputAction: TextInputAction.next,
|
textInputAction: TextInputAction.next,
|
||||||
keyboardType: isPwd ? TextInputType.emailAddress : null,
|
// 修改键盘类型为密码类型
|
||||||
style: isPwd
|
keyboardType: isPwd
|
||||||
? TextStyle(
|
? TextInputType.visiblePassword
|
||||||
fontSize: 22.sp,
|
: TextInputType.emailAddress,
|
||||||
color: Colors.transparent,
|
// 添加密码隐藏属性
|
||||||
letterSpacing: 2.5,
|
obscureText: isPwd,
|
||||||
fontFamily: 'Monospace',
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
//输入里面输入文字内边距设置
|
//输入里面输入文字内边距设置
|
||||||
contentPadding: const EdgeInsets.only(
|
// contentPadding: const EdgeInsets.only(
|
||||||
top: 8.0, right: -10.0, bottom: 8.0),
|
// top: 8.0, right: -10.0, bottom: 8.0),
|
||||||
labelText: widget.label,
|
labelText: widget.label,
|
||||||
labelStyle: TextStyle(
|
labelStyle: TextStyle(
|
||||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||||
@ -122,20 +119,6 @@ class _LoginInputState extends State<LoginInput> {
|
|||||||
: null,
|
: 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',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user