open static method

Future<HiveCacheStore> open(
  1. String boxName
)

Opens or creates a Hive cache store.

boxName is the name of the Hive box to use for storage. Each box is a separate storage namespace.

Throws HiveError if Hive is not initialized or if there's an error opening the box.

Example:

final store = await HiveCacheStore.open('my_cache');

Implementation

static Future<HiveCacheStore> open(String boxName) async {
  final box = await Hive.openBox<Map<dynamic, dynamic>>(boxName);
  return HiveCacheStore._(box);
}