IgnoreCache class
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);
}
- Annotations
-
- @Target({TargetKind.parameter})
Constructors
- IgnoreCache({bool? useCacheOnError})
-
IgnoreCache
const
Properties
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- useCacheOnError → bool?
-
If set
true
then return the last cached value when an error occurs.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited