just_storage 1.1.2
just_storage: ^1.1.2 copied to clipboard
Standard and secure key-value storage with typed helpers and reactive streams.
1.1.2 - 2026-03-14 #
Changed #
- README — added a Comparison with similar packages section with a feature matrix table contrasting
just_storageagainstshared_preferences,flutter_secure_storage, andhive, plus guidance on when to choose each package.
1.1.1 - 2026-03-14 #
Fixed #
-
WASM compatibility — replaced
dart:htmlimports inWebStorageandWebSecureStoragewithpackage:web(web: ^1.0.0); changed all conditional export guards fromdart.library.htmltodart.library.js_interop, which is available on both JS web and WASM targets. The package is now compatible withdart compile wasmand Flutter WASM builds. -
Missing documentation warnings — added doc comments to the previously undocumented constructors:
EncryptedFileStorage.new,FileStorage.new,JustSecureStorage.new,JustStandardStorage.new, andStorageException.new. Resolves themissing_code_block_language_in_doc_comment/ pub.dev documentation score warnings.
Changed #
- Example (
example/example.dart) — Example page added to demonstrate basic usage ofJustStoragein a Flutter app, including reading/writing values, using the reactivewatch()stream, and displaying the admin UI.
1.1.0 - 2026-03-14 #
Added #
-
Web platform support —
JustStorage.standard()andJustStorage.encrypted()now resolve to web-specific backends on Flutter Web via conditional imports; no API changes required in consuming code. -
WebStorage—JustStandardStorageimplementation for web, backed bywindow.localStorage.- Values stored under keys prefixed with
just_storage:to avoid collisions - Full
read,write,delete,clear,containsKey,readAll,readJson,writeJson, andwatch()support StreamController.broadcast(sync: true)per key for zero-latencywatch()delivery
- Values stored under keys prefixed with
-
WebSecureStorage—JustSecureStorageimplementation for web, backed bywindow.localStoragewith AES-256-GCM authenticated encryption.- Master key generated on first use with
Random.secure(), stored under a reservedlocalStoragekey - Per-value random 12-byte nonce (fresh on every
write) — same nonce-reuse prevention asEncryptedFileStorage - Data entries stored under keys prefixed with
just_secure:in the format{ "n": "<base64 nonce>", "ct": "<base64 ciphertext+GCMtag>" } - In-memory cache populated on first access; corrupt entries are silently skipped on load
- Full
read,write,delete,clear,containsKey,readAll,readJson,writeJson, andwatch()support
- Master key generated on first use with
-
JustStorageFactory— conditional export (just_storage_factory_native.dart/just_storage_factory_web.dart) so the correctJustStorageimplementation is selected at compile time with no runtime platform checks. -
Admin UI (
package:just_storage/ui.dart) — a complete Flutter admin screen for inspecting and editing storage at runtime.JUStorageAdminScreen— full-screen widget with three tabs:- Standard — browse, search, add, edit, and delete plain key-value entries
- Secure — same operations for AES-256-GCM encrypted entries
- Info — entry counts, backend details, and danger-zone clear actions
- Accepts optional
standardandsecureconstructor parameters to inject existing storage instances (useful when the app already wires up its own) - Accepts an optional
themeparameter to override the surrounding app theme StorageProvider(ChangeNotifier) — internal state manager; creates its own storage instances viaJustStoragewhen none are supplied
1.0.0 - 2026-02-23 #
Added #
-
JustStandardStorage— abstract interface for non-sensitive key-value storage.read,write,delete,clear,containsKeyreadAll()— returns all key-value pairs as an unmodifiable mapreadJson<T>/writeJson<T>typed JSON helperswatch(key)— reactive broadcast stream (emits current value on subscription, then every subsequent change)
-
JustSecureStorage— abstract interface for encrypted key-value storage.- Same read/write/delete/clear/containsKey/readAll/JSON/watch surface as
JustStandardStorage
- Same read/write/delete/clear/containsKey/readAll/JSON/watch surface as
-
JustStorage— factory class for obtaining storage instances.JustStorage.standard([Directory?])→Future<JustStandardStorage>— returns aFileStorageinstance backed by the platform's application support directory.JustStorage.encrypted([Directory?])→Future<JustSecureStorage>— returns anEncryptedFileStorageinstance backed by the platform's application support directory.- Both methods accept an optional
Directoryoverride for testing.
-
FileStorage—JustStandardStorageimplementation backed bydart:io.- Persists to
<directory>/just_storage.json - Atomic writes via rename-swap (
<name>.tmp→ target) - In-memory cache; lazy initialisation on first use
StreamController.broadcast(sync: true)per key for zero-latencywatch()delivery
- Persists to
-
EncryptedFileStorage—JustSecureStorageimplementation backed bydart:io+ AES-256-GCM.- Persists to
<directory>/just_secure_storage.enc - AES-256-GCM via
pointycastle— authenticated encryption; any tampered byte causesStorageException - Per-value random 12-byte nonce (fresh on every
write) — nonce reuse is prevented by design - Master key (
StorageKeyManager) auto-generated withRandom.secure(), stored at<directory>/.storage.keywithchmod 600on POSIX - Atomic writes via rename-swap
- Buffered, causally-ordered
watch()stream
- Persists to
-
StorageKeyManager— manages the 256-bit AES master key lifecycle.- Generates and persists the key on first use
- Validates key file size on load (throws
StorageExceptionon corruption) destroy()— secure key wipe for full data-erasure scenarios
-
AesGcmCipher— thin, tested wrapper overpointycastle'sGCMBlockCipher(AESEngine()).encrypt(key, nonce, plaintext)→ciphertext || 16-byte GCM tagdecrypt(key, nonce, ciphertextWithTag)→ plaintext, or throwsStorageExceptionon tag failureAesGcmCipher.randomNonce()— generates a cryptographically-random 12-byte nonce
-
StorageException— typed exception wrapping underlying errors withmessageand optionalcause.
Dependencies #
path_provider: ^2.1.2— resolves the app-private support directorypointycastle: ^3.7.3— AES-256-GCM cryptographic primitives