Skip to content

Instantly share code, notes, and snippets.

@shark-h
Created September 4, 2019 10:27
Show Gist options
  • Save shark-h/4ed4e3390db11b15ee5c9e772e698fb3 to your computer and use it in GitHub Desktop.
Save shark-h/4ed4e3390db11b15ee5c9e772e698fb3 to your computer and use it in GitHub Desktop.
final HttpsCallable callable =
CloudFunctions.instance.getHttpsCallable(
functionName: 'registerUser',
);
try {
await callable.call(<String, dynamic>{
'email': email.text,
'displayName': name.text,
'password': password.text
});
await FirebaseAuth.instance
.signInWithEmailAndPassword(
email: email.text, password: password.text);
Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => AuthCheck()),
);
} catch (e) {
setState(() {
loading = false;
});
print(e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment