列表最后一项上的 FloatingActionButton [英] FloatingActionButton over last item of list

查看:26
本文介绍了列表最后一项上的 FloatingActionButton的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 FloatingActionButton 的可滚动列表.我想让列表在 FloatingActionButton 之前完成,因为列表的最后一项不再可见(FAB 它在列表项之上)

I have a scrollable list with a FloatingActionButton. I would like to make the list to finish before the FloatingActionButton because last item of list isn't visible anymore(FAB it's over list item)

return Scaffold(
    body: ListView(
      scrollDirection: Axis.vertical,
      controller: _scrollController,
      shrinkWrap: true,
      children: <Widget>[
        _buildUpcomingExpansionTileEvents(myUpcomingEvents),
        _buildPastExpansionTileEvents(myPastEvents),
      ],
    ),
    floatingActionButton: UnicornDialer(
        parentButtonBackground: Colors.blue,
        orientation: UnicornOrientation.VERTICAL,
        parentButton: Icon(OMIcons.add),
        childButtons: childButtons));

如何更改我的列表以完成一项空项目?或者这个问题的最佳解决方案是什么?

How could I change my list to finish with one empty item? Or what's the best solution to this problem?

推荐答案

FloatingActionButton 大小为 56 为非 mini 和 40迷你,所以你可以做的是在 ListView 中使用 padding 像:

FloatingActionButton has size of 56 for non-mini and 40 for mini, so what you can do is use padding in ListView like:

ListView(
  padding: EdgeInsets.only(bottom: 56), // if you have non-mini FAB else use 40
  // ...
),

这篇关于列表最后一项上的 FloatingActionButton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆