38 lines
797 B
Dart
38 lines
797 B
Dart
import 'package:afterwork/domain/entities/user.dart';
|
|
|
|
class UserModel extends User {
|
|
const UserModel({
|
|
required String id,
|
|
required String nom,
|
|
required String prenoms,
|
|
required String email,
|
|
required String motDePasse,
|
|
}) : super(
|
|
id: id,
|
|
nom: nom,
|
|
prenoms: prenoms,
|
|
email: email,
|
|
motDePasse: motDePasse,
|
|
);
|
|
|
|
factory UserModel.fromJson(Map<String, dynamic> json) {
|
|
return UserModel(
|
|
id: json['id'] ?? '',
|
|
nom: json['nom'] ?? '',
|
|
prenoms: json['prenoms'] ?? '',
|
|
email: json['email'] ?? '',
|
|
motDePasse: json['motDePasse'] ?? '',
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
'id': id,
|
|
'nom': nom,
|
|
'prenoms': prenoms,
|
|
'email': email,
|
|
'motDePasse': motDePasse,
|
|
};
|
|
}
|
|
}
|