EventListData.fromJson constructor
EventListData.fromJson(- Map<String, dynamic> json
)
Implementation
factory EventListData.fromJson(Map<String, dynamic> json) {
return EventListData(
id: json["id"],
userId: json["user_id"],
name: json["name"],
eventImage: json["event_image"],
startDate: json["start_date"] == null ? null : DateTime.parse(json["start_date"]),
endDate: json["end_date"] == null ? null : DateTime.parse(json["end_date"]),
startTime: json["start_time"],
endTime: json["end_time"],
bookingLimit: json["booking_limit"],
leftBookingCount: json["left_booking_count"],
// actualPrice: json["actual_price"],
price: json["price"],
// description: json["description"],
// contactNumber: json["contact_number"],
discount: json["discount"],
discountType: json["discount_type"],
address: json["address"],
// country: json["country"],
// state: json["state"],
city: json["city"],
latitude: json["latitude"],
longitude: json["longitude"],
postalCode: json["postal_code"],
status: json["status"],
isFeatured: json["is_featured"],
statusText: json["status_text"],
isFavourite: json["is_favourite"],
totalRating: json["total_rating"],
// avgRating: json["avg_rating"]?.toDouble(),
// rating: json["rating"] == null ? [] : List<Rating>.from(json["rating"]!.map((x) => Rating.fromJson(x))),
// aboutEvent: json["about_event"] == null ? [] : List<AboutEvent>.from(json["about_event"]!.map((x) => AboutEvent.fromJson(x))),
// eventFaqs: json["event_faqs"] == null ? [] : List<EventFaq>.from(json["event_faqs"]!.map((x) => EventFaq.fromJson(x))),
// business: json["business"] == null ? null : ListingListData.fromJson(json["business"]),
musicTypeId: json["music_type_id"] == null ? [] : List<int>.from(json["music_type_id"]),
musicType: json["music_type"] == null ? [] : List<MusicAffinityModel>.from(json["music_type"]!.map((x) => MusicAffinityModel.fromMap(x))),
artistId: json["artists_id"] == null ? [] : List<int>.from(json["artists_id"].map((x) => x ?? 0)),
// artists: json["artists"] == null ? [] : List<Artist>.from(json["artists"]!.map((x) => Artist.fromJson(x))),
// galleryAttachmentArray: json["gallery_attachment_array"] == null ? [] : List<dynamic>.from(json["gallery_attachment_array"]!.map((x) => x)),
isToday: json["is_today"],
isTomorrow: json["is_tomorrow"],
isWeekEnd: json["is_weekend"],
updatedAt: json['updated_at']);
}