487 lines
13 KiB
Dart
487 lines
13 KiB
Dart
import 'package:hive_flutter/hive_flutter.dart';
|
|
|
|
class MyEventsListModel {
|
|
int? code;
|
|
String? message;
|
|
List<MyEventsData>? data;
|
|
int? lastPage;
|
|
int? lastRow;
|
|
int? count;
|
|
|
|
MyEventsListModel(
|
|
{this.code,
|
|
this.message,
|
|
this.data,
|
|
this.lastPage,
|
|
this.lastRow,
|
|
this.count});
|
|
|
|
MyEventsListModel.fromJson(Map<String, dynamic> 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) => MyEventsData.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<String, dynamic> toJson() {
|
|
final Map<String, dynamic> _data = <String, dynamic>{};
|
|
_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;
|
|
}
|
|
}
|
|
|
|
class MyEventsData {
|
|
String? uniqueId;
|
|
dynamic switchedId;
|
|
String? createdByUser;
|
|
String? updatedByUser;
|
|
dynamic deletedByUser;
|
|
String? formattedCreatedAt;
|
|
String? formattedUpdatedAt;
|
|
dynamic formattedDeletedAt;
|
|
List<MyEventsList>? events;
|
|
|
|
MyEventsData(
|
|
{this.uniqueId,
|
|
this.switchedId,
|
|
this.createdByUser,
|
|
this.updatedByUser,
|
|
this.deletedByUser,
|
|
this.formattedCreatedAt,
|
|
this.formattedUpdatedAt,
|
|
this.formattedDeletedAt,
|
|
this.events});
|
|
|
|
MyEventsData.fromJson(Map<String, dynamic> json) {
|
|
if (json["unique_id"] is String) {
|
|
uniqueId = json["unique_id"];
|
|
}
|
|
switchedId = json["switched_id"];
|
|
if (json["created_by_user"] is String) {
|
|
createdByUser = json["created_by_user"];
|
|
}
|
|
if (json["updated_by_user"] is String) {
|
|
updatedByUser = json["updated_by_user"];
|
|
}
|
|
deletedByUser = json["deleted_by_user"];
|
|
if (json["formatted_created_at"] is String) {
|
|
formattedCreatedAt = json["formatted_created_at"];
|
|
}
|
|
if (json["formatted_updated_at"] is String) {
|
|
formattedUpdatedAt = json["formatted_updated_at"];
|
|
}
|
|
formattedDeletedAt = json["formatted_deleted_at"];
|
|
if (json["events"] is List) {
|
|
events = json["events"] == null
|
|
? null
|
|
: (json["events"] as List)
|
|
.map((e) => MyEventsList.fromJson(e))
|
|
.toList();
|
|
}
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> _data = <String, dynamic>{};
|
|
_data["unique_id"] = uniqueId;
|
|
_data["switched_id"] = switchedId;
|
|
_data["created_by_user"] = createdByUser;
|
|
_data["updated_by_user"] = updatedByUser;
|
|
_data["deleted_by_user"] = deletedByUser;
|
|
_data["formatted_created_at"] = formattedCreatedAt;
|
|
_data["formatted_updated_at"] = formattedUpdatedAt;
|
|
_data["formatted_deleted_at"] = formattedDeletedAt;
|
|
if (events != null) {
|
|
_data["events"] = events?.map((e) => e.toJson()).toList();
|
|
}
|
|
return _data;
|
|
}
|
|
}
|
|
|
|
@HiveType(typeId: 101)
|
|
class MyEventsList {
|
|
@HiveField(0)
|
|
String? myeventid;
|
|
@HiveField(1)
|
|
String? eventid;
|
|
@HiveField(2)
|
|
String? sessionName;
|
|
@HiveField(3)
|
|
String? start;
|
|
@HiveField(4)
|
|
String? end;
|
|
@HiveField(5)
|
|
String? organizer;
|
|
@HiveField(6)
|
|
String? sessionSponsor;
|
|
@HiveField(7)
|
|
dynamic location;
|
|
@HiveField(8)
|
|
dynamic address;
|
|
@HiveField(9)
|
|
dynamic postalCode;
|
|
@HiveField(10)
|
|
String? url;
|
|
@HiveField(11)
|
|
String? activityType;
|
|
@HiveField(12)
|
|
dynamic topic;
|
|
@HiveField(13)
|
|
String? role;
|
|
@HiveField(14)
|
|
String? eventTypeName;
|
|
@HiveField(15)
|
|
String? country;
|
|
@HiveField(16)
|
|
String? region;
|
|
@HiveField(17)
|
|
String? city;
|
|
@HiveField(18)
|
|
String? organizerTypeName;
|
|
@HiveField(19)
|
|
String? sponsorTypeName;
|
|
@HiveField(20)
|
|
String? sessionTypeName;
|
|
@HiveField(21)
|
|
String? kolName;
|
|
@HiveField(22)
|
|
dynamic kolUniqueId;
|
|
@HiveField(23)
|
|
String? name1;
|
|
@HiveField(24)
|
|
String? eventUniqueId;
|
|
@HiveField(25)
|
|
String? createdByUser;
|
|
@HiveField(26)
|
|
String? updatedByUser;
|
|
@HiveField(27)
|
|
String? formattedCreatedAt;
|
|
@HiveField(28)
|
|
String? formattedUpdatedAt;
|
|
@HiveField(29)
|
|
List<Attendees>? attendees;
|
|
@HiveField(30)
|
|
bool isfav = false;
|
|
@HiveField(31)
|
|
bool isAttending = false;
|
|
@HiveField(32)
|
|
String? speakerscount;
|
|
@HiveField(33)
|
|
String? topTopics;
|
|
@HiveField(34)
|
|
String? topSpeakers;
|
|
|
|
MyEventsList(
|
|
{this.eventid,
|
|
this.sessionName,
|
|
this.start,
|
|
this.end,
|
|
this.organizer,
|
|
this.sessionSponsor,
|
|
this.location,
|
|
this.address,
|
|
this.postalCode,
|
|
this.url,
|
|
this.activityType,
|
|
this.topic,
|
|
this.role,
|
|
this.eventTypeName,
|
|
this.country,
|
|
this.region,
|
|
this.city,
|
|
this.organizerTypeName,
|
|
this.sponsorTypeName,
|
|
this.sessionTypeName,
|
|
this.kolName,
|
|
this.kolUniqueId,
|
|
this.name1,
|
|
this.eventUniqueId,
|
|
this.createdByUser,
|
|
this.updatedByUser,
|
|
this.formattedCreatedAt,
|
|
this.formattedUpdatedAt,
|
|
this.attendees});
|
|
|
|
MyEventsList.fromJson(Map<String, dynamic> json) {
|
|
if (json["unique_id"] is String) {
|
|
eventid = json["unique_id"];
|
|
}
|
|
if (json["session_name"] is String) {
|
|
sessionName = json["session_name"];
|
|
}
|
|
if (json["start_date"] is String) {
|
|
start = json["start_date"];
|
|
}
|
|
if (json["end_date"] is String) {
|
|
end = json["end_date"];
|
|
}
|
|
if (json["organizer"] is String) {
|
|
organizer = json["organizer"];
|
|
}
|
|
if (json["session_sponsor"] is String) {
|
|
sessionSponsor = json["session_sponsor"];
|
|
}
|
|
location = json["location"];
|
|
address = json["address"];
|
|
postalCode = json["postal_code"];
|
|
if (json["url"] is String) {
|
|
url = json["url"];
|
|
}
|
|
if (json["activity_type"] is String) {
|
|
activityType = json["activity_type"];
|
|
}
|
|
topic = json["topic"];
|
|
if (json["role"] is String) {
|
|
role = json["role"];
|
|
}
|
|
if (json["event_type_name"] is String) {
|
|
eventTypeName = json["event_type_name"];
|
|
}
|
|
if (json["country_name"] is String) {
|
|
country = json["country_name"];
|
|
}
|
|
if (json["state_name"] is String) {
|
|
region = json["state_name"];
|
|
}
|
|
if (json["city_name"] is String) {
|
|
city = json["city_name"];
|
|
}
|
|
if (json["organizer_type_name"] is String) {
|
|
organizerTypeName = json["organizer_type_name"];
|
|
}
|
|
if (json["sponsor_type_name"] is String) {
|
|
sponsorTypeName = json["sponsor_type_name"];
|
|
}
|
|
if (json["session_type_name"] is String) {
|
|
sessionTypeName = json["session_type_name"];
|
|
}
|
|
if (json["kol_name"] is String) {
|
|
kolName = json["kol_name"];
|
|
}
|
|
kolUniqueId = json["kol_unique_id"];
|
|
if (json["event_name"] is String) {
|
|
name1 = json["event_name"];
|
|
}
|
|
if (json["event_unique_id"] is String) {
|
|
eventUniqueId = json["event_unique_id"];
|
|
}
|
|
if (json["created_by_user"] is String) {
|
|
createdByUser = json["created_by_user"];
|
|
}
|
|
if (json["updated_by_user"] is String) {
|
|
updatedByUser = json["updated_by_user"];
|
|
}
|
|
if (json["formatted_created_at"] is String) {
|
|
formattedCreatedAt = json["formatted_created_at"];
|
|
}
|
|
if (json["formatted_updated_at"] is String) {
|
|
formattedUpdatedAt = json["formatted_updated_at"];
|
|
}
|
|
if (json["attendees"] is List) {
|
|
attendees = json["attendees"] == null
|
|
? null
|
|
: (json["attendees"] as List)
|
|
.map((e) => Attendees.fromJson(e))
|
|
.toList();
|
|
}
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> _data = <String, dynamic>{};
|
|
_data["unique_id"] = eventid;
|
|
_data["session_name"] = sessionName;
|
|
_data["start_date"] = start;
|
|
_data["end_date"] = end;
|
|
_data["organizer"] = organizer;
|
|
_data["session_sponsor"] = sessionSponsor;
|
|
_data["location"] = location;
|
|
_data["address"] = address;
|
|
_data["postal_code"] = postalCode;
|
|
_data["url"] = url;
|
|
_data["activity_type"] = activityType;
|
|
_data["topic"] = topic;
|
|
_data["role"] = role;
|
|
_data["event_type_name"] = eventTypeName;
|
|
_data["country_name"] = country;
|
|
_data["state_name"] = region;
|
|
_data["city_name"] = city;
|
|
_data["organizer_type_name"] = organizerTypeName;
|
|
_data["sponsor_type_name"] = sponsorTypeName;
|
|
_data["session_type_name"] = sessionTypeName;
|
|
_data["kol_name"] = kolName;
|
|
_data["kol_unique_id"] = kolUniqueId;
|
|
_data["event_name"] = name1;
|
|
_data["event_unique_id"] = eventUniqueId;
|
|
_data["created_by_user"] = createdByUser;
|
|
_data["updated_by_user"] = updatedByUser;
|
|
_data["formatted_created_at"] = formattedCreatedAt;
|
|
_data["formatted_updated_at"] = formattedUpdatedAt;
|
|
if (attendees != null) {
|
|
_data["attendees"] = attendees?.map((e) => e.toJson()).toList();
|
|
}
|
|
return _data;
|
|
}
|
|
}
|
|
|
|
@HiveType(typeId: 102)
|
|
class Attendees {
|
|
@HiveField(0)
|
|
String? uniqueId;
|
|
@HiveField(1)
|
|
int? kolEventId;
|
|
@HiveField(2)
|
|
int? kolId;
|
|
@HiveField(3)
|
|
String? hcpFullName;
|
|
@HiveField(4)
|
|
String? hcpPin;
|
|
@HiveField(5)
|
|
int? npiNum;
|
|
@HiveField(6)
|
|
dynamic specialty;
|
|
@HiveField(7)
|
|
dynamic organization;
|
|
@HiveField(8)
|
|
String? therapeuticArea;
|
|
@HiveField(9)
|
|
dynamic cityId;
|
|
@HiveField(10)
|
|
dynamic stateId;
|
|
@HiveField(11)
|
|
dynamic countryId;
|
|
@HiveField(12)
|
|
dynamic cleansStatus;
|
|
@HiveField(13)
|
|
int? isDeleted;
|
|
@HiveField(14)
|
|
String? createdByUser;
|
|
@HiveField(15)
|
|
String? updatedByUser;
|
|
@HiveField(16)
|
|
dynamic deletedByUser;
|
|
@HiveField(17)
|
|
String? formattedCreatedAt;
|
|
@HiveField(18)
|
|
String? formattedUpdatedAt;
|
|
@HiveField(19)
|
|
dynamic formattedDeletedAt;
|
|
|
|
Attendees(
|
|
{this.uniqueId,
|
|
this.kolEventId,
|
|
this.kolId,
|
|
this.hcpFullName,
|
|
this.hcpPin,
|
|
this.npiNum,
|
|
this.specialty,
|
|
this.organization,
|
|
this.therapeuticArea,
|
|
this.cityId,
|
|
this.stateId,
|
|
this.countryId,
|
|
this.cleansStatus,
|
|
this.isDeleted,
|
|
this.createdByUser,
|
|
this.updatedByUser,
|
|
this.deletedByUser,
|
|
this.formattedCreatedAt,
|
|
this.formattedUpdatedAt,
|
|
this.formattedDeletedAt});
|
|
|
|
Attendees.fromJson(Map<String, dynamic> json) {
|
|
if (json["unique_id"] is String) {
|
|
uniqueId = json["unique_id"];
|
|
}
|
|
if (json["kol_event_id"] is int) {
|
|
kolEventId = json["kol_event_id"];
|
|
}
|
|
if (json["kol_id"] is int) {
|
|
kolId = json["kol_id"];
|
|
}
|
|
if (json["hcp_full_name"] is String) {
|
|
hcpFullName = json["hcp_full_name"];
|
|
}
|
|
if (json["hcp_pin"] is String) {
|
|
hcpPin = json["hcp_pin"];
|
|
}
|
|
if (json["npi_num"] is int) {
|
|
npiNum = json["npi_num"];
|
|
}
|
|
specialty = json["specialty"];
|
|
organization = json["organization"];
|
|
if (json["therapeutic_area"] is String) {
|
|
therapeuticArea = json["therapeutic_area"];
|
|
}
|
|
cityId = json["city_id"];
|
|
stateId = json["state_id"];
|
|
countryId = json["country_id"];
|
|
cleansStatus = json["cleans_status"];
|
|
if (json["is_deleted"] is int) {
|
|
isDeleted = json["is_deleted"];
|
|
}
|
|
if (json["created_by_user"] is String) {
|
|
createdByUser = json["created_by_user"];
|
|
}
|
|
if (json["updated_by_user"] is String) {
|
|
updatedByUser = json["updated_by_user"];
|
|
}
|
|
deletedByUser = json["deleted_by_user"];
|
|
if (json["formatted_created_at"] is String) {
|
|
formattedCreatedAt = json["formatted_created_at"];
|
|
}
|
|
if (json["formatted_updated_at"] is String) {
|
|
formattedUpdatedAt = json["formatted_updated_at"];
|
|
}
|
|
formattedDeletedAt = json["formatted_deleted_at"];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> _data = <String, dynamic>{};
|
|
_data["unique_id"] = uniqueId;
|
|
_data["kol_event_id"] = kolEventId;
|
|
_data["kol_id"] = kolId;
|
|
_data["hcp_full_name"] = hcpFullName;
|
|
_data["hcp_pin"] = hcpPin;
|
|
_data["npi_num"] = npiNum;
|
|
_data["specialty"] = specialty;
|
|
_data["organization"] = organization;
|
|
_data["therapeutic_area"] = therapeuticArea;
|
|
_data["city_id"] = cityId;
|
|
_data["state_id"] = stateId;
|
|
_data["country_id"] = countryId;
|
|
_data["cleans_status"] = cleansStatus;
|
|
_data["is_deleted"] = isDeleted;
|
|
_data["created_by_user"] = createdByUser;
|
|
_data["updated_by_user"] = updatedByUser;
|
|
_data["deleted_by_user"] = deletedByUser;
|
|
_data["formatted_created_at"] = formattedCreatedAt;
|
|
_data["formatted_updated_at"] = formattedUpdatedAt;
|
|
_data["formatted_deleted_at"] = formattedDeletedAt;
|
|
return _data;
|
|
}
|
|
}
|