encrypt method Null safety

  1. @override
Future<String?> encrypt (
  1. String string,
  2. String key
)
override

Encrypts string using a key generated from generateRandomKey or generateKeyFromPassword. The returned string is a sequence of 3 base64-encoded strings (iv, mac and cipherText) and can be transferred and stored almost anywhere.

Implementation

@override
Future<String?> encrypt(String string, String key) async =>
    await _channel.invokeMethod("encrypt", {
      "string": string,
      "key": key,
    });