IgnoreCache constructor

const IgnoreCache({
  1. bool? useCacheOnError,
})

IgnoreCache

Annotation for Cached package.

Annotation that must be above a field in a method and must be bool, if true the cache will be ignored

Example

Use @ignoreCache annotation

@cached
Future<int> getInt(String param, {@ignoreCache bool ignoreCache = false}) {
  return Future.value(1);
}

or with useCacheOnError in the annotation and if set true then return the last cached value when an error occurs.

Future<int> getInt(String param, {@IgnoreCache(useCacheOnError: true) bool ignoreCache = false}) {
  return Future.value(1);
}

Implementation

const IgnoreCache({
  this.useCacheOnError,
});