CacheManager class
A simple cache manager for storing JSON data with TTL (Time To Live).
Constructors
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
-
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
Static Methods
-
clear(
) → Future< void> - Clears all cache entries.
-
getJson(
String key) → Future - Retrieves cached JSON data if it's not expired.
-
putJson(
String key, dynamic data, {Duration ttl = const Duration(minutes: 10)}) → Future< void> - Stores JSON data with a specified TTL.
-
remove(
String key) → Future< void> - Clears a specific cache entry.