Error im receiving : StateError (Bad state: cannot get a field on a DocumentSnapshotPlatform which does not exist)
Future getUserInterests(userId) async {
User currentUser = User();
await _firestore.collection('users').doc(userId).get().then((user) {
currentUser.photo = user.get('name');
currentUser.photo = user.get('photoUrl');
currentUser.gender = user.get('gender');
currentUser.subject = user.get('subject');
});
return currentUser;
}
the name field does exist in my firebase collection thing
here is an image of my database, ignore how gender says 10th lol
