DataCacheManager class

DataCacheManager is a Flutter cache manager package for storing and managing Dart data types, and should be used as a single instance.

Constructors

DataCacheManager({Config config = const Config(), DataStore? dataStore})
Create a new instance of DataCacheManager.

Properties

config Config
The config to customize DataCacheManager.
final
dataStore DataStore
The underlying storage system to store the data.
final
hashCode int
The hash code for this object.
no setterinherited
isCleanupTaskSet bool
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

add(String key, dynamic value, {Map<String, dynamic> queryParams = const <String, dynamic>{}}) Future<CachedData>
Add data to cache.
clear({bool rebuildDb = false}) Future<void>
Remove everything from cache.
close() Future<void>
Close the cache storage system.
get(String key, {Map<String, dynamic> queryParams = const <String, dynamic>{}, DateTime? updatedAt, bool removeSameKeyData = false, bool rebuildDb = false}) Future<CachedData?>
Get data from cache.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open() Future<void>
Open the cache storage system.
remove(String key, {Map<String, dynamic> queryParams = const <String, dynamic>{}, bool rebuildDb = false}) Future<void>
Remove data from cache.
removeByKey(String key, {bool rebuildDb = false}) Future<void>
Remove data from cache by key.
removeStale() Future<void>
Remove stale cache.
toString() String
A string representation of this object.
inherited

Operators

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