How not to dispose Stateful widget in Flutter?

Viewed 410

I have an app. Its homepage has a lot of functionality(heaver). It takes a little bit time to build. Therefore when App starts I show the Splash screen in the meantime Homepage is built. But when I navigate(by push replacement) from the homepage to another it's dispose method called. So when I try to come back to the homepage it takes some time and the app got hang for that time. So I want that When I navigate(by push replacement) from Homepage to another page its dispose method should not be called. So, when user want to come back to the homepage it doesn't rebuild.

Note: I can not use Navigator.push or something else except push replacement because I am navigating from navigation bar( I made my custom Navigation Bar Where I cannot use anything else except push replacement).

0 Answers
Related