Created
September 22, 2020 00:01
-
-
Save adamcyber1/6064b9ce43ab73d09f08a1f76f0104e3 to your computer and use it in GitHub Desktop.
Doogle Grive Sign Up
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<String> _registerUser(LoginData data) async { | |
try { | |
Map<String, dynamic> userAttributes = { | |
"email": data.name, | |
}; | |
SignUpResult res = await Amplify.Auth.signUp( | |
username: data.name, | |
password: data.password, | |
options: CognitoSignUpOptions(userAttributes: userAttributes)); | |
_userName = data.name; | |
_isSignedUp = res.isSignUpComplete; | |
return null; | |
} on AuthError catch (e) { | |
print(e); | |
return "Register Error: " + e.toString(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment