我想要一排IconButtons,都挨在一起,但是实际图标和IconButton边界之间有相当大的填充。我已经将按钮上的填充设置为0。
这是我的组件,非常直观:
class ActionButtons extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.lightBlue,
margin: const EdgeInsets.all(0.0),
padding: const EdgeInsets.all(0.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
IconButton(
icon: new Icon(ScanrIcons.reg),
alignment: Alignment.center,
padding: new EdgeInsets.all(0.0),
onPressed: () {},
),
IconButton(
icon: new Icon(Icons.volume_up),
alignment: Alignment.center,
padding: new EdgeInsets.all(0.0),
onPressed: () {},
)
],
),
);
}
}
我想要缩小大部分浅蓝色空间,让我的图标开始位置更靠左且彼此更接近,但我找不到调整IconButton本身大小的方法。
我几乎可以确定这个空间被按钮本身占据了,因为如果我将它们的对齐方式更改为 centerRight
和 centerLeft
,它们会变成这样:
实际上使图标更小也没有帮助,按钮仍然很大:
感谢您的帮助。