read method

Future<String?> read(
  1. String key
)

Implementation

Future<String?> read(String key) async {
  if (!isReady) await init();
  try {
    if (_storage.containsKey(key)) return _storage[key];

    final value = await _readFromFile(key);
    if (value != null) _storage[key] = value;

    return value;
  } catch (e) {
    // Handle exceptions related to reading from secure storage
    zprint('Error reading from secure storage: $e');
    return null;
  }
}