cacheInterceptor function
DioCacheInterceptor
cacheInterceptor(
{ - Duration? maxStale,
- List<int>? hitCacheOnErrorExcept,
})
Implementation
DioCacheInterceptor cacheInterceptor({Duration? maxStale, List<int>? hitCacheOnErrorExcept}) {
log("Cache policy: ${CachePolicy.refreshForceCache}", name: "OS_BASECODE");
return DioCacheInterceptor(
options: CacheOptions(
store: HiveCacheStore(AppPathProvider.path),
policy: CachePolicy.refreshForceCache,
hitCacheOnErrorExcept: hitCacheOnErrorExcept,
maxStale: maxStale ?? 7.days,
priority: CachePriority.high));
}