KonectarApp/lib/model/events_details.dart

388 lines
10 KiB
Dart

// To parse this JSON data, do
//
// final eventsOverviewDetails = eventsOverviewDetailsFromJson(jsonString);
import 'dart:convert';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:konectar_events/utils/hivetypeids.dart';
part 'events_details.g.dart';
EventsOverviewDetails eventsOverviewDetailsFromJson(String str) =>
EventsOverviewDetails.fromJson(json.decode(str));
String eventsOverviewDetailsToJson(EventsOverviewDetails data) =>
json.encode(data.toJson());
class EventsOverviewDetails {
EventsOverviewData? data;
EventsOverviewDetails({
this.data,
});
factory EventsOverviewDetails.fromJson(Map<String, dynamic> json) =>
EventsOverviewDetails(
data: json["data"] == null
? null
: EventsOverviewData.fromJson(json["data"]),
);
Map<String, dynamic> toJson() => {
"data": data?.toJson(),
};
}
class EventsOverviewData {
int? projectKolAttendee;
bool? cal;
int? grid;
String? eventFor;
String? eventId;
List<TopSpeakers>? topSpeakers;
List<EventTopic>? eventTopics;
List<EventSponser>? eventSponsers;
bool? eventUserAttendee;
bool? eventUserInterest;
List<ArrEvent>? arrEvents;
int? attendeeCount;
EventsOverviewData({
this.projectKolAttendee,
this.cal,
this.grid,
this.eventFor,
this.eventId,
this.topSpeakers,
this.eventTopics,
this.eventSponsers,
this.eventUserAttendee,
this.eventUserInterest,
this.arrEvents,
this.attendeeCount,
});
factory EventsOverviewData.fromJson(Map<String, dynamic> json) =>
EventsOverviewData(
projectKolAttendee: json["project_kol_attendee"],
cal: json["cal"],
grid: json["grid"],
eventFor: json["eventFor"],
eventId: json["eventId"],
topSpeakers: json["eventData"] == null
? []
: List<TopSpeakers>.from(
json["eventData"]!.map((x) => TopSpeakers.fromJson(x))),
eventTopics: json["eventTopics"] == null
? []
: List<EventTopic>.from(
json["eventTopics"]!.map((x) => EventTopic.fromJson(x))),
eventSponsers: json["eventTopics"] == null
? []
: List<EventSponser>.from(
json["eventSponsers"]!.map((x) => EventSponser.fromJson(x))),
eventUserAttendee: json["event_user_attendee"],
eventUserInterest: json["event_user_interest"],
arrEvents: json["arrEvents"] == null
? []
: List<ArrEvent>.from(
json["arrEvents"]!.map((x) => ArrEvent.fromJson(x))),
attendeeCount: json["attendeeCount"],
);
Map<String, dynamic> toJson() => {
"project_kol_attendee": projectKolAttendee,
"cal": cal,
"grid": grid,
"eventFor": eventFor,
"eventId": eventId,
"eventData": topSpeakers == null
? []
: List<dynamic>.from(topSpeakers!.map((x) => x.toJson())),
"eventTopics": eventTopics,
"eventSponsers": eventSponsers == null
? []
: List<dynamic>.from(eventSponsers!.map((x) => x.toJson())),
"event_user_attendee": eventUserAttendee,
"event_user_interest": eventUserInterest,
"arrEvents": arrEvents == null
? []
: List<dynamic>.from(arrEvents!.map((x) => x.toJson())),
"attendeeCount": attendeeCount,
};
}
class ArrEvent {
String? sponsorType;
String? sponsorTypeName;
String? id;
String? kolId;
String? type;
String? eventType;
String? eventId;
String? sessionType;
String? sessionName;
String? role;
dynamic topic;
String? start;
String? end;
String? organizer;
String? sessionSponsor;
String? organizerType;
String? location;
String? address;
String? cityId;
String? stateId;
String? countryId;
String? postalCode;
dynamic subject;
String? url1;
dynamic url2;
dynamic notes;
String? createdBy;
DateTime? createdOn;
dynamic modifiedBy;
DateTime? modifiedOn;
String? clientId;
dynamic projectId;
String? activityType;
String? profileType;
dynamic globalEventId;
String? eventUniqueId;
String? name;
String? confEventType;
String? country;
dynamic eventTopic;
String? confSessionType;
String? region;
String? city;
ArrEvent({
this.sponsorType,
this.sponsorTypeName,
this.id,
this.kolId,
this.type,
this.eventType,
this.eventId,
this.sessionType,
this.sessionName,
this.role,
this.topic,
this.start,
this.end,
this.organizer,
this.sessionSponsor,
this.organizerType,
this.location,
this.address,
this.cityId,
this.stateId,
this.countryId,
this.postalCode,
this.subject,
this.url1,
this.url2,
this.notes,
this.createdBy,
this.createdOn,
this.modifiedBy,
this.modifiedOn,
this.clientId,
this.projectId,
this.activityType,
this.profileType,
this.globalEventId,
this.eventUniqueId,
this.name,
this.confEventType,
this.country,
this.eventTopic,
this.confSessionType,
this.region,
this.city,
});
factory ArrEvent.fromJson(Map<String, dynamic> json) => ArrEvent(
sponsorType: json["sponsor_type"],
sponsorTypeName: json["sponsor_type_name"],
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"],
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"] == null
? null
: DateTime.parse(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"],
name: json["name"],
confEventType: json["conf_event_type"],
country: json["country"],
eventTopic: json["event_topic"],
confSessionType: json["conf_session_type"],
region: json["region"],
city: json["city"],
);
Map<String, dynamic> toJson() => {
"sponsor_type": sponsorType,
"sponsor_type_name": sponsorTypeName,
"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,
"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?.toIso8601String(),
"modified_by": modifiedBy,
"modified_on": modifiedOn?.toIso8601String(),
"client_id": clientId,
"project_id": projectId,
"activity_type": activityType,
"profile_type": profileType,
"global_event_id": globalEventId,
"event_unique_id": eventUniqueId,
"name": name,
"conf_event_type": confEventType,
"country": country,
"event_topic": eventTopic,
"conf_session_type": confSessionType,
"region": region,
"city": city,
};
}
class EventTopic {
String? numTopics;
String? eventTopics;
EventTopic({
this.numTopics,
this.eventTopics,
});
factory EventTopic.fromJson(Map<String, dynamic> json) => EventTopic(
numTopics: json["num_topics"],
eventTopics: json["event_topics"],
);
Map<String, dynamic> toJson() => {
"num_topics": numTopics,
"event_topics": eventTopics,
};
}
@HiveType(typeId: HiveTypeIdConstants.topspeakersHiveId)
class TopSpeakers {
@HiveField(0)
String? firstName;
@HiveField(1)
dynamic middleName;
@HiveField(2)
dynamic lastName;
@HiveField(3)
String? numSess;
TopSpeakers({
this.firstName,
this.middleName,
this.lastName,
this.numSess,
});
factory TopSpeakers.fromJson(Map<String, dynamic> json) => TopSpeakers(
firstName: json["first_name"],
middleName: json["middle_name"],
lastName: json["last_name"],
numSess: json["num_sess"],
);
Map<String, dynamic> toJson() => {
"first_name": firstName,
"middle_name": middleName,
"last_name": lastName,
"num_sess": numSess,
};
}
@HiveType(typeId: HiveTypeIdConstants.topSponsorsHiveId)
class EventSponser {
@HiveField(0)
String? numSess;
@HiveField(1)
String? sessionSponsor;
@HiveField(2)
String? type;
@HiveField(3)
String? sponsorsType;
EventSponser({
this.numSess,
this.sessionSponsor,
this.type,
this.sponsorsType,
});
factory EventSponser.fromJson(Map<String, dynamic> json) => EventSponser(
numSess: json["num_sess"],
sessionSponsor: json["session_sponsor"],
type: json["type"],
sponsorsType: json["sponsors_type"],
);
Map<String, dynamic> toJson() => {
"num_sess": numSess,
"session_sponsor": sessionSponsor,
"type": type,
"sponsors_type": sponsorsType,
};
}