我正在制作一个颤振应用程序,用户可以在其中输入消息并点击键盘中的发送按钮来发送消息。问题是当我按下发送按钮时,消息会发送,但键盘会自动关闭。我怎样才能防止这种情况发生?提前致谢。
TextField(
autofocus: true,
keyboardType: TextInputType.multiline,
maxLines: null,
decoration: new InputDecoration.collapsed(
hintText: "Let's talk",
border: UnderlineInputBorder(
borderRadius: BorderRadius.circular(1),
),
),
textInputAction: TextInputAction.send,
onSubmitted: null,
)
Run Code Online (Sandbox Code Playgroud)