Skip to content

Instantly share code, notes, and snippets.

@SerdarAtesc
Created April 6, 2021 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SerdarAtesc/375a12f7eae4c62e6ef6e98f30eac109 to your computer and use it in GitHub Desktop.
Save SerdarAtesc/375a12f7eae4c62e6ef6e98f30eac109 to your computer and use it in GitHub Desktop.
kullanici Model
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