简体   繁体   English

如何在 Flutter 中通过键盘显示小部件?

[英]How to show a widget over the keyboard in Flutter?

I want to place a widget on top of everything (a loading widget), but I can not manage to place it over the keyboard too.我想在所有东西之上放置一个小部件(加载小部件),但我也无法将它放在键盘上。

I've tried some methods, but the widget is always under the keyboard.我试过一些方法,但小部件总是在键盘下面。 Is there any way to place it over it?有没有办法把它放在上面?

Example using all kind of Stacks使用各种堆栈的示例

Using stacks, I can not position the loading over the keyboard.使用堆栈,我不能 position 通过键盘加载。

What I want:我想要的是:

在此处输入图像描述

What I super sadly get:我非常遗憾地得到:

在此处输入图像描述

This is not really an answer, but I can't write comments yet.这不是真正的答案,但我还不能写评论。

You won't be able to do that with Flutter (I think) as the keyboard is handled by the Android System itself.您将无法使用 Flutter(我认为)执行此操作,因为键盘由Android 系统本身处理。

Anyway, Blocking the phone's UI is not something that should be even tried in most circumstances.无论如何,在大多数情况下甚至不应该尝试阻止手机的用户界面 Blocking just your app's UI though, is the right approach whenever you have some processo to wait for.但是,只要您有一些进程要等待,只阻止应用程序的 UI是正确的方法。

Be careful when designing your ideas.设计想法时要小心。 The user is free to use his/her other resources as he or she sees fit and you shouldn't try to control what your user does outside of your application.用户可以自由使用他/她认为合适的其他资源,你不应该试图控制你的用户在你的应用程序之外做什么。

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

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