Flutter Stack ListView over Footer

Flutter Stack ListView over Footer

提问人:moritz648 提问时间:9/9/2023 最后编辑:ankushlokhandemoritz648 更新时间:9/11/2023 访问量:24

问:

我想创建一个网站,其中页脚粘在页面底部,但填充整个页面的 ListView 的项目与页脚重叠,直到用户一直向上滚动。

例如:页脚的高度为 350,列表视图的最后一个元素是高度为 350 的容器。问题在于,如果页脚位于项目列表下方,则页脚中的项目不可单击。有没有办法解决这个问题?

这是我到目前为止的设置示例:

...,
children: [
            Positioned(
              bottom: 0,
              left: 0,
              right: 0,
              child: FooterWidget(),      //Container of height 350 with some TextButtons, etc.
            ),
            ListView(..., Container(height: 350,),)

children: [
  Positioned(
    bottom: 0,
    left: 0,
    right: 0,
    child: FooterWidget(), // Container of height 350 with some TextButtons, etc.
  ),
  ListView(
    children: [
      Container(
        height: 350,
        ...
      ),
      ...
    ],
  ),
]

感谢您的帮助!

扑动 布局 页脚 定位

评论

1赞 Will Hlas 9/9/2023
您是否尝试过使用代替?的孩子将是第一个孩子,也是最后一个孩子。ColumnStackColumnExpanded(child: ListView(...))SizedBox(height: 350, child: FooterWidget())
0赞 moritz648 9/11/2023
@WillHlas 这不会达到我想要的逻辑,因为页脚会一直被看到。我想实现的是,页脚仅在 ListView 的末尾显示。

答: 暂无答案