@@ -13,9 +13,9 @@ class HiveStore extends Store {
1313 /// Opens a box. Convenience pass through to [Hive.openBox] .
1414 ///
1515 /// If the box is already open, the instance is returned and all provided parameters are being ignored.
16- static Future <Box <Map <String , dynamic >>> openBox (
17- {required String boxName, String ? path}) async {
18- return await Hive .openBox <Map <String , dynamic >>(boxName, path: path);
16+ static Future <Box <Map <dynamic , dynamic >? >> openBox (String boxName,
17+ {String ? path}) async {
18+ return await Hive .openBox <Map <dynamic , dynamic >? >(boxName, path: path);
1919 }
2020
2121 /// Convenience factory for `HiveStore(await openBox(boxName ?? 'graphqlClientStore', path: path))`
@@ -26,7 +26,7 @@ class HiveStore extends Store {
2626 String boxName = defaultBoxName,
2727 String ? path,
2828 }) async =>
29- HiveStore (await openBox (boxName: boxName , path: path));
29+ HiveStore (await openBox (boxName, path: path));
3030
3131 /// Init Hive on specific Path
3232 static void init ({required String onPath}) => Hive .init (onPath);
@@ -35,22 +35,22 @@ class HiveStore extends Store {
3535 ///
3636 /// **WARNING**: Directly editing the contents of the store will not automatically
3737 /// rebroadcast operations.
38- final Box <Map <String , dynamic >?> box;
38+ final Box <Map <dynamic , dynamic >?> box;
3939
4040 /// Creates a HiveStore initialized with the given [box] , defaulting to `Hive.box(defaultBoxName)`
4141 ///
4242 /// **N.B.**: [box] must already be [opened] with either [openBox] , [open] , or `initHiveForFlutter` from `graphql_flutter` .
4343 /// This lets us decouple the async initialization logic, making store usage elsewhere much more straightforward.
4444 ///
4545 /// [opened] : https://docs.hivedb.dev/#/README?id=open-a-box
46- HiveStore ([Box <Map <String , dynamic >>? box])
47- : this .box = box ?? Hive .box <Map <String , dynamic >>(defaultBoxName);
46+ HiveStore ([Box <Map <dynamic , dynamic >? >? box])
47+ : this .box = box ?? Hive .box <Map <dynamic , dynamic >? >(defaultBoxName);
4848
4949 @override
5050 Map <String , dynamic >? get (String dataId) {
5151 final result = box.get (dataId);
5252 if (result == null ) return null ;
53- return Map .from (result);
53+ return Map < String , dynamic > .from (result);
5454 }
5555
5656 @override
@@ -59,7 +59,7 @@ class HiveStore extends Store {
5959 }
6060
6161 @override
62- void putAll (Map <String , Map <String , dynamic >> data) {
62+ void putAll (Map <String , Map <String , dynamic >? > data) {
6363 box.putAll (data);
6464 }
6565
@@ -69,7 +69,7 @@ class HiveStore extends Store {
6969 }
7070
7171 @override
72- Map <String , Map <String , dynamic >> toMap () => Map .unmodifiable (box.toMap ());
72+ Map <String , Map <String , dynamic >? > toMap () => Map .unmodifiable (box.toMap ());
7373
7474 Future <void > reset () => box.clear ();
7575}
0 commit comments