Refactoring et amélioration de la création et l'affichage d'un évènement.

This commit is contained in:
DahoudG
2024-09-02 03:04:40 +00:00
parent b8d7cfcb8d
commit 7bc7761591
9 changed files with 226 additions and 95 deletions

View File

@@ -8,6 +8,7 @@ class EventModel {
final String? link;
final String? imageUrl;
final String creatorId;
final String status;
EventModel({
required this.eventId,
@@ -19,6 +20,7 @@ class EventModel {
this.link,
this.imageUrl,
required this.creatorId,
required this.status,
});
// Méthode pour créer un EventModel à partir d'un JSON
@@ -33,6 +35,7 @@ class EventModel {
link: json['link'],
imageUrl: json['imageUrl'],
creatorId: json['creator']['id'], // Assurez-vous que le JSON a ce format
status: json['status'],
);
}
@@ -48,6 +51,7 @@ class EventModel {
'link': link,
'imageUrl': imageUrl,
'creator': {'id': creatorId}, // Structure du JSON pour l'API
'status': status,
};
}