我在最后放置了一个 FloaatingActionButton(我想要右下角对齐)但不幸的是它离右边太远,底部的一部分被边缘切断
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
FloatingActionButton(
onPressed: displayDialog,
child: Icon(
Icons.queue_music,
),
foregroundColor: Colors.white,
backgroundColor: Colors.red[900],
)
],
),
如何添加一些间距并避免这种重叠?
最佳答案
在 FAB 右边有一些边距之后,在小部件中添加 Container 作为 Row 的子级
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
FloatingActionButton(
onPressed: displayDialog,
child: Icon(
Icons.queue_music,
),
foregroundColor: Colors.white,
backgroundColor: Colors.red[900],
),
Container(
margin: EdgeInsets.only(right: someMargin),
),
],
),
关于dart - FloatingActionButton 结束对齐切割图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55472199/