class AnnouncementResponse { String? id; String? uniqueId; List? sentTo; String? message; DateTime? createdAt; DateTime? updatedAt; int? v; AnnouncementResponse({ this.id, this.uniqueId, this.sentTo, this.message, this.createdAt, this.updatedAt, this.v, }); factory AnnouncementResponse.fromJson(Map json) { return AnnouncementResponse( id: json['_id'], uniqueId: json['uniqueId'], sentTo: json['sentTo'] != null ? List.from(json['sentTo']) : null, message: json['message'], createdAt: json['createdAt'] != null ? DateTime.parse(json['createdAt']) : null, updatedAt: json['updatedAt'] != null ? DateTime.parse(json['updatedAt']) : null, v: json['__v'], ); } Map toJson() { return { '_id': id, 'uniqueId': uniqueId, 'sentTo': sentTo, 'message': message, 'createdAt': createdAt?.toIso8601String(), 'updatedAt': updatedAt?.toIso8601String(), '__v': v, }; } }