实现获取焦点首先需要先定义一个FocusNode
FocusNode _focusNode= FocusNode();
//在TextField中绑定
TextField(
focusNode: _focusNode,
),
获取焦点
InkWell(
child: Icon(Icons.sentiment_satisfied_rounded),
onTap: () {
FocusScope.of(context).requestFocus(_focusNode);
},
),
网友评论