dispose static method

Future<void> dispose(
  1. String env
)

Flushes and closes boxes for the given environment.

Implementation

static Future<void> dispose(String env) async {
  if (_hiveBoxCollection == null) {
    return;
  }
  final store = await getBox(env);
  await store.flush();
  if (_openedBoxes.containsKey(env)) {
    _openedBoxes.remove(env);
  }

  // Note: The shared _meta box is not disposed per-environment.
  // It will be closed when all environments are disposed or the collection closes.
}