我创建了六位密码字段组件,它在较大尺寸的模拟器中按预期工作,但是当我使用小尺寸模拟器检查时,密码输入被键盘隐藏。
child: TextField(
enableInteractiveSelection: false,
focusNode: focusNode,
controller: widget.controller,
keyboardType: TextInputType.number,
inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
style: const TextStyle(
height: 0.1,
color: Colors.transparent,
),
decoration: const InputDecoration(
focusedErrorBorder: transparentBorder,
errorBorder: transparentBorder,
disabledBorder: transparentBorder,
enabledBorder: transparentBorder,
focusedBorder: transparentBorder,
helperStyle: TextStyle(
color: Colors.transparent,
),
fillColor: Colors.transparent,
border: InputBorder.none,
),
cursorColor: Colors.transparent,
showCursor: false,
maxLength: widget.maxLength,
onChanged: _onTextChanged,
),