UserModel.fromMap constructor
Creates a UserModel from a Firestore document map.
Parameters:
- map: A Map<String, dynamic> containing the user's data.
Returns: A UserModel instance populated with the map's data.
Implementation
factory UserModel.fromMap(Map<String, dynamic> map) {
return UserModel(
uid: map['uid'],
email: map['email'],
fullName: map['fullName'],
userType: UserTypeExtension.fromString(map['userType']),
phoneNumber: map['phoneNumber'] ?? '',
address: map['address'] ?? '',
farmName: map['farmName'] ?? '',
farmLocation: map['farmLocation'] ?? '',
);
}