I have this page view in flutter and I get a blank page on the first page, how to solve this problem?
PageView.builder(
physics: new NeverScrollableScrollPhysics(),
itemCount: allDays.length,
controller: _pageController,
itemBuilder: ( context, int index) {
return index == 0 ? Container() : _listDay(index-1);
},
)
In the itemBuilder, you are returning an empty Container for index 0. As the index is zero-based, index 0 is the first page. Try the following:
PageView.builder(
physics: new NeverScrollableScrollPhysics(),
itemCount: allDays.length,
controller: _pageController,
itemBuilder: ( context, int index) {
return _listDay(index);
},
)