iamshaunjp / iamshaunjp/flutter-firebase
Question related to custom User Model
- Dominant language
- No language data
- Stars
- 586
- Forks
- 427
- PR merge metrics
- No merged PRs in 30d
Description
I want to add more fields to User model, for example, name, sex, job title, age, etc. Here is my code:
```
Stream get user {
// return _auth.onAuthStateChanged.map(_fromFirebaseUser);
final theUser = _auth.onAuthStateChanged.map((firebaseUser) {
final result = Firestore.instance.collection("users")
.document(firebaseUser.uid).snapshots().map((snapshot) {
return User(
uid: user.uid,
name: snapshot.data['name'],
email: user.email,
age: snapshot.data['age'],
gender: snapshot.data['gender']
);
}
return result;
});
return theUser;
}
```
The basic idea is I will get the data from users collection and populate the User model. But I got the following error message:
> The argument type 'Stream>' can't be assigned to the parameter type 'Stream'.
Need your advice. Thanks.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.