persistObject static method

Future<void> persistObject(
  1. String key,
  2. String value
)

Writes serialized object to a file

Implementation

static Future<void> persistObject(String key, String value) async {
  if (persistent && hiveBox != null) {
    Box box = Hive.box(hiveBox!);
    if (box.isOpen) {
      await box.put(key, value);
    }
  }
}