initCache static method

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

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

Implementation

static Future<void> initCache(String? storeLocation) async {
  if (storeLocation != null) {
    Hive.init(storeLocation);
  }
  await Hive.openLazyBox(cacheName);
}