At the first time of app opening user will see a pageview.
In pageview builder initial value starts from the 0. At first time page opening user will see page index 0.
PageView.builder(
controller: pageController,
itemBuilder: (BuildContext context, int index) {
return MyPage(data: dataList[index]);
});
If pagecount is not provided then, user can able to swipe right direction infinitely, but not left side.
I want that, user can swipe left right in both direction infinitely. User will page index of 0. Then user can not swipe at left direction. So i want to make this happen.
i.e. user can swipe a -1 , -2 index like that..
How to do this.
2
Answers
Didn’t really under stand the use-case, but You can do this by setting up your own page controller
This way, the user can swipe left and right infinitely without ever going out of bounds. Hope this helps!
here is how to do it my code is work perfectly
at first declare a member variable for the current page index