import 'package:hive_flutter/hive_flutter.dart'; import 'package:konectar_events/contacts_module/model_class/k2_api_model/kol_event_k2.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["data"] is List) { events = json["data"] == null ? null : (json["data"] 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; } } class EventsDataStaging { List? events; EventsDataStaging({this.events}); EventsDataStaging.fromJson(Map json) { if (json["data"] is List) { events = json["data"] == null ? null : (json["data"] as List).map((e) => EventsList.fromJson(e)).toList(); } } Map toJson() { final Map _data = {}; if (events != null) { _data["data"] = events?.map((e) => e.toJson()).toList(); } return _data; } } // RESPONSE FROM K2 class EventsListRespK2 { int? code; String? message; List? data; int? lastPage; int? lastRow; int? count; EventsListRespK2( {this.code, this.message, this.data, this.lastPage, this.lastRow, this.count}); EventsListRespK2.fromJson(Map json) { if (json["code"] is int) { code = json["code"]; } if (json["message"] is String) { message = json["message"]; } if (json["data"] is List) { data = json["data"] == null ? null : (json["data"] as List).map((e) => EventsList.fromJson(e)).toList(); } if (json["last_page"] is int) { lastPage = json["last_page"]; } if (json["last_row"] is int) { lastRow = json["last_row"]; } if (json["count"] is int) { count = json["count"]; } } Map toJson() { final Map _data = {}; _data["code"] = code; _data["message"] = message; if (data != null) { _data["data"] = data?.map((e) => e.toJson()).toList(); } _data["last_page"] = lastPage; _data["last_row"] = lastRow; _data["count"] = count; 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; @HiveField(63) late bool? eventUserInterest; 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, this.eventUserInterest, }); factory EventsList.fromJson(Map json) => EventsList( therapeuticArea: json["therapeutic_area"], hcpPin: json["hcp_pin"], cnt: json["cnt"], id: json["id"], kolId: json["kol_id"], type: json["type"], eventType: json["event_type"], eventId: json["event_id"], sessionType: json["session_type"], sessionName: json["session_name"], role: json["role"], topic: json["topic"], start: json["start"], end: json["end"], organizer: json["organizer"], sponsorType: json["sponsor_type"], sessionSponsor: json["session_sponsor"], organizerType: json["organizer_type"], location: json["location"], address: json["address"], cityId: json["city_id"], stateId: json["state_id"], countryId: json["country_id"], postalCode: json["postal_code"], subject: json["subject"], url1: json["url1"], url2: json["url2"], notes: json["notes"], createdBy: json["created_by"], createdOn: json["created_on"], modifiedBy: json["modified_by"], modifiedOn: json[ "modified_on"], // == null ? null : DateTime.parse(json["modified_on"]), clientId: json["client_id"], projectId: json["project_id"], activityType: json["activity_type"], profileType: json["profile_type"], globalEventId: json["global_event_id"], eventUniqueId: json["event_unique_id"], stype: json["stype"], otype: json["otype"], // name: json["name"], partiallyReleasedEvent: json["partially_released_event"], country: json["Country"], region: json["Region"], city: json["City"], topicName: json["topic_name"], eventLat: json["eventLat"], eventLong: json["eventLong"], userCount: json["user_count"], partialcount: json["partialcount"], sessionNote1: json["session_note1"], sessionNote: json["session_note"], organizerAlias: json["organizerAlias"], eAllowed: json["eAllowed"], dAllowed: json["dAllowed"], updated: json["updated"], eventUserAttendee: json["event_user_attendee"], eventUserInterest: json["event_user_interest"], name1: json["name1"], ); Map toJson() => { "therapeutic_area": therapeuticArea, "hcp_pin": hcpPin, "cnt": cnt, "id": id, "kol_id": kolId, "type": type, "event_type": eventType, "event_id": eventId, "session_type": sessionType, "session_name": sessionName, "role": role, "topic": topic, "start": start, "end": end, "organizer": organizer, "sponsor_type": sponsorType, "session_sponsor": sessionSponsor, "organizer_type": organizerType, "location": location, "address": address, "city_id": cityId, "state_id": stateId, "country_id": countryId, "postal_code": postalCode, "subject": subject, "url1": url1, "url2": url2, "notes": notes, "created_by": createdBy, "created_on": createdOn, "modified_by": modifiedBy, "modified_on": modifiedOn, "client_id": clientId, "project_id": projectId, "activity_type": activityType, "profile_type": profileType, "global_event_id": globalEventId, "event_unique_id": eventUniqueId, "stype": stype, "otype": otype, // "name": name, "partially_released_event": partiallyReleasedEvent, "Country": country, "Region": region, "City": city, "topic_name": topicName, "eventLat": eventLat, "eventLong": eventLong, "user_count": userCount, "partialcount": partialcount, "session_note1": sessionNote1, "session_note": sessionNote, "organizerAlias": organizerAlias, "eAllowed": eAllowed, "dAllowed": dAllowed, "updated": updated, "event_user_attendee": eventUserAttendee, "event_user_interest": eventUserInterest, "name1": name1, }; } // EventsList.fromJson(Map json) { // isfav = false; // if (json["city_name"] is String) { // city = json["city_name"] ?? null; // } // if (json["country_name"] is String) { // country = json["country_name"] ?? null; // } // if (json["state_name"] is String) { // region = json["state_name"] ?? 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_date"] is String) { // end = json["end_date"]; // } // if (json["eventLat"] is String) { // eventLat = json["eventLat"]; // } // if (json["eventLong"] is String) { // eventLong = json["eventLong"]; // } // if (json["unique_id"] is String) { // eventId = json["unique_id"]; // } // if (json["event_type_name"] is String) { // eventType = json["event_type_name"]; // } // 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["event_name"] is String) { // name1 = json["event_name"]; // } // 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_name"] is String) { // organizerType = json["organizer_type_name"]; // } // 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_name"] is String) { // sponsorType = json["sponsor_type_name"]; // } // if (json["start_date"] is String) { // start = json["start_date"]; // } // 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["url"] is String) { // url1 = json["url"]; // } // 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; // } // }