27 lines
606 B
Dart
27 lines
606 B
Dart
class UserModel {
|
|
final String uid;
|
|
final String name;
|
|
final String email;
|
|
final String createdAt;
|
|
|
|
UserModel({
|
|
required this.uid,
|
|
required this.name,
|
|
required this.email,
|
|
required this.createdAt,
|
|
});
|
|
|
|
factory UserModel.fromMap(Map<dynamic, dynamic> json) {
|
|
return UserModel(
|
|
uid: json['uid'] ?? '',
|
|
name: json['name'] ?? '',
|
|
email: json['email'] ?? '',
|
|
createdAt: json['created_at'] ?? '',
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toMap() {
|
|
return {'uid': uid, 'name': name, 'email': email, 'created_at': createdAt};
|
|
}
|
|
}
|