简体   繁体   English

如何在 flutter 中显示默认 Android 消息(如(+)按钮并显示自定义小部件代替键盘?

[英]How to show Default Android Messages like (+) button and show custom widget in place of keyboard in flutter?

How can I implement default android Messages like a custom widget in place of the keyboard shown in the GIF?如何实现默认的 android 消息,例如自定义小部件来代替 GIF 中显示的键盘?

在此处输入图像描述

When you tap on + button, what happens is,当您点击+按钮时,会发生什么,

  • Keyboard Closed, to achieve this you can use FocusNode instance and assign in TextField , to unfocus or to close keyboard, you can achieve it by focusNode.unfocus() .键盘关闭,为此您可以使用FocusNode实例并在TextField中分配,以取消焦点关闭键盘,您可以通过focusNode.unfocus()来实现。

  • The content you see on tap of + is outside keyboard, ie you have to create widget and change it's visibility accordingly, Visibility can be used.您点击+看到的内容在键盘之外,即您必须创建小部件并相应地更改它的可见性,可以使用Visibility

  • In other case misc options is visible and user tap on keyboard icon then change visibility of extra options and obtain focus of FocusNode instance(enable keyboard), by focusNode.requestFocus() .在其他情况下,杂项选项可见,用户点击键盘图标,然后通过focusNode.requestFocus()更改额外选项的可见性并获得FocusNode实例的焦点(启用键盘)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM