import 'package:hive_flutter/hive_flutter.dart'; part 'neweventsmodel.g.dart'; class EventsResp { EventsData? data; EventsResp({this.data}); EventsResp.fromJson(Map json) { if (json["data"] is Map) { data = json["data"] == null ? null : EventsData.fromJson(json["data"]); } } Map toJson() { final Map _data = {}; if (data != null) { _data["data"] = data?.toJson(); } return _data; } } class EventsData { List? events; EventsData({this.events}); EventsData.fromJson(Map json) { if (json["events"] is List) { events = json["events"] == null ? null : (json["events"] as List) .map((e) => EventsList.fromJson(e)) .toList(); } } Map toJson() { final Map _data = {}; if (events != null) { _data["events"] = events?.map((e) => e.toJson()).toList(); } return _data; } } @HiveType(typeId: 2) class EventsList { @HiveField(0) String? city; @HiveField(1) String? country; @HiveField(2) String? region; @HiveField(3) String? activityType; @HiveField(4) String? address; @HiveField(5) String? cityId; @HiveField(6) String? clientId; @HiveField(7) String? cnt; @HiveField(8) String? countryId; @HiveField(9) String? createdBy; @HiveField(10) String? createdOn; @HiveField(11) bool? dAllowed; @HiveField(12) bool? eAllowed; @HiveField(13) String? end; @HiveField(14) String? eventLat; @HiveField(15) String? eventLong; @HiveField(16) String? eventId; @HiveField(17) String? eventType; @HiveField(18) String? eventUniqueId; @HiveField(19) bool? eventUserAttendee; @HiveField(20) String? globalEventId; @HiveField(21) String? hcpPin; @HiveField(22) String? id; @HiveField(23) String? kolId; @HiveField(24) String? location; @HiveField(25) String? modifiedBy; @HiveField(26) String? modifiedOn; @HiveField(27) String? name1; @HiveField(28) String? notes; @HiveField(29) String? organizer; @HiveField(30) String? organizerAlias; @HiveField(31) String? organizerType; @HiveField(32) String? otype; @HiveField(33) String? partialcount; @HiveField(34) String? partiallyReleasedEvent; @HiveField(35) String? postalCode; @HiveField(36) String? profileType; @HiveField(37) String? projectId; @HiveField(38) String? role; @HiveField(39) String? sessionName; @HiveField(40) String? sessionNote; @HiveField(41) String? sessionNote1; @HiveField(42) String? sessionSponsor; @HiveField(43) String? sessionType; @HiveField(44) String? sponsorType; @HiveField(45) String? start; @HiveField(46) String? stateId; @HiveField(47) String? stype; @HiveField(48) String? subject; @HiveField(49) String? therapeuticArea; @HiveField(50) String? topic; @HiveField(51) String? topicName; @HiveField(52) String? type; @HiveField(53) bool? updated; @HiveField(54) String? url1; @HiveField(55) String? url2; @HiveField(56) String? userCount; @HiveField(57) bool isfav = false; @HiveField(58) bool isAttending = false; @HiveField(59) String? speakerscount; @HiveField(60) String? topTopics; @HiveField(61) String? topSpeakers; @HiveField(62) String? sponsors; EventsList( {this.city, this.sponsors, this.speakerscount, this.topSpeakers, this.topTopics, this.isfav = false, this.isAttending = false, this.country, this.region, this.activityType, this.address, this.cityId, this.clientId, this.cnt, this.countryId, this.createdBy, this.createdOn, this.dAllowed, this.eAllowed, this.end, this.eventLat, this.eventLong, this.eventId, this.eventType, this.eventUniqueId, this.eventUserAttendee, this.globalEventId, this.hcpPin, this.id, this.kolId, this.location, this.modifiedBy, this.modifiedOn, this.name1, this.notes, this.organizer, this.organizerAlias, this.organizerType, this.otype, this.partialcount, this.partiallyReleasedEvent, this.postalCode, this.profileType, this.projectId, this.role, this.sessionName, this.sessionNote, this.sessionNote1, this.sessionSponsor, this.sessionType, this.sponsorType, this.start, this.stateId, this.stype, this.subject, this.therapeuticArea, this.topic, this.topicName, this.type, this.updated, this.url1, this.url2, this.userCount}); EventsList.fromJson(Map json) { isfav = false; if (json["City"] is String) { city = json["City"] ?? null; } if (json["Country"] is String) { country = json["Country"] ?? null; } if (json["Region"] is String) { region = json["Region"] ?? null; } if (json["activity_type"] is String) { activityType = json["activity_type"]; } if (json["address"] is String) { address = json["address"]; } if (json["city_id"] is String) { cityId = json["city_id"]; } if (json["client_id"] is String) { clientId = json["client_id"]; } if (json["cnt"] is String) { cnt = json["cnt"]; } if (json["country_id"] is String) { countryId = json["country_id"]; } if (json["created_by"] is String) { createdBy = json["created_by"]; } if (json["created_on"] is String) { createdOn = json["created_on"]; } if (json["dAllowed"] is bool) { dAllowed = json["dAllowed"]; } if (json["eAllowed"] is bool) { eAllowed = json["eAllowed"]; } if (json["end"] is String) { end = json["end"]; } if (json["eventLat"] is String) { eventLat = json["eventLat"]; } if (json["eventLong"] is String) { eventLong = json["eventLong"]; } if (json["event_id"] is String) { eventId = json["event_id"]; } if (json["event_type"] is String) { eventType = json["event_type"]; } if (json["event_unique_id"] is String) { eventUniqueId = json["event_unique_id"]; } if (json["event_user_attendee"] is bool) { eventUserAttendee = json["event_user_attendee"]; } if (json["global_event_id"] is String) { globalEventId = json["global_event_id"]; } if (json["hcp_pin"] is String) { hcpPin = json["hcp_pin"]; } if (json["id"] is String) { id = json["id"]; } if (json["kol_id"] is String) { kolId = json["kol_id"]; } if (json["location"] is String) { location = json["location"]; } if (json["modified_by"] is String) { modifiedBy = json["modified_by"]; } if (json["modified_on"] is String) { modifiedOn = json["modified_on"]; } if (json["name1"] is String) { name1 = json["name1"]; } if (json["notes"] is String) { notes = json["notes"]; } if (json["organizer"] is String) { organizer = json["organizer"]; } if (json["organizerAlias"] is String) { organizerAlias = json["organizerAlias"]; } if (json["organizer_type"] is String) { organizerType = json["organizer_type"]; } if (json["otype"] is String) { otype = json["otype"]; } if (json["partialcount"] is String) { partialcount = json["partialcount"]; } if (json["partially_released_event"] is String) { partiallyReleasedEvent = json["partially_released_event"]; } if (json["postal_code"] is String) { postalCode = json["postal_code"]; } if (json["profile_type"] is String) { profileType = json["profile_type"]; } if (json["project_id"] is String) { projectId = json["project_id"]; } if (json["role"] is String) { role = json["role"]; } if (json["session_name"] is String) { sessionName = json["session_name"]; } if (json["session_note"] is String) { sessionNote = json["session_note"]; } if (json["session_note1"] is String) { sessionNote1 = json["session_note1"]; } if (json["session_sponsor"] is String) { sessionSponsor = json["session_sponsor"]; } if (json["session_type"] is String) { sessionType = json["session_type"]; } if (json["sponsor_type"] is String) { sponsorType = json["sponsor_type"]; } if (json["start"] is String) { start = json["start"]; } if (json["state_id"] is String) { stateId = json["state_id"]; } if (json["stype"] is String) { stype = json["stype"]; } if (json["subject"] is String) { subject = json["subject"]; } if (json["therapeutic_area"] is String) { therapeuticArea = json["therapeutic_area"]; } if (json["topic"] is String) { topic = json["topic"]; } if (json["topic_name"] is String) { topicName = json["topic_name"]; } if (json["type"] is String) { type = json["type"]; } if (json["updated"] is bool) { updated = json["updated"]; } if (json["url1"] is String) { url1 = json["url1"]; } if (json["url2"] is String) { url2 = json["url2"]; } if (json["user_count"] is String) { userCount = json["user_count"]; } if (json["speakerscount"] is String) { speakerscount = json["speakerscount"]; } if (json["topTopics"] is String) { topTopics = json["topTopics"]; } if (json["topSpeakers"] is String) { topSpeakers = json["topSpeakers"]; } if (json["sponsors"] is String) { sponsors = json["sponsors"]; } } Map toJson() { final Map _data = {}; _data["City"] = city; _data["country"] = country; _data["region"] = region; _data["activity_type"] = activityType; _data["address"] = address; _data["city_id"] = cityId; _data["client_id"] = clientId; _data["cnt"] = cnt; _data["country_id"] = countryId; _data["created_by"] = createdBy; _data["created_on"] = createdOn; _data["dAllowed"] = dAllowed; _data["eAllowed"] = eAllowed; _data["end"] = end; _data["eventLat"] = eventLat; _data["eventLong"] = eventLong; _data["event_id"] = eventId; _data["event_type"] = eventType; _data["event_unique_id"] = eventUniqueId; _data["event_user_attendee"] = eventUserAttendee; _data["global_event_id"] = globalEventId; _data["hcp_pin"] = hcpPin; _data["id"] = id; _data["kol_id"] = kolId; _data["location"] = location; _data["modified_by"] = modifiedBy; _data["modified_on"] = modifiedOn; _data["name1"] = name1; _data["notes"] = notes; _data["organizer"] = organizer; _data["organizerAlias"] = organizerAlias; _data["organizer_type"] = organizerType; _data["otype"] = otype; _data["partialcount"] = partialcount; _data["partially_released_event"] = partiallyReleasedEvent; _data["postal_code"] = postalCode; _data["profile_type"] = profileType; _data["project_id"] = projectId; _data["role"] = role; _data["session_name"] = sessionName; _data["session_note"] = sessionNote; _data["session_note1"] = sessionNote1; _data["session_sponsor"] = sessionSponsor; _data["session_type"] = sessionType; _data["sponsor_type"] = sponsorType; _data["start"] = start; _data["state_id"] = stateId; _data["stype"] = stype; _data["subject"] = subject; _data["therapeutic_area"] = therapeuticArea; _data["topic"] = topic; _data["topic_name"] = topicName; _data["type"] = type; _data["updated"] = updated; _data["url1"] = url1; _data["url2"] = url2; _data["user_count"] = userCount; return _data; } }