flutter – 在ListView中滚动键盘上方的TextFormField

我的应用程序中有以下抽屉:

enter image description here

当我按下密码TextFormField时,我得到以下内容:

enter image description here

如您所见,覆盖了密码TextFormField.我按照建议here试图解决这个问题:

class _LoginDrawer extends State<LoginDrawer> {
  static var _listViewScrollController = new ScrollController();

  @override
  Widget build(BuildContext context) => new Drawer(
    child: new ListView(
      controller: _listViewScrollController,children: <Widget>[
        // ...
        new Padding(
          padding: const EdgeInsets.symmetric(horizontal: 16.0),child: new GestureDetector(
            onTap: () {
              SchedulerBinding.instance.addPostFrameCallback((_) {
                _listViewScrollController.jumpTo(
                 _listViewScrollController.position.maxScrollExtent);
              });
            },child: new TextFormField(
                obscureText: true,decoration: new InputDecoration(labelText: "Password")),),],);
}

但这并没有解决它,该应用程序只是像以前一样.还有一些人建议使用反转的ListView然后使用listViewController.jumpTo(0.0),但这导致了不必要的效果,所有小部件从底部开始:

enter image description here

解决方法

根据@aziza发布的问题,它涉及到这个github问题:

https://github.com/flutter/flutter/issues/7032

解决方案是使用一个小部件,将元素移出键盘.这是一个颤抖的错误.

相关文章

这篇文章主要讲解了“FlutterComponent动画的显和隐怎么实现...
这篇文章主要讲解了“flutter微信聊天输入框功能如何实现”,...
本篇内容介绍了“Flutter之Navigator的高级用法有哪些”的有...
这篇文章主要介绍“Flutter怎么使用Android原生播放器”,在...
Flutter开发的android端如何修改APP名称,logo,版本号,具体...
Flutter路由管理初识路由概念一.路由管理1.1.Route1.2.Mater...