-
-
Save SerdarAtesc/375a12f7eae4c62e6ef6e98f30eac109 to your computer and use it in GitHub Desktop.
kullanici Model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:cloud_firestore/cloud_firestore.dart'; | |
import 'package:firebase_auth/firebase_auth.dart'; | |
import 'package:flutter/material.dart'; | |
class Kullanici { | |
final String id; | |
final String adSoyad; | |
final String email; | |
Kullanici({ | |
@required this.id, | |
this.adSoyad, | |
this.email, | |
}); | |
factory Kullanici.firebasedenuret(User kullanici) { | |
return Kullanici( | |
id: kullanici.uid, | |
adSoyad: kullanici.displayName, | |
email: kullanici.email, | |
); | |
} | |
factory Kullanici.dokumandanuret(DocumentSnapshot doc) { | |
return Kullanici( | |
id: doc.id, | |
adSoyad: doc.data()['kullaniciAdi'], | |
email: doc.data()['email'], | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment