decrypt method

Future<String> decrypt(
  1. String text
)
override

Implementation

Future<String> decrypt(String text) async {

  SharedPreferences prefs = await SharedPreferences.getInstance();
  final plainText = text;
  List<String> getKey =  await getKeyEncrypt();
    String keyEncrypt = getKey[0];
    String ivEncrypt = getKey[1];

  final key = Encrypt.Key.fromUtf8(keyEncrypt);
  final iv = Encrypt.IV.fromUtf8(ivEncrypt);
  final encrypter = Encrypt.Encrypter(Encrypt.AES(key, mode: Encrypt.AESMode.cbc));
  final decrypted = encrypter.decrypt(Encrypt.Encrypted.fromBase64(text), iv: iv);
  return decrypted;
//
}