Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class FireTest {
- Stream<UserCheck> streamUser(FirebaseUser user) async {
- return _db
- .collection('users')
- .document(uid)
- .snapshots()
- .map((snap) => UserProfile.fromFirestore(snap));
- }
- }
- @JsonSerializable(nullable: false)
- class UserCheck extends ChangeNotifier {
- final String uid;
- final String fName;
- final String lName;
- final String regEmail;
- final String org;
- UserCheck({
- this.uid,
- this.fName,
- this.lName,
- this.regEmail,
- this.org,
- });
- factory UserCheck.fromJson(DocumentSnapshot doc) {
- Map data = doc.data;
- return UserCheck(
- uid: data['uid'],
- fName: data['fName'],
- etc...
- }
- //Map<String, dynamic> toJson() => _$UserCheckToJson(this);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement