4

I have only been programming with Flutter for one and a half months and am still quite inexperienced. But I have a question that I couldn't find an answer to on the Internet. I need an app that mainly consists of a PageView. Unfortunately, with a PageView, all pages are always the same size. Is there any way to make the width of one page smaller or make the viewport fraction smaller for one page than for other pages?

PageView.Custom may help us, but I haven't been able to find out whether PageView.Custom has this function or not. I tried to read me cleverly on the Internet, but couldn't find anything.

If Pageview doesn't work, you have an alternative idea which widget I could use. My pageview has only two pages, but I need both the swipe function and the function "animatetopage ..."

3
  • Instead of making the PageView size variable, you can make the contents of the PageView as per your requirement.
    – mdeora
    Commented Apr 2, 2020 at 14:49
  • How do you mean? The one page in the pageView must have a smaller width than the other. That is the only thing that matters. Not the content, but the pagewidth .... thanks for your quick reply Commented Apr 2, 2020 at 16:25
  • Why don't you add an image or an illustration to make yourself clearer.But I think you can just specify the child widget's size of the PageView as @mdeora said... for example you can jsut use Container or SizedBox Commented Apr 2, 2020 at 16:45

1 Answer 1

1

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.