Flutter ButtonRow padding

后端 未结 2 788
渐次进展
渐次进展 2021-02-08 10:59

I am developing an app in Flutter with Dart and am generally finding layout quite straightforward. However, I am running into a problem which I think is related to default padd

2条回答
  •  青春惊慌失措
    2021-02-08 11:49

    Also, the ButtonBar itself has a buttonPadding attribute that you can customize.

    Overrides the surrounding ButtonThemeData.padding to define the padding for a button's child (typically the button's label).

    If null then it will use the surrounding ButtonBarTheme.buttonPadding. If that is null, it will default to 8.0 logical pixels on the left and right.


    ButtonBar(
      buttonPadding: EdgeInsets.all(0),
      children: [
        FlatButton(
          child: Text('Hello'),
          onPressed: () => print(),
          materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
        ),
      ],
    ),
    

提交回复
热议问题