diff --git a/packages/secure_storage/amplify_secure_storage_dart/lib/src/ffi/win32/data_protection.dart b/packages/secure_storage/amplify_secure_storage_dart/lib/src/ffi/win32/data_protection.dart index 4257dc754c..2dddf23138 100644 --- a/packages/secure_storage/amplify_secure_storage_dart/lib/src/ffi/win32/data_protection.dart +++ b/packages/secure_storage/amplify_secure_storage_dart/lib/src/ffi/win32/data_protection.dart @@ -14,7 +14,7 @@ import 'package:win32/win32.dart' /// Encrypts the provided string as a [Uint8List]. Uint8List encryptString(String value) { - final encodedValue = utf8.encode(value) as Uint8List; + final encodedValue = const Utf8Encoder().convert(value); return encrypt(encodedValue); }