一尘不染

删除Flutter Container> FlatButton中的填充

flutter

我正在寻找删除FlatButton的默认边距,但似乎无法设置/覆盖它。

带填充的按钮

Column(children: <Widget>[
      Container(
          children: [
            FractionallySizedBox(
              widthFactor: 0.6,
              child: FlatButton(
                  color: Color(0xFF00A0BE),
                  textColor: Color(0xFFFFFFFF),
                  child: Text('LOGIN', style: TextStyle(letterSpacing: 4.0)),
                  shape: RoundedRectangleBorder(side: BorderSide.none)))),
      Container(
          margin: const EdgeInsets.only(top: 0.0),
          child: FractionallySizedBox(
              widthFactor: 0.6,
              child: FlatButton(
                  color: Color(0xFF00A0BE),
                  textColor: Color(0xFF525252),
                  child: Text('SIGN UP',
                      style: TextStyle(
                          fontFamily: 'Lato',
                          fontSize: 12.0,
                          color: Color(0xFF525252),
                          letterSpacing: 2.0)))))
    ])

我遇到过类似的事情ButtonTheme,甚至debugDumpRenderTree()还无法正确实现。


阅读 438

收藏
2020-08-13

共1个答案

一尘不染

FlatButton(materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,)
2020-08-13