CacheStore class

Object to access specific CacheStore

Constructors

CacheStore({required String name, required CachePolicy policy})

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
CacheStore name to create multiple typeof cache
final
policy CachePolicy
Cache Policy for the store
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → dynamic
Clear the box irrespective whether is expired or not.
clearExpired() → dynamic
It clears all the expired caches manually
delete(dynamic key) → dynamic
Delete a specific Cache
dispose() → dynamic
CacheStore dispose function to close box once work is done
get<T>(String key, {HasDataChanged<T>? cacheInvalidation}) Future<T?>
Returns data from Hive based on key
getLength() Future<int>
Returns the count of data stored in the cache
init() → dynamic
Cache Store init function.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set<T>(String key, T data, {Duration? expiryDuration}) → dynamic
Set data in Cache
toString() String
A string representation of this object.
inherited

Operators

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