731 lines
23 KiB
Dart
731 lines
23 KiB
Dart
import 'dart:convert';
|
|
|
|
import 'package:dio/dio.dart';
|
|
import 'package:konectar_events/contacts_module/constants.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/affiliations.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/awards_model.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/certificate_model.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/education_model.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/email_model.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/event_model.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/location_model.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/nih_model.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/patent_model.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/pno_model.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/procedure_model.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/publication_model.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/speaker.dart';
|
|
import 'package:konectar_events/contacts_module/model_class/trainig_model.dart';
|
|
import 'package:konectar_events/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();
|
|
}
|
|
}
|