Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is it possible to store username in FirebaseAuth.instance.currentUser in firestore flutter?

I want to store user information. Right now I created a collection Users with an email, an username and a profile image. I can get all this data using a method Future<CloudUser> getUserDetails({required String userId});. Is it possible to store the username in the class FirebaseAuth.instance.currentUser? so I don’t have to use the method getUserDetails everytime I want to get the username. I am using flutter and firestore.

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Is it possible to store the username in the class
FirebaseAuth.instance.currentUser?

You can store the username in the displayName property of the User class.

You can set this value by modifying the user object as shown here in the doc.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading