0

On Flutter Web, I have a stream from firestore which displays the current messages in a collection but when the internet is not available I can't have access to those messages from that stream.

I Decided to use a hive box to cache the messages and return them when no internet is available.

I cache the massages using a Hive Box but it's really challenging for me to leverage providers and return the cache data first and linking that up with the stream from firestore.

Tried convert the cached data from a Hive Box into broadcast stream and combine with the firestore stream using ZipStreams and did a mapping but doesn't still work.

Please I will need help on the best way to go about this.

mck
  • 40,932
  • 13
  • 35
  • 50
  • Hey Fuh Austin Ambe, welcome to Stack Overflow! Please provide us with a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example), so we can help you. – Axel Köhler Jan 15 '21 at 09:05

1 Answers1

1

Firestore has its own data persistence (read/write data when offline) and it handles all the hard work so you don't need Hive.

Works on web apps, android and iOS.

See: https://firebase.google.com/docs/firestore/manage-data/enable-offline