0

I use hive: ^1.4.4+1 and hive_flutter: ^0.3.1. I have a problem with box.get after updating a box. It gets the cached version of the object, not the version in the .hive file. For example:

Box box = await Hive.openBox('box1');
box.put('configData', configData);
ConfigData configDataToRestore = await box.get('configData'); //Works as expected
(configData is now updated)
box.put('configData', configData); //The .hive file is updated as it should
ConfigData configDataToRestore = await box.get('configData'); //Returns the first version from the cache, not the updated version

How can I fix this? Is there a way to clear the cache?

padaleiana
  • 955
  • 1
  • 14
  • 23
Bo Hellgren
  • 109
  • 9

0 Answers0