When you create user using firebase auth on flutter, you able to set email and password while creating user. I also need to set display name while creating user, but i found only way to set display name after creating user.
I used code like this
FirebaseAuth.instance.
createUserWithEmailAndPassword(
email: eMail.text.trim(),
password: passWord.text.trim(),
)
.then((uC){
uC.user!
.updateDisplayName(userName.text.trim());
}
But this isn’t what I need
2
Answers
yes, you can use fireStore to add user detail to firebase after SignUp is successful.
With the Flutter (and other client-side SDKs) it will always require an extra API call to set the display name of the user.
If creating the user and setting their display name atomically is a requirement for you app, consider using the Admin SDK in a trusted environment (such as your development machine, a server that you control, or Cloud Functions/Cloud Run) to perform that action atomically, creating an endpoint for your this, and then calling that from your app.
Also see: