User.fromMap constructor

User.fromMap(
  1. Map<String, dynamic> map,
  2. String uid
)

Creates a User instance from a Map

Implementation

factory User.fromMap(Map<String, dynamic> map, String uid) {
  return User(
    uid: uid,
    displayName: map['displayName'] ?? '',
    email: map['email'] ?? '',
    photoUrl: map['photoUrl'],
    lastSeen: map['lastSeen']?.toDate(),
  );
}