local_storage_manager 1.0.3
local_storage_manager: ^1.0.3 copied to clipboard
A comprehensive Flutter local storage manager package for your app.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.3 - 2025-07-05 #
1.0.2 - 2025-07-05 #
- Bug Fixes
1.0.1 - 2025-06-22 #
- Fix linter problems
- Add additional public API documentations
1.0.0 - 2024-12-19 #
π Initial Release #
This is the first stable release of Local Storage Manager, a comprehensive Flutter package for type-safe local storage operations with clean architecture principles.
β¨ Features Added #
Core Storage Operations
- Type-Safe Storage API: Generic methods with compile-time type safety for all operations
- SharedPreferences Backend: Complete implementation using SharedPreferences with flutter_shared_utilities
- Comprehensive Value Types: Support for primitives (
String
,int
,double
,bool
), collections (List<T>
,Map<String, T>
), and complex objects via JSON serialization - Null Safety: Full null safety support with nullable value handling
Advanced Operations
- Batch Operations: Efficient multi-key operations including
setMultipleValues
,removeMultipleValues
, andgetMultipleValues
- Storage Information: Rich query methods including
getAllKeys
,getAllValues
,getStorageSize
,isEmpty
,hasValue
, andgetKeysMatching
- Key Management: Robust key validation and pattern matching capabilities
Error Handling & Reliability
- Functional Error Handling: Either-style
StorageResult<T>
pattern for elegant error management - Comprehensive Failure Types: 11 distinct failure types covering all error scenarios
- Detailed Error Information: Rich error context including stack traces, original errors, and additional metadata
- Safe Operations: All operations wrapped in try-catch with proper error recovery
Architecture & Design
- Clean Architecture: Abstract
LocalStorageManager
interface following dependency inversion principle - Extensible Design: Easy to add new storage backends (Hive, SQLite, etc.)
- Immutable Models: All data models are immutable with proper equality and hash code implementations
- Builder Pattern: Fluent API design for chaining operations
Developer Experience
- Comprehensive Documentation: Extensive inline documentation with examples
- Type Safety: Full generic support with compile-time type checking
- Functional Programming: Rich functional operations including
map
,flatMap
,fold
,onSuccess
,onFailure
- Convenience Methods: Helper methods like
getValueWithDefault
for common patterns
π¦ Dependencies #
- flutter: SDK dependency (>=3.0.0)
- flutter_shared_utilities: ^1.0.3 (for safe serialization)
- shared_preferences: ^2.5.3 (for storage backend)
π§ͺ Testing & Quality #
- Comprehensive Test Suite: Unit tests, integration tests, and error scenario testing
- Example Application: Full-featured example app demonstrating all package capabilities
- Code Quality: Strict linting rules with custom Flutter lints
- Performance: Optimized batch operations and memory usage
π Documentation #
- Complete API Documentation: All public APIs documented with examples
- Usage Guide: Comprehensive README with quick start and advanced usage
- Error Handling Guide: Detailed error handling patterns and best practices
- Architecture Guide: Clean architecture implementation details
π§ Supported Operations #
Basic Operations
setValue<T>(String key, T value)
- Type-safe value storagegetValue<T>(String key)
- Type-safe value retrievalgetValueWithDefault<T>(String key, {required T defaultValue})
- Safe retrieval with defaultsremoveValue(String key)
- Single key removalcontainsKey(String key)
- Key existence checkingclearAll()
- Complete storage cleanup
Batch Operations
setMultipleValues(Map<String, Object?> values)
- Multi-key storageremoveMultipleValues(List<String> keys)
- Multi-key removalgetMultipleValues<T>(List<String> keys)
- Multi-key retrieval
Storage Information
getAllKeys()
- Get all stored keysgetAllValues()
- Get complete storage contentsgetStorageSize()
- Get number of stored itemsisEmpty()
- Check if storage is emptyhasValue(String key)
- Check if key has non-null valuegetKeysMatching(String pattern)
- Pattern-based key filtering
π‘οΈ Error Types Covered #
keyNotFound
- Requested key doesn't existconversionError
- Type conversion failuresserializationError
- JSON serialization/deserialization failuresaccessDenied
- Storage access permission issuesquotaExceeded
- Storage quota limitationsnetworkError
- Network-related storage errorsoperationFailed
- General operation failuresinvalidKey
- Key format validation errorsinvalidValue
- Value format validation errorscorruptedData
- Data integrity issuesunknown
- Unexpected errors with full context
π― Target Platforms #
- Flutter: 3.0.0 and above
- Dart: 3.8.1 and above
- Platforms: iOS, Android, Web, Desktop (all Flutter-supported platforms)
π Breaking Changes #
None - this is the initial release.
π Migration Guide #
This is the first release, so no migration is required.
π€ Contributors #
- Initial implementation and architecture design
- Comprehensive testing and documentation
- Example application development
Note: This changelog follows Keep a Changelog format. For more details about changes, see the GitHub repository.