首页 > 解决方案 > 如何在 PageView 中有不同大小的页面?

问题描述

我才用 Flutter 编程一个半月,还是很缺乏经验。但是我有一个问题,我在互联网上找不到答案。我需要一个主要由 PageView 组成的应用程序。不幸的是,使用 PageView,所有页面总是相同的大小。有没有办法使一页的宽度更小或使一页的视口分数比其他页面小?

PageView.Custom 可能对我们有帮助,但我一直无法找出 PageView.Custom 是否具有此功能。我试图在互联网上巧妙地阅读我,但找不到任何东西。

如果 Pageview 不起作用,您有另一个想法,我可以使用哪个小部件。我的浏览量只有两页,但我需要滑动功能和“animatetopage ...”功能

标签: androidiosflutterdartflutter-pageview

解决方案


I have successfully solved the problem. Now to my solution. I have built a second PageController that has a ViewPortFraction of 0.8. As soon as the second page is opened to 30%, the first controller is replaced by the second PageController and the second page is getting smaller.


推荐阅读