当点击提交按钮的时候,如何关闭键盘
1. final FocusNode verifyNode = FocusNode();
2.child:TextField(
focusNode: verifyNode)
3.按钮点击事件中
onPressed: (){
//FocusScope.of(context).requestFocus(verifyNode);让它成为焦点
//让它失去焦点
verifyNode.unfocus();
},




当点击提交按钮的时候,如何关闭键盘
1. final FocusNode verifyNode = FocusNode();
2.child:TextField(
focusNode: verifyNode)
3.按钮点击事件中
onPressed: (){
//FocusScope.of(context).requestFocus(verifyNode);让它成为焦点
//让它失去焦点
verifyNode.unfocus();
},
本文标题:Flutter 关闭键盘 键盘失去焦点 键盘成为焦点
本文链接:https://www.haomeiwen.com/subject/srsvrktx.html
网友评论