将小部件放在键盘顶部 - 我目前在该小部件下方获得了大量空间

问题描述 投票:0回答:1

这就是我现在看来的样子

enter image description here

这是我正在使用的代码

Widget getCustomKeyboardButtons()
    {
        Row buttonRow  = new Row(
            children: <Widget>[
                new IconButton(
                        icon: Icon(
                            Icons.arrow_drop_down,
                            color: Colors.blueGrey,
                            ),
                        onPressed: () {
                            FocusScope.of(context).requestFocus(new FocusNode());
                        }),
                Expanded(child:new MaterialButton(
                    onPressed: null,
                    child: new Text("Press me"),
                    color: Colors.red,
                    ),),
            ],
        );

        var col = Column(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: <Widget>[
                getMainContainer(),
                buttonRow,
            ]);

        SafeArea s = new SafeArea(child: col,);
        return s;
    }

我的问题是为什么我在红色按钮下方获得所有这些额外空间?我怎样才能解决这个问题 ?

dart flutter
1个回答
0
投票

检查this以获得键盘的高度。相应地定位小部件。 :)

© www.soinside.com 2019 - 2024. All rights reserved.