Reputation: 55
I'm having a problem where initState()
won't get called inside a PageView if the page was loaded before. And dispose()
is also not getting called when changing pages. I have set keepPage = false
but it still won't work.
Upvotes: 0
Views: 843
Reputation: 550
This is because the PageView
doesn't rebuild the page on changing the page. The solution to this is to use PageView.builder
. For initState()
and dispose()
to call add them in the respective PageView widgets
Upvotes: 1