Storing Data Locally and On Firebase Depending on Data Type in Flutter App

Viewed 24

This question is more of a Flutter software design/structure question, than a core programming question. I have a fun little project app that lets a user catalogue their game collection, and allows a user to upload associated photos and videos to Firebase using the default JSON array structure. However, from a scalability standpoint, hosting videos can get ridiculous. I would rather limit firebase communication to just a login sync, with only the game, game info, and photos uploading or pulling, while videos stay being stored locally.

I'm newer to Firebase and its features, but I did find in the documentation that it allows local caching, and will push data on network connection: https://firebase.google.com/docs/firestore/manage-data/enable-offline

Does anyone have any learning sources on someone who has implemented such a behavior (Android or IOS is fine) that follows that hybrid structure of forming app pages with both offline and online stored data? Have you done this in your own work, and could you provide some wisdom on getting such a structure working?

Edit: I found this resource on local flutter data storage: https://levelup.gitconnected.com/the-4-ways-to-store-data-locally-in-your-flutter-app-that-youre-going-to-need-abdafa991ae3

There is a really useful section that describes having data saved permanently at a local level for the app.

However, I actually have a follow up question to this. Is there a way to have my videos live in there normal location, and I could just save the file location and pull that to display? I feel like it would be messy for a user to save a 30 minute game playthrough again on the same device, but instead just save a pointer to display? Or perhaps I should limit video size, and allow it to be saved to the app folder, so it can be transferred at a later date if a user switches devices?

I'm wondering what the professional community would do when approaching this issue, because I feel like its a good learning experience for any future mobile projects.

Thanks!

0 Answers
Related