Interface de connexion avec connexion réussie au serveur
This commit is contained in:
@@ -1,26 +1,37 @@
|
||||
|
||||
import '../../domain/entities/user.dart';
|
||||
import 'package:afterwork/domain/entities/user.dart';
|
||||
|
||||
class UserModel extends User {
|
||||
const UserModel({
|
||||
required super.id,
|
||||
required super.name,
|
||||
required super.email,
|
||||
});
|
||||
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'],
|
||||
name: json['name'],
|
||||
email: json['email'],
|
||||
id: json['id'] ?? '',
|
||||
nom: json['nom'] ?? '',
|
||||
prenoms: json['prenoms'] ?? '',
|
||||
email: json['email'] ?? '',
|
||||
motDePasse: json['motDePasse'] ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'name': name,
|
||||
'nom': nom,
|
||||
'prenoms': prenoms,
|
||||
'email': email,
|
||||
'motDePasse': motDePasse,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user