StorageManager class
Manages local storage, caching, and secure storage via swappable providers.
Constructors
- StorageManager({bool enableCache = true, bool enableOffline = false, IStorageProvider? cacheProvider, IStorageProvider? dataProvider, required ISecureStorageProvider secureProvider})
Properties
- cacheProvider → IStorageProvider?
-
final
- dataProvider → IStorageProvider?
-
final
- enableCache → bool
-
final
- enableOffline → bool
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secureProvider → ISecureStorageProvider
-
final
Methods
-
clearCache(
) → Future< void> -
clearData(
) → Future< void> -
clearEndpointCache(
String endpointPath) → Future< void> - Clears all cache entries for a specific endpoint (all parameter variants).
-
clearSecure(
) → Future< void> -
deleteData(
String key) → Future< void> -
deleteSecure(
String key) → Future< void> -
dispose(
) → Future< void> -
getCache(
String key) → Future -
getData(
String key) → Future -
getSecure(
String key) → Future< String?> -
init(
) → Future< void> - Initializes the storage providers.
-
invalidateCache(
String pattern) → Future< void> -
invalidateCachePattern(
String pattern) → Future< void> - Clears cache entries matching a wildcard pattern.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setCache(
String key, dynamic value, {Duration duration = const Duration(minutes: 5)}) → Future< void> -
setData(
String key, dynamic value) → Future< void> -
setSecure(
String key, String value) → Future< void> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited