cacheInterceptor function

DioCacheInterceptor cacheInterceptor({
  1. Duration? maxStale,
  2. List<int>? hitCacheOnErrorExcept,
})

Implementation

DioCacheInterceptor cacheInterceptor({Duration? maxStale, List<int>? hitCacheOnErrorExcept}) {
  return DioCacheInterceptor(
      options: CacheOptions(
          store: HiveCacheStore(AppPathProvider.path),
          policy: CachePolicy.refreshForceCache,
          hitCacheOnErrorExcept: hitCacheOnErrorExcept,
          maxStale: maxStale ?? 7.days,
          priority: CachePriority.high));
}