open static method

Future<UStore> open(
  1. String name, {
  2. bool secure = false,
})

Opens (or returns the already open) store name. Each store is its own file, so it can be cleared or deleted without touching the others. Use secure for encrypted stores.

Implementation

static Future<UStore> open(String name, {bool secure = false}) {
  final UStore? open = _stores[name];
  if (open != null) return SynchronousFuture<UStore>(open);
  return _opening[name] ??= UStore._load(name, secure: secure).then((UStore store) {
    _stores[name] = store;
    _opening.remove(name);
    return store;
  });
}