LocalStorage class

Local storage abstraction over Isar database

Constructors

LocalStorage({EncryptionService? encryptionService})

Properties

encryptionService EncryptionService?
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addToSyncQueue(SyncOperation operation) Future<void>
Add operation to sync queue
addToSyncQueueBatch(List<SyncOperation> operations) Future<void>
Add multiple operations to sync queue in a single transaction
close() Future<void>
Close database
deleteData({required String collectionName, required String recordId}) Future<void>
Delete data (soft delete) with version increment
getAllCollections() Future<List<String>>
Get all unique collection names
getAllData(String collectionName) Future<List<DataRecord>>
Get all records in a collection
getData({required String collectionName, required String recordId}) Future<DataRecord?>
Get data by record ID
getFailedSyncOperations() Future<List<SyncOperation>>
Get failed sync operations
getLastSyncTime(String collectionName) Future<DateTime?>
Get last sync time for a collection
getPendingSyncOperations() Future<List<SyncOperation>>
Get pending sync operations
incrementOperationRetryCount(int operationId) Future<void>
Increment retry count for an operation
init() Future<void>
Initialize Isar database
markAsSynced({required String collectionName, required String recordId, required int version, required DateTime syncTime}) Future<void>
Mark a record as synced with version and timestamp
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resetOperationRetryCount(int operationId) Future<void>
Reset retry count for an operation
saveData({required String collectionName, required String recordId, required String data}) Future<void>
Save data to local storage with version increment and hash generation
toString() String
A string representation of this object.
inherited
updateLastSyncTime(String collectionName, DateTime syncTime) Future<void>
Update last sync time for a collection
updateSyncOperationStatus({required int operationId, required String status, String? errorMessage}) Future<void>
Update sync operation status
watchCollection(String collectionName) Stream<List<DataRecord>>
Watch collection for changes

Operators

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