颤振删除列中行之间的空格

时间:2018-11-02 09:12:39

标签: flutter

我有一列有3行,如何删除行之间的空间?

这是我的代码:

Widget _buildTable() {
    return Column(
      children: [
      Row(
        children: _getBtns(),
      ),
      Row(
        children: _getBtns(),
      ),
      Row(
        children: _getBtns(),
      ),
    ]);
  }

  List<Widget> _getBtns() {
    final result = <Widget>[];
    for (int i = 0; i < 7; i++) {
      result.add( 
        Expanded(
          child: RaisedButton(color: Colors.green, onPressed: () {}),
        ),
      ); 
    }

    return result;
  }

enter image description here

这就是我想要得到的:

enter image description here

1 个答案:

答案 0 :(得分:3)

设置materialTapTargetSize

child: RaisedButton(color: Colors.green, onPressed: () {}, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,),
相关问题