keep 0.2.1
keep: ^0.2.1 copied to clipboard
Typed, reactive, encrypted local storage for Flutter.
0.2.1 #
Changed #
- Consistent Exception Handling: All catch blocks now properly wrap errors in
KeepExceptionand propagate them correctly. - Read Methods Graceful Degradation:
read()andreadSync()methods now returnnullinstead of re-throwing when aKeepExceptionoccurs, ensuring graceful recovery from corrupted data. - Write Methods Fail-Fast:
write()methods now always throw exceptions on failure, ensuring data integrity issues are immediately visible.
Fixed #
- Duplicate
onErrorCalls: Fixed issue whereonErrorcallback was being called multiple times for the same exception when errors bubbled up through layers. - Exception Propagation: Added
on KeepException { rethrow }pattern to prevent double-wrapping of exceptions in non-read operations.
0.2.0 #
Added #
- Binary Format Versioning (V1): Introduced a 1-byte version field to the binary storage format for both internal and external storage to facilitate future migrations.
- Migration Infrastructure: Added
KeepMigrationto handle centralized data transformations and version-based migrations. - Unified Key Hashing: All storage keys (Plain & Secure) now use DJB2 hashing for their physical storage names (
storeName). This prevents issues with special characters in file names and adds a layer of obfuscation for all keys. - Payload Obfuscation for External Storage: Byte shifting (ROL 1) is now consistently applied to both internal and external storage payloads.
Changed #
- Breaking Change (Secure Storage Format):
KeepKeySecureno longer wraps encrypted data in a Map{ 'k': name, 'v': value }. It now stores the raw encrypted value directly for improved efficiency and simplicity. - Refactoring: Decoupled binary decoding and migration logic into
KeepCodecandKeepMigration. - Code Standards: Standardized on explicit return blocks, multi-line if-statements, and complete internal documentation for better readability and maintenance.
Fixed #
- Empty File Handling: Added robust null checks for empty files in external storage to prevent potential crashes.
- Migration Guard: Added backward compatibility logic to handle legacy Map structures during the transition to the 0.2.0 format.
0.1.2 #
0.1.1 #
Added #
- Exports: Exposed
KeepBuilderandKeepExceptionto allow easier integration and error handling.
Changed #
- API Refinement: Renamed
useExternalStoragetouseExternalacross all factories for a more concise and consistent API. - Maintenance: Applied minor code formatting and internal optimizations to storage methods.
0.1.0 #
Added #
KeepKeyPlainConverters: AddedfromStorageandtoStoragesupport toKeepKeyPlain, enabling custom serialization and deserialization for non-encrypted keys.- Factory Type Safety: Enhanced
Keep.listandKeep.mapfactories with automaticcast<T>()andcast<String, dynamic>()support to preventList<dynamic>toList<String>type cast errors from JSON.
0.0.4 #
Added #
- Implicit External Storage: Providing a custom
storageadapter now automatically enablesuseExternalStorage, simplifying key definitions.
0.0.3 #
Added #
- Per-Key Custom Storage: Added support for specifying an optional
KeepStoragefor individual keys via factories, allowing multi-backend storage strategies. - Enhanced Documentation: Added realistic AES-GCM and Custom Database Storage implementation examples.
0.0.2 #
Added #
- Static Key Factories: Added
Keep.integer,Keep.stringSecure, etc., enabling cleaner field declarations withoutlate. - Decimal Support: Added
decimalanddecimalSecurefactories for typed-safe double storage. - Inline Documentation: Added comprehensive DartDocs for all public members and constructors.
Changed #
- API Simplification:
Keep.keysandKeep.removableKeysnow returnList<KeepKey>instead ofList<String>, utilizing the internal registry for faster access. - Registry-Based Discovery: Removed manual disk scanning for key discovery (
keysExternalremoved) in favor of the new automatic registration system. - Reactive Cleanup:
clearRemovable()now automatically notifies all listeners of the affected keys viaonChangeController. - Metadata Optimization: Eliminated
meta.keepfile; external storage is now purely code-driven. - Structure: Removed
KeepKeyManagerand organized factories directly within theKeepclass.
Fixed #
- Type Safety: Improved
numtodoubleconversion in decimal factories. - Boolean Parsing: Added support for
1as truthy inbooleanSecure. - Duplicate Directives: Cleaned up project file organization and part directives.
0.0.1+1 #
- Internal build stabilization and testing.
0.0.1 #
- Initial release