toEncryptAES static method

String toEncryptAES({
  1. required String rawText,
  2. required String key,
})

Implementation

static String toEncryptAES({required String rawText, required String key}) {
  final encrypt.Encrypter encrypter = encrypt.Encrypter(
      encrypt.AES(encrypt.Key.fromUtf8(key), mode: encrypt.AESMode.ecb));
  return encrypter.encrypt(rawText, iv: iv).base64;
}