@@ -29,6 +29,7 @@ Rultor.com](https://www.rultor.com/b/dartoos-dev/json_cache)](https://www.rultor
2929 - [ JsonCacheEncPrefs — EncryptedSharedPreferences] ( #jsoncacheencprefs )
3030 - [ JsonCacheSecStorage — FlutterSecureStorage] ( #jsoncachesecstorage )
3131 - [ JsonCacheLocalStorage — LocalStorage] ( #jsoncachelocalstorage )
32+ - [ JsonCacheHive — Hive] ( #jsoncachehive )
3233 - [ JsonCacheCrossLocalStorage — CrossLocalStorage] ( #jsoncachecrosslocalstorage )
3334- [ Demo application] ( #demo-application )
3435- [ Contribute] ( #contribute )
@@ -79,7 +80,7 @@ abstract class JsonCache {
7980 Future<Map<String, dynamic>?> value(String key);
8081
8182 /// It either updates data located at [key] with [value] or, if there is no
82- /// previous data at [key], creates a new cache row at [key] with [value].
83+ /// data at [key], creates a new cache row at [key] with [value].
8384 ///
8485 /// **Note**: [value] must be json encodable.
8586 Future<void> refresh(String key, Map<String, dynamic> value);
@@ -127,7 +128,7 @@ the cache instance that persists data on the user's device.
127128
128129#### Typical Usage
129130
130- Due to the fact that ` JsonCacheMem ` is a decorator, you should always pass
131+ Due to the fact that ` JsonCacheMem ` is a decorator, you should normally pass
131132another ` JsonCache ` instance to it whenever you instantiate a ` JsonCacheMem `
132133object. For example:
133134
@@ -231,6 +232,20 @@ is an implementation on top of the
231232 …
232233```
233234
235+ ### JsonCacheHive
236+
237+ [ JsonCacheHive] ( https://pub.dev/documentation/json_cache/latest/json_cache/JsonCacheHive.html )
238+ is an implementation on top of the [ hive] ( https://pub.dev/packages/hive )
239+ package.
240+
241+ ``` dart
242+ …
243+ await Hive.initFlutter(); // mandatory initialization.
244+ final box = await Hive.openBox<String>('appBox'); // it must be a Box<String>.
245+ final JsonCache hiveCache = JsonCacheMem(JsonCacheHive(box));
246+ …
247+ ```
248+
234249### JsonCacheCrossLocalStorage
235250
236251[ JsonCacheLocalCrossStorage] ( https://pub.dev/documentation/json_cache/latest/json_cache/JsonCacheCrossLocalStorage-class.html )
@@ -270,7 +285,7 @@ Contributors are welcome!
270285 branch and make a Pull Request.
2712863 . After review and acceptance, the PR is merged and closed.
272287
273- Make sure the commands below ** passes** before making a Pull Request.
288+ Make sure the command below ** passes** before making a Pull Request.
274289
275290``` shell
276291 flutter analyze && flutter test
0 commit comments