I have following pageview()
Widget _build() {
return PageView(
children:<Widget>[
page1,
page2,
page3
]
)
}
now when this _build method is called i want to show page2 and not initial page.
I have tried this code
initState(){
pageController = PageController();
pageController.jumpToPage(2);
}
but here 2nd line throws this error
ScrollController not attached to any scroll views
how can i show a particular page using PageView() ?
Thanks
Here's what i did
to show a particular page we have to pass its index to PageController
constructor
like thispageController = PageController(initialPage: widget.activePageIndex);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With