CachedRepository<T extends DBModelI> constructor

CachedRepository<T extends DBModelI>(
  1. FirebaseRepository<T> repository
)

This is a wrapper for query method in FirebaseRepository.

FirebaseRepository.query can be used to get realtime updates from Firestore with the given specification. This wrapper will

  1. Return data from Firestore cache. Or,
  2. Return data from online db call.

And for every data returned, it will keep give realtime updates from db in the background.

Implementation

CachedRepository(this.repository)
    : _addon = RepositoryAddon(repository: repository);