Is there any way to show to Two Page at the same time in PageView widget? basically a number of pages need to be set dynamically like for portrait 1 for landscape 2, if not with PageView is there any alternative?
Asked
Active
Viewed 470 times
1 Answers
1
It is possible to dynamically change the number of pages. This is likely best achieved using the PageView.builder
constructor of PageView
. Set the itemCount
to 2(or else the maximum number of pages that you'll have) and provide your pages in the builder
, returning null
on index 1 when you only want 1 page.

Christopher Moore
- 15,626
- 10
- 42
- 52
-
Actually the case is there will be total of 300+ pages, on landscape two pages needs to be shown at the same and on scroll next, two pages will be displayed. – Sadman Samee May 27 '20 at 05:09
-
@SadmanSamee In that case you can still use `PageView.builder` and just return two pages put in a `Row` for every index when in landscape mode. – Christopher Moore May 27 '20 at 06:06
-
yeah, That's what going to do now. – Sadman Samee May 27 '20 at 06:15