Flutter 按钮,不需要的额外顶部和底部填充

Flutter button, unwanted extra top and bottom padding

我正在尝试自定义 Flutter 按钮:

ButtonTheme(
    child: FlatButton(
        child: Text(_text),
        color: _color,
        onPressed: _onPressed,
    ),
    minWidth: 40,
),

但我无法摆脱额外的顶部和底部填充:

FlatButton, RaisedButton, MaterialButton, 都有padding.

注意:我有更多自定义项,例如填充、文本修剪和边框半径。

ButtonTheme 的填充设置为 0,如下所示

    new ButtonTheme(
      padding: new EdgeInsets.all(0.0),
      child: FlatButton(
        child: Text(_text),
        color: _color,
        onPressed: _onPressed,
        ),
      minWidth: 40,
    ),

要删除该填充,请添加 - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,

ButtonTheme(
                            child: FlatButton(
                              materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,  // add this
                              child: Text('Dummy'),
                              color: Colors.blue,
                              onPressed: () {},
                            ),
                            minWidth: 40,
                          ),