jonataslaw / getx

Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
MIT License
10.44k stars 1.63k forks source link

Dispose and Navigate #1246

Open shinewanna opened 3 years ago

shinewanna commented 3 years ago

My app is calling recursive page and changes happen in the same screen.

Describe the bug So i made preventDuplicates to false in navigation. All are good but one thing, In my initial state of the home page is calling a long method like loops and update. So when i navigate home screen on and on, the init state is also calling on and on. That's happening bad behaviour in my screen, when i call like 4 times, the updates are execute in last home page screen.

So, what i want is, can i dispose or stop the function loop calling when i navigate the same page. Like dispose the first home page to kill all method running in first home page and navigate to second page.I hope u'll understand my problem.

**Reproduction code Get.off(HomePage(), preventDuplicates: false);

Expected behavior I only want to call the last home page init state method, other should be disposed.

Flutter Version: 2.0.0

Getx Version: ^3.26.0

Describe on which device you found the bug: Android.

eduardoflorence commented 3 years ago

Please provide a minimum code for us to reproduce the problem