decrypt method

  1. @override
Future<String?> decrypt({
  1. required String tag,
  2. required String message,
  3. required String sharedPreferences,
})
override

Implementation

@override
Future<String?> decrypt({
  required String tag,
  required String message,
  required String sharedPreferences,
}) async {
  var iv = await getIV(key: tag, sharedPreferences: sharedPreferences);
  log('iv sp : $iv');

  final res = await methodChannel.invokeMethod<String?>(
    'decrypt',
    {'tag': tag, 'message': message, 'iv': iv},
  );

  if (res == null) return null;

  var jsonRes = json.decode(res);

  return jsonRes['plainText'];
}