dart - FloatingActionButton 结束对齐切割图标

标签 dart flutter

我在最后放置了一个 FloaatingActionButton(我想要右下角对齐)但不幸的是它离右边太远,底部的一部分被边缘切断

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

enter image description here

如何添加一些间距并避免这种重叠?

最佳答案

在 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/

相关文章:

json - 解析 JSON API 响应

xcode - slider 内 flutter 图像未出现

flutter - 更改格式DateTime

android - 如何解决错误 FAILURE : Build failed with an exception. * 其中:脚本 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' 行:1005

javascript - 使用不带html文件的dart:js库

binding - 如何查询 dom-repeat 中的元素

flutter - 使用Flutter进行汽车加减速

facebook - 如何在 flutter 中使用 facebook 执行 firebase 身份验证

flutter - 如何在Flutter中为TextField使用BeveledRectangleBorder

Flutter tabcontroller index不响应tabbarview的变化