decryptString static method

Future<String> decryptString(
  1. String txt,
  2. String key
)

Decrypts the txt with the given key.

The content txt that needs to be decrypted must be HEX encoded,key also. txt and key shoudn't be null.

Implementation

static Future<String> decryptString(String txt, String key) async {
  try {
    final String result =
        await _channel.invokeMethod('decrypt', {"input": txt, "key": key});
    return result;
  } on PlatformException catch (e) {
    throw "Failed to get string encoded: '${e.message}'.";
  }
}