简体   繁体   中英

How do I get rid of the extra padding around this custom widget? (flutter-dart)

I've created a custom widget that is just a row of buttons. However it is adding padding around the buttons that I would like to remove, thing is I can't figure out how.

Here is what it looks like.

在此处输入图像描述

Here is the code for the individual button.

@override
Widget build(BuildContext context) {
  return MaterialButton(
    padding: EdgeInsets.zero,
    materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
    onPressed: onPressed ?? null,
    color: color,
    textColor: iconColor,
    child: SvgPicture.asset(iconLocation,
        width: height / 2, height: height / 2, color: iconColor),
    shape: CircleBorder(),
    height: height,
  );
}
 contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),

Make it 0.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM