shouldUseCache method

Future<bool> shouldUseCache(
  1. LocalRepository repository,
  2. CacheDescription? cache
)

Implementation

Future<bool> shouldUseCache(
  LocalRepository repository,
  CacheDescription? cache,
) async {
  if (cache == null || cache.key.isEmpty) return false;
  ApiConfig().log('cache ${cache.key} lifeSpan=${cache.lifeSpan}');
  if (cache.invalidateCache) return false;
  if (cache.overrideTime) return true;
  return await repository.checkCache(cache.key);
}