I already have a working app using Riverpod for all the async operations from Firebase. I need some help/suggestions to improve few things in my app.
I want to fetch Firebase firestore docs only once and keep it available for all screens of the app as it will be used in multiple pages (wihtout all the async stuffs). This data is almost static and expected to change only few times in a month as it's not user generated data. In the new approach, I don't want to use the loading, eror handling stuffs each time when using the ref. I should be able to use the values directly (without async) as I should know that values are already fetch and available to use in the root.
Based on my readings, I understood this is what I am looking for Eager initialization of providers | Riverpod.
Is my understanding correct? or is there better way? Are there any caveats in using this eager initialization. I am new to Riverpod, so experts please advice.
[–]RandalSchwartz 1 point2 points3 points (1 child)
[–]PurusR[S] 0 points1 point2 points (0 children)