JsonCacheInfoRepository class Null safety

Inheritance
Available Extensions

Constructors

JsonCacheInfoRepository({String? path, String? databaseName})
Either the path or the database name should be provided. If the path is provider it should end with '{databaseName}.json', for example: /data/user/0/com.example.example/databases/imageCache.json
JsonCacheInfoRepository.withFile(File file)
The directory and the databaseName should both the provided. The database is stored as {databaseName}.json in the directory,

Properties

databaseName String?
read / write
directory Directory?
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
openCompleter Completer<bool>?
read / write, inherited
openConnections int
read / write, inherited
path String?
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
timer Timer?
read / write
timerDuration Duration
read / write

Methods

close() Future<bool>
Close the connection to the repository. If this is the last connection to the repository it will return true and the repository is trully closed. If there are still open connections it will return false;
override
delete(int id) Future<int>
Deletes a cache object by id
override
deleteAll(Iterable<int> ids) Future<int>
Deletes items with ids from the repository
override
deleteDataFile() Future
Deletes the cache data file including all cache data.
override
exists() Future<bool>
Returns whether or not there is an existing data file with cache info.
override
get(String key) Future<CacheObject?>
Gets a CacheObject by key
override
getAllObjects() Future<List<CacheObject>>
Gets the list of all objects in the cache
override
getObjectsOverCapacity(int capacity) Future<List<CacheObject>>
Gets the list of CacheObject that can be removed if the repository is over capacity. [...]
override
getOldObjects(Duration maxAge) Future<List<CacheObject>>
Returns a list of CacheObject that are older than maxAge
override
insert(CacheObject cacheObject, {bool setTouchedToNow = true}) Future<CacheObject>
Inserts cacheObject into the repository
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
open() Future<bool>
Opens the repository, or just returns true if the repo is already open.
override
opened() bool
inherited
shouldClose() bool
inherited
shouldOpenOnNewConnection() bool
inherited
toString() String
A string representation of this object. [...]
inherited
update(CacheObject cacheObject, {bool setTouchedToNow = true}) Future<int>
Updates an existing cacheObject
override
updateOrInsert(CacheObject cacheObject) Future
Updates a given CacheObject, if it exists, or adds a new item to the repository
override

Operators

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