This is for encryption from documentation of getStream. https://getstream.io/chat/docs/sdk/flutter/guides/end_to_end_chat_encryption/#dependencies
I am using webcrypto: ^0.5.2 as mentioned in the documentation.
Future<JsonWebKeyPair> generateKeys() async {
final keyPair = await EcdhPrivateKey.generateKey(EllipticCurve.p256);
final publicKeyJwk = await keyPair.publicKey.exportJsonWebKey();
final privateKeyJwk = await keyPair.privateKey.exportJsonWebKey();
return JsonWebKeyPair(
privateKey: json.encode(privateKeyJwk),
publicKey: json.encode(publicKeyJwk),
);
}
I am getting error "package:webcrypto failed to attached finalizer" in the generateKey function
I have tried changing the version of webcrypto but I am still getting the error.