fix:回滚输入框改动

This commit is contained in:
liyi 2025-04-02 09:32:40 +08:00
parent 9f43b3e7c1
commit 3f022ed878

View File

@ -93,17 +93,20 @@ class _LoginInputState extends State<LoginInput> {
onTap: widget.onTapAction, onTap: widget.onTapAction,
autofocus: false, autofocus: false,
inputFormatters: widget.inputFormatters, inputFormatters: widget.inputFormatters,
textInputAction: isPwd ? TextInputAction.done : TextInputAction.next, textInputAction: TextInputAction.next,
// keyboardType: isPwd ? TextInputType.emailAddress : null,
keyboardType: isPwd style: isPwd
? TextInputType.visiblePassword ? TextStyle(
: TextInputType.emailAddress, fontSize: 22.sp,
// color: Colors.transparent,
obscureText: isPwd, letterSpacing: 2.5,
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),
@ -119,6 +122,20 @@ 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',
),
),
),
], ],
), ),
), ),