CacheService class

Service to manage cache instances as singletons

This service provides easy access to pre-configured cache instances throughout your application without needing to recreate them.

Properties

apiCache IwsCache
Specialized cache for API responses with longer TTL
no setter
hashCode int
The hash code for this object.
no setterinherited
memoryCache IwsCache
Memory cache for temporary data (fast access)
no setter
persistentCache IwsCache
Persistent cache for data that should survive app restarts
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
userDataCache IwsCache
Specialized cache for user-specific data
no setter

Methods

clearAll() Future<void>
Clear all caches (useful for logout scenarios)
closeAll() Future<void>
Close all cache instances (call when app is shutting down)
getAllStats() Future<Map<String, CacheStats>>
Get cache statistics for all instances
getCustomCache({required String name, required bool persistent, int? maxSize, EvictionPolicy evictionPolicy = EvictionPolicy.lru, Duration cleanupInterval = const Duration(minutes: 30)}) IwsCache
Get a custom cache instance with specific configuration
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 Properties

instance CacheService
Get the singleton instance
no setter