docs icon indicating copy to clipboard operation
docs copied to clipboard

Variable type does not match

Open Santatra00 opened this issue 2 years ago • 1 comments

This is the "original" code final key = await secureStorage.read(key: 'key'); final encryptionKey = base64Url.decode(key!); print('Encryption key: $encryptionKey'); final encryptedBox= await Hive.openBox('vaultBox', encryptionCipher: HiveAesCipher(encryptionKey)); 1- the variable encryptionKey is declared as final on top, so it could not be final 2- the variable encryptionKey is typed as String? so it does not match with the return of .decode() -> Uint8List 3- because of these, the example code does not work I propose this : encryptionKey = await secureStorage.read(key: 'key'); final key = base64Url.decode(encryptionKey!); print('Encryption key: $key'); final encryptedBox= await Hive.openBox('vaultBox', encryptionCipher: HiveAesCipher(key));

Santatra00 avatar Sep 22 '22 07:09 Santatra00

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
docs ✅ Ready (Inspect) Visit Preview Sep 22, 2022 at 7:35AM (UTC)

vercel[bot] avatar Sep 22 '22 07:09 vercel[bot]