Why the first navigator push stutters in flutter?

13 Views Asked by At

I'm creating a web application with flutter and have quite a small static second page. I'm using this code upon pressing a button to move to the second page:

  void openInfoScreen() async {
    Navigator.push(
      context,
      MaterialPageRoute(page: InfoPage()),
    );
  }`

The problem is the first time upon loading the website, the animation stutters halfway every time. When I go back and try again it's smooth like butter. I've tried making custom fade animation or using tips from this thread https://github.com/flutter/flutter/issues/31059 but none worked. The closest I got to a solution was removing the animation and accepting frozen screen for half a second which isn't ideal.

0

There are 0 best solutions below