简体   繁体   English

FloatingActionButton 端对齐剪切图标

[英]FloatingActionButton end alignment cuts icon

I have positioned a FloaatingActionButton at the end (I would like to have a bottom right alignment) but unfortunately it goes too far off the right with part of the bottom being cut off by the margins我在最后放置了一个 FloatingActionButton(我想要右下对齐)但不幸的是它离右边太远了,底部的一部分被边缘切断了

            Row(
              mainAxisAlignment: MainAxisAlignment.end,
              children: <Widget>[
                FloatingActionButton(
                  onPressed: displayDialog,
                  child: Icon(
                    Icons.queue_music,
                  ),
                  foregroundColor: Colors.white,
                  backgroundColor: Colors.red[900],
                )
              ],
            ),

在此处输入图片说明

how can I add some spacing and avoid this overlap ?如何添加一些间距并避免这种重叠?

Add Container in the widgets as child of Row after FAB having some margin on right在 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),
             ),
          ],
        ),

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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