I encountered this loop behaviour on FlutterFlow.
Setup:
1. Home Page, Page B.
2. Both pages have navigation to Home Page and Page B.
3. Page B have back a button with Go Back action.
3. Page B has a looping action on page load.
Case 1
1. From Home Page go to Page B.
2. Loop action on Page B runs.
3. Press back button, going back to Home Page.
4. Loop action on Page B stops.
5. Go to Page B again, loop action runs again.
6. This is the expected behaviour, and it's good.
Case 2
1. From Home Page go to Page B.
2. Loop action on Page B runs.
3. Go to Home Page by pressing nav button with action : Navigate to Home.
4. Loop action on Page B keeps running.
5. Go to Page B again, a new loop instance running in addition to the old loop.
6. Go to Home, two loop instance keep running.
7. Go to Page B again, another loop instance running, making it 3 loop actions running.
8. And so on, a new loop instance keeps adding when going to Page B.
Conclusion:
- loop stops when using Go Back action.
- loop keeps running when using Navigate To action.
Is there a way to stop a loop instance when you go to another page by using Navigate To action?
I need to have a loop action that runs only when you're on that particular page.
Loop must stop when using Navigate To.