local_storage/src/storage_helpers library

Functions

storageCollectionDeleteIndex<T>(String key, int index) Future<void>
Delete an item from a collection in the storage class.
storageCollectionDeleteValue<T>(String key, {required T value}) Future<void>
Delete a value from a collection in the storage class.
storageCollectionDeleteWhere<T>(String key, bool value(T where)) Future<void>
Delete an item from a collection in the storage class.
storageCollectionRead<T>(String key, {Map<Type, dynamic>? modelDecoders}) Future<List<T>>
Read a collection from the storage class.
storageCollectionSave<T>(String key, List<T> collection) Future<void>
Save a collection to the storage class.
storageDelete(String key) Future<void>
Delete data from the storage class.
storageDeleteMultiple(List<String> keys, {bool andFromBackpack = false}) Future<void>
Delete multiple keys from storage in batch.
storageGetTTL(String key) Future<Duration?>
Get the remaining time-to-live for a key with expiry.
storageHasKey(String key) Future<bool>
Check if a key exists in storage.
storageRead<T>(String key, {Map<Type, dynamic>? modelDecoders}) Future<T?>
Read data from the storage class. Returns the value cast to type T, or null if not found.
storageReadMultiple<T>(List<String> keys, {Map<Type, dynamic>? modelDecoders}) Future<Map<String, T?>>
Read multiple keys from storage in batch.
storageReadWithExpiry<T>(String key, {T? defaultValue, Map<Type, dynamic>? modelDecoders, bool deleteIfExpired = true}) Future<T?>
Read data from the storage class, respecting TTL expiration.
storageRemoveExpired() Future<int>
Remove all expired keys from storage.
storageSave(String key, dynamic object, {bool inBackpack = false}) Future<void>
Save data to the storage class.
storageSaveAll(Map<String, dynamic> items, {bool inBackpack = false}) Future<void>
Save multiple key-value pairs to storage in batch.
storageSaveWithExpiry(String key, dynamic object, {required Duration ttl, bool inBackpack = false}) Future<void>
Save data to the storage class with an expiration time.