android - 如何在 PageView 中有不同大小的页面?
问题描述
我才用 Flutter 编程一个半月,还是很缺乏经验。但是我有一个问题,我在互联网上找不到答案。我需要一个主要由 PageView 组成的应用程序。不幸的是,使用 PageView,所有页面总是相同的大小。有没有办法使一页的宽度更小或使一页的视口分数比其他页面小?
PageView.Custom 可能对我们有帮助,但我一直无法找出 PageView.Custom 是否具有此功能。我试图在互联网上巧妙地阅读我,但找不到任何东西。
如果 Pageview 不起作用,您有另一个想法,我可以使用哪个小部件。我的浏览量只有两页,但我需要滑动功能和“animatetopage ...”功能
解决方案
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.
推荐阅读
- c++ - 如何避免没有谓词的虚假唤醒?
- android - Livedata 和 ViewModel 更新无限次
- javascript - contentEditable 默认模板新行
- loops - 如何在 Shopify 液体中合并两个集合而不将其更改为数组?
- amazon-web-services - 在 EC2 AWS 实例中添加 Jenkins 用户和组
- javascript - 导航栏状态 - 手动从正常状态更改为折叠状态
- android - 如何将 Flutter 应用的构建过程与 Rust 代码集成?即构建Flutter代码时,如何自动构建其Rust代码?
- python-3.x - AttributeError:“列表”对象没有属性“查找”
- javascript - 点击导航栏消失
- python-sphinx - 一种让 Sphinx 文档小节开始新页面的方法?