Error: The argument type 'Map<String, String>' can't be assigned to the parameter type 'Map<CognitoUserAttributeKey, String>'.
Run Code Online (Sandbox Code Playgroud)
当我查找错误时,没有任何相关信息。
在 AWS 文档中,他们推荐了此代码,这会导致错误:
Map<String, String> userAttributes = {
'email': 'email@domain.com',
'phone_number': '+15559101234',
// additional attributes as needed
};
SignUpResult res = await Amplify.Auth.signUp(
username: 'myusername',
password: 'mysupersecurepassword',
options: CognitoSignUpOptions(
userAttributes: userAttributes
)
);
Run Code Online (Sandbox Code Playgroud)