29 lines
751 B
Dart
29 lines
751 B
Dart
class AnnouncementResponse {
|
|
final String id;
|
|
final String uniqueId;
|
|
final List<String> sentTo;
|
|
final String message;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
|
|
AnnouncementResponse({
|
|
required this.id,
|
|
required this.uniqueId,
|
|
required this.sentTo,
|
|
required this.message,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
});
|
|
|
|
factory AnnouncementResponse.fromJson(Map<String, dynamic> json) {
|
|
return AnnouncementResponse(
|
|
id: json['_id'] ?? '',
|
|
uniqueId: json['uniqueId'] ?? '',
|
|
sentTo: List<String>.from(json['sentTo']),
|
|
message: json['message'] ?? '',
|
|
createdAt: DateTime.parse(json['createdAt']),
|
|
updatedAt: DateTime.parse(json['updatedAt']),
|
|
);
|
|
}
|
|
}
|