CacheStorageHandler class
Handler class for managing SDK cache storage operations.
This class provides a simplified interface for reading and writing data to the SDK's local cache storage. It uses the GetStorage package for persistent data storage across app sessions.
Features
- Data Persistence: Stores data locally for offline access
- Type Safety: Supports generic types for data retrieval
- Simple Interface: Easy-to-use read/write operations
- Singleton Pattern: Ensures single instance throughout the app
Usage Example
// Write data to cache
await CacheStorageHandler.instance.write('key', 'value');
// Read data from cache
final value = CacheStorageHandler.instance.read<String>('key');
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
-
init(
) → Future< void> - Initializes the cache storage system.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read<
T> (String key) → T? - Reads data from the cache storage.
-
toString(
) → String -
A string representation of this object.
inherited
-
write(
String key, dynamic value) → Future< void> - Writes data to the cache storage.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → CacheStorageHandler
-
Returns the singleton instance of CacheStorageHandler.
no setter