在Flutter中调整ListView中下一个元素的高度

问题描述

因此,我正在构建一个ListView来对我的内容进行滚动供稿,与旁边的索引相比,应扩大用户所在的索引。例如,如果我正在查看帖子#2,则它的高度应为200,而作为帖子#1,#3的高度应为175。我无法找到与此相关的任何内容,并且无法想到任何可以实现这一点的东西。 这是我到目前为止编写的代码:

ListView:

return SizedBox(
                      height: MediaQuery.of(context).size.height * 0.42,width: MediaQuery.of(context).size.width * 0.96,child: ListView.separated(
                        scrollDirection: Axis.horizontal,separatorBuilder: (BuildContext context,int index) {
                          return SizedBox( width: 20,);
                        },itemCount: 5,itemBuilder: (BuildContext context,int index) {
                          return Container(
                            width: MediaQuery.of(context).size.width * 0.58,height: MediaQuery.of(context).size.height * 0.42,decoration: BoxDecoration(
                              color: pageColour.withOpacity(0.9),borderRadius: BorderRadius.circular(35),),);

以下是我正在寻找的图像:

enter image description here

这是我尝试后得到的:

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...