CustomCacheManager class

Lightweight key-value cache persisted on top of LocalStorageManager.

Values are stored as strings with metadata:

  • savedAt: persisted timestamp (milliseconds since epoch)
  • ttl: optional time-to-live (milliseconds). If null, the entry does not auto-expire.

On read, attempts jsonDecode of the stored string; if decoding fails, returns the raw string.

Constructors

CustomCacheManager(LocalStorageManager _localStorageManager)

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

deleteAll() Future<void>
deleteCache(String key) Future<void>
getCache({required String key, bool allowExpired = false}) Future
Read cached value for key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setCache({required String key, required dynamic value, Duration? ttl}) Future<void>
Persist value under key.
toString() String
A string representation of this object.
inherited

Operators

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