When you try to navigate to the page, it loads as expected, but when you try to exit the page for the other slides, it runs the query again. This is wasteful since it requires database access and minio access.
Steps to reproduce
Run the Chats branch.
Go to the chats tab, and then click on the cards tab on the bottom nav bar.
What is the expected correct behavior?
It should only run the get profile once, when it enters the page, not when it leaves as well.
Possible fixes
I saw that maybe it is because the navigation uses a transition from one widget to another, and the from widget is the reloaded version of the other tab, which is causing the query to execute again. Perhaps we need to find a way using the go router to make the from widget void in this case.
https://www.appsloveworld.com/flutter/200/199/initstate-gets-called-when-navigating-to-a-new-page
Summary
When you try to navigate to the page, it loads as expected, but when you try to exit the page for the other slides, it runs the query again. This is wasteful since it requires database access and minio access.
Steps to reproduce
Run the Chats branch. Go to the chats tab, and then click on the cards tab on the bottom nav bar.
What is the expected correct behavior?
It should only run the get profile once, when it enters the page, not when it leaves as well.
Possible fixes
I saw that maybe it is because the navigation uses a transition from one widget to another, and the from widget is the reloaded version of the other tab, which is causing the query to execute again. Perhaps we need to find a way using the go router to make the from widget void in this case. https://www.appsloveworld.com/flutter/200/199/initstate-gets-called-when-navigating-to-a-new-page