initPersistence static method

Future<void> initPersistence(
  1. String? storeLocation
)

Creates directory boxDir in the file system to save serialized objects storeLocation is optional for Web

Implementation

static Future<void> initPersistence(String? storeLocation) async {
  if (persistent && hiveBox != null) {
    if (storeLocation != null) {
      Hive.init(storeLocation);
    }
    await Hive.openBox(hiveBox!);

    // Cache Initialization
    WrenchCache.configCache('${hiveBox}Cache');
    await WrenchCache.initCache(storeLocation);
  }
}