Skip to content

Commit 6c46a17

Browse files
authored
doc: add JsonCacheSafeLocalStorage info to README
Closes #134
1 parent 3fe8861 commit 6c46a17

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fix
11+
12+
- Add JsonCacheSafeLocalStorage info to README - [134](https://github.com/dartoos-dev/json_cache/issues/134).
13+
1014
## [2.1.0] - 2023-03-31
1115

1216
### Added

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Rultor.com](https://www.rultor.com/b/dartoos-dev/json_cache)](https://www.rultor
3030
- [JsonCacheTry — Enhanced Diagnostic Messages](#jsoncachetry)
3131
- [JsonCacheSharedPreferences — SharedPreferences](#jsoncachesharedpreferences)
3232
- [JsonCacheLocalStorage — LocalStorage](#jsoncachelocalstorage)
33+
- [JsonCacheSafeLocalStorage — SafeLocalStorage](#jsoncachesafelocalstorage)
3334
- [JsonCacheFlutterSecureStorage — FlutterSecureStorage](#jsoncachefluttersecurestorage)
3435
- [JsonCacheCrossLocalStorage — CrossLocalStorage](#jsoncachecrosslocalstorage)
3536
- [JsonCacheHive — Hive](#jsoncachehive)
@@ -120,6 +121,7 @@ final JsonCache jsonCache = … retrieve one of the JsonCache implementations.
120121
await jsonCache.refresh('profile', {'name': 'John Doe', 'email': 'johndoe@email.com', 'accountType': 'premium'});
121122
await jsonCache.refresh('preferences', {'theme': {'dark': true}, 'notifications':{'enabled': true}});
122123
```
124+
123125
### Storing Simple Values
124126

125127
In order to store a simple value such as a `string`, `int`, `double`, etc,
@@ -272,6 +274,7 @@ is an implementation on top of the
272274
final JsonCache jsonCache = JsonCacheMem(JsonCacheSharedPreferences(sharedPrefs));
273275
274276
```
277+
275278
### JsonCacheLocalStorage
276279

277280
[JsonCacheLocalStorage](https://pub.dev/documentation/json_cache/latest/json_cache/JsonCacheLocalStorage-class.html)
@@ -285,6 +288,18 @@ is an implementation on top of the
285288
286289
```
287290

291+
### JsonCacheSafeLocalStorage
292+
293+
[JsonCacheSafeLocalStorage](https://pub.dev/documentation/json_cache/latest/json_cache/JsonCacheSafeLocalStorage-class.html)
294+
is an implementation on top of the
295+
[safe_local_storage](https://pub.dev/packages/safe_local_storage) package.
296+
297+
```dart
298+
299+
final storage = SafeLocalStorage('/path/to/your/cache/file.json');
300+
final JsonCache jsonCache = JsonCacheMem(JsonCacheSafeLocalStorage(storage));
301+
302+
```
288303

289304
### JsonCacheFlutterSecureStorage
290305

@@ -331,6 +346,7 @@ package.
331346
final JsonCache hiveCache = JsonCacheMem(JsonCacheHive(box));
332347
333348
```
349+
334350
## Unit Test Tips
335351

336352
This package has been designed with unit testing in mind. This is one of the

0 commit comments

Comments
 (0)