Flutter PageController AnimateToPage breaks the app

Viewed 215

I have been using page view with a page controller to move between pages in my flutter app, I have five screens. When I go from one page to another which is just adjacent to each other, then it's all fine. But when I go from let's say page with index 0 to 2, then the app hangs and nothing works, and there's no log or error shown, even with try and catch.

On the other hand if I use pageController.jumpToPage() then everything works perfectly.

This problem only showed up when I upgraded flutter to the latest version and all the dependencies.

This is the code that I've been using:

_pageController.animateToPage(index,
            duration: Duration(milliseconds: 400), curve: Curves.easeIn);
0 Answers
Related