Page index
mohammedX6 opened this issue · comments
Mohammed Aljezawi commented
How to get the current page index ?
Mohammed Aljezawi commented
Never-mind i managed to find a solution like this :
1.declare a variable int currentPageIndex=1;
2.PageView(
controller: controller,
pageSnapping: true,
onPageChanged: (x) {
// here you can get the current page index
setState(() {
currentPageIndex= x+1;
});
},
children: allPagesWidgets)