When the keyboard appears, the Flutter widgets resize. How to prevent this?

我怕爱的太早我们不能终老 提交于 2019-11-27 19:22:05
aziza

In your Scaffold, set resizeToAvoidBottomInset property to false.

Property "resizeToAvoidBottomPadding" is deprecated now.... In your Scaffold, set resizeToAvoidBottomPadding property to false.

Set resizeToAvoidBottomInset to false instead of resizeToAvoidBottomPadding which is deprecated.

    return Scaffold(
      resizeToAvoidBottomInset : false,
      body: YourWidgets(),
    );

Depending on the use case you could also consider using a listview. That would ensure that the contents scroll when there is not enough room. As an example, you can look at the textfield demo in the gallery app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!