clear method

Future<void> clear()

Clear all values from storage.

Implementation

Future<void> clear() async {
  switch (storageType) {
    case StorageType.inMemory:
    case StorageType.stdSembast:
      final bridge = PVBridge();
      final db = await bridge.getDatabaseForType(
        storageType,
        heavy: ctx.cache.heavy,
        env: ctx.cache.env,
      );
      final storeName = isMetadata
          ? ctx.cache.metadataNameFunction!(ctx.cache.env)
          : ctx.cache.env;
      final store = bridge.getStore(storeName, storageType);
      await store.delete(db);
      break;

    case StorageType.secureStorage:
      // SecureStorage doesn't support clearing all keys
      // Would need to maintain a key registry
      break;
  }
}