ContactsModuleMerge

This commit is contained in:
poojakhatawate 2024-10-07 18:11:28 +05:30
parent 5072100b96
commit c9b71a1386
210 changed files with 15706 additions and 9164 deletions

View File

@ -19,7 +19,12 @@ class Constants {
rootBundle.loadString('assets/section.json');
static const Color tabbgColor = Color.fromARGB(255, 0, 112, 184);
static const url = "http://192.168.21.50:8084/api";
//static const url = 'http://192.168.2.143:8085/api';
//static const url = 'http://192.168.153.50:8082/api';
static const url = "http://192.168.2.143:8000/api";
// static const url = "http://192.168.21.50:8000/api";
//static const url = 'http://192.168.2.143:8085/api';http://127.0.0.1:8001
//static const url = 'http://192.168.153.50:8082/api';192.168.21.50:8000
static const k2url = "http://192.168.2.130:8888/api";
}

View File

@ -0,0 +1,212 @@
import 'package:discover_module/contacts_module/constants.dart';
import 'package:discover_module/contacts_module/custom_widget/text.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_aff_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_awards_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_education_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_email_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_event_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_location_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_pno_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_training_k2.dart';
import 'package:flutter/material.dart';
class CustomExpansionTile<T> extends StatefulWidget {
final String title;
final List<T> itemList;
final String buttonText;
final String field1;
final String field2;
final Function(T) onItemSelected;
const CustomExpansionTile({
Key? key,
required this.title,
required this.itemList,
required this.buttonText,
required this.onItemSelected,
required this.field1,
required this.field2,
}) : super(key: key);
@override
_CustomExpansionTileState createState() => _CustomExpansionTileState<T>();
}
class _CustomExpansionTileState<T> extends State<CustomExpansionTile<T>> {
bool _isExpanded = false;
@override
Widget build(BuildContext context) {
print("Chekingg_Field_one: ${widget.field1}");
return ListTileTheme(
dense: true,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0),
child: Container(
child: Card(
margin: EdgeInsets.all(1.0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(0.0),
),
color: Constants.k2color11,
child: ExpansionTile(
backgroundColor: Constants.k2color11,
initiallyExpanded: false,
maintainState: true,
onExpansionChanged: (bool expanded) {
setState(() {
_isExpanded = expanded;
});
},
trailing: Icon(
_isExpanded
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.black,
),
title: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text1(
title: widget.title,
txtcolor: Colors.black,
fontweight: FontWeight.normal,
txtfont: 16.0,
),
const SizedBox(width: 8.0),
Text1(
title: "(${widget.itemList.length})",
txtcolor: Colors.black,
fontweight: FontWeight.normal,
txtfont: 16.0,
),
],
),
children: [
Scrollbar(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Container(
constraints: BoxConstraints(
minWidth: MediaQuery.of(context).size.width,
),
color: Colors.white,
child: DataTable(
showCheckboxColumn: false,
columns: [
DataColumn(
label: Expanded(
child: Text(
widget.field1 ?? 'Item',
style: TextStyle(fontWeight: FontWeight.w600),
softWrap: true,
),
),
),
DataColumn(
label: Expanded(
child: Text(
widget.field2 ?? 'Details',
style: TextStyle(fontWeight: FontWeight.w600),
),
),
),
],
rows: List.generate(widget.itemList.take(2).length,
(index) {
final item = widget.itemList[index];
return DataRow(
onSelectChanged: (value) {
widget.onItemSelected(widget.itemList[index]);
},
cells: [
DataCell(getdatacel1(item)),
DataCell(
getdatacel2(item),
),
],
);
}),
),
),
),
),
Container(
color: Colors.white,
child: Align(
alignment: Alignment.center,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: OutlinedButton(
onPressed: () {
// Handle the button action here
},
child: Text(
widget.buttonText,
style: TextStyle(color: Constants.k2color),
),
style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
),
),
),
),
],
),
),
),
),
);
}
getdatacel1(T location) {
if (location is Data) {
return Text1(title: "${location.address1}");
} else if (location is DataPhno) {
return Text1(title: "${location.phoneTypeName}");
} else if (location is EmailData) {
return Text1(title: "${location.emailTypeName}");
} else if (location is TrainingList) {
return Text1(title: "${location.organizationId}");
} else if (location is EducationList) {
return Text1(title: "${location.organizationId}");
} else if (location is AwardsList) {
return Text1(title: "${location.name}");
} else if (location is CertificateList) {
return Text1(title: "${location.organizationId}");
} else if (location is AffList) {
return Text1(title: "${location.title}");
} else if (location is EventList) {
return Text1(title: "${location.name}");
}
}
getdatacel2(T location) {
if (location is Data) {
return Text1(title: "${location.postalCode}");
} else if (location is DataPhno) {
return Text1(title: "${location.number}");
} else if (location is EmailData) {
return Text1(title: "${location.email}");
} else if (location is TrainingList) {
return Text1(title: "${location.degree}");
} else if (location is EducationList) {
return Text1(title: "${location.degree}");
} else if (location is AwardsList) {
return Text1(title: "${location.startDate} ${location.endDate}");
} else if (location is CertificateList) {
return Text1(title: "${location.specialty}");
} else if (location is AffList) {
return Text1(title: "${location.role}");
} else if (location is EventList) {
return Text1(title: "${location.notes}");
}
}
}

View File

@ -1,4 +1,4 @@
import 'package:discover_module/custom_widget/text.dart';
import 'package:discover_module/contacts_module/custom_widget/text.dart';
import 'package:flutter/material.dart';
import 'package:http_mock_adapter/http_mock_adapter.dart';

View File

@ -1,3 +1,4 @@
// import 'package:discover_module/storage_hive/kol_info/kol_info_model_hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
class HiveFunctions {
@ -8,6 +9,8 @@ class HiveFunctions {
static final apihcpdata = Hive.box("hcpdata");
static final apihcpdata123 = Hive.box('kolshive');
static createUser(Map data) {
_contactbox.add(data);
}
@ -85,11 +88,23 @@ class HiveFunctions {
}
//static deleteUser112(row) {}
static deleteUser11(id) {
static deleteUser11(id) async {
print("Hive_id: $id");
final value1 = _contactbox.delete(id);
print("Getted_valueee: $value1");
for (var entry in _contactbox.toMap().entries) {
var contactData = entry.value;
print("Selected_del_value: $contactData");
if (contactData['id'] == id) {
print("entry.keyentry.key: ${entry.key}.");
// Found the contact with the matching id
await _contactbox.delete(entry.key); // Delete by key
print("Record with id $id has been deleted.");
return; // Exit the function after deletion
}
}
}
static Future<void> deleteUser(int selectedremoveIndic) async {
@ -186,17 +201,27 @@ class HiveFunctions {
return apihcpdata.values.toList();
}
static Future<List> getindexUser(String text) async {
print("Text_issssssS: $text");
// final value = _contactbox.get(int.parse(text));
// print("Checking_Name1111 : $value");
// final data = _contactbox.keys.map((key) {
// var contactBox =
// await Hive.openBox('contacts'); // Replace 'contacts' with your box name
static List getindexUser(String query) {
//static getindexUser(String text) async {
print("Text_issssssS: $query");
final value = _contactbox.values;
print("Checking_Name : $value");
print("Checking_Name : ${value.contains(text)}");
final value = _contactbox.values.toList();
print("Checking_Name_Offline_Searchh : ${value}");
// final offlinesearch1 = value.map((e) => e["name"].toString()).toList();
// print("Checking_offlinesearch1 : ${offlinesearch1}");
List data = value
.where((hcp) =>
hcp['name'].toLowerCase().contains(query.toLowerCase()) ||
hcp['speciality'].toLowerCase().contains(query.toLowerCase()) ||
hcp['addr'].toLowerCase().contains(query.toLowerCase()))
.toList();
print("Checking_Name_data : ${data}");
// print("Checking_Name : ${value.contains(text)}");
// final dataa = value.get(text);
// return {
@ -214,7 +239,7 @@ class HiveFunctions {
// }).toList();
// print("Check_data_is: $data");
return value.toList();
return data.toList();
}
static getuser(int selectedremoveIndic) {
@ -239,4 +264,127 @@ class HiveFunctions {
return data;
}
static getAllhcpdata(String? option) {
List myhcpname = _contactbox.values.toList();
if (option == "HCP Name") {
return myhcpname.map((e) => e["name"].toString()).toList();
} else {
return myhcpname.map((e) => e["speciality"].toString()).toList();
}
}
static List OfflineStored_getindexUser(String query) {
//static getindexUser(String text) async {
print("Text_issssssS: $query");
final value = apihcpdata123.values.toList();
print("Checking_Name_Offline_Searchh : ${value}");
// final offlinesearch1 = value.map((e) => e["name"].toString()).toList();
// print("Checking_offlinesearch1 : ${offlinesearch1}");
List data = value
.where((hcp) =>
hcp['name'].toLowerCase().contains(query.toLowerCase()) ||
// (hcp['speciality'].toLowerCase().contains(query.toLowerCase()) ??
// hcp['spl'].toLowerCase().contains(query.toLowerCase())) ||
hcp['speciality'].toLowerCase().contains(query.toLowerCase()) ||
hcp['addr'].toLowerCase().contains(query.toLowerCase()))
.toList();
print("Checking_Name_data : ${data}");
// print("Checking_Name : ${value.contains(text)}");
// final dataa = value.get(text);
// return {
// "name": value["name"],
// "org": value["org"],
// "adrr": value["adrr"],
// "phone": value["phone"],
// "Pphone": value["Pphone"],
// "email": value["email"],
// "affno": value["affno"],
// "eveno": value["eveno"],
// "pubno": value["pubno"],
// "trailno": value["trailno"]
// };
// }).toList();
// print("Check_data_is: $data");
return data.toList();
}
// static void savemyContact(List<String> selectedIndices, [List displayedHCPList]) async {
// print("Iam selectedd $selectedIndices");
// for (int i = 0; i < selectedIndices.length; i++) {
// Map<String, dynamic>? row = await findRecordById1(selectedIndices[i]);
// print("StoringgggMyContactneww_isss_isss:Row $row");
// }
// }
// Map<String, dynamic> findRecordById(String selectedIndic) {
// final list = _contactbox.values.toList();
// }
static Map<String, dynamic>? findRecordById1(String selectedIndic) {
final list = _contactbox.values.toList();
return list
.firstWhere((element) => element['id'] == int.parse(selectedIndic));
}
static savemyContact(Map<String, dynamic> row) async {
print("CheckingRowww ${row!["email"]}");
final value1 = await _contactbox.values.toList();
List value11 = await value1
.where((element) => element["email"] == row["email"])
.toList();
print("Getted_valueee: ${value11}");
if (value11.isEmpty) {
print("Getted_valueee_imaEmpty");
Map<String, dynamic> data = await {
"id": row["id"],
"name": row["name"],
"org": row["org"],
"addr": row["addr"],
"phone": row["phone"],
"phone_no": row["phone_no"],
"email": row["email"],
"summarry": row["summarry"],
"speciality": row["speciality"],
"sub_speciality": row["sub_speciality"],
"img_path": row["img_path"]
};
print("Inserting_data_is: $data");
await _contactbox.put(await getNextAutoIncrementValue(), data);
// await _contactbox.add(row);
}
}
static Future<int> getNextAutoIncrementValue() async {
var counterBox = await Hive.openBox<int>('counterBox');
if (!counterBox.containsKey('counter')) {
counterBox.put('counter', 0);
}
int? counter = counterBox.get('counter');
counterBox.put('counter', counter! + 1);
await counterBox.close();
return counter;
}
}

View File

@ -0,0 +1,59 @@
// To parse this JSON data, do
//
// final awa = awaFromJson(jsonString);
import 'dart:convert';
List<Awa> awaFromJson(String str) =>
List<Awa>.from(json.decode(str).map((x) => Awa.fromJson(x)));
String awaToJson(List<Awa> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Awa {
int id;
int userId;
String educationType;
String institutionName;
String degree;
String specialty;
String timeFrame;
String url1;
String url2;
Awa({
required this.id,
required this.userId,
required this.educationType,
required this.institutionName,
required this.degree,
required this.specialty,
required this.timeFrame,
required this.url1,
required this.url2,
});
factory Awa.fromJson(Map<String, dynamic> json) => Awa(
id: json["id"],
userId: json["user_id"],
educationType: json["Education Type"],
institutionName: json["Institution Name"],
degree: json["Degree"],
specialty: json["Specialty"],
timeFrame: json["Time Frame"],
url1: json["Url1"],
url2: json["Url2"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"Education Type": educationType,
"Institution Name": institutionName,
"Degree": degree,
"Specialty": specialty,
"Time Frame": timeFrame,
"Url1": url1,
"Url2": url2,
};
}

View File

@ -0,0 +1,59 @@
// To parse this JSON data, do
//
// final cer = cerFromJson(jsonString);
import 'dart:convert';
List<Cer> cerFromJson(String str) =>
List<Cer>.from(json.decode(str).map((x) => Cer.fromJson(x)));
String cerToJson(List<Cer> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Cer {
int id;
int userId;
String educationType;
String institutionName;
String degree;
String specialty;
int timeFrame;
String url1;
String url2;
Cer({
required this.id,
required this.userId,
required this.educationType,
required this.institutionName,
required this.degree,
required this.specialty,
required this.timeFrame,
required this.url1,
required this.url2,
});
factory Cer.fromJson(Map<String, dynamic> json) => Cer(
id: json["id"],
userId: json["user_id"],
educationType: json["Education Type"],
institutionName: json["Institution Name"],
degree: json["Degree"],
specialty: json["Specialty"],
timeFrame: json["Time Frame"],
url1: json["Url1"],
url2: json["Url2"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"Education Type": educationType,
"Institution Name": institutionName,
"Degree": degree,
"Specialty": specialty,
"Time Frame": timeFrame,
"Url1": url1,
"Url2": url2,
};
}

View File

@ -0,0 +1,51 @@
// To parse this JSON data, do
//
// final edu = eduFromJson(jsonString);
import 'dart:convert';
List<Edu> eduFromJson(String str) =>
List<Edu>.from(json.decode(str).map((x) => Edu.fromJson(x)));
String eduToJson(List<Edu> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Edu {
int id;
int userId;
String educationType;
String institutionName;
String degree;
String specialty;
int timeFrame;
Edu({
required this.id,
required this.userId,
required this.educationType,
required this.institutionName,
required this.degree,
required this.specialty,
required this.timeFrame,
});
factory Edu.fromJson(Map<String, dynamic> json) => Edu(
id: json["id"],
userId: json["user_id"],
educationType: json["Education Type"],
institutionName: json["Institution Name"],
degree: json["Degree"],
specialty: json["Specialty"],
timeFrame: json["Time Frame"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"Education Type": educationType,
"Institution Name": institutionName,
"Degree": degree,
"Specialty": specialty,
"Time Frame": timeFrame,
};
}

View File

@ -0,0 +1,39 @@
// To parse this JSON data, do
//
// final email = emailFromJson(jsonString);
import 'dart:convert';
List<Email> emailFromJson(String str) =>
List<Email>.from(json.decode(str).map((x) => Email.fromJson(x)));
String emailToJson(List<Email> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Email {
int id;
int userId;
String emailType;
String email;
Email({
required this.id,
required this.userId,
required this.emailType,
required this.email,
});
factory Email.fromJson(Map<String, dynamic> json) => Email(
id: json["id"],
userId: json["user_id"],
emailType: json["Email Type"],
email: json["Email"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"Email Type": emailType,
"Email": email,
};
}

View File

@ -0,0 +1,122 @@
// To parse this JSON data, do
//
// final dataCertificate = dataCertificateFromJson(jsonString);
import 'dart:convert';
DataCertificate dataCertificateFromJson(String str) =>
DataCertificate.fromJson(json.decode(str));
String dataCertificateToJson(DataCertificate data) =>
json.encode(data.toJson());
class DataCertificate {
int? code;
String? message;
List<CertificateList>? data;
int? lastPage;
int? lastRow;
int? count;
DataCertificate({
this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count,
});
factory DataCertificate.fromJson(Map<String, dynamic> json) =>
DataCertificate(
code: json["code"],
message: json["message"],
data: json["data"] == null
? []
: List<CertificateList>.from(
json["data"]!.map((x) => CertificateList.fromJson(x))),
lastPage: json["last_page"],
lastRow: json["last_row"],
count: json["count"],
);
Map<String, dynamic> toJson() => {
"code": code,
"message": message,
"data": data == null
? []
: List<dynamic>.from(data!.map((x) => x.toJson())),
"last_page": lastPage,
"last_row": lastRow,
"count": count,
};
}
class CertificateList {
String? uniqueId;
int? kolId;
int? clientId;
int? organizationId;
dynamic specialty;
String? startDate;
String? endDate;
String? url;
dynamic switchedUserId;
String? createdByUser;
String? updatedByUser;
DateTime? formattedCreatedAt;
DateTime? formattedUpdatedAt;
CertificateList({
this.uniqueId,
this.kolId,
this.clientId,
this.organizationId,
this.specialty,
this.startDate,
this.endDate,
this.url,
this.switchedUserId,
this.createdByUser,
this.updatedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt,
});
factory CertificateList.fromJson(Map<String, dynamic> json) =>
CertificateList(
uniqueId: json["unique_id"],
kolId: json["kol_id"],
clientId: json["client_id"],
organizationId: json["organization_id"],
specialty: json["specialty"],
startDate: json["start_date"],
endDate: json["end_date"],
url: json["url"],
switchedUserId: json["switched_user_id"],
createdByUser: json["created_by_user"],
updatedByUser: json["updated_by_user"],
formattedCreatedAt: json["formatted_created_at"] == null
? null
: DateTime.parse(json["formatted_created_at"]),
formattedUpdatedAt: json["formatted_updated_at"] == null
? null
: DateTime.parse(json["formatted_updated_at"]),
);
Map<String, dynamic> toJson() => {
"unique_id": uniqueId,
"kol_id": kolId,
"client_id": clientId,
"organization_id": organizationId,
"specialty": specialty,
"start_date": startDate,
"end_date": endDate,
"url": url,
"switched_user_id": switchedUserId,
"created_by_user": createdByUser,
"updated_by_user": updatedByUser,
"formatted_created_at": formattedCreatedAt?.toIso8601String(),
"formatted_updated_at": formattedUpdatedAt?.toIso8601String(),
};
}

View File

@ -0,0 +1,144 @@
// To parse this JSON data, do
//
// final dataAffiliations = dataAffiliationsFromJson(jsonString);
import 'dart:convert';
DataAffiliations dataAffiliationsFromJson(String str) =>
DataAffiliations.fromJson(json.decode(str));
String dataAffiliationsToJson(DataAffiliations data) =>
json.encode(data.toJson());
class DataAffiliations {
int? code;
String? message;
List<AffList>? data;
int? lastPage;
int? lastRow;
int? count;
DataAffiliations({
this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count,
});
factory DataAffiliations.fromJson(Map<String, dynamic> json) =>
DataAffiliations(
code: json["code"],
message: json["message"],
data: json["data"] == null
? []
: List<AffList>.from(json["data"]!.map((x) => AffList.fromJson(x))),
lastPage: json["last_page"],
lastRow: json["last_row"],
count: json["count"],
);
Map<String, dynamic> toJson() => {
"code": code,
"message": message,
"data": data == null
? []
: List<dynamic>.from(data!.map((x) => x.toJson())),
"last_page": lastPage,
"last_row": lastRow,
"count": count,
};
}
class AffList {
String? uniqueId;
String? department;
String? title;
String? startYear;
String? endYear;
String? role;
dynamic switchedUserId;
dynamic kolOrganizationUniqueId;
dynamic kolOrganizationName;
String? kolOrganizationType;
String? kolEngagementType;
String? kolEngagementTypeUniqueId;
String? startAndEndYear;
String? createdByUser;
String? updatedByUser;
dynamic deletedByUser;
DateTime? formattedCreatedAt;
DateTime? formattedUpdatedAt;
dynamic formattedDeletedAt;
AffList({
this.uniqueId,
this.department,
this.title,
this.startYear,
this.endYear,
this.role,
this.switchedUserId,
this.kolOrganizationUniqueId,
this.kolOrganizationName,
this.kolOrganizationType,
this.kolEngagementType,
this.kolEngagementTypeUniqueId,
this.startAndEndYear,
this.createdByUser,
this.updatedByUser,
this.deletedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt,
this.formattedDeletedAt,
});
factory AffList.fromJson(Map<String, dynamic> json) => AffList(
uniqueId: json["unique_id"],
department: json["department"],
title: json["title"],
startYear: json["start_year"],
endYear: json["end_year"],
role: json["role"],
switchedUserId: json["switched_user_id"],
kolOrganizationUniqueId: json["kol_organization_unique_id"],
kolOrganizationName: json["kol_organization_name"],
kolOrganizationType: json["kol_organization_type"],
kolEngagementType: json["kol_engagement_type"],
kolEngagementTypeUniqueId: json["kol_engagement_type_unique_id"],
startAndEndYear: json["start_and_end_year"],
createdByUser: json["created_by_user"],
updatedByUser: json["updated_by_user"],
deletedByUser: json["deleted_by_user"],
formattedCreatedAt: json["formatted_created_at"] == null
? null
: DateTime.parse(json["formatted_created_at"]),
formattedUpdatedAt: json["formatted_updated_at"] == null
? null
: DateTime.parse(json["formatted_updated_at"]),
formattedDeletedAt: json["formatted_deleted_at"],
);
Map<String, dynamic> toJson() => {
"unique_id": uniqueId,
"department": department,
"title": title,
"start_year": startYear,
"end_year": endYear,
"role": role,
"switched_user_id": switchedUserId,
"kol_organization_unique_id": kolOrganizationUniqueId,
"kol_organization_name": kolOrganizationName,
"kol_organization_type": kolOrganizationType,
"kol_engagement_type": kolEngagementType,
"kol_engagement_type_unique_id": kolEngagementTypeUniqueId,
"start_and_end_year": startAndEndYear,
"created_by_user": createdByUser,
"updated_by_user": updatedByUser,
"deleted_by_user": deletedByUser,
"formatted_created_at": formattedCreatedAt?.toIso8601String(),
"formatted_updated_at": formattedUpdatedAt?.toIso8601String(),
"formatted_deleted_at": formattedDeletedAt,
};
}

View File

@ -0,0 +1,115 @@
// To parse this JSON data, do
//
// final dataAwards = dataAwardsFromJson(jsonString);
import 'dart:convert';
DataAwards dataAwardsFromJson(String str) =>
DataAwards.fromJson(json.decode(str));
String dataAwardsToJson(DataAwards data) => json.encode(data.toJson());
class DataAwards {
int? code;
String? message;
List<AwardsList>? data;
int? lastPage;
int? lastRow;
int? count;
DataAwards({
this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count,
});
factory DataAwards.fromJson(Map<String, dynamic> json) => DataAwards(
code: json["code"],
message: json["message"],
data: json["data"] == null
? []
: List<AwardsList>.from(
json["data"]!.map((x) => AwardsList.fromJson(x))),
lastPage: json["last_page"],
lastRow: json["last_row"],
count: json["count"],
);
Map<String, dynamic> toJson() => {
"code": code,
"message": message,
"data": data == null
? []
: List<dynamic>.from(data!.map((x) => x.toJson())),
"last_page": lastPage,
"last_row": lastRow,
"count": count,
};
}
class AwardsList {
String? uniqueId;
int? kolId;
int? clientId;
String? name;
String? startDate;
String? endDate;
String? url;
dynamic switchedUserId;
String? createdByUser;
String? updatedByUser;
DateTime? formattedCreatedAt;
DateTime? formattedUpdatedAt;
AwardsList({
this.uniqueId,
this.kolId,
this.clientId,
this.name,
this.startDate,
this.endDate,
this.url,
this.switchedUserId,
this.createdByUser,
this.updatedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt,
});
factory AwardsList.fromJson(Map<String, dynamic> json) => AwardsList(
uniqueId: json["unique_id"],
kolId: json["kol_id"],
clientId: json["client_id"],
name: json["name"],
startDate: json["start_date"],
endDate: json["end_date"],
url: json["url"],
switchedUserId: json["switched_user_id"],
createdByUser: json["created_by_user"],
updatedByUser: json["updated_by_user"],
formattedCreatedAt: json["formatted_created_at"] == null
? null
: DateTime.parse(json["formatted_created_at"]),
formattedUpdatedAt: json["formatted_updated_at"] == null
? null
: DateTime.parse(json["formatted_updated_at"]),
);
Map<String, dynamic> toJson() => {
"unique_id": uniqueId,
"kol_id": kolId,
"client_id": clientId,
"name": name,
"start_date": startDate,
"end_date": endDate,
"url": url,
"switched_user_id": switchedUserId,
"created_by_user": createdByUser,
"updated_by_user": updatedByUser,
"formatted_created_at": formattedCreatedAt?.toIso8601String(),
"formatted_updated_at": formattedUpdatedAt?.toIso8601String(),
};
}

View File

@ -0,0 +1,123 @@
// To parse this JSON data, do
//
// final dataEducation = dataEducationFromJson(jsonString);
import 'dart:convert';
DataEducation dataEducationFromJson(String str) =>
DataEducation.fromJson(json.decode(str));
String dataEducationToJson(DataEducation data) => json.encode(data.toJson());
class DataEducation {
int? code;
String? message;
List<EducationList>? data;
int? lastPage;
int? lastRow;
int? count;
DataEducation({
this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count,
});
factory DataEducation.fromJson(Map<String, dynamic> json) => DataEducation(
code: json["code"],
message: json["message"],
data: json["data"] == null
? []
: List<EducationList>.from(
json["data"]!.map((x) => EducationList.fromJson(x))),
lastPage: json["last_page"],
lastRow: json["last_row"],
count: json["count"],
);
Map<String, dynamic> toJson() => {
"code": code,
"message": message,
"data": data == null
? []
: List<dynamic>.from(data!.map((x) => x.toJson())),
"last_page": lastPage,
"last_row": lastRow,
"count": count,
};
}
class EducationList {
String? uniqueId;
int? kolId;
int? clientId;
dynamic organizationId;
dynamic degree;
dynamic specialty;
String? startDate;
String? endDate;
String? url;
dynamic switchedUserId;
String? createdByUser;
String? updatedByUser;
DateTime? formattedCreatedAt;
DateTime? formattedUpdatedAt;
EducationList({
this.uniqueId,
this.kolId,
this.clientId,
this.organizationId,
this.degree,
this.specialty,
this.startDate,
this.endDate,
this.url,
this.switchedUserId,
this.createdByUser,
this.updatedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt,
});
factory EducationList.fromJson(Map<String, dynamic> json) => EducationList(
uniqueId: json["unique_id"],
kolId: json["kol_id"],
clientId: json["client_id"],
organizationId: json["organization_id"],
degree: json["degree"],
specialty: json["specialty"],
startDate: json["start_date"],
endDate: json["end_date"],
url: json["url"],
switchedUserId: json["switched_user_id"],
createdByUser: json["created_by_user"],
updatedByUser: json["updated_by_user"],
formattedCreatedAt: json["formatted_created_at"] == null
? null
: DateTime.parse(json["formatted_created_at"]),
formattedUpdatedAt: json["formatted_updated_at"] == null
? null
: DateTime.parse(json["formatted_updated_at"]),
);
Map<String, dynamic> toJson() => {
"unique_id": uniqueId,
"kol_id": kolId,
"client_id": clientId,
"organization_id": organizationId,
"degree": degree,
"specialty": specialty,
"start_date": startDate,
"end_date": endDate,
"url": url,
"switched_user_id": switchedUserId,
"created_by_user": createdByUser,
"updated_by_user": updatedByUser,
"formatted_created_at": formattedCreatedAt?.toIso8601String(),
"formatted_updated_at": formattedUpdatedAt?.toIso8601String(),
};
}

View File

@ -0,0 +1,102 @@
// To parse this JSON data, do
//
// final dataEmail = dataEmailFromJson(jsonString);
import 'dart:convert';
DataEmail dataEmailFromJson(String str) => DataEmail.fromJson(json.decode(str));
String dataEmailToJson(DataEmail data) => json.encode(data.toJson());
class DataEmail {
int? code;
String? message;
List<EmailData>? data;
int? lastPage;
int? lastRow;
int? count;
DataEmail({
this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count,
});
factory DataEmail.fromJson(Map<String, dynamic> json) => DataEmail(
code: json["code"],
message: json["message"],
data: json["data"] == null
? []
: List<EmailData>.from(
json["data"]!.map((x) => EmailData.fromJson(x))),
lastPage: json["last_page"],
lastRow: json["last_row"],
count: json["count"],
);
Map<String, dynamic> toJson() => {
"code": code,
"message": message,
"data": data == null
? []
: List<dynamic>.from(data!.map((x) => x.toJson())),
"last_page": lastPage,
"last_row": lastRow,
"count": count,
};
}
class EmailData {
String? uniqueId;
String? email;
String? kolUniqueId;
String? emailTypeName;
String? formattedIsPrimary;
String? createdByUser;
String? updatedByUser;
DateTime? formattedCreatedAt;
DateTime? formattedUpdatedAt;
EmailData({
this.uniqueId,
this.email,
this.kolUniqueId,
this.emailTypeName,
this.formattedIsPrimary,
this.createdByUser,
this.updatedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt,
});
factory EmailData.fromJson(Map<String, dynamic> json) => EmailData(
uniqueId: json["unique_id"],
email: json["email"],
kolUniqueId: json["kol_unique_id"],
emailTypeName: json["email_type_name"],
formattedIsPrimary: json["formatted_is_primary"],
createdByUser: json["created_by_user"],
updatedByUser: json["updated_by_user"],
formattedCreatedAt: json["formatted_created_at"] == null
? null
: DateTime.parse(json["formatted_created_at"]),
formattedUpdatedAt: json["formatted_updated_at"] == null
? null
: DateTime.parse(json["formatted_updated_at"]),
);
Map<String, dynamic> toJson() => {
"unique_id": uniqueId,
"email": email,
"kol_unique_id": kolUniqueId,
"email_type_name": emailTypeName,
"formatted_is_primary": formattedIsPrimary,
"created_by_user": createdByUser,
"updated_by_user": updatedByUser,
"formatted_created_at": formattedCreatedAt?.toIso8601String(),
"formatted_updated_at": formattedUpdatedAt?.toIso8601String(),
};
}

View File

@ -0,0 +1,98 @@
// To parse this JSON data, do
//
// final dataEvent = dataEventFromJson(jsonString);
import 'dart:convert';
DataEvent dataEventFromJson(String str) => DataEvent.fromJson(json.decode(str));
String dataEventToJson(DataEvent data) => json.encode(data.toJson());
class DataEvent {
int? code;
String? message;
List<EventList>? data;
int? lastPage;
int? lastRow;
int? count;
DataEvent({
this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count,
});
factory DataEvent.fromJson(Map<String, dynamic> json) => DataEvent(
code: json["code"],
message: json["message"],
data: json["data"] == null
? []
: List<EventList>.from(
json["data"]!.map((x) => EventList.fromJson(x))),
lastPage: json["last_page"],
lastRow: json["last_row"],
count: json["count"],
);
Map<String, dynamic> toJson() => {
"code": code,
"message": message,
"data": data == null
? []
: List<dynamic>.from(data!.map((x) => x.toJson())),
"last_page": lastPage,
"last_row": lastRow,
"count": count,
};
}
class EventList {
String? uniqueId;
String? name;
dynamic notes;
int? partiallyReleasedEvent;
String? createdByUser;
String? updatedByUser;
DateTime? formattedCreatedAt;
DateTime? formattedUpdatedAt;
EventList({
this.uniqueId,
this.name,
this.notes,
this.partiallyReleasedEvent,
this.createdByUser,
this.updatedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt,
});
factory EventList.fromJson(Map<String, dynamic> json) => EventList(
uniqueId: json["unique_id"],
name: json["name"],
notes: json["notes"],
partiallyReleasedEvent: json["partially_released_event"],
createdByUser: json["created_by_user"],
updatedByUser: json["updated_by_user"],
formattedCreatedAt: json["formatted_created_at"] == null
? null
: DateTime.parse(json["formatted_created_at"]),
formattedUpdatedAt: json["formatted_updated_at"] == null
? null
: DateTime.parse(json["formatted_updated_at"]),
);
Map<String, dynamic> toJson() => {
"unique_id": uniqueId,
"name": name,
"notes": notes,
"partially_released_event": partiallyReleasedEvent,
"created_by_user": createdByUser,
"updated_by_user": updatedByUser,
"formatted_created_at": formattedCreatedAt?.toIso8601String(),
"formatted_updated_at": formattedUpdatedAt?.toIso8601String(),
};
}

View File

@ -0,0 +1,128 @@
class KolLocation {
int? code;
String? message;
List<Data>? data;
int? lastPage;
int? lastRow;
int? count;
KolLocation(
{this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count});
KolLocation.fromJson(Map<String, dynamic> json) {
code = json['code'];
message = json['message'];
if (json['data'] != null) {
data = <Data>[];
json['data'].forEach((v) {
data!.add(new Data.fromJson(v));
});
}
lastPage = json['last_page'];
lastRow = json['last_row'];
count = json['count'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['code'] = this.code;
data['message'] = this.message;
if (this.data != null) {
data['data'] = this.data!.map((v) => v.toJson()).toList();
}
data['last_page'] = this.lastPage;
data['last_row'] = this.lastRow;
data['count'] = this.count;
return data;
}
}
class Data {
String? uniqueId;
Null? orgInstitutionId;
String? address1;
String? postalCode;
String? kolUniqueId;
String? formattedIsPrimary;
Null? organizationUniqueId;
Null? organizationName;
String? countryUniqueId;
String? countryName;
String? stateUniqueId;
String? stateName;
String? cityUniqueId;
String? cityName;
String? createdByUser;
String? updatedByUser;
String? formattedCreatedAt;
String? formattedUpdatedAt;
Data(
{this.uniqueId,
this.orgInstitutionId,
this.address1,
this.postalCode,
this.kolUniqueId,
this.formattedIsPrimary,
this.organizationUniqueId,
this.organizationName,
this.countryUniqueId,
this.countryName,
this.stateUniqueId,
this.stateName,
this.cityUniqueId,
this.cityName,
this.createdByUser,
this.updatedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt});
Data.fromJson(Map<String, dynamic> json) {
uniqueId = json['unique_id'];
orgInstitutionId = json['org_institution_id'];
address1 = json['address1'];
postalCode = json['postal_code'];
kolUniqueId = json['kol_unique_id'];
formattedIsPrimary = json['formatted_is_primary'];
organizationUniqueId = json['organization_unique_id'];
organizationName = json['organization_name'];
countryUniqueId = json['country_unique_id'];
countryName = json['country_name'];
stateUniqueId = json['state_unique_id'];
stateName = json['state_name'];
cityUniqueId = json['city_unique_id'];
cityName = json['city_name'];
createdByUser = json['created_by_user'];
updatedByUser = json['updated_by_user'];
formattedCreatedAt = json['formatted_created_at'];
formattedUpdatedAt = json['formatted_updated_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['unique_id'] = this.uniqueId;
data['org_institution_id'] = this.orgInstitutionId;
data['address1'] = this.address1;
data['postal_code'] = this.postalCode;
data['kol_unique_id'] = this.kolUniqueId;
data['formatted_is_primary'] = this.formattedIsPrimary;
data['organization_unique_id'] = this.organizationUniqueId;
data['organization_name'] = this.organizationName;
data['country_unique_id'] = this.countryUniqueId;
data['country_name'] = this.countryName;
data['state_unique_id'] = this.stateUniqueId;
data['state_name'] = this.stateName;
data['city_unique_id'] = this.cityUniqueId;
data['city_name'] = this.cityName;
data['created_by_user'] = this.createdByUser;
data['updated_by_user'] = this.updatedByUser;
data['formatted_created_at'] = this.formattedCreatedAt;
data['formatted_updated_at'] = this.formattedUpdatedAt;
return data;
}
}

View File

@ -0,0 +1,116 @@
// To parse this JSON data, do
//
// final dataPno = dataPnoFromJson(jsonString);
import 'dart:convert';
DataaPnoresponse dataPnoFromJson(String str) =>
DataaPnoresponse.fromJson(json.decode(str));
String dataPnoToJson(DataaPnoresponse data) => json.encode(data.toJson());
class DataaPnoresponse {
int? code;
String? message;
List<DataPhno>? data;
int? lastPage;
int? lastRow;
int? count;
DataaPnoresponse({
this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count,
});
factory DataaPnoresponse.fromJson(Map<String, dynamic> json) =>
DataaPnoresponse(
code: json["code"],
message: json["message"],
data: json["data"] == null
? []
: List<DataPhno>.from(
json["data"]!.map((x) => DataPhno.fromJson(x))),
lastPage: json["last_page"],
lastRow: json["last_row"],
count: json["count"],
);
Map<String, dynamic> toJson() => {
"code": code,
"message": message,
"data": data == null
? []
: List<dynamic>.from(data!.map((x) => x.toJson())),
"last_page": lastPage,
"last_row": lastRow,
"count": count,
};
}
class DataPhno {
String? uniqueId;
int? number;
String? kolUniqueId;
String? phoneTypeName;
String? phoneTypeUniqueId;
String? formattedIsPrimary;
dynamic organizationUniqueId;
dynamic organizationName;
String? createdByUser;
String? updatedByUser;
DateTime? formattedCreatedAt;
DateTime? formattedUpdatedAt;
DataPhno({
this.uniqueId,
this.number,
this.kolUniqueId,
this.phoneTypeName,
this.phoneTypeUniqueId,
this.formattedIsPrimary,
this.organizationUniqueId,
this.organizationName,
this.createdByUser,
this.updatedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt,
});
factory DataPhno.fromJson(Map<String, dynamic> json) => DataPhno(
uniqueId: json["unique_id"],
number: json["number"],
kolUniqueId: json["kol_unique_id"],
phoneTypeName: json["phone_type_name"],
phoneTypeUniqueId: json["phone_type_unique_id"],
formattedIsPrimary: json["formatted_is_primary"],
organizationUniqueId: json["organization_unique_id"],
organizationName: json["organization_name"],
createdByUser: json["created_by_user"],
updatedByUser: json["updated_by_user"],
formattedCreatedAt: json["formatted_created_at"] == null
? null
: DateTime.parse(json["formatted_created_at"]),
formattedUpdatedAt: json["formatted_updated_at"] == null
? null
: DateTime.parse(json["formatted_updated_at"]),
);
Map<String, dynamic> toJson() => {
"unique_id": uniqueId,
"number": number,
"kol_unique_id": kolUniqueId,
"phone_type_name": phoneTypeName,
"phone_type_unique_id": phoneTypeUniqueId,
"formatted_is_primary": formattedIsPrimary,
"organization_unique_id": organizationUniqueId,
"organization_name": organizationName,
"created_by_user": createdByUser,
"updated_by_user": updatedByUser,
"formatted_created_at": formattedCreatedAt?.toIso8601String(),
"formatted_updated_at": formattedUpdatedAt?.toIso8601String(),
};
}

View File

@ -0,0 +1,127 @@
// To parse this JSON data, do
//
// final dataTraining = dataTrainingFromJson(jsonString);
import 'dart:convert';
DataTraining dataTrainingFromJson(String str) =>
DataTraining.fromJson(json.decode(str));
String dataTrainingToJson(DataTraining data) => json.encode(data.toJson());
class DataTraining {
int? code;
String? message;
List<TrainingList>? data;
int? lastPage;
int? lastRow;
int? count;
DataTraining({
this.code,
this.message,
this.data,
this.lastPage,
this.lastRow,
this.count,
});
factory DataTraining.fromJson(Map<String, dynamic> json) => DataTraining(
code: json["code"],
message: json["message"],
data: json["data"] == null
? []
: List<TrainingList>.from(
json["data"]!.map((x) => TrainingList.fromJson(x))),
lastPage: json["last_page"],
lastRow: json["last_row"],
count: json["count"],
);
Map<String, dynamic> toJson() => {
"code": code,
"message": message,
"data": data == null
? []
: List<dynamic>.from(data!.map((x) => x.toJson())),
"last_page": lastPage,
"last_row": lastRow,
"count": count,
};
}
class TrainingList {
String? uniqueId;
int? kolId;
int? orgId;
int? clientId;
dynamic organizationId;
dynamic degree;
dynamic specialty;
String? startDate;
String? endDate;
String? url;
dynamic switchedUserId;
String? createdByUser;
String? updatedByUser;
DateTime? formattedCreatedAt;
DateTime? formattedUpdatedAt;
TrainingList({
this.uniqueId,
this.kolId,
this.orgId,
this.clientId,
this.organizationId,
this.degree,
this.specialty,
this.startDate,
this.endDate,
this.url,
this.switchedUserId,
this.createdByUser,
this.updatedByUser,
this.formattedCreatedAt,
this.formattedUpdatedAt,
});
factory TrainingList.fromJson(Map<String, dynamic> json) => TrainingList(
uniqueId: json["unique_id"],
kolId: json["kol_id"],
orgId: json["org_id"],
clientId: json["client_id"],
organizationId: json["organization_id"],
degree: json["degree"],
specialty: json["specialty"],
startDate: json["start_date"],
endDate: json["end_date"],
url: json["url"],
switchedUserId: json["switched_user_id"],
createdByUser: json["created_by_user"],
updatedByUser: json["updated_by_user"],
formattedCreatedAt: json["formatted_created_at"] == null
? null
: DateTime.parse(json["formatted_created_at"]),
formattedUpdatedAt: json["formatted_updated_at"] == null
? null
: DateTime.parse(json["formatted_updated_at"]),
);
Map<String, dynamic> toJson() => {
"unique_id": uniqueId,
"kol_id": kolId,
"org_id": orgId,
"client_id": clientId,
"organization_id": organizationId,
"degree": degree,
"specialty": specialty,
"start_date": startDate,
"end_date": endDate,
"url": url,
"switched_user_id": switchedUserId,
"created_by_user": createdByUser,
"updated_by_user": updatedByUser,
"formatted_created_at": formattedCreatedAt?.toIso8601String(),
"formatted_updated_at": formattedUpdatedAt?.toIso8601String(),
};
}

View File

@ -0,0 +1,272 @@
// To parse this JSON data, do
//
// final kolcontact = kolcontactFromJson(jsonString);
import 'dart:convert';
Kolcontact kolcontactFromJson(String str) =>
Kolcontact.fromJson(json.decode(str));
String kolcontactToJson(Kolcontact data) => json.encode(data.toJson());
class Kolcontact {
int code;
String message;
List<Datum> data;
int lastPage;
int lastRow;
int count;
Kolcontact({
required this.code,
required this.message,
required this.data,
required this.lastPage,
required this.lastRow,
required this.count,
});
factory Kolcontact.fromJson(Map<String, dynamic> json) => Kolcontact(
code: json["code"],
message: json["message"],
data: List<Datum>.from(json["data"].map((x) => Datum.fromJson(x))),
lastPage: json["last_page"],
lastRow: json["last_row"],
count: json["count"],
);
Map<String, dynamic> toJson() => {
"code": code,
"message": message,
"data": List<dynamic>.from(data.map((x) => x.toJson())),
"last_page": lastPage,
"last_row": lastRow,
"count": count,
};
}
class Datum {
String uniqueId;
dynamic profileImage;
String? npiNum;
String fullName;
String? specialityName;
List<dynamic> subSpecialities;
dynamic primaryOrganization;
String? primaryEmail;
int? primaryPhoneNumber;
dynamic primaryFax;
dynamic primaryCountry;
dynamic primaryState;
dynamic primaryCity;
dynamic primaryPostalCode;
dynamic profileDocumentUniqueId;
dynamic profileDocumentImage;
dynamic latitude;
dynamic longitude;
List<dynamic> organizations;
List<Email> emails;
List<Address> address;
List<StateLicense> stateLicense;
String createdByUser;
String updatedByUser;
dynamic deletedByUser;
DateTime formattedCreatedAt;
DateTime formattedUpdatedAt;
dynamic formattedDeletedAt;
dynamic profile;
Datum({
required this.uniqueId,
required this.profileImage,
required this.npiNum,
required this.fullName,
required this.specialityName,
required this.subSpecialities,
required this.primaryOrganization,
required this.primaryEmail,
required this.primaryPhoneNumber,
required this.primaryFax,
required this.primaryCountry,
required this.primaryState,
required this.primaryCity,
required this.primaryPostalCode,
required this.profileDocumentUniqueId,
required this.profileDocumentImage,
required this.latitude,
required this.longitude,
required this.organizations,
required this.emails,
required this.address,
required this.stateLicense,
required this.createdByUser,
required this.updatedByUser,
required this.deletedByUser,
required this.formattedCreatedAt,
required this.formattedUpdatedAt,
required this.formattedDeletedAt,
required this.profile,
});
factory Datum.fromJson(Map<String, dynamic> json) => Datum(
uniqueId: json["unique_id"],
profileImage: json["profile_image"],
npiNum: json["npi_num"],
fullName: json["full_name"],
specialityName: json["speciality_name"],
subSpecialities:
List<dynamic>.from(json["sub_specialities"].map((x) => x)),
primaryOrganization: json["primary_organization"],
primaryEmail: json["primary_email"],
primaryPhoneNumber: json["primary_phone_number"],
primaryFax: json["primary_fax"],
primaryCountry: json["primary_country"],
primaryState: json["primary_state"],
primaryCity: json["primary_city"],
primaryPostalCode: json["primary_postal_code"],
profileDocumentUniqueId: json["profile_document_unique_id"],
profileDocumentImage: json["profile_document_image"],
latitude: json["latitude"],
longitude: json["longitude"],
organizations: List<dynamic>.from(json["organizations"].map((x) => x)),
emails: List<Email>.from(json["emails"].map((x) => Email.fromJson(x))),
address:
List<Address>.from(json["address"].map((x) => Address.fromJson(x))),
stateLicense: List<StateLicense>.from(
json["state_license"].map((x) => StateLicense.fromJson(x))),
createdByUser: json["created_by_user"],
updatedByUser: json["updated_by_user"],
deletedByUser: json["deleted_by_user"],
formattedCreatedAt: DateTime.parse(json["formatted_created_at"]),
formattedUpdatedAt: DateTime.parse(json["formatted_updated_at"]),
formattedDeletedAt: json["formatted_deleted_at"],
profile: json["profile"],
);
Map<String, dynamic> toJson() => {
"unique_id": uniqueId,
"profile_image": profileImage,
"npi_num": npiNum,
"full_name": fullName,
"speciality_name": specialityName,
"sub_specialities": List<dynamic>.from(subSpecialities.map((x) => x)),
"primary_organization": primaryOrganization,
"primary_email": primaryEmail,
"primary_phone_number": primaryPhoneNumber,
"primary_fax": primaryFax,
"primary_country": primaryCountry,
"primary_state": primaryState,
"primary_city": primaryCity,
"primary_postal_code": primaryPostalCode,
"profile_document_unique_id": profileDocumentUniqueId,
"profile_document_image": profileDocumentImage,
"latitude": latitude,
"longitude": longitude,
"organizations": List<dynamic>.from(organizations.map((x) => x)),
"emails": List<dynamic>.from(emails.map((x) => x.toJson())),
"address": List<dynamic>.from(address.map((x) => x.toJson())),
"state_license":
List<dynamic>.from(stateLicense.map((x) => x.toJson())),
"created_by_user": createdByUser,
"updated_by_user": updatedByUser,
"deleted_by_user": deletedByUser,
"formatted_created_at": formattedCreatedAt.toIso8601String(),
"formatted_updated_at": formattedUpdatedAt.toIso8601String(),
"formatted_deleted_at": formattedDeletedAt,
"profile": profile,
};
// @override
// String toString() {
// // TODO: implement toString
// return profileImage.toString();
// }
}
class Address {
String address1;
String? address2;
String country;
String? state;
City city;
Address({
required this.address1,
required this.address2,
required this.country,
required this.state,
required this.city,
});
factory Address.fromJson(Map<String, dynamic> json) => Address(
address1: json["address1"],
address2: json["address2"],
country: json["country"],
state: json["state"],
city: cityValues.map[json["city"]]!,
);
Map<String, dynamic> toJson() => {
"address1": address1,
"address2": address2,
"country": country,
"state": state,
"city": cityValues.reverse[city],
};
}
enum City { ONTARIO }
final cityValues = EnumValues({"Ontario": City.ONTARIO});
class Email {
dynamic type;
String phoneNo;
Email({
required this.type,
required this.phoneNo,
});
factory Email.fromJson(Map<String, dynamic> json) => Email(
type: json["type"],
phoneNo: json["phone_no"],
);
Map<String, dynamic> toJson() => {
"type": type,
"phone_no": phoneNo,
};
}
class StateLicense {
String licenseNumber;
dynamic stateCode;
StateLicense({
required this.licenseNumber,
required this.stateCode,
});
factory StateLicense.fromJson(Map<String, dynamic> json) => StateLicense(
licenseNumber: json["license_number"],
stateCode: json["state_code"],
);
Map<String, dynamic> toJson() => {
"license_number": licenseNumber,
"state_code": stateCode,
};
}
class EnumValues<T> {
Map<String, T> map;
late Map<T, String> reverseMap;
EnumValues(this.map);
Map<T, String> get reverse {
reverseMap = map.map((k, v) => MapEntry(v, k));
return reverseMap;
}
}

View File

@ -0,0 +1,51 @@
// To parse this JSON data, do
//
// final loc = locFromJson(jsonString);
import 'dart:convert';
List<Loc> locFromJson(String str) =>
List<Loc>.from(json.decode(str).map((x) => Loc.fromJson(x)));
String locToJson(List<Loc> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Loc {
int id;
int userId;
String institution;
String address;
String city;
String state;
int postalCode;
Loc({
required this.id,
required this.userId,
required this.institution,
required this.address,
required this.city,
required this.state,
required this.postalCode,
});
factory Loc.fromJson(Map<String, dynamic> json) => Loc(
id: json["id"],
userId: json["user_id"],
institution: json["Institution"],
address: json["Address"],
city: json["City"],
state: json["State"],
postalCode: json["Postal_code"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"Institution": institution,
"Address": address,
"City": city,
"State": state,
"Postal_code": postalCode,
};
}

View File

@ -0,0 +1,100 @@
// To parse this JSON data, do
//
// final nih = nihFromJson(jsonString);
import 'dart:convert';
List<Nih> nihFromJson(String str) =>
List<Nih>.from(json.decode(str).map((x) => Nih.fromJson(x)));
String nihToJson(List<Nih> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Nih {
int id;
int userId;
String piNames;
String firstName;
String middleName;
String lastName;
String organizationName;
String departmentName;
String orgCity;
String orgState;
String purpose;
String institute;
String totalCost;
String projectStart;
String projectEnd;
String budgetStart;
String budgetEnd;
String createdOn;
int piId;
Nih({
required this.id,
required this.userId,
required this.piNames,
required this.firstName,
required this.middleName,
required this.lastName,
required this.organizationName,
required this.departmentName,
required this.orgCity,
required this.orgState,
required this.purpose,
required this.institute,
required this.totalCost,
required this.projectStart,
required this.projectEnd,
required this.budgetStart,
required this.budgetEnd,
required this.createdOn,
required this.piId,
});
factory Nih.fromJson(Map<String, dynamic> json) => Nih(
id: json["id"],
userId: json["user_id"],
piNames: json["pi_names"],
firstName: json["first_name"],
middleName: json["middle_name"],
lastName: json["last_name"],
organizationName: json["organizationName"],
departmentName: json["departmentName"],
orgCity: json["org_city"],
orgState: json["org_state"],
purpose: json["purpose"],
institute: json["institute"],
totalCost: json["total_cost"],
projectStart: json["project_start"],
projectEnd: json["project_end"],
budgetStart: json["budget_start"],
budgetEnd: json["budget_end"],
createdOn: json["created_on"],
piId: json["pi_id"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"pi_names": piNames,
"first_name": firstName,
"middle_name": middleName,
"last_name": lastName,
"organizationName": organizationName,
"departmentName": departmentName,
"org_city": orgCity,
"org_state": orgState,
"purpose": purpose,
"institute": institute,
"total_cost": totalCost,
"project_start": projectStart,
"project_end": projectEnd,
"budget_start": budgetStart,
"budget_end": budgetEnd,
"created_on": createdOn,
"pi_id": piId,
};
}

View File

@ -0,0 +1,39 @@
// To parse this JSON data, do
//
// final patent = patentFromJson(jsonString);
import 'dart:convert';
List<Patent> patentFromJson(String str) =>
List<Patent>.from(json.decode(str).map((x) => Patent.fromJson(x)));
String patentToJson(List<Patent> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Patent {
int id;
int userId;
String patentTitle;
String status;
Patent({
required this.id,
required this.userId,
required this.patentTitle,
required this.status,
});
factory Patent.fromJson(Map<String, dynamic> json) => Patent(
id: json["id"],
userId: json["user_id"],
patentTitle: json["Patent Title"],
status: json["Status"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"Patent Title": patentTitle,
"Status": status,
};
}

View File

@ -0,0 +1,43 @@
// To parse this JSON data, do
//
// final phoneno = phonenoFromJson(jsonString);
import 'dart:convert';
List<Phoneno> phonenoFromJson(String str) =>
List<Phoneno>.from(json.decode(str).map((x) => Phoneno.fromJson(x)));
String phonenoToJson(List<Phoneno> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Phoneno {
int id;
int userId;
String phoneType;
String locations;
String phoneNumber;
Phoneno({
required this.id,
required this.userId,
required this.phoneType,
required this.locations,
required this.phoneNumber,
});
factory Phoneno.fromJson(Map<String, dynamic> json) => Phoneno(
id: json["id"],
userId: json["user_id"],
phoneType: json["Phone type"],
locations: json["Locations"],
phoneNumber: json["phone Number"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"Phone type": phoneType,
"Locations": locations,
"phone Number": phoneNumber,
};
}

View File

@ -0,0 +1,59 @@
// To parse this JSON data, do
//
// final pro = proFromJson(jsonString);
import 'dart:convert';
List<Pro> proFromJson(String str) =>
List<Pro>.from(json.decode(str).map((x) => Pro.fromJson(x)));
String proToJson(List<Pro> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Pro {
int id;
int userId;
int procedureCode;
String procedure;
String placeOfService;
int totalBeneficiaries;
int totalServices;
int totalBeneDayServices;
int programYear;
Pro({
required this.id,
required this.userId,
required this.procedureCode,
required this.procedure,
required this.placeOfService,
required this.totalBeneficiaries,
required this.totalServices,
required this.totalBeneDayServices,
required this.programYear,
});
factory Pro.fromJson(Map<String, dynamic> json) => Pro(
id: json["id"],
userId: json["user_id"],
procedureCode: json["Procedure code"],
procedure: json["Procedure"],
placeOfService: json["Place of Service"],
totalBeneficiaries: json["Total Beneficiaries"],
totalServices: json["Total Services"],
totalBeneDayServices: json["Total_bene_day_services"],
programYear: json["Program year"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"Procedure code": procedureCode,
"Procedure": procedure,
"Place of Service": placeOfService,
"Total Beneficiaries": totalBeneficiaries,
"Total Services": totalServices,
"Total_bene_day_services": totalBeneDayServices,
"Program year": programYear,
};
}

View File

@ -1,17 +1,16 @@
// To parse this JSON data, do
//
// final medicalInsight = medicalInsightFromJson(jsonString);
// final speaker = speakerFromJson(jsonString);
import 'dart:convert';
List<MedicalInsight> medicalInsightFromJson(String str) =>
List<MedicalInsight>.from(
json.decode(str).map((x) => MedicalInsight.fromJson(x)));
List<Speaker> speakerFromJson(String str) =>
List<Speaker>.from(json.decode(str).map((x) => Speaker.fromJson(x)));
String medicalInsightToJson(List<MedicalInsight> data) =>
String speakerToJson(List<Speaker> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class MedicalInsight {
class Speaker {
int id;
String programtopic;
String speakername;
@ -21,7 +20,7 @@ class MedicalInsight {
DateTime createdAt;
DateTime updatedAt;
MedicalInsight({
Speaker({
required this.id,
required this.programtopic,
required this.speakername,
@ -32,7 +31,7 @@ class MedicalInsight {
required this.updatedAt,
});
factory MedicalInsight.fromJson(Map<String, dynamic> json) => MedicalInsight(
factory Speaker.fromJson(Map<String, dynamic> json) => Speaker(
id: json["id"],
programtopic: json["programtopic"],
speakername: json["speakername"],

View File

@ -0,0 +1,51 @@
// To parse this JSON data, do
//
// final traning = traningFromJson(jsonString);
import 'dart:convert';
List<Traning> traningFromJson(String str) =>
List<Traning>.from(json.decode(str).map((x) => Traning.fromJson(x)));
String traningToJson(List<Traning> data) =>
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
class Traning {
int id;
int userId;
String educationType;
String institutionName;
String degree;
String specialty;
String timeFrame;
Traning({
required this.id,
required this.userId,
required this.educationType,
required this.institutionName,
required this.degree,
required this.specialty,
required this.timeFrame,
});
factory Traning.fromJson(Map<String, dynamic> json) => Traning(
id: json["id"],
userId: json["user_id"],
educationType: json["Education Type"],
institutionName: json["Institution Name"],
degree: json["Degree"],
specialty: json["Specialty"],
timeFrame: json["Time Frame"],
);
Map<String, dynamic> toJson() => {
"id": id,
"user_id": userId,
"Education Type": educationType,
"Institution Name": institutionName,
"Degree": degree,
"Specialty": specialty,
"Time Frame": timeFrame,
};
}

View File

@ -1,8 +1,7 @@
import 'dart:convert';
import 'package:discover_module/model_class/affiliations.dart';
import 'package:discover_module/model_class/section.dart';
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/aff_data/insert_aff.dart';
import 'package:flutter/cupertino.dart';
class AffiliationsProvider extends ChangeNotifier {
@ -24,7 +23,6 @@ class AffiliationsProvider extends ChangeNotifier {
// print("Affiliations_is return:$jsonData ");
affiliations1 = affdata;
// print("Affiliations_is return:$affiliations1 ");
notifyListeners();
}
@ -37,4 +35,12 @@ class AffiliationsProvider extends ChangeNotifier {
allaffiliations1 = affdata;
notifyListeners();
}
storeAff(row) async {
final affdata = await affapi.getaffiliationsdata(row);
print("Affiliations_MyStoringData:$affdata ");
await addAffiliation(affdata);
}
}

View File

@ -1,4 +1,5 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/awa_data/crud_awa.dart';
import 'package:flutter/cupertino.dart';
class AwardProvider extends ChangeNotifier {
@ -13,4 +14,9 @@ class AwardProvider extends ChangeNotifier {
awalist = email_result;
notifyListeners();
}
storeAwa(row) async {
final awaresult = await apicall.getawarddata(row);
await addAwa(awaresult);
}
}

View File

@ -1,4 +1,5 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/cer_hive/crud_cer.dart';
import 'package:flutter/cupertino.dart';
class CertificateProvider extends ChangeNotifier {
@ -13,4 +14,9 @@ class CertificateProvider extends ChangeNotifier {
cerlist = email_result;
notifyListeners();
}
storeCer(row) async {
final cerResult = await apicall.getcerlistdata(row);
await addCer(cerResult);
}
}

View File

@ -1,4 +1,5 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/edu_data/crud_edu.dart';
import 'package:flutter/cupertino.dart';
class EducationProvider extends ChangeNotifier {
@ -13,4 +14,9 @@ class EducationProvider extends ChangeNotifier {
edulist = email_result;
notifyListeners();
}
storeEdu(row) async {
final emailresult = await apicall.getedulistdata(row);
await addEdu(emailresult);
}
}

View File

@ -1,4 +1,5 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/email_data/crud_email.dart';
import 'package:flutter/cupertino.dart';
class EmailProvider extends ChangeNotifier {
@ -13,4 +14,9 @@ class EmailProvider extends ChangeNotifier {
emaillist = email_result;
notifyListeners();
}
storeEmail(row) async {
final emailresult = await apicall.getemaildata(row);
await addEmail(emailresult);
}
}

View File

@ -1,4 +1,4 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:flutter/cupertino.dart';
class EnagagementProvider extends ChangeNotifier {

View File

@ -1,4 +1,5 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/events_data/crud_event.dart';
import 'package:flutter/cupertino.dart';
class EventProvider extends ChangeNotifier {
@ -25,4 +26,9 @@ class EventProvider extends ChangeNotifier {
alleventlist = events;
notifyListeners();
}
storeEvent(row) async {
final events = await apicall.geteventsdata(row);
await addEvent(events);
}
}

View File

@ -1,5 +1,7 @@
import 'package:discover_module/hive_fun.dart';
import 'package:discover_module/service.dart/service.dart';
// import 'package:discover_module/hive_fun.dart';
// import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/hive_fun.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:flutter/foundation.dart';
class hcpProvider extends ChangeNotifier {
@ -12,6 +14,8 @@ class hcpProvider extends ChangeNotifier {
getHCPProvider() async {
final jsondata = await apicall.getallhcpdata();
print("kkoollll_dataaaa: ${jsondata}");
_list = jsondata;
notifyListeners();
@ -66,4 +70,54 @@ class hcpProvider extends ChangeNotifier {
notifyListeners();
//print("Get_hcp_dataaaL ${HiveFunctions.gethcpdata()}");
}
gethcpNamefilter(String? option) {
if (option == "HCP Name") {
return _list.map((e) => e["name"].toString()).toList();
} else {
return _list.map((e) => e["speciality"].toString()).toList();
}
}
getHCPProviderFilters(String? _selectedValue1, List<String> value) {
print("I_am Provider_filterr");
if (_selectedValue1 == "Profile Type") {
print("PPPP11");
return value = [
"All Profile",
'Full Profile',
'Basic Profile',
];
}
// else if (_selectedValue1 == "HCP Name") {
// print("FilterHcpNameee");
// fecthhcpbyname();
// } else if (_selectedValue1 == "Speciality") {
// print("kkk");
// fecthhcpbyspl();
// }
else if (_selectedValue1 == "Country") {
print("kkk");
return value = [
"United States",
"United States",
"United States",
];
} else if (_selectedValue1 == "State") {
print("kkk");
return value = [
"Karnataka",
'Karnataka',
'Karnataka',
];
} else if (_selectedValue1 == "City") {
print("kkk");
return value = [
"Hubli",
'Hubli',
'Hubli',
];
}
}
}

View File

@ -0,0 +1,37 @@
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_aff_k2.dart';
import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart';
class AffiliationsProviderk2 extends ChangeNotifier {
final affapi = CallK2api();
List<AffList> affiliations1 = [];
List allaffiliations1 = [];
List get adddta => affiliations1;
List get affiliationsAll => allaffiliations1;
getAffiliationsdata(text) async {
print("Affiliations_is: ${text}");
final affdata = await affapi.getaffiliationsdata(text);
print("Affiliations_is after:$affdata ");
// final Map<String, dynamic> jsonData = json.decode(affdata);
// // final List<dynamic> affiliations = jsonData['Affiliations'];
// print("Affiliations_is return:$jsonData ");
affiliations1 = affdata!;
// print("Affiliations_is return:$affiliations1 ");
notifyListeners();
}
getAllAffiliationsdata() async {
print("Affiliations_is: ");
final affdata = await affapi.getallaffiliationsdata();
print("Affiliations_is after:$affdata ");
allaffiliations1 = affdata;
notifyListeners();
}
}

View File

@ -0,0 +1,17 @@
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_awards_k2.dart';
import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart';
class AwardProviderK2 extends ChangeNotifier {
final apicall = CallK2api();
List<AwardsList> awalist = [];
List get awardlist => awalist;
awainfo(text) async {
print("Location_Text");
final email_result = await apicall.getawarddata(text);
awalist = email_result!;
notifyListeners();
}
}

View File

@ -0,0 +1,17 @@
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart';
import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart';
class CertificateProviderK2 extends ChangeNotifier {
final apicall = CallK2api();
List<CertificateList> cerlist = [];
List get certificatelist => cerlist;
certificateinfo(text) async {
print("Location_Text");
final email_result = await apicall.getcerlistdata(text);
cerlist = email_result!;
notifyListeners();
}
}

View File

@ -0,0 +1,17 @@
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_education_k2.dart';
import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart';
class EducationProviderK2 extends ChangeNotifier {
final apicall = CallK2api();
List<EducationList> edulist = [];
List get educationlist => edulist;
eduinfo(text) async {
print("Location_Text");
final email_result = await apicall.getedulistdata(text);
edulist = email_result!;
notifyListeners();
}
}

View File

@ -0,0 +1,17 @@
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_email_k2.dart';
import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart';
class EmailProviderK2 extends ChangeNotifier {
final apicall = CallK2api();
List<EmailData> emaillist = [];
List get emailkollist => emaillist;
emailinfo(text) async {
print("Location_Text");
final email_result = await apicall.getemaildata(text);
emaillist = email_result!;
notifyListeners();
}
}

View File

@ -0,0 +1,29 @@
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_event_k2.dart';
import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart';
class EventProviderK2 extends ChangeNotifier {
final apicall = CallK2api();
List<EventList> eventlist = [];
List get EventsList => eventlist;
List alleventlist = [];
List get allEventsList => alleventlist;
geteventdata(text) async {
final events = await apicall.geteventsdata(text);
eventlist = events!;
notifyListeners();
}
allgeteventdata() async {
final events = await apicall.allgeteventsdata();
alleventlist = events;
notifyListeners();
}
}

View File

@ -0,0 +1,61 @@
import 'package:discover_module/contacts_module/hive_fun.dart';
import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/foundation.dart';
class KolListProvider extends ChangeNotifier {
final apicall = CallK2api();
List _list = [];
List get list => _list;
getHCPProvider() async {
final jsondata = await apicall.getallhcpdata();
print("kkoollll_dataaaa: ${jsondata}");
_list = jsondata;
notifyListeners();
}
List searchHCP(String query) {
if (query.isEmpty) {
return List.from(_list); // Return full list if query is empty
} else {
// return _list
// .where(
// (hcp) => hcp['name'].toLowerCase().contains(query.toLowerCase()))
// .toList();
print("JsonIssList: $_list");
print("queryIssList: $query");
return _list
.where((hcp) =>
hcp['full_name']
.toLowerCase()
.contains(query.toLowerCase()) ||
// (hcp['speciality'].toLowerCase().contains(query.toLowerCase()) ??
// hcp['spl'].toLowerCase().contains(query.toLowerCase())) ||
hcp['speciality_name']
.toLowerCase()
.contains(query.toLowerCase())
// ||
// hcp['addr'].toLowerCase().contains(query.toLowerCase())
)
.toList();
}
}
getHCPProviderHive() async {
final jsondata = await HiveFunctions.gethcpdata();
print("JsonDtaa: ${jsondata}");
_list = jsondata;
print("JsonDtaaList: $_list");
notifyListeners();
//print("Get_hcp_dataaaL ${HiveFunctions.gethcpdata()}");
}
}

View File

@ -1,8 +1,8 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart';
class LocationProvider extends ChangeNotifier {
final apicall = Callapi();
class LocationKolProvider extends ChangeNotifier {
final apicall = CallK2api();
List loclist = [];
List get locationlist => loclist;

View File

@ -0,0 +1,17 @@
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_pno_k2.dart';
import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart';
class PhonenoProviderK2 extends ChangeNotifier {
final apicall = CallK2api();
List<DataPhno>? phonelist = [];
List get phonenolist => phonelist!;
phonek2info(text) async {
print("Location_Text");
final phone_result = await apicall.getphonedata(text);
phonelist = phone_result;
notifyListeners();
}
}

View File

@ -0,0 +1,17 @@
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_training_k2.dart';
import 'package:discover_module/contacts_module/service.dart/k2_service/Apicall_k2.dart';
import 'package:flutter/cupertino.dart';
class TrainigProviderK2 extends ChangeNotifier {
final apicall = CallK2api();
List<TrainingList> tralist = [];
List get traininglist => tralist;
traininginfo(text) async {
print("Location_Text");
final email_result = await apicall.gettrainingdata(text);
tralist = email_result!;
notifyListeners();
}
}

View File

@ -0,0 +1,22 @@
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/loc_data/crud_loc.dart';
import 'package:flutter/cupertino.dart';
class LocationProvider extends ChangeNotifier {
final apicall = Callapi();
List loclist = [];
List get locationlist => loclist;
locationinfo(text) async {
print("Location_Text");
final publication_result = await apicall.getlocationsdata(text);
loclist = publication_result;
notifyListeners();
}
storeLoc(row) async {
final publicationResult = await apicall.getlocationsdata(row);
await addLoc(publicationResult);
}
}

View File

@ -1,4 +1,4 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:flutter/cupertino.dart';
class MediacalInsightProvider extends ChangeNotifier {

View File

@ -1,4 +1,5 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/nih_grant_data/crud_nih.dart';
import 'package:flutter/cupertino.dart';
class NIHGrantsProvider extends ChangeNotifier {
@ -13,4 +14,9 @@ class NIHGrantsProvider extends ChangeNotifier {
nihlist = nih_result;
notifyListeners();
}
storeNih(row) async {
final nihresult = await apicall.getnihdata(row);
await addNih(nihresult);
}
}

View File

@ -1,4 +1,5 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/patent_data/crud_patent.dart';
import 'package:flutter/cupertino.dart';
class PatentProvider extends ChangeNotifier {
@ -13,4 +14,9 @@ class PatentProvider extends ChangeNotifier {
palist = patent_result;
notifyListeners();
}
storePet(row) async {
final patentresult = await apicall.getpatentdata(row);
await addPatent(patentresult);
}
}

View File

@ -1,4 +1,5 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/pno_data/crud_pno.dart';
import 'package:flutter/cupertino.dart';
class PhonenoProvider extends ChangeNotifier {
@ -13,4 +14,10 @@ class PhonenoProvider extends ChangeNotifier {
phonelist = phone_result;
notifyListeners();
}
storePno(row) async {
print("Location_Text");
final phoneresult = await apicall.getphonedata(row);
await addPno(phoneresult);
}
}

View File

@ -1,4 +1,5 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/procedure_data/crud_pro.dart';
import 'package:flutter/cupertino.dart';
class ProcedureProvider extends ChangeNotifier {
@ -13,4 +14,9 @@ class ProcedureProvider extends ChangeNotifier {
procedurelist = nih_result;
notifyListeners();
}
storePro(row) async {
final proData = await apicall.getprodata(row);
await addPro(proData);
}
}

View File

@ -1,4 +1,6 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/pub_data/curd_pub.dart';
import 'package:flutter/cupertino.dart';
class PublicatioProvider extends ChangeNotifier {
@ -22,4 +24,12 @@ class PublicatioProvider extends ChangeNotifier {
allpublist = publication_result;
notifyListeners();
}
storePub(row) async {
final publication_result = await apicall.getpublicationsdata(row);
print("Affiliations_MyStoringData:$publication_result ");
await addPublication(publication_result);
}
}

View File

@ -1,5 +1,6 @@
import 'package:discover_module/model_class/single_hcpinfo.dart';
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/model_class/single_hcpinfo.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:flutter/foundation.dart';
class Singlehcpdetails extends ChangeNotifier {

View File

@ -0,0 +1,24 @@
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/speaker_data/crud.speaker.dart';
import 'package:flutter/cupertino.dart';
class SpekerEvalutionProvider extends ChangeNotifier {
final callapi = Callapi();
List speaker_data = [];
List get speakerlist => speaker_data;
getspeakerdata() async {
final data = await callapi.getSpeakerdata();
speaker_data = data;
notifyListeners();
}
storeSpeaker(row) async {
final dataSpe = await callapi.getSpeakerdata();
await addSpeaker(dataSpe);
}
}

View File

@ -1,4 +1,5 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/traning_data/crud_training.dart';
import 'package:flutter/cupertino.dart';
class TrainigProvider extends ChangeNotifier {
@ -13,4 +14,9 @@ class TrainigProvider extends ChangeNotifier {
tralist = email_result;
notifyListeners();
}
storeTraining(row) async {
final trainingresult = await apicall.gettrainingdata(row);
await addtraining(trainingresult);
}
}

View File

@ -1,4 +1,5 @@
import 'package:discover_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/service.dart/service.dart';
import 'package:discover_module/contacts_module/storage_hive/trials_data/crud_trials.dart';
import 'package:flutter/cupertino.dart';
class TrialsProvider extends ChangeNotifier {
@ -13,4 +14,9 @@ class TrialsProvider extends ChangeNotifier {
trials = jsonres;
notifyListeners();
}
storeTrials(row) async {
final jsonres = await callapi.getalltrials(row);
await addTrials(jsonres);
}
}

View File

@ -0,0 +1,496 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:discover_module/contacts_module/constants.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_aff_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_awards_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_education_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_email_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_event_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_location_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_pno_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kol_training_k2.dart';
import 'package:discover_module/contacts_module/model_class/k2_api_model/kolcontact_list_k2.dart';
import 'package:discover_module/contacts_module/model_class/nih_model.dart';
import 'package:discover_module/contacts_module/model_class/patent_model.dart';
import 'package:discover_module/contacts_module/model_class/procedure_model.dart';
import 'package:discover_module/contacts_module/model_class/publication_model.dart';
import 'package:discover_module/contacts_module/model_class/speaker.dart';
import 'package:discover_module/contacts_module/model_class/trials.dart';
const String curl = Constants.k2url;
class CallK2api {
getallhcpdata() async {
const url = '$curl/contacts/v2/en/fetch_kols';
print("K2_Urll: $url");
// final response = await Dio().get(url);
final response = await Dio().post(url,
data: {"page": 1, "limit": 100},
options: Options(headers: {
"Authorization":
"Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd"
}));
print("ResponseeeeK2: ${response.statusCode}");
if (response.statusCode == 200) {
List<Datum> users = (response.data['data'] as List)
.map((userJson) => Datum.fromJson(userJson))
.toList();
return users;
}
// final jsonresponse = response.data;
// final jsonresponse211 = response.data["data"];
// print("jsonresponse211: ${jsonresponse211}");
// final kolresponse =
// jsonresponse211.map((kollist) => Datum.fromJson(kollist)).toList();
// print("kolresponse_isss: ${kolresponse}");
// return kolresponse;
}
getsinglehcpdata() async {
const url = '$curl/users/1';
final responsehcp = await Dio().post(url);
final jsonresponse1 = responsehcp.data;
// final List<dynamic> Json = json.decode(responsehcp.data);
print("Singlejsondata : ${jsonresponse1}");
return jsonresponse1;
}
Future<List<AffList>?> getaffiliationsdata(id) async {
print("Affiliation_iddd: ${id}");
var url = '$curl/affiliations/v1/en/fetch';
final affiliationres = await Dio().post(url,
data: {"page": 1, "limit": 100},
options: Options(headers: {
"Authorization":
"Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd"
}));
if (affiliationres.statusCode == 200) {
DataAffiliations dataaff = DataAffiliations.fromJson(affiliationres.data);
List<AffList> afflist = dataaff.data!;
return afflist;
}
// print("Gettingdata_isss: ${'''[$affiliationres]'''}");
// String arrayText = '''[$affiliationres]''';
// final jsonresponse2 = json.decode(arrayText);
// return jsonresponse2
// .map((doctor) => Affiliations.fromJson(doctor))
// .toList();
}
getpublicationsdata(id) async {
print("getpublicationsdata_iddd: ${id}");
var url = '$curl/publications/$id';
final publicationres = await Dio().get(url);
String arrayText = '''[$publicationres]''';
final jsonresponse2 = json.decode(arrayText);
return jsonresponse2
.map((doctor) => Publications.fromJson(doctor))
.toList();
}
Future<List<EventList>?> geteventsdata(id) async {
var url = '$curl/events/v1/en/fetch';
final events = await Dio().post(url,
data: {"page": 1, "limit": 100},
options: Options(headers: {
"Authorization":
"Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd"
}));
if (events.statusCode == 200) {
DataEvent dataeve = DataEvent.fromJson(events.data);
List<EventList> evelist = dataeve.data!;
return evelist;
}
// String evn = '''[$events]''';
// final jsonEvent = json.decode(evn);
// print("All_event: $jsonEvent");
// return jsonEvent.map((doctor) => Events.fromJson(doctor)).toList();
}
getallaffiliationsdata() async {
const url = '$curl/affiliations/';
final events = await Dio().get(url);
// final jsonEvent = events.data;
final jsonEvent = events.data;
print("All_event: $jsonEvent");
return jsonEvent;
}
getallpublicationsdata() async {
const url = '$curl/publications';
final events = await Dio().get(url);
// final jsonEvent = events.data;
final jsonEvent = events.data;
print("All_event: $jsonEvent");
return jsonEvent;
}
allgeteventsdata() async {
const url = '$curl/events';
final events = await Dio().get(url);
// final jsonEvent = events.data;
final jsonEvent = events.data;
print("All_event: $jsonEvent");
return jsonEvent;
}
getalltrials(id) async {
print("TrialsssssAPIIIIIIIIII: $id");
// var url = '$curl/trails/$id';
var url = '$curl/trails/1';
final trials = await Dio().get(url);
String dataa = "[${trials}]";
final jsontrials = jsonDecode(dataa);
print("All_trialsss: $jsontrials");
// return jsontrials;
if (jsontrials.isEmpty) {
print("notnulllllll: $jsontrials");
//return jsontrials.map((doctor) => Trials.fromJson(doctor)).toList();
} else {
return jsontrials.map((doctor) => Trials.fromJson(doctor)).toList();
}
}
getallMedicalInsightdata() async {
const url = '$curl/medicalinsight';
final response = await Dio().get(url);
final jsonresponse = response.data;
return jsonresponse;
}
getSpeakerdata() async {
// print("TrialsssssAPIIIIIIIIII: $id");
// var url = '$curl/trails/$id';
var url = '$curl/speaker/1';
final speaker = await Dio().get(url);
print("Checkkkkk: Speakerrr: $speaker");
final List jsonspe = speaker.data; // Directly use the data
return jsonspe.map((location) => Speaker.fromJson(location)).toList();
}
getEngdata() async {
final String response = await Constants.response;
final Engagement = await json.decode(response);
final List<dynamic> eng = Engagement['Engagement'];
print("engData_isss: $eng");
return eng;
}
getlocationsdata($id) async {
const url = '$curl/contacts/v2/en/kol_location_fetch';
// var url = '$curl/location/1';
// final location = await Dio().get(url);
final location = await Dio().post(url,
data: {
"page": 1,
"limit": 100,
"kol_id": "b470ae0ac9ff5cf81e2d44b8fbfe32b1"
},
options: Options(headers: {
"Authorization":
"Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd"
}));
// print("All_locDataaK22: ${location.data}");
final List jsonEvent = location.data["data"]; // Directly use the data
// print("All_locDataa123: ${jsonEvent}");
// return jsonEvent.map((location) => Loc.fromJson(location)).toList();
if (location.statusCode == 200) {
List<Data> kolLocation = jsonEvent.map((e) => Data.fromJson(e)).toList();
print("All_locDataaK22: ${kolLocation}");
return kolLocation;
}
}
Future<List<DataPhno>?> getphonedata($id) async {
var url = '$curl/contacts/v2/en/kol_phoneno_fetch';
// final phoneno = await Dio().get(url);
final phoneno = await Dio().post(url,
data: {
"page": 1,
"limit": 100,
"kol_id": "b470ae0ac9ff5cf81e2d44b8fbfe32b1"
},
options: Options(headers: {
"Authorization":
"Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd"
}));
if (phoneno.statusCode == 200) {
final List jsonpno = phoneno.data["data"]; // Directly use the data
print("All_locDataaphone_pnos: ${jsonpno}");
DataaPnoresponse dataPno = DataaPnoresponse.fromJson(phoneno.data);
List<DataPhno>? datalist = dataPno.data;
// List kol_pno = jsonpno.map((e) => pno.PhnoData.fromJson(e)).toList();
print("All_kol_pnoDataa123: ${datalist}");
// List<Datum> users = (response.data['data'] as List)
// .map((userJson) => Datum.fromJson(userJson))
// .toList();
// return users;
return datalist;
}
// return datalist;
// return jsonEvent.map((pno) => Phoneno.fromJson(pno)).toList();
}
Future<List<EmailData>?> getemaildata($id) async {
var url = '$curl/contacts/v2/en/kol_email_fetch';
final email = await Dio().post(url,
data: {
"page": 1,
"limit": 100,
"kol_id": "b470ae0ac9ff5cf81e2d44b8fbfe32b1"
},
options: Options(headers: {
"Authorization":
"Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd"
}));
print("All_locDataaEmaillK22: ${email.data}");
if (email.statusCode == 200) {
DataEmail email1 = DataEmail.fromJson(email.data);
List<EmailData>? emailinfo = email1.data;
return emailinfo;
}
// final List jsonEvent = email.data; // Directly use the data
// print("All_locDataa123: ${jsonEvent}");
//return jsonEvent.map((email) => Email.fromJson(email)).toList();
}
getpatentdata(id) async {
var url = '$curl/patent/1';
final patent = await Dio().get(url);
print("All_locDataa: ${patent.data}");
final List jsonEvent = patent.data; // Directly use the data
print("All_locDataa123: ${jsonEvent}");
return jsonEvent.map((email) => Patent.fromJson(email)).toList();
}
Future<List<CertificateList>?> getcerlistdata(id) async {
var url = '$curl/contacts/v2/en/kol_certification_fetch';
final cer = await Dio().post(url,
data: {
"page": 1,
"limit": 100,
"kol_id": "b470ae0ac9ff5cf81e2d44b8fbfe32b1"
},
options: Options(headers: {
"Authorization":
"Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd"
}));
print("All_locDataa: ${cer.data}");
if (cer.statusCode == 200) {
DataCertificate datacer = DataCertificate.fromJson(cer.data);
List<CertificateList>? cerlist = datacer.data;
return cerlist;
}
// final List jsonEvent = cer.data; // Directly use the data
// print("All_locDataa123: ${jsonEvent}");
// return jsonEvent.map((certificate) => Cer.fromJson(certificate)).toList();
}
Future<List<EducationList>?> getedulistdata($id) async {
var url = '$curl/contacts/v2/en/kol_education_fetch';
final edu = await Dio().post(url,
data: {
"page": 1,
"limit": 100,
"kol_id": "b470ae0ac9ff5cf81e2d44b8fbfe32b1"
},
options: Options(headers: {
"Authorization":
"Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd"
}));
print("All_locDataa: ${edu.data}");
if (edu.statusCode == 200) {
DataEducation dataedu = DataEducation.fromJson(edu.data);
List<EducationList>? edulist = dataedu.data;
return edulist;
}
// final List jsonEvent = edu.data; // Directly use the data
// print("All_locDataa123: ${jsonEvent}");
// return jsonEvent.map((edu) => Edu.fromJson(edu)).toList();
}
Future<List<AwardsList>?> getawarddata(id) async {
var url = '$curl/contacts/v2/en/kol_awards_fetch';
final awa = await Dio().post(url,
data: {
"page": 1,
"limit": 100,
"kol_id": "b470ae0ac9ff5cf81e2d44b8fbfe32b1"
},
options: Options(headers: {
"Authorization":
"Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd"
}));
print("All_locDataa: ${awa.data}");
if (awa.statusCode == 200) {
DataAwards awardss = DataAwards.fromJson(awa.data);
List<AwardsList> awalist = awardss.data!;
return awalist;
}
// // String loc = "{$location}";
// // final jsonEvent = json.decode(loc);
// // print("All_loc: $jsonEvent");
// final List jsonEvent = awa.data; // Directly use the data
// print("All_locDataa123: ${jsonEvent}");
// return jsonEvent.map((awards) => Awa.fromJson(awards)).toList();
}
Future<List<TrainingList>?> gettrainingdata(id) async {
var url = '$curl/contacts/v2/en/kol_training_fetch';
final training = await Dio().post(url,
data: {
"page": 1,
"limit": 100,
"kol_id": "b470ae0ac9ff5cf81e2d44b8fbfe32b1"
},
options: Options(headers: {
"Authorization":
"Bearer 245|J1GeqJKw33m4YhCOfiMNyQm2U8jbx8rf1JkC567ffcb2f9bd"
}));
print("All_locDataa:Training: ${training.data}");
if (training.statusCode == 200) {
DataTraining trainingdata = DataTraining.fromJson(training.data);
List<TrainingList>? traininglist = trainingdata.data;
return traininglist;
}
// // String loc = "{$location}";
// // final jsonEvent = json.decode(loc);
// // print("All_loc: $jsonEvent");
// final List jsonEvent = training.data; // Directly use the data
// print("All_locDataa123: ${jsonEvent}");
// return jsonEvent.map((awards) => Traning.fromJson(awards)).toList();
}
getnihdata(id) async {
var url = '$curl/nih/1';
final nih = await Dio().get(url);
print("All_locDataa: ${nih.data}");
final List jsonEvent = nih.data; // Directly use the data
print("All_locDataa123: ${jsonEvent}");
return jsonEvent.map((awards) => Nih.fromJson(awards)).toList();
}
getprodata(id) async {
var url = '$curl/pro/1';
final pro = await Dio().get(url);
print("All_locDataa: ${pro.data}");
final List jsonEvent = pro.data; // Directly use the data
print("All_locDataa123: ${jsonEvent}");
return jsonEvent.map((awards) => Pro.fromJson(awards)).toList();
}
}

View File

@ -0,0 +1,730 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:discover_module/contacts_module/constants.dart';
import 'package:discover_module/contacts_module/model_class/affiliations.dart';
import 'package:discover_module/contacts_module/model_class/awards_model.dart';
import 'package:discover_module/contacts_module/model_class/certificate_model.dart';
import 'package:discover_module/contacts_module/model_class/education_model.dart';
import 'package:discover_module/contacts_module/model_class/email_model.dart';
import 'package:discover_module/contacts_module/model_class/event_model.dart';
import 'package:discover_module/contacts_module/model_class/location_model.dart';
import 'package:discover_module/contacts_module/model_class/nih_model.dart';
import 'package:discover_module/contacts_module/model_class/patent_model.dart';
import 'package:discover_module/contacts_module/model_class/pno_model.dart';
import 'package:discover_module/contacts_module/model_class/procedure_model.dart';
import 'package:discover_module/contacts_module/model_class/publication_model.dart';
import 'package:discover_module/contacts_module/model_class/speaker.dart';
import 'package:discover_module/contacts_module/model_class/trainig_model.dart';
import 'package:discover_module/contacts_module/model_class/trials.dart';
const String curl = Constants.url;
class Callapi {
getallhcpdata() async {
const url = '$curl/users';
final response = await Dio().get(url);
print("Responseeee: ${response.statusCode}");
final jsonresponse = response.data;
// final apihcpdata = Hive.box("hcpdata");
// if (apihcpdata.isEmpty) {
// print("alldata_is: , ${jsonresponse} ${jsonresponse.length}");
// for (int i = 0; i < jsonresponse.length; i++) {
// print("hcp:data_is: , ${jsonresponse[i]['email']}");
// // HiveFunctions.storehcpdata({
// // "id": jsonresponse[i]['id'],
// // "name": jsonresponse[i]['name'],
// // "email": jsonresponse[i]['email'],
// // "summarry": jsonresponse[i]['summarry'],
// // "addr": jsonresponse[i]['addr'],
// // "license_no": jsonresponse[i]['license_no'],
// // "p_suffix": jsonresponse[i]['p_suffix'],
// // "speciality": jsonresponse[i]['speciality'],
// // "sub_speciality": jsonresponse[i]['sub_speciality'],
// // "phone_no": jsonresponse[i]['phone_no'],
// // "rank": jsonresponse[i]['rank'],
// // "score": jsonresponse[i]['score'],
// // "events_count": jsonresponse[i]['events_count'],
// // "affiliations_count": jsonresponse[i]['affiliations_count'],
// // "publications_count": jsonresponse[i]['publications_count'],
// // "img_path": jsonresponse[i]["img_path"],
// // });
// }
// }
return jsonresponse;
// print("OfflineJsonnnn");
// final String response = await rootBundle.loadString('assets/contact.json');
// final data = await json.decode(response);
// print("Data_isss: $data");
// return data;
}
getsinglehcpdata() async {
// const url = 'http://127.0.0.1:8000/api/users/1';
// const url = 'http://192.168.2.143:8082/api/users/1';
// const url = 'http://192.168.172.50:8081/api/users/1';
const url = '$curl/users/1';
final responsehcp = await Dio().post(url);
final jsonresponse1 = responsehcp.data;
// final List<dynamic> Json = json.decode(responsehcp.data);
print("Singlejsondata : ${jsonresponse1}");
return jsonresponse1;
}
// getaffiliationsdata(id) async {
// print("Affiliation_iddd: ${id}");
// var url = '$curl/affiliations/$id';
// // final affiliationres = await Dio().get(url);
// // final jsonresponse2 = affiliationres.data.take(2).toList();
// final affiliationres = await Dio().get(url);
// print("Gettingdata_isss: ${'''[$affiliationres]'''}");
// String arrayText = '''[$affiliationres]''';
// final jsonresponse2 = json.decode(arrayText);
// print("Gettingdata_jsonresponse2isss: ${jsonresponse2}");
// return jsonresponse2;
// ////////////////////////////////offline//////////////////////////
// // final String response = await Constants.response;
// // final Affiliation = await json.decode(response);
// // /////////////////////////////////////////////////////
// // final List<Map<String, dynamic>> filteredData = Affiliation['Affiliations']
// // .where((item) => item['user_id'] == id)
// // .cast<Map<String, dynamic>>()
// // .toList();
// // print("filteredDatafilteredDatafilteredData: ${filteredData}");
// // // Print filtered data
// // final List<dynamic> affiliations = Affiliation['Affiliations'];
// // print("Data_isss: $affiliations");
// // return filteredData;
// }
getaffiliationsdata(id) async {
print("Affiliation_iddd: ${id}");
var url = '$curl/affiliations/$id';
// final affiliationres = await Dio().get(url);
// final jsonresponse2 = affiliationres.data.take(2).toList();
final affiliationres = await Dio().get(url);
print("Gettingdata_isss: ${'''[$affiliationres]'''}");
String arrayText = '''[$affiliationres]''';
final jsonresponse2 = json.decode(arrayText);
return jsonresponse2
.map((doctor) => Affiliations.fromJson(doctor))
.toList();
// print("Gettingdata_jsonresponse2isss: ${jsonresponse2}");
// return jsonresponse2;
}
getpublicationsdata(id) async {
print("getpublicationsdata_iddd: ${id}");
// const url = '$curl/publications';
// final affiliationres = await Dio().get(url);
// final jsonresponse2 = affiliationres.data.take(2).toList();
// return jsonresponse2;
var url = '$curl/publications/$id';
final publicationres = await Dio().get(url);
String arrayText = '''[$publicationres]''';
//print("Gettingdata_isss: ${affiliationres}");
// final jsonresponse2 = affiliationres.data;
final jsonresponse2 = json.decode(arrayText);
return jsonresponse2
.map((doctor) => Publications.fromJson(doctor))
.toList();
//return jsonresponse2;
////////////////////////////////offline//////////////////////////
// final String response = await Constants.response;
// final Publications = await json.decode(response);
// final List<dynamic> publication = Publications['Publications'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Publications['Publications']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .toList();
// print("filteredDatafilteredDatafilteredData111: ${filteredData}");
// // Print filtered data
// print("publicationData_isss: $publication");
// return filteredData;
}
geteventsdata(id) async {
var url = '$curl/events/$id';
final events = await Dio().get(url);
// // final jsonEvent = events.data;
// final jsonEvent = events.data;
// print("All_event: $jsonEvent");
// final jsonEvent1 = events.data.take(2).toList();
// print("only few : $jsonEvent1");
// return jsonEvent1;
// final jsonEvent = events.data;
String evn = '''[$events]''';
final jsonEvent = json.decode(evn);
print("All_event: $jsonEvent");
return jsonEvent.map((doctor) => Events.fromJson(doctor)).toList();
//return jsonEvent;
////////////////////////////////offline//////////////////////////
// final String response = await Constants.response;
// final Events = await json.decode(response);
// final List<dynamic> event = Events['Events'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Events['Events']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .toList();
// print("filteredDatafilteredDatafilteredData111: ${filteredData}");
// // Print filtered data
// print("eventData_isss: $event");
// return filteredData;
}
getallaffiliationsdata() async {
// const url = 'http://192.168.2.143:8082/api/affiliations';
//const url = 'http://192.168.172.50:8081/api/affiliations';
const url = '$curl/affiliations/';
final events = await Dio().get(url);
// final jsonEvent = events.data;
final jsonEvent = events.data;
print("All_event: $jsonEvent");
return jsonEvent;
}
getallpublicationsdata() async {
// const url = 'http://192.168.2.143:8082/api/publications';
//const url = 'http://192.168.172.50:8081/api/publications';
const url = '$curl/publications';
final events = await Dio().get(url);
// final jsonEvent = events.data;
final jsonEvent = events.data;
print("All_event: $jsonEvent");
return jsonEvent;
}
allgeteventsdata() async {
//const url = 'http://192.168.2.143:8082/api/events';
//const url = 'http://192.168.172.50:8081/api/events';
const url = '$curl/events';
final events = await Dio().get(url);
// final jsonEvent = events.data;
final jsonEvent = events.data;
print("All_event: $jsonEvent");
return jsonEvent;
}
getalltrials(id) async {
// print("TrialsssssAPIIIIIIIIII: $id");
// const url = '$curl/trails';
// final trials = await Dio().get(url);
// final jsontrials = trials.data;
// print("All_trialsss: $jsontrials");
// return jsontrials;
print("TrialsssssAPIIIIIIIIII: $id");
// var url = '$curl/trails/$id';
var url = '$curl/trails/1';
final trials = await Dio().get(url);
String dataa = "[${trials}]";
final jsontrials = jsonDecode(dataa);
print("All_trialsss: $jsontrials");
// return jsontrials;
if (jsontrials.isEmpty) {
print("notnulllllll: $jsontrials");
//return jsontrials.map((doctor) => Trials.fromJson(doctor)).toList();
} else {
return jsontrials.map((doctor) => Trials.fromJson(doctor)).toList();
}
////////////////////////////////offline//////////////////////////
// final String response = await Constants.response;
// final Trials = await json.decode(response);
// final List<dynamic> trials = Trials['Trials'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Trials['Trials']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .toList();
// print("TrialsssssAPIIIIIIIIIIilteredDatafilteredData111: ${filteredData}");
// // Print filtered data
// print("trialsData_isss: $trials");
// return filteredData;
}
getallMedicalInsightdata() async {
// const url = 'http://127.0.0.1:8000/api/users';
// const url = 'http://192.168.2.143:8082/api/users';
// const url = 'http://192.168.172.50:8082/api/users';
// const url = 'http://192.168.172.50:8081/api/users';
const url = '$curl/medicalinsight';
final response = await Dio().get(url);
final jsonresponse = response.data;
return jsonresponse;
}
// getSpeakerdata() async {
// // const url = '$curl/speaker';
// // final response = await Dio().get(url);
// // final jsonresponse = response.data;
// // return jsonresponse;
// final String response = await Constants.response;
// final Speaker = await json.decode(response);
// final List<dynamic> speaker = Speaker['Speaker'];
// print("speakerData_isss: $speaker");
// return speaker;
// }
getSpeakerdata() async {
// print("TrialsssssAPIIIIIIIIII: $id");
// var url = '$curl/trails/$id';
var url = '$curl/speaker/1';
final speaker = await Dio().get(url);
print("Checkkkkk: Speakerrr: $speaker");
// final jsonspe = jsonDecode(speaker.data);
// print("All_trialsss: $jsonspe");
final List jsonspe = speaker.data; // Directly use the data
return jsonspe.map((location) => Speaker.fromJson(location)).toList();
}
getEngdata() async {
// const url = '$curl/engagement';
// final response = await Dio().get(url);
// final jsonresponse = response.data;
// return jsonresponse;
// }
final String response = await Constants.response;
final Engagement = await json.decode(response);
final List<dynamic> eng = Engagement['Engagement'];
print("engData_isss: $eng");
return eng;
}
// getlocationsdata(id) async {
// final String response = await Constants.response;
// final Location = await json.decode(response);
// final List<dynamic> event = Location['Location'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Location['Location']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .toList();
// print("LocationfilteredDatafilteredData111: ${filteredData}");
// // Print filtered data
// print("LocationeventData_isss: $event");
// return filteredData;
// }
getlocationsdata($id) async {
var url = '$curl/location/1';
final location = await Dio().get(url);
print("All_locDataa: ${location.data}");
// String loc = "{$location}";
// final jsonEvent = json.decode(loc);
// print("All_loc: $jsonEvent");
final List jsonEvent = location.data; // Directly use the data
print("All_locDataa123: ${jsonEvent}");
return jsonEvent.map((location) => Loc.fromJson(location)).toList();
}
// getphonedata(id) async {
// final String response = await Constants.response;
// final PhoneNo = await json.decode(response);
// final List<dynamic> event = PhoneNo['Location'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = PhoneNo['PhoneNo']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .toList();
// print("PhoneNofilteredDatafilteredData111: ${filteredData}");
// // Print filtered data
// print("PhoneNoeventData_isss: $event");
// return filteredData;
// }
getphonedata($id) async {
var url = '$curl/pno/1';
final phoneno = await Dio().get(url);
print("All_locDataa: ${phoneno.data}");
// String loc = "{$location}";
// final jsonEvent = json.decode(loc);
// print("All_loc: $jsonEvent");
final List jsonEvent = phoneno.data; // Directly use the data
print("All_locDataa123: ${jsonEvent}");
return jsonEvent.map((pno) => Phoneno.fromJson(pno)).toList();
}
// getemaildata(id) async {
// final String response = await Constants.response;
// final Email = await json.decode(response);
// final List<dynamic> event = Email['Email'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Email['Email']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .toList();
// print("EmaililteredDatafilteredData111: ${filteredData}");
// // Print filtered data
// print("EmaileventData_isss: $event");
// return filteredData;
// }
getemaildata($id) async {
var url = '$curl/email/1';
final email = await Dio().get(url);
print("All_locDataa: ${email.data}");
// String loc = "{$location}";
// final jsonEvent = json.decode(loc);
// print("All_loc: $jsonEvent");
final List jsonEvent = email.data; // Directly use the data
print("All_locDataa123: ${jsonEvent}");
return jsonEvent.map((email) => Email.fromJson(email)).toList();
}
// getpatentdata(id) async {
// final String response = await Constants.response;
// final Patent = await json.decode(response);
// final List<dynamic> event = Patent['Patent'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Patent['Patent']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .toList();
// print("PatenteredDatafilteredData111: ${filteredData}");
// // Print filtered data
// print("PatenttData_isss: $event");
// return filteredData;
// }
getpatentdata(id) async {
var url = '$curl/patent/1';
final patent = await Dio().get(url);
print("All_locDataa: ${patent.data}");
// String loc = "{$location}";
// final jsonEvent = json.decode(loc);
// print("All_loc: $jsonEvent");
final List jsonEvent = patent.data; // Directly use the data
print("All_locDataa123: ${jsonEvent}");
return jsonEvent.map((email) => Patent.fromJson(email)).toList();
}
// getcerlistdata(id) async {
// final String response = await Constants.response;
// final Certificate = await json.decode(response);
// final List<dynamic> event = Certificate['Certificate'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Certificate['Certificate']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .toList();
// print("PatenteredDatafilteredData111: ${filteredData}");
// // Print filtered data
// print("PatenttData_isss: $event");
// return filteredData;
// }
getcerlistdata(id) async {
var url = '$curl/cer/1';
final cer = await Dio().get(url);
print("All_locDataa: ${cer.data}");
// String loc = "{$location}";
// final jsonEvent = json.decode(loc);
// print("All_loc: $jsonEvent");
final List jsonEvent = cer.data; // Directly use the data
print("All_locDataa123: ${jsonEvent}");
return jsonEvent.map((certificate) => Cer.fromJson(certificate)).toList();
}
// getedulistdata(id) async {
// final String response = await Constants.response;
// final Education = await json.decode(response);
// final List<dynamic> event = Education['Education'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Education['Education']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .toList();
// print("PatenteredDatafilteredData111: ${filteredData}");
// // Print filtered data
// print("PatenttData_isss: $event");
// return filteredData;
// }
getedulistdata($id) async {
var url = '$curl/edu/1';
final edu = await Dio().get(url);
print("All_locDataa: ${edu.data}");
// String loc = "{$location}";
// final jsonEvent = json.decode(loc);
// print("All_loc: $jsonEvent");
final List jsonEvent = edu.data; // Directly use the data
print("All_locDataa123: ${jsonEvent}");
return jsonEvent.map((edu) => Edu.fromJson(edu)).toList();
}
// getawarddata(id) async {
// final String response = await Constants.response;
// final Awards = await json.decode(response);
// final List<dynamic> event = Awards['Awards'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Awards['Awards']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .toList();
// print("PatenteredDatafilteredData111: ${filteredData}");
// // Print filtered data
// print("PatenttData_isss: $event");
// return filteredData;
// }
getawarddata(id) async {
var url = '$curl/awa/1';
final awa = await Dio().get(url);
print("All_locDataa: ${awa.data}");
// String loc = "{$location}";
// final jsonEvent = json.decode(loc);
// print("All_loc: $jsonEvent");
final List jsonEvent = awa.data; // Directly use the data
print("All_locDataa123: ${jsonEvent}");
return jsonEvent.map((awards) => Awa.fromJson(awards)).toList();
}
// gettrainingdata(id) async {
// final String response = await Constants.response;
// final Training = await json.decode(response);
// final List<dynamic> event = Training['Training'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Training['Training']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .toList();
// print("PatenteredDatafilteredData111: ${filteredData}");
// // Print filtered data
// print("PatenttData_isss: $event");
// return filteredData;
// }
gettrainingdata(id) async {
var url = '$curl/training/1';
final training = await Dio().get(url);
print("All_locDataa: ${training.data}");
// String loc = "{$location}";
// final jsonEvent = json.decode(loc);
// print("All_loc: $jsonEvent");
final List jsonEvent = training.data; // Directly use the data
print("All_locDataa123: ${jsonEvent}");
return jsonEvent.map((awards) => Traning.fromJson(awards)).toList();
}
// getnihdata(id) async {
// final String response = await Constants.response;
// final Nih = await json.decode(response);
// final List<dynamic> event = Nih['NIHGrants'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Nih['NIHGrants']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .toList();
// print("PatenteredDatafilteredData111: ${filteredData}");
// // Print filtered data
// print("PatenttData_isss: $event");
// return filteredData;
// }
getnihdata(id) async {
var url = '$curl/nih/1';
final nih = await Dio().get(url);
print("All_locDataa: ${nih.data}");
// String loc = "{$location}";
// final jsonEvent = json.decode(loc);
// print("All_loc: $jsonEvent");
final List jsonEvent = nih.data; // Directly use the data
print("All_locDataa123: ${jsonEvent}");
return jsonEvent.map((awards) => Nih.fromJson(awards)).toList();
}
// getprodata(id) async {
// final String response = await Constants.response;
// final Pro = await json.decode(response);
// final List<dynamic> event = Pro['Procedure'];
// /////////////////////////////////////////////////////
// final List<Map<String, dynamic>> filteredData = Pro['Procedure']
// .where((item) => item['user_id'] == id)
// .cast<Map<String, dynamic>>()
// .toList();
// print("PatenteredDatafilteredData111: ${filteredData}");
// // Print filtered data
// print("PatenttData_isss: $event");
// return filteredData;
// }
getprodata(id) async {
var url = '$curl/pro/1';
final pro = await Dio().get(url);
print("All_locDataa: ${pro.data}");
// String loc = "{$location}";
// final jsonEvent = json.decode(loc);
// print("All_loc: $jsonEvent");
final List jsonEvent = pro.data; // Directly use the data
print("All_locDataa123: ${jsonEvent}");
return jsonEvent.map((awards) => Pro.fromJson(awards)).toList();
}
}

View File

@ -0,0 +1,49 @@
import 'package:hive/hive.dart';
part 'aff_model_hive.g.dart'; // This part file will be generated
@HiveType(typeId: 30) // Use a unique typeId for this class
class Affiliation extends HiveObject {
@HiveField(0)
final int? id;
@HiveField(1)
final int? userId;
@HiveField(2)
final String? orgName;
@HiveField(3)
final String? dept;
@HiveField(4)
final String? role;
@HiveField(5)
final String? timeFrame;
@HiveField(6)
final String? orgType;
@HiveField(7)
final String? emgType;
@HiveField(8)
final DateTime? createdAt;
@HiveField(9)
final DateTime? updatedAt; // Nullable
Affiliation({
this.id,
this.userId,
this.orgName,
this.dept,
this.role,
this.timeFrame,
this.orgType,
this.emgType,
this.createdAt,
this.updatedAt,
});
}

View File

@ -0,0 +1,68 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'aff_model_hive.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class AffiliationAdapter extends TypeAdapter<Affiliation> {
@override
final int typeId = 30;
@override
Affiliation read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Affiliation(
id: fields[0] as int?,
userId: fields[1] as int?,
orgName: fields[2] as String?,
dept: fields[3] as String?,
role: fields[4] as String?,
timeFrame: fields[5] as String?,
orgType: fields[6] as String?,
emgType: fields[7] as String?,
createdAt: fields[8] as DateTime?,
updatedAt: fields[9] as DateTime?,
);
}
@override
void write(BinaryWriter writer, Affiliation obj) {
writer
..writeByte(10)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.userId)
..writeByte(2)
..write(obj.orgName)
..writeByte(3)
..write(obj.dept)
..writeByte(4)
..write(obj.role)
..writeByte(5)
..write(obj.timeFrame)
..writeByte(6)
..write(obj.orgType)
..writeByte(7)
..write(obj.emgType)
..writeByte(8)
..write(obj.createdAt)
..writeByte(9)
..write(obj.updatedAt);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is AffiliationAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View File

@ -0,0 +1,70 @@
import 'package:hive_flutter/hive_flutter.dart';
import 'aff_model_hive.dart';
addAffiliation(List affilist) async {
// static final apihcpdata = Hive.box("hcpdata");
//final box = Hive.box<Affiliations>('affiliationshive');
var box = await Hive.openBox<Affiliation>('affiliationshive');
print("IamAffiliation_dataaa: ${affilist}");
// Convert JSON list to List<Affiliation>
List<Affiliation> affiliations = affilist.map((json) {
print("CheckinggJsonnnn: ${json.id}, ${json.userId}");
return Affiliation(
id: json.id,
userId: json.userId,
orgName: json.orgName,
dept: json.dept,
role: json.role,
timeFrame: json.timeFrame,
orgType: json.orgType,
emgType: json.emgType,
createdAt: DateTime.parse(json.createdAt),
updatedAt: json.updatedAt != null ? DateTime.parse(json.updatedAt) : null,
);
}).toList();
for (var affiliation in affiliations) {
print("Storing_Affff: ${affiliation.orgName}");
await box.put(affiliation.id, affiliation); // Use `put` with id as key
}
}
retrieveAffiliations() async {
var box = await Hive.openBox<Affiliation>('affiliationshive');
print('Retrive Doctor}');
List affiliations = box.values.toList();
print('Retrive Doctor affiliations ${affiliations}}');
for (var affiliation in affiliations) {
print('Retrive Organization Name: ${affiliation.orgName}');
print('Department: ${affiliation.dept}');
// Access other fields as needed
}
return affiliations;
}
retrieveidAffiliations(int text) async {
var box = await Hive.openBox<Affiliation>('affiliationshive');
print('Retrive Doctor123 ${text}}');
var affiliations = box.get(text);
List<Affiliation> affiliations1 = [];
if (affiliations != null) {
affiliations1.add(affiliations); // Add to the list if not null
}
print('Retrive Doctor affiliations ${affiliations}');
// for (var affiliation in affiliations) {
// print('Retrive Organization Name: ${affiliation.orgName}');
// print('Department: ${affiliation.dept}');
// // Access other fields as needed
// }
return affiliations1;
}

View File

@ -0,0 +1,36 @@
import 'package:hive_flutter/hive_flutter.dart';
part 'awa_model_hive.g.dart'; // This part file will be generated
@HiveType(typeId: 40)
class Awa extends HiveObject {
@HiveField(0)
final int id;
@HiveField(1)
final int userId;
@HiveField(2)
final String? educationType;
@HiveField(3)
final String? institutionName;
@HiveField(4)
final String? degree;
@HiveField(5)
final String? specialty;
@HiveField(6)
final String? timeFrame;
Awa({
required this.id,
required this.userId,
this.educationType,
this.institutionName,
this.degree,
this.specialty,
this.timeFrame,
});
}

View File

@ -0,0 +1,59 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'awa_model_hive.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class AwaAdapter extends TypeAdapter<Awa> {
@override
final int typeId = 40;
@override
Awa read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Awa(
id: fields[0] as int,
userId: fields[1] as int,
educationType: fields[2] as String?,
institutionName: fields[3] as String?,
degree: fields[4] as String?,
specialty: fields[5] as String?,
timeFrame: fields[6] as String?,
);
}
@override
void write(BinaryWriter writer, Awa obj) {
writer
..writeByte(7)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.userId)
..writeByte(2)
..write(obj.educationType)
..writeByte(3)
..write(obj.institutionName)
..writeByte(4)
..write(obj.degree)
..writeByte(5)
..write(obj.specialty)
..writeByte(6)
..write(obj.timeFrame);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is AwaAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View File

@ -0,0 +1,61 @@
import 'package:discover_module/contacts_module/storage_hive/awa_data/awa_model_hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
addAwa(List awalist) async {
// static final apihcpdata = Hive.box("hcpdata");
var box = await Hive.openBox<Awa>('awahive');
//
//var box = await Hive.openBox<Affiliation>('affiliationshive');
// print("IamPublication_dataaa: ${publist},${publist.}");
// Convert JSON list to List<Affiliation>
List<Awa> edus = awalist.map((json) {
return Awa(
id: json.id,
userId: json.userId,
educationType: json.educationType ?? '',
institutionName: json.institutionName ?? '',
degree: json.degree ?? '',
specialty: json.specialty ?? '',
timeFrame: json.timeFrame.toString() ?? '',
);
}).toList();
print("Eduactionnsss ${edus}");
for (var edu in edus) {
print("Storing_Eduactionnsss: ${edu.specialty}");
await box.put(edu.id, edu); // Use `put` with id as key
}
}
// Future<void> retrievePublications() async {
// var box = await Hive.openBox<Location>('pubhive');
// print('Retrive Doctor}');
// List<Location> publications = box.values.toList();
// print('Retrive Doctor publications ${publications}}');
// for (var publications in publications) {
// print('Retrive artical_title Name: ${publications.artical_title}');
// print('journal_name: ${publications.journal_name}');
// // Access other fields as needed
// }
// }
retrieveidawa(int id) async {
var box = await Hive.openBox<Awa>('awahive');
print('Retrive Doctor}');
var edus = box.get(id);
print('Retrive Doctor Eduuu ${edus}}');
List<Awa> dataedu = [];
if (edus != null) {
dataedu.add(edus); // Add to the list if not null
}
return dataedu;
}

View File

@ -0,0 +1,36 @@
import 'package:hive_flutter/hive_flutter.dart';
part 'cer_model_hive.g.dart'; // This part file will be generated
@HiveType(typeId: 41)
class Cer extends HiveObject {
@HiveField(0)
final int id;
@HiveField(1)
final int userId;
@HiveField(2)
final String? educationType;
@HiveField(3)
final String? institutionName;
@HiveField(4)
final String? degree;
@HiveField(5)
final String? specialty;
@HiveField(6)
final String? timeFrame;
Cer({
required this.id,
required this.userId,
this.educationType,
this.institutionName,
this.degree,
this.specialty,
this.timeFrame,
});
}

View File

@ -0,0 +1,59 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'cer_model_hive.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class CerAdapter extends TypeAdapter<Cer> {
@override
final int typeId = 41;
@override
Cer read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Cer(
id: fields[0] as int,
userId: fields[1] as int,
educationType: fields[2] as String?,
institutionName: fields[3] as String?,
degree: fields[4] as String?,
specialty: fields[5] as String?,
timeFrame: fields[6] as String?,
);
}
@override
void write(BinaryWriter writer, Cer obj) {
writer
..writeByte(7)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.userId)
..writeByte(2)
..write(obj.educationType)
..writeByte(3)
..write(obj.institutionName)
..writeByte(4)
..write(obj.degree)
..writeByte(5)
..write(obj.specialty)
..writeByte(6)
..write(obj.timeFrame);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is CerAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View File

@ -0,0 +1,63 @@
// import 'package:discover_module/storage_hive/awa_data/awa_model_hive.dart';
import 'package:discover_module/contacts_module/storage_hive/awa_data/awa_model_hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
addCer(List cerlist) async {
// static final apihcpdata = Hive.box("hcpdata");
var box = await Hive.openBox<Awa>('cerhive');
//
//var box = await Hive.openBox<Affiliation>('affiliationshive');
// print("IamPublication_dataaa: ${publist},${publist.}");
// Convert JSON list to List<Affiliation>
List<Awa> cers = cerlist.map((json) {
return Awa(
id: json.id,
userId: json.userId,
educationType: json.educationType ?? '',
institutionName: json.institutionName ?? '',
degree: json.degree ?? '',
specialty: json.specialty ?? '',
timeFrame: json.timeFrame.toString() ?? '',
);
}).toList();
print("Eduactionnsss ${cers}");
for (var cer in cers) {
print("Storing_Eduactionnsss: ${cer.specialty}");
await box.put(cer.id, cer); // Use `put` with id as key
}
}
// Future<void> retrievePublications() async {
// var box = await Hive.openBox<Location>('pubhive');
// print('Retrive Doctor}');
// List<Location> publications = box.values.toList();
// print('Retrive Doctor publications ${publications}}');
// for (var publications in publications) {
// print('Retrive artical_title Name: ${publications.artical_title}');
// print('journal_name: ${publications.journal_name}');
// // Access other fields as needed
// }
// }
retrieveidcer(int id) async {
var box = await Hive.openBox<Awa>('cerhive');
print('Retrive Doctor}');
var cers = box.get(id);
print('Retrive Doctor Eduuu ${cers}}');
List<Awa> datacer = [];
if (cers != null) {
datacer.add(cers); // Add to the list if not null
}
return datacer;
}

View File

@ -0,0 +1,64 @@
import 'package:discover_module/contacts_module/storage_hive/edu_data/edu_model_hive.dart';
// import 'package:discover_module/storage_hive/edu_data/edu_model_hive.dart';
// import 'package:discover_module/storage_hive/loc_data/location_model_hive.dart';
// import 'package:discover_module/storage_hive/pno_data/pno_model_hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
addEdu(List edulist) async {
// static final apihcpdata = Hive.box("hcpdata");
var box = await Hive.openBox<Edu>('edulhive');
//
//var box = await Hive.openBox<Affiliation>('affiliationshive');
// print("IamPublication_dataaa: ${publist},${publist.}");
// Convert JSON list to List<Affiliation>
List<Edu> edus = edulist.map((json) {
return Edu(
id: json.id,
userId: json.userId,
educationType: json.educationType ?? '',
institutionName: json.institutionName ?? '',
degree: json.degree ?? '',
specialty: json.specialty ?? '',
timeFrame: json.timeFrame.toString() ?? '',
);
}).toList();
print("Eduactionnsss ${edus}");
for (var edu in edus) {
print("Storing_Eduactionnsss: ${edu.specialty}");
await box.put(edu.id, edu); // Use `put` with id as key
}
}
// Future<void> retrievePublications() async {
// var box = await Hive.openBox<Location>('pubhive');
// print('Retrive Doctor}');
// List<Location> publications = box.values.toList();
// print('Retrive Doctor publications ${publications}}');
// for (var publications in publications) {
// print('Retrive artical_title Name: ${publications.artical_title}');
// print('journal_name: ${publications.journal_name}');
// // Access other fields as needed
// }
// }
retrieveidedus(int id) async {
var box = await Hive.openBox<Edu>('edulhive');
print('Retrive Doctor}');
var edus = box.get(4);
print('Retrive Doctor Eduuu ${edus}}');
List<Edu> dataedu = [];
if (edus != null) {
dataedu.add(edus); // Add to the list if not null
}
return dataedu;
}

View File

@ -0,0 +1,36 @@
import 'package:hive_flutter/hive_flutter.dart';
part 'edu_model_hive.g.dart'; // This part file will be generated
@HiveType(typeId: 39)
class Edu extends HiveObject {
@HiveField(0)
final int id;
@HiveField(1)
final int userId;
@HiveField(2)
final String? educationType;
@HiveField(3)
final String? institutionName;
@HiveField(4)
final String? degree;
@HiveField(5)
final String? specialty;
@HiveField(6)
final String? timeFrame;
Edu({
required this.id,
required this.userId,
this.educationType,
this.institutionName,
this.degree,
this.specialty,
this.timeFrame,
});
}

View File

@ -0,0 +1,59 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'edu_model_hive.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class EduAdapter extends TypeAdapter<Edu> {
@override
final int typeId = 39;
@override
Edu read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Edu(
id: fields[0] as int,
userId: fields[1] as int,
educationType: fields[2] as String?,
institutionName: fields[3] as String?,
degree: fields[4] as String?,
specialty: fields[5] as String?,
timeFrame: fields[6] as String?,
);
}
@override
void write(BinaryWriter writer, Edu obj) {
writer
..writeByte(7)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.userId)
..writeByte(2)
..write(obj.educationType)
..writeByte(3)
..write(obj.institutionName)
..writeByte(4)
..write(obj.degree)
..writeByte(5)
..write(obj.specialty)
..writeByte(6)
..write(obj.timeFrame);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is EduAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View File

@ -0,0 +1,60 @@
// import 'package:discover_module/storage_hive/email_data/email_model_hive.dart';
// import 'package:discover_module/storage_hive/loc_data/location_model_hive.dart';
// import 'package:discover_module/storage_hive/pno_data/pno_model_hive.dart';
import 'package:discover_module/contacts_module/storage_hive/email_data/email_model_hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
addEmail(List emaillist) async {
// static final apihcpdata = Hive.box("hcpdata");
var box = await Hive.openBox<Email>('emailhive');
//
//var box = await Hive.openBox<Affiliation>('affiliationshive');
// print("IamPublication_dataaa: ${publist},${publist.}");
// Convert JSON list to List<Affiliation>
List<Email> emails = emaillist.map((json) {
return Email(
id: json.id,
userId: json.userId,
emailType: json.emailType ?? '',
email: json.email ?? '',
);
}).toList();
print("Publicattionnsss_isss: ${emails}");
for (var email in emails) {
print("Storing_Affff: ${email.emailType}");
await box.put(email.id, email); // Use `put` with id as key
}
}
// Future<void> retrievePublications() async {
// var box = await Hive.openBox<Location>('pubhive');
// print('Retrive Doctor}');
// List<Location> publications = box.values.toList();
// print('Retrive Doctor publications ${publications}}');
// for (var publications in publications) {
// print('Retrive artical_title Name: ${publications.artical_title}');
// print('journal_name: ${publications.journal_name}');
// // Access other fields as needed
// }
// }
retrieveidemails(int id) async {
var box = await Hive.openBox<Email>('emailhive');
print('Retrive Doctor}');
var pnos = box.get(id);
print('Retrive Doctor locations ${pnos}}');
List<Email> dataemail = [];
if (pnos != null) {
dataemail.add(pnos); // Add to the list if not null
}
return dataemail;
}

View File

@ -0,0 +1,25 @@
import 'package:hive_flutter/hive_flutter.dart';
part 'email_model_hive.g.dart'; // This part file will be generated
@HiveType(typeId: 38)
class Email extends HiveObject {
@HiveField(0)
final int id;
@HiveField(1)
final int userId;
@HiveField(2)
final String? emailType;
@HiveField(3)
final String? email;
Email({
required this.id,
required this.userId,
this.emailType,
this.email,
e,
});
}

View File

@ -0,0 +1,50 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'email_model_hive.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class EmailAdapter extends TypeAdapter<Email> {
@override
final int typeId = 38;
@override
Email read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Email(
id: fields[0] as int,
userId: fields[1] as int,
emailType: fields[2] as String?,
email: fields[3] as String?,
);
}
@override
void write(BinaryWriter writer, Email obj) {
writer
..writeByte(4)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.userId)
..writeByte(2)
..write(obj.emailType)
..writeByte(3)
..write(obj.email);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is EmailAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View File

@ -0,0 +1,76 @@
// import 'package:discover_module/storage_hive/events_data/event_model_hive.dart';
// import 'package:discover_module/storage_hive/pub_data/pub_model_hive.dart';
import 'package:discover_module/contacts_module/storage_hive/events_data/event_model_hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
addEvent(List publist) async {
// static final apihcpdata = Hive.box("hcpdata");
var box = await Hive.openBox<Events>('eventhive');
//
//var box = await Hive.openBox<Affiliation>('affiliationshive');
// print("IamPublication_dataaa: ${publist},${publist.}");
// Convert JSON list to List<Affiliation>
List<Events> events = publist.map((json) {
return Events(
id: json.id,
userId: json.userId,
event_name: json.eventName ?? '',
event_type: '',
session_type: json.sessionType ?? '',
session_Name: '',
role: json.role ?? '',
topic: json.topic ?? '',
start: '',
end: '',
organizer: '',
organizer_Type: '',
sponsor: '',
sponsor_Type: '',
location: '',
address: '',
country: '',
state: '',
city: '',
postal_Code: '',
url1: '',
url2: '');
}).toList();
print("Events_isss: ${events}");
for (var events in events) {
print("Storing_Affff: ${events.event_name}");
await box.put(events.id, events); // Use `put` with id as key
}
}
Future<void> retrieveEventss() async {
var box = await Hive.openBox<Events>('eventhive');
print('Retrive Doctor}');
List<Events> events1 = box.values.toList();
print('Retrive Doctor Events ${events1}}');
for (var Events in events1) {
print('Retrive Events Name: ${Events.event_name}');
print('Events: ${Events.event_type}');
// Access other fields as needed
}
}
retrieveidEvent(int id) async {
var box = await Hive.openBox<Events>('eventhive');
print('Retrive Doctor}');
var events = box.get(id);
print('Retrive Doctor publications ${events}}');
List<Events> datapub = [];
if (events != null) {
datapub.add(events); // Add to the list if not null
}
return datapub;
}

View File

@ -0,0 +1,96 @@
import 'package:hive/hive.dart';
part 'event_model_hive.g.dart'; // This part file will be generated
@HiveType(typeId: 33) // Use a unique typeId for this class
class Events extends HiveObject {
@HiveField(0)
final int? id;
@HiveField(1)
final int? userId;
@HiveField(2)
final String? event_name;
@HiveField(3)
final String? event_type;
@HiveField(4)
final String? session_type;
@HiveField(5)
final String? session_Name;
@HiveField(6)
final String? role;
@HiveField(7)
final String? topic;
@HiveField(8)
final String? start;
@HiveField(9)
final String? end;
@HiveField(10)
final String? organizer;
@HiveField(11)
final String? organizer_Type;
@HiveField(12)
final String? sponsor;
@HiveField(13)
final String? sponsor_Type;
@HiveField(14)
final String? location;
@HiveField(15)
final String? address;
@HiveField(16)
final String? country;
@HiveField(17)
final String? state;
@HiveField(18)
final String? city;
@HiveField(19)
final String? postal_Code;
@HiveField(20)
final String? url1; // Nullable
@HiveField(21)
final String? url2; // Nullable
Events({
this.id,
this.userId,
this.event_name,
this.event_type,
this.session_type,
this.session_Name,
this.role,
this.topic,
this.start,
this.end,
this.organizer,
this.organizer_Type,
this.sponsor,
this.sponsor_Type,
this.location,
this.address,
this.country,
this.state,
this.city,
this.postal_Code,
this.url1,
this.url2,
});
}

View File

@ -0,0 +1,104 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'event_model_hive.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class EventsAdapter extends TypeAdapter<Events> {
@override
final int typeId = 33;
@override
Events read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Events(
id: fields[0] as int?,
userId: fields[1] as int?,
event_name: fields[2] as String?,
event_type: fields[3] as String?,
session_type: fields[4] as String?,
session_Name: fields[5] as String?,
role: fields[6] as String?,
topic: fields[7] as String?,
start: fields[8] as String?,
end: fields[9] as String?,
organizer: fields[10] as String?,
organizer_Type: fields[11] as String?,
sponsor: fields[12] as String?,
sponsor_Type: fields[13] as String?,
location: fields[14] as String?,
address: fields[15] as String?,
country: fields[16] as String?,
state: fields[17] as String?,
city: fields[18] as String?,
postal_Code: fields[19] as String?,
url1: fields[20] as String?,
url2: fields[21] as String?,
);
}
@override
void write(BinaryWriter writer, Events obj) {
writer
..writeByte(22)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.userId)
..writeByte(2)
..write(obj.event_name)
..writeByte(3)
..write(obj.event_type)
..writeByte(4)
..write(obj.session_type)
..writeByte(5)
..write(obj.session_Name)
..writeByte(6)
..write(obj.role)
..writeByte(7)
..write(obj.topic)
..writeByte(8)
..write(obj.start)
..writeByte(9)
..write(obj.end)
..writeByte(10)
..write(obj.organizer)
..writeByte(11)
..write(obj.organizer_Type)
..writeByte(12)
..write(obj.sponsor)
..writeByte(13)
..write(obj.sponsor_Type)
..writeByte(14)
..write(obj.location)
..writeByte(15)
..write(obj.address)
..writeByte(16)
..write(obj.country)
..writeByte(17)
..write(obj.state)
..writeByte(18)
..write(obj.city)
..writeByte(19)
..write(obj.postal_Code)
..writeByte(20)
..write(obj.url1)
..writeByte(21)
..write(obj.url2);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is EventsAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View File

@ -0,0 +1,86 @@
import 'dart:convert';
// import 'package:discover_module/storage_hive/kol_info/kol_info_model_hive.dart';
import 'package:discover_module/contacts_module/storage_hive/kol_info/kol_info_model_hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
addKolInfo(Map<String, dynamic> kollist) async {
var box = await Hive.openBox<KolInfo>('kolshive');
print("IamKolInfo_dataaa: ${kollist}");
var doctor = KolInfo(
id: kollist['id'],
name: kollist['name'],
email: kollist['email'],
summarry: kollist['summarry'],
addr: kollist['addr'],
license_no: kollist['license_no'].toString(),
p_suffix: kollist['p_suffix'],
speciality: kollist['speciality'],
sub_speciality: kollist['sub_speciality'],
phone_no: kollist['phone_no'].toString(),
// created_at: DateTime.parse('2023-11-28T15:58:08.000000Z'),
// updated_at: DateTime.parse('2024-01-16T11:26:10.000000Z'),
img_path: kollist['img_path'].toString(),
country: kollist['country'].toString(),
);
print("Checkinggg_thatt : ${doctor}, ${doctor.id}");
await box.put(doctor.id, doctor);
// await box.put(affiliation.id, affiliation); // Use `put` with id as key
// return KolInfo(id : json['id'], name : json['id'], email :json['email'], summarry, addr, license_no, p_suffix, speciality, sub_speciality, phone_no, created_at, updated_at, img_path, country)
// });
}
retrievekol() async {
var box = await Hive.openBox<KolInfo>('kolshive');
print('Retrive Kol Namehii}');
List doctordata = box.values.toList();
print('Retrive Kol123 ${doctordata}, ${doctordata.length}');
for (var affiliation in doctordata) {
print(' Name: ${affiliation.name}');
print('email: ${affiliation.email}');
// Access other fields as needed
}
return doctordata;
}
deletekol(id) async {
var box = await Hive.openBox<KolInfo>('kolshive');
print("DeletingKolll");
await box.delete(id);
}
searchkol(String query) async {
var box = await Hive.openBox<KolInfo>('kolshive');
print('Retrive Kol Namehii}');
List doctordata = box.values.toList();
print('Searchh Kol123 ${doctordata}, ${doctordata.length}');
List data = doctordata
.where((hcp) =>
hcp.name.toLowerCase().contains(query.toLowerCase()) ||
// (hcp['speciality'].toLowerCase().contains(query.toLowerCase()) ??
// hcp['spl'].toLowerCase().contains(query.toLowerCase())) ||
hcp.speciality.toLowerCase().contains(query.toLowerCase()) ||
hcp.addr.toLowerCase().contains(query.toLowerCase()))
.toList();
print("Checking_Name_data : ${data}");
// for (var affiliation in doctordata) {
// print(' Name: ${affiliation.name}');
// print('email: ${affiliation.email}');
// // Access other fields as needed
// }
return data.toList();
}

View File

@ -0,0 +1,63 @@
import 'package:hive_flutter/hive_flutter.dart';
part 'kol_info_model_hive.g.dart'; // This part file will be generated
@HiveType(typeId: 31)
class KolInfo extends HiveObject {
@HiveField(0)
final int id;
@HiveField(1)
final String name;
@HiveField(2)
final String? email;
@HiveField(3)
final String? summarry;
@HiveField(4)
final String? addr;
@HiveField(5)
final String? license_no;
@HiveField(6)
final String? p_suffix;
@HiveField(7)
final String? speciality;
@HiveField(8)
final String? sub_speciality;
@HiveField(9)
final String? phone_no;
@HiveField(10)
final String? created_at;
@HiveField(11)
final String? updated_at;
@HiveField(12)
final String? img_path;
@HiveField(13)
final String? country;
KolInfo(
{required this.id,
required this.name,
this.email,
this.summarry,
this.addr,
this.license_no,
this.p_suffix,
this.speciality,
this.sub_speciality,
this.phone_no,
this.created_at,
this.updated_at,
required this.img_path,
this.country});
}

View File

@ -0,0 +1,80 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'kol_info_model_hive.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class KolInfoAdapter extends TypeAdapter<KolInfo> {
@override
final int typeId = 31;
@override
KolInfo read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return KolInfo(
id: fields[0] as int,
name: fields[1] as String,
email: fields[2] as String?,
summarry: fields[3] as String?,
addr: fields[4] as String?,
license_no: fields[5] as String?,
p_suffix: fields[6] as String?,
speciality: fields[7] as String?,
sub_speciality: fields[8] as String?,
phone_no: fields[9] as String?,
created_at: fields[10] as String?,
updated_at: fields[11] as String?,
img_path: fields[12] as String?,
country: fields[13] as String?,
);
}
@override
void write(BinaryWriter writer, KolInfo obj) {
writer
..writeByte(14)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.name)
..writeByte(2)
..write(obj.email)
..writeByte(3)
..write(obj.summarry)
..writeByte(4)
..write(obj.addr)
..writeByte(5)
..write(obj.license_no)
..writeByte(6)
..write(obj.p_suffix)
..writeByte(7)
..write(obj.speciality)
..writeByte(8)
..write(obj.sub_speciality)
..writeByte(9)
..write(obj.phone_no)
..writeByte(10)
..write(obj.created_at)
..writeByte(11)
..write(obj.updated_at)
..writeByte(12)
..write(obj.img_path)
..writeByte(13)
..write(obj.country);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is KolInfoAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View File

@ -0,0 +1,61 @@
// import 'package:discover_module/storage_hive/loc_data/location_model_hive.dart';
import 'package:discover_module/contacts_module/storage_hive/loc_data/location_model_hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
addLoc(List loclist) async {
// static final apihcpdata = Hive.box("hcpdata");
var box = await Hive.openBox<Location>('lochive');
//
//var box = await Hive.openBox<Affiliation>('affiliationshive');
// print("IamPublication_dataaa: ${publist},${publist.}");
// Convert JSON list to List<Affiliation>
List<Location> locations = loclist.map((json) {
return Location(
id: json.id,
userId: json.userId,
institution: json.institution ?? '',
address: json.address ?? '',
city: json.city ?? '',
state: json.state ?? '',
postalCode: json.postalCode.toString() ?? '',
);
}).toList();
print("Publicattionnsss_isss: ${locations}");
for (var loc in locations) {
print("Storing_Affff: ${loc.institution}");
await box.put(loc.id, loc); // Use `put` with id as key
}
}
// Future<void> retrievePublications() async {
// var box = await Hive.openBox<Location>('pubhive');
// print('Retrive Doctor}');
// List<Location> publications = box.values.toList();
// print('Retrive Doctor publications ${publications}}');
// for (var publications in publications) {
// print('Retrive artical_title Name: ${publications.artical_title}');
// print('journal_name: ${publications.journal_name}');
// // Access other fields as needed
// }
// }
retrieveidlocations(int id) async {
var box = await Hive.openBox<Location>('lochive');
print('Retrive Doctor}');
var locations = box.get(id);
print('Retrive Doctor locations ${locations}}');
List<Location> dataloc = [];
if (locations != null) {
dataloc.add(locations); // Add to the list if not null
}
return dataloc;
}

View File

@ -0,0 +1,36 @@
import 'package:hive_flutter/hive_flutter.dart';
part 'location_model_hive.g.dart'; // This part file will be generated
@HiveType(typeId: 36)
class Location extends HiveObject {
@HiveField(0)
final int id;
@HiveField(1)
final int userId;
@HiveField(2)
final String? institution;
@HiveField(3)
final String? address;
@HiveField(4)
final String? city;
@HiveField(5)
final String? state;
@HiveField(6)
final String? postalCode;
Location({
required this.id,
required this.userId,
this.institution,
this.address,
this.city,
this.state,
this.postalCode,
});
}

View File

@ -0,0 +1,59 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'location_model_hive.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class LocationAdapter extends TypeAdapter<Location> {
@override
final int typeId = 36;
@override
Location read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Location(
id: fields[0] as int,
userId: fields[1] as int,
institution: fields[2] as String?,
address: fields[3] as String?,
city: fields[4] as String?,
state: fields[5] as String?,
postalCode: fields[6] as String?,
);
}
@override
void write(BinaryWriter writer, Location obj) {
writer
..writeByte(7)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.userId)
..writeByte(2)
..write(obj.institution)
..writeByte(3)
..write(obj.address)
..writeByte(4)
..write(obj.city)
..writeByte(5)
..write(obj.state)
..writeByte(6)
..write(obj.postalCode);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is LocationAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View File

@ -0,0 +1,55 @@
// import 'package:discover_module/storage_hive/nih_grant_data/nih_model_hive.dart';
import 'package:discover_module/contacts_module/storage_hive/nih_grant_data/nih_model_hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
addNih(List nihlist) async {
var box = await Hive.openBox<Nih>('nihhive');
List<Nih> nihs = nihlist.map((json) {
print("Checkingggg: ${json.piNames}");
return Nih(
id: json.id,
userId: json.userId,
piNames: json.piNames ?? '',
firstName: json.firstName ?? '',
middleName: json.middleName ?? '',
lastName: json.lastName ?? '',
organizationName: json.organizationName ?? '',
departmentName: json.departmentName ?? '',
orgCity: json.orgCity ?? '',
orgState: json.orgState ?? '',
purpose: json.purpose ?? '',
institute: json.institute ?? '',
totalCost: json.totalCost ?? '',
projectStart: json.projectStart ?? '',
projectEnd: json.projectEnd ?? '',
budgetStart: json.budgetStart ?? '',
budgetEnd: json.budgetEnd ?? '',
createdOn: json.createdOn ?? '',
piId: json.piId ?? '',
);
}).toList();
print("Eduactionnsss ${nihs}");
for (var nih in nihs) {
print("Storing_Eduactionnsss: ${nih.piNames}");
await box.put(nih.id, nih); // Use `put` with id as key
}
}
retrieveidnih(int id) async {
var box = await Hive.openBox<Nih>('nihhive');
print('Retrive Doctor}');
var nihs = box.get(id);
print('Retrive Doctor Eduuu ${nihs}}');
List<Nih> datanih = [];
if (nihs != null) {
datanih.add(nihs); // Add to the list if not null
}
return datanih;
}

View File

@ -0,0 +1,84 @@
import 'package:hive_flutter/hive_flutter.dart';
part 'nih_model_hive.g.dart'; // This part file will be generated
@HiveType(typeId: 43)
class Nih extends HiveObject {
@HiveField(0)
final int id;
@HiveField(1)
final int userId;
@HiveField(2)
final String? piNames;
@HiveField(3)
final String? firstName;
@HiveField(4)
final String? middleName;
@HiveField(5)
final String? lastName;
@HiveField(6)
final String? organizationName;
@HiveField(7)
final String? departmentName;
@HiveField(8)
final String? orgCity;
@HiveField(9)
final String? orgState;
@HiveField(10)
final String? purpose;
@HiveField(11)
final String? institute;
@HiveField(12)
final String? totalCost;
@HiveField(13)
final String? projectStart;
@HiveField(14)
final String? projectEnd;
@HiveField(15)
final String? budgetStart;
@HiveField(16)
final String? budgetEnd;
@HiveField(17)
final String? createdOn;
@HiveField(18)
final int? piId;
Nih({
required this.id,
required this.userId,
this.piNames,
this.firstName,
this.middleName,
this.lastName,
this.organizationName,
this.departmentName,
this.orgCity,
this.orgState,
this.purpose,
this.institute,
this.totalCost,
this.projectStart,
this.projectEnd,
this.budgetStart,
this.budgetEnd,
this.createdOn,
this.piId,
});
}

View File

@ -0,0 +1,95 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'nih_model_hive.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class NihAdapter extends TypeAdapter<Nih> {
@override
final int typeId = 43;
@override
Nih read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return Nih(
id: fields[0] as int,
userId: fields[1] as int,
piNames: fields[2] as String?,
firstName: fields[3] as String?,
middleName: fields[4] as String?,
lastName: fields[5] as String?,
organizationName: fields[6] as String?,
departmentName: fields[7] as String?,
orgCity: fields[8] as String?,
orgState: fields[9] as String?,
purpose: fields[10] as String?,
institute: fields[11] as String?,
totalCost: fields[12] as String?,
projectStart: fields[13] as String?,
projectEnd: fields[14] as String?,
budgetStart: fields[15] as String?,
budgetEnd: fields[16] as String?,
createdOn: fields[17] as String?,
piId: fields[18] as int?,
);
}
@override
void write(BinaryWriter writer, Nih obj) {
writer
..writeByte(19)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.userId)
..writeByte(2)
..write(obj.piNames)
..writeByte(3)
..write(obj.firstName)
..writeByte(4)
..write(obj.middleName)
..writeByte(5)
..write(obj.lastName)
..writeByte(6)
..write(obj.organizationName)
..writeByte(7)
..write(obj.departmentName)
..writeByte(8)
..write(obj.orgCity)
..writeByte(9)
..write(obj.orgState)
..writeByte(10)
..write(obj.purpose)
..writeByte(11)
..write(obj.institute)
..writeByte(12)
..write(obj.totalCost)
..writeByte(13)
..write(obj.projectStart)
..writeByte(14)
..write(obj.projectEnd)
..writeByte(15)
..write(obj.budgetStart)
..writeByte(16)
..write(obj.budgetEnd)
..writeByte(17)
..write(obj.createdOn)
..writeByte(18)
..write(obj.piId);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is NihAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}

View File

@ -0,0 +1,20 @@
// import 'package:discover_module/storage_hive/note_data/note_model_hive.dart';
// import 'package:discover_module/storage_hive/patent_data/patent_model_hive.dart';
import 'package:hive_flutter/hive_flutter.dart';
final Box<String> box = Hive.box<String>('notehive');
addNote(String text) async {
// var box = await Hive.openBox<String>('notehive');
print("Text_issss: $text");
box.add(text); // Save text with a key
}
List<String> getText() {
//var box = await Hive.openBox<String>('notehive');
print("SavedNotesssL : ${box.values.toList()}");
return box.values.toList();
}

View File

@ -0,0 +1,16 @@
import 'package:hive_flutter/hive_flutter.dart';
part 'note_model_hive.g.dart'; // This part file will be generated
@HiveType(typeId: 47)
class Note extends HiveObject {
@HiveField(0)
final int id;
@HiveField(1)
final String? note;
Note({
required this.id,
this.note,
});
}

Some files were not shown because too many files have changed in this diff Show More