readSecureData static method

dynamic readSecureData(
  1. String key
)

Read and decrypt value from storage, NOTE: value can be null, need to handle null case

Implementation

static dynamic readSecureData(String key) {
  try {
    String? encryptedValue = _getStorage.read(key);
    // ConditionalLogs().customLog("readSecureData \n key: $key");
    if (encryptedValue != null) {
      return _decrypt(encryptedValue);
    }
    return null;
  } catch (e) {
    ConditionalLogs().customLog("error on readSecureData $e");
  }
}