如果caneditfoldername==true我想显示一个文本字段,否则我想显示一个文本..但是文本字段中的焦点不工作..有人能修复吗?
code:appBar:AppBar(操作:[ IconButton(
onPressed: () {
setState(() {
caneditfoldername = true;
FocusScope.of(context)
.requestFocus(foldertitlefocus);
});
},
icon: Icon(
Icons.edit_rounded,
size: MediaQuery.of(context).size.height * .028,
)))
],
title: widget.two == false
? Text(
"Add",
)
:
caneditfoldername == true ? Padding(
padding: EdgeInsets.only(right: MediaQuery.of(context).size.width * .23,),
child: TextFormField(
focusNode: foldertitlefocus,
autofocus: true,
controller: foldertitle,
):Text(
"My passwords..",
)
),
1条答案
按热度按时间kupeojn61#
看起来
TextFormField
小部件没有正确关闭,请尝试修改: