Open zhouhao27 opened 4 years ago
did you find the answer
I think you could create another class service for getting user snapshot from Firestore and inside there you could create a function or method that accepts string parameter uid of the current user logged in. And has a returning value of stream user.
class FirestoreService {
Stream
And also don't forget to modify first your User model with properties you want to add. Like this...
class User { final String uid; final String name; final String email; final int age; final String gender;
User({this.uid, this.name, this.email, this.age, this.gender}); }
Hope it helps and don't judge me if it doesn't work/not a perfect a solution. I'm also new to dart & flutter development. Good luck! 👍 😄
I want to add more fields to User model, for example, name, sex, job title, age, etc. Here is my code:
The basic idea is I will get the data from users collection and populate the User model. But I got the following error message:
Need your advice. Thanks.