decrypt method

String decrypt({
  1. required String data_base64,
  2. required DatabaseMiniGeneralLibraryBaseOptions databaseMiniGeneralLibraryBaseOptions,
})

Implementation

String decrypt({
  required String data_base64,
  required DatabaseMiniGeneralLibraryBaseOptions
      databaseMiniGeneralLibraryBaseOptions,
}) {
  if (databaseMiniGeneralLibraryBaseOptions.isUseCrypto) {
    try {
      return databaseMiniGeneralLibraryBaseOptions.crypto
          .decrypt(data_base64: data_base64);
    } catch (e) {
      if (databaseMiniGeneralLibraryBaseOptions.isIgnoreError == false) {
        rethrow;
      }
      return json.encode({});
    }
  } else {
    try {
      return data_base64;
    } catch (e) {
      if (databaseMiniGeneralLibraryBaseOptions.isIgnoreError == false) {
        rethrow;
      }
      return json.encode({});
    }
  }
}