Flutter - SingleChildScrollView interfering in columns

前端 未结 2 1423
一生所求
一生所求 2021-01-17 10:47

I created a screen that works well with the columns, but I needed to scroll because of the keyboard.

When you insert the SingleChildScrollView or the

2条回答
  •  佛祖请我去吃肉
    2021-01-17 11:12

    I would recommend against using FloatingActionButton in the way you are doing here. FloatingActionButton should be used for actions that always need to always be on screen at all times. See the Material guidelines on button usage for suggestions on other button types that can be scrolled, like RaisedButton and FlatButton. You could use a RaisedButton here, but I think it would be better to make your screen a dialog and put the save action in the AppBar as I suggested in your other question.

    If you do decide to use a RaisedButton or FlatButton, keep in mind that scrollables don't normally change their item spacing based on the size of their container. Instead of using MainAxisAlignment.spaceBetween, you could put some Padding around your RaisedButton to separate it from the TextField elements. This will ensure that they are spaced the same distance apart regardless of rotation, screen size, and regardless of whether the keyboard is up.

提交回复
热议问题