refactoring
This commit is contained in:
23
lib/data/models/social_post_model.dart
Normal file
23
lib/data/models/social_post_model.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
class SocialPost {
|
||||
final String userName;
|
||||
final String userImage;
|
||||
final String postText;
|
||||
final String postImage;
|
||||
final int likes;
|
||||
final int comments;
|
||||
final int shares;
|
||||
final List<String> badges; // Gamification badges
|
||||
final List<String> tags; // Ajout de tags pour personnalisation des posts
|
||||
|
||||
SocialPost({
|
||||
required this.userName,
|
||||
required this.userImage,
|
||||
required this.postText,
|
||||
required this.postImage,
|
||||
required this.likes,
|
||||
required this.comments,
|
||||
required this.shares,
|
||||
required this.badges,
|
||||
this.tags = const [],
|
||||
});
|
||||
}
|
||||
@@ -20,7 +20,7 @@ class UserModel extends User {
|
||||
/// Factory pour créer un `UserModel` à partir d'un JSON reçu depuis l'API.
|
||||
factory UserModel.fromJson(Map<String, dynamic> json) {
|
||||
return UserModel(
|
||||
userId: json['id'] ?? '',
|
||||
userId: json['userId'] ?? '',
|
||||
nom: json['nom'] ?? 'Inconnu',
|
||||
prenoms: json['prenoms'] ?? 'Inconnu',
|
||||
email: json['email'] ?? 'inconnu@example.com',
|
||||
|
||||
Reference in New Issue
Block a user