Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1.  
  2. class FireTest {
  3. Stream<UserCheck> streamUser(FirebaseUser user) async {
  4. return _db
  5. .collection('users')
  6. .document(uid)
  7. .snapshots()
  8. .map((snap) => UserProfile.fromFirestore(snap));
  9. }
  10. }
  11.  
  12.  
  13. @JsonSerializable(nullable: false)
  14. class UserCheck extends ChangeNotifier {
  15. final String uid;
  16. final String fName;
  17. final String lName;
  18. final String regEmail;
  19. final String org;
  20.  
  21. UserCheck({
  22. this.uid,
  23. this.fName,
  24. this.lName,
  25. this.regEmail,
  26. this.org,
  27. });
  28.  
  29. factory UserCheck.fromJson(DocumentSnapshot doc) {
  30. Map data = doc.data;
  31. return UserCheck(
  32. uid: data['uid'],
  33. fName: data['fName'],
  34. etc...
  35. }
  36. //Map<String, dynamic> toJson() => _$UserCheckToJson(this);
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement