FileCacheStore class

File-backed CacheStore implementation.

Values are stored as a single JSON map in _file. Missing, invalid, or unreadable files are treated as an empty cache.

Implemented types

Constructors

FileCacheStore.new(File _file)
Creates a cache store backed by _file.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() Future<void>
Clears the cache file.
override
get(String key) Future<Object?>
Reads the cached value for key.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(String key, Object? value) Future<void>
Saves value under key and rewrites the backing file.
override
remove(String key) Future<void>
Removes key from the cache file.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited