batchRead method

Future<Map<String, String>> batchRead(
  1. List<String> keys
)

Batch read operations

Implementation

Future<Map<String, String>> batchRead(List<String> keys) async {
  _checkInit();
  try {
    final results = await Future.wait(
      keys.map((key) async {
        final value = await getString(key);
        return MapEntry(key, value);
      }),
    );

    return Map.fromEntries(
      results
          .where((entry) => entry.value != null)
          .map((entry) => MapEntry(entry.key, entry.value!)),
    );
  } catch (e) {
    throw SecureStorageException('Batch read operation failed', e);
  }
}