parse_offline_extension 1.1.0
parse_offline_extension: ^1.1.0 copied to clipboard
Offline caching extension for Parse Server SDK Flutter. Adds O(1) local storage, batch saves, auto-migration, and connectivity-aware live lists to any ParseObject subclass.
1.1.0 #
- Map-based storage (
offline_cache_<ClassName>_v2): objects are stored asMap<objectId, jsonString>instead ofList<String>, making every single-object read, write, existence check, and removal an O(1) hash operation instead of an O(n) linear scan. - Auto-migration: the old
List<String>format is automatically upgraded on first access; existing cached data is preserved. updateInLocalCachenow returnsFuture<bool>indicating whether the object was found (previouslyFuture<void>).syncLocalCacheWithServeraccepts an optionalshouldSyncpredicate to skip objects that should not overwrite server state.- All
json.decodecalls are wrapped in try-catch; corrupt entries are skipped rather than crashing the operation. clearLocalCacheForClassusesstore.remove()(single key) instead ofstore.setStringList([])(leaves empty list entry).- Replaced all
print()calls withdebugPrint().
1.0.0 #
- Initial public release.
saveToLocalCache()— persist a ParseObject to CoreStore.removeFromLocalCache()— remove a single object by objectId.updateInLocalCache(Map updates)— partial update; returnsboolindicating whether the object was found.loadFromLocalCache(className, objectId)— O(1) lookup by objectId.loadAllFromLocalCache(className)— load all cached objects for a class.saveAllToLocalCache(className, objects)— efficient batch save in one write.existsInLocalCache(className, objectId)— O(1) existence check.getAllObjectIdsInLocalCache(className)— returns all cached ids (no JSON decoding required).clearLocalCacheForClass(className)— wipe entire class cache.syncLocalCacheWithServer(className, {shouldSync})— push cached objects to the server with an optional filter predicate.- Map-based storage (
offline_cache_<ClassName>_v2) for O(1) per-object operations; auto-migrates the legacy list format on first read. - All
json.decodecalls are guarded — corrupt entries are skipped, not thrown.