删除 ROw 中两个 IconButton 之间多余的 space

Remove extra space between two IconButton in ROw

我想删除 Row 小部件中两个 IconButton 之间的一些额外 space 我尝试了更多但仍然无法删除小部件

之间的 space
Column(
  children: <Widget>[
    Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: <Widget>[
        Text("Home",
          style: TextStyle(
            fontWeight: FontWeight.bold,
            fontSize: 15,
            color: Colors.black
          )
        ),
        Row(
          mainAxisAlignment: MainAxisAlignment.end,
          children: <Widget>[
            IconButton(
              icon: Icon(
                Icons.edit,
                color: Colors.black,
                size: 20,
              ),
              onPressed: () {
                IntelUtility.navigateToScreen(
                  context, EditHomeAddressScreen()
                );
              },
            ),
            IconButton(
              icon: Icon(
                Icons.delete,
                color: Colors.black,
                size: 20,
              ),
              onPressed: () {},
            ),
          ],
        ),
      ],
    ),
  ],
),

请帮助解决这个问题,我遇到了麻烦:(

将参数 padding: EdgeInsets.all(0) 添加到 IconButton。

IconButton(
          padding: EdgeInsets.all(0),
          icon: Icon(
            Icons.delete,
            color: Colors.black,
            size: 20,
          ),
          onPressed: () {},
        )

你的答案是 BoxConstraints

Row(
          mainAxisAlignment: MainAxisAlignment.end,
          children: <Widget>[
            IconButton(
              constraints: BoxConstraints.tight(Size.fromWidth(30)),
              icon: Icon(
                Icons.edit,
                color: Colors.black,
                size: 20,
              ),
              onPressed: () {
                IntelUtility.navigateToScreen(
                  context, EditHomeAddressScreen()
                );
              },
            ),
            IconButton(
              constraints: BoxConstraints.tight(Size.fromWidth(30)),
              icon: Icon(
                Icons.delete,
                color: Colors.black,
                size: 20,
              ),
              onPressed: () {},
            ),
          ],
        ),

你可以改变constraints: BoxConstraints.tight(Size.fromWidth(30)),任何你想要的

不使用 IconButton, 你可以像这样使用 CupertinoButton :

CupertinoButton(
  minSize: double.minPositive,
  padding: EdgeInsets.zero,
  child: Icon(
    Icons.delete,
    color: Color.black,
    size: 20
  ),
  onPressed: () {},
)