Reputation: 175
I have a simple async function and I call this function in my initState. This function reads my Firebase Firestore database and I want to keep the amount of reads as low as possible. But when using a BottomNavigationBar, and navigating with body: _widgetOptions.elementAt(index), a screen gets disposed whenever is navigated to a new screen. When I return back to the original screen initState is called again and my data is being loaded again while this is not something I need or want.
Does anyone have a solution or tips?
Thanks in advance!
Upvotes: 2
Views: 744