优化红米手机登录时密码光标问题
This commit is contained in:
parent
9df5d948fd
commit
2bbbf5f5a1
@ -160,7 +160,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
|||||||
height: 36.w,
|
height: 36.w,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
hintText: '请输入邮箱'.tr,
|
hintText: '请输入邮箱或手机号'.tr,
|
||||||
inputFormatters: <TextInputFormatter>[
|
inputFormatters: <TextInputFormatter>[
|
||||||
LengthLimitingTextInputFormatter(30),
|
LengthLimitingTextInputFormatter(30),
|
||||||
FilteringTextInputFormatter.singleLineFormatter
|
FilteringTextInputFormatter.singleLineFormatter
|
||||||
|
|||||||
@ -61,6 +61,7 @@ class _LoginInputState extends State<LoginInput> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget androidView() {
|
Widget androidView() {
|
||||||
|
final TextEditingController _controller = TextEditingController();
|
||||||
bool isPwd = widget.isPwd ?? false;
|
bool isPwd = widget.isPwd ?? false;
|
||||||
String pwd = (widget.controller?.text ?? '').replaceAll(RegExp(r'.'), '●');
|
String pwd = (widget.controller?.text ?? '').replaceAll(RegExp(r'.'), '●');
|
||||||
return Container(
|
return Container(
|
||||||
@ -85,6 +86,10 @@ class _LoginInputState extends State<LoginInput> {
|
|||||||
controller: widget.controller,
|
controller: widget.controller,
|
||||||
focusNode: widget.focusNode,
|
focusNode: widget.focusNode,
|
||||||
onChanged: (String text) {
|
onChanged: (String text) {
|
||||||
|
_controller.text = text;
|
||||||
|
_controller.selection = TextSelection.fromPosition(
|
||||||
|
TextPosition(offset: _controller.text.length),
|
||||||
|
);
|
||||||
if (widget.onchangeAction != null) {
|
if (widget.onchangeAction != null) {
|
||||||
widget.onchangeAction!(text);
|
widget.onchangeAction!(text);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user