newCacheInterceptor function
Creates a new Interceptor
backed by the provided Cache
pattern
: All the calls with a url matching this pattern will be cached
Returns a Interceptor
Implementation
Interceptor newCacheInterceptor(String pattern, Cache cache) {
return (CacheInterceptorBuilder()..cache(pattern, cache)).build();
}