From c9b71a13866300ddfc9d657fc3003178001874dc Mon Sep 17 00:00:00 2001 From: poojakhatawate Date: Mon, 7 Oct 2024 18:11:28 +0530 Subject: [PATCH] ContactsModuleMerge --- lib/{ => contacts_module}/check.dart | 0 lib/{ => contacts_module}/connectivity.dart | 0 lib/{ => contacts_module}/constants.dart | 11 +- .../custom_widget/custom_expansiontile.dart | 212 + .../custom_widget/elevation_btn.dart | 0 .../custom_widget/floating_btn.dart | 0 .../custom_widget/show_alert.dart | 2 +- .../custom_widget/text.dart | 0 .../custom_widget/textfield.dart | 0 lib/{ => contacts_module}/hive_fun.dart | 176 +- .../model_class/affiliations.dart | 0 .../model_class/awards_model.dart | 59 + .../model_class/certificate_model.dart | 59 + .../model_class/education_model.dart | 51 + .../model_class/email_model.dart | 39 + .../model_class/event_model.dart | 0 .../model_class/hcp_details.dart | 0 .../k2_api_model/kol_Certificate_k2.dart | 122 + .../model_class/k2_api_model/kol_aff_k2.dart | 144 + .../k2_api_model/kol_awards_k2.dart | 115 + .../k2_api_model/kol_education_k2.dart | 123 + .../k2_api_model/kol_email_k2.dart | 102 + .../k2_api_model/kol_event_k2.dart | 98 + .../k2_api_model/kol_location_k2.dart | 128 + .../model_class/k2_api_model/kol_pno_k2.dart | 116 + .../k2_api_model/kol_training_k2.dart | 127 + .../k2_api_model/kolcontact_list_k2.dart | 272 + .../model_class/location_model.dart | 51 + .../model_class/nih_model.dart | 100 + .../model_class/patent_model.dart | 39 + .../model_class/pno_model.dart | 43 + .../model_class/procedure_model.dart | 59 + .../model_class/publication_model.dart | 0 .../model_class/section.dart | 0 .../model_class/single_hcpinfo.dart | 0 .../model_class/speaker.dart | 15 +- .../model_class/trainig_model.dart | 51 + .../model_class/trials.dart | 0 .../network_connection/network_check.dart | 0 .../provider_class/affiliationsprovider.dart | 14 +- .../provider_class/award_provider.dart | 8 +- .../provider_class/certificate_provider.dart | 8 +- .../provider_class/educationprovider.dart | 8 +- .../provider_class/email_provider.dart | 8 +- .../provider_class/engagement_provider.dart | 2 +- .../provider_class/events_provider.dart | 8 +- .../provider_class/hcp _provider.dart | 58 +- .../k2_provider/kol_aff_provider.dart | 37 + .../k2_provider/kol_awards_provider.dart | 17 + .../k2_provider/kol_certificate_provider.dart | 17 + .../k2_provider/kol_education_provider.dart | 17 + .../k2_provider/kol_email_provider.dart | 17 + .../k2_provider/kol_event_provider.dart | 29 + .../k2_provider/kol_list_provider.dart | 61 + .../k2_provider/kol_locationprovider.dart} | 6 +- .../k2_provider/kol_pno_provider.dart | 17 + .../k2_provider/kol_training_provider.dart | 17 + .../provider_class/location_provider.dart | 22 + .../medicalinsightprovider.dart | 2 +- .../provider_class/nih_provider.dart | 8 +- .../provider_class/patent_provider.dart | 8 +- .../provider_class/phoneno_provider.dart | 9 +- .../provider_class/procedureprovider.dart | 8 +- .../provider_class/publications_provider.dart | 12 +- .../provider_class/single_hcpprovider.dart | 5 +- .../provider_class/speaker_provider.dart | 24 + .../provider_class/training_provider.dart | 8 +- .../provider_class/trials_provider.dart | 8 +- lib/{ => contacts_module}/row_class.dart | 0 .../service.dart/k2_service/Apicall_k2.dart | 496 ++ lib/contacts_module/service.dart/service.dart | 730 +++ .../storage_hive/aff_data/aff_model_hive.dart | 49 + .../aff_data/aff_model_hive.g.dart | 68 + .../storage_hive/aff_data/insert_aff.dart | 70 + .../storage_hive/awa_data/awa_model_hive.dart | 36 + .../awa_data/awa_model_hive.g.dart | 59 + .../storage_hive/awa_data/crud_awa.dart | 61 + .../storage_hive/cer_hive/cer_model_hive.dart | 36 + .../cer_hive/cer_model_hive.g.dart | 59 + .../storage_hive/cer_hive/crud_cer.dart | 63 + .../storage_hive/edu_data/crud_edu.dart | 64 + .../storage_hive/edu_data/edu_model_hive.dart | 36 + .../edu_data/edu_model_hive.g.dart | 59 + .../storage_hive/email_data/crud_email.dart | 60 + .../email_data/email_model_hive.dart | 25 + .../email_data/email_model_hive.g.dart | 50 + .../storage_hive/events_data/crud_event.dart | 76 + .../events_data/event_model_hive.dart | 96 + .../events_data/event_model_hive.g.dart | 104 + .../storage_hive/kol_info/curd_kol.dart | 86 + .../kol_info/kol_info_model_hive.dart | 63 + .../kol_info/kol_info_model_hive.g.dart | 80 + .../storage_hive/loc_data/crud_loc.dart | 61 + .../loc_data/location_model_hive.dart | 36 + .../loc_data/location_model_hive.g.dart | 59 + .../storage_hive/nih_grant_data/crud_nih.dart | 55 + .../nih_grant_data/nih_model_hive.dart | 84 + .../nih_grant_data/nih_model_hive.g.dart | 95 + .../storage_hive/note_data/crud_note.dart | 20 + .../note_data/note_model_hive.dart | 16 + .../note_data/note_model_hive.g.dart | 44 + .../storage_hive/patent_data/crud_patent.dart | 40 + .../patent_data/patent_model_hive.dart | 24 + .../patent_data/patent_model_hive.g.dart | 50 + .../storage_hive/pno_data/crud_pno.dart | 60 + .../storage_hive/pno_data/pno_model_hive.dart | 29 + .../pno_data/pno_model_hive.g.dart | 53 + .../storage_hive/procedure_data/crud_pro.dart | 44 + .../procedure_data/pro_model_hive.dart | 43 + .../procedure_data/pro_model_hive.g.dart | 65 + .../storage_hive/pub_data/curd_pub.dart | 64 + .../storage_hive/pub_data/pub_model_hive.dart | 52 + .../pub_data/pub_model_hive.g.dart | 71 + .../speaker_data/crud.speaker.dart | 42 + .../speaker_data/speaker_model_hive.dart | 39 + .../speaker_data/speaker_model_hive.g.dart | 62 + .../traning_data/crud_training.dart | 41 + .../traning_data/traning_model_hive.dart | 36 + .../traning_data/traning_model_hive.g.dart | 59 + .../storage_hive/trials_data/crud_trials.dart | 80 + .../trials_data/trial_model_hive.dart | 107 + .../trials_data/trial_model_hive.g.dart | 113 + lib/{ => contacts_module}/textScalar.dart | 0 .../ui_screen/activity_tab.dart | 59 +- .../ui_screen/add_event/add_event.dart | 0 .../ui_screen/add_event/add_hcp.dart | 0 .../add_event/model/event_model.dart | 3 +- .../add_event/model/event_model.g.dart | 0 .../ui_screen/affiliation_data.dart | 203 +- .../ui_screen/awardshowmore.dart | 6 +- .../ui_screen/bottom_sheet.dart | 9 +- .../ui_screen/bottommmsheet.dart | 0 .../ui_screen/bottomsheet_dynamicheight.dart | 0 .../ui_screen/cer_show_more.dart | 6 +- .../ui_screen/chart.dart | 0 .../ui_screen/contact_filters.dart | 314 + .../ui_screen/contacts.dart | 0 .../ui_screen/discover.dart | 0 .../ui_screen/edu_show_more.dart | 6 +- .../ui_screen/email_show_more.dart | 6 +- .../ui_screen/engagementlist.dart | 11 +- .../ui_screen/engagementtab.dart | 1190 +--- .../ui_screen/events_data.dart | 10 +- .../ui_screen/filters_menu.dart | 6 +- .../ui_screen/horizontal_listview.dart | 0 .../interactionform/NewtworkConnectivity.dart | 0 .../interactionform/configprovider.dart | 15 +- .../edit_interaction_screen.dart | 63 +- .../interactionform/interaction_screen.dart | 45 +- .../interactionlistscreen.dart | 14 +- .../interactionform/interactionprovider.dart | 21 +- .../ui_screen/interactionform/mockapi.dart | 3 +- .../model/engagement_interaction.dart | 3 +- .../model/engagement_interaction.g.dart | 6 +- .../model/interaction_config_data.dart | 3 +- .../model/interaction_config_data.g.dart | 0 .../model/interaction_config_data.g1.dart | 0 .../model/interaction_data.dart | 0 .../model/interaction_data.g.dart | 0 .../interactionform/model/json_form_data.dart | 0 .../model/json_form_data.g.dart | 0 .../interactionform/model/location_model.dart | 0 .../model/medical_insight.dart | 0 .../model/save_interaction.dart | 3 +- .../model/save_interaction.g.dart | 0 .../interactionform/new_dynamicform.dart | 361 +- .../repository/hive_repository.dart | 3 +- .../ui_screen/interactionform/util.dart | 12 +- .../interactionform/view_forms_list.dart | 25 +- .../view_interaction_screen.dart | 21 +- .../viewinteractionprovider.dart | 21 +- .../interactionform/widget/custombutton.dart | 0 .../widget/customrangeslider.dart | 3 +- .../widget/interatciontextfield.dart | 0 .../widget/location_showmore.dart | 6 +- .../widget/responsive_ext.dart | 0 .../k2api_integrated_ui/activityk2_tab.dart | 737 +++ .../k2api_integrated_ui/bottomsheetk2.dart | 292 + .../k2api_integrated_ui/callbottomsheet.dart | 34 + .../k2api_integrated_ui/k2testbshhet.dart | 72 + .../k2api_integrated_ui/kol_list.dart | 1372 +++++ .../k2api_integrated_ui/locationk2_tab.dart | 362 ++ .../ui_screen/listview.dart | 0 .../ui_screen/location_tab.dart | 490 +- .../ui_screen/medical_insight.dart | 364 ++ .../ui_screen/new_contacts.dart | 712 +++ .../ui_screen/new_editinteraction.dart | 191 +- .../ui_screen/new_new_profile.dart | 858 +++ .../ui_screen/new_new_profile_offline.dart | 0 .../ui_screen/new_viewinteraction.dart | 21 +- .../ui_screen/newformlist.dart | 22 +- .../ui_screen/nih_show_more.dart | 6 +- .../ui_screen/patent_show_more.dart | 6 +- .../ui_screen/pno_showmore.dart | 6 +- .../ui_screen/pro_show_more.dart | 6 +- .../ui_screen/publication_data.dart | 10 +- .../ui_screen/ranking.dart | 0 .../ui_screen/rising_stars.dart | 11 +- .../saved_profiles/saved_activity.dart | 978 +++ .../saved_profiles/saved_contact.dart} | 536 +- .../saved_profiles/saved_profile_info.dart | 1257 ++++ .../ui_screen/training_showmore.dart | 4 +- .../ui_screen/trends.dart | 8 +- .../ui_screen/trials_show_more.dart | 6 +- .../ui_screen/view_insight.dart | 3 +- lib/main.dart | 319 +- lib/provider_class/speaker_provider.dart | 17 - lib/service.dart/service.dart | 450 -- lib/ui_screen/medical_insight.dart | 968 --- lib/ui_screen/new_new_profile.dart | 5348 ----------------- 210 files changed, 15706 insertions(+), 9164 deletions(-) rename lib/{ => contacts_module}/check.dart (100%) rename lib/{ => contacts_module}/connectivity.dart (100%) rename lib/{ => contacts_module}/constants.dart (67%) create mode 100644 lib/contacts_module/custom_widget/custom_expansiontile.dart rename lib/{ => contacts_module}/custom_widget/elevation_btn.dart (100%) rename lib/{ => contacts_module}/custom_widget/floating_btn.dart (100%) rename lib/{ => contacts_module}/custom_widget/show_alert.dart (89%) rename lib/{ => contacts_module}/custom_widget/text.dart (100%) rename lib/{ => contacts_module}/custom_widget/textfield.dart (100%) rename lib/{ => contacts_module}/hive_fun.dart (55%) rename lib/{ => contacts_module}/model_class/affiliations.dart (100%) create mode 100644 lib/contacts_module/model_class/awards_model.dart create mode 100644 lib/contacts_module/model_class/certificate_model.dart create mode 100644 lib/contacts_module/model_class/education_model.dart create mode 100644 lib/contacts_module/model_class/email_model.dart rename lib/{ => contacts_module}/model_class/event_model.dart (100%) rename lib/{ => contacts_module}/model_class/hcp_details.dart (100%) create mode 100644 lib/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart create mode 100644 lib/contacts_module/model_class/k2_api_model/kol_aff_k2.dart create mode 100644 lib/contacts_module/model_class/k2_api_model/kol_awards_k2.dart create mode 100644 lib/contacts_module/model_class/k2_api_model/kol_education_k2.dart create mode 100644 lib/contacts_module/model_class/k2_api_model/kol_email_k2.dart create mode 100644 lib/contacts_module/model_class/k2_api_model/kol_event_k2.dart create mode 100644 lib/contacts_module/model_class/k2_api_model/kol_location_k2.dart create mode 100644 lib/contacts_module/model_class/k2_api_model/kol_pno_k2.dart create mode 100644 lib/contacts_module/model_class/k2_api_model/kol_training_k2.dart create mode 100644 lib/contacts_module/model_class/k2_api_model/kolcontact_list_k2.dart create mode 100644 lib/contacts_module/model_class/location_model.dart create mode 100644 lib/contacts_module/model_class/nih_model.dart create mode 100644 lib/contacts_module/model_class/patent_model.dart create mode 100644 lib/contacts_module/model_class/pno_model.dart create mode 100644 lib/contacts_module/model_class/procedure_model.dart rename lib/{ => contacts_module}/model_class/publication_model.dart (100%) rename lib/{ => contacts_module}/model_class/section.dart (100%) rename lib/{ => contacts_module}/model_class/single_hcpinfo.dart (100%) rename lib/{ => contacts_module}/model_class/speaker.dart (75%) create mode 100644 lib/contacts_module/model_class/trainig_model.dart rename lib/{ => contacts_module}/model_class/trials.dart (100%) rename lib/{ => contacts_module}/network_connection/network_check.dart (100%) rename lib/{ => contacts_module}/provider_class/affiliationsprovider.dart (73%) rename lib/{ => contacts_module}/provider_class/award_provider.dart (55%) rename lib/{ => contacts_module}/provider_class/certificate_provider.dart (56%) rename lib/{ => contacts_module}/provider_class/educationprovider.dart (55%) rename lib/{ => contacts_module}/provider_class/email_provider.dart (55%) rename lib/{ => contacts_module}/provider_class/engagement_provider.dart (95%) rename lib/{ => contacts_module}/provider_class/events_provider.dart (65%) rename lib/{ => contacts_module}/provider_class/hcp _provider.dart (55%) create mode 100644 lib/contacts_module/provider_class/k2_provider/kol_aff_provider.dart create mode 100644 lib/contacts_module/provider_class/k2_provider/kol_awards_provider.dart create mode 100644 lib/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart create mode 100644 lib/contacts_module/provider_class/k2_provider/kol_education_provider.dart create mode 100644 lib/contacts_module/provider_class/k2_provider/kol_email_provider.dart create mode 100644 lib/contacts_module/provider_class/k2_provider/kol_event_provider.dart create mode 100644 lib/contacts_module/provider_class/k2_provider/kol_list_provider.dart rename lib/{provider_class/location_provider.dart => contacts_module/provider_class/k2_provider/kol_locationprovider.dart} (62%) create mode 100644 lib/contacts_module/provider_class/k2_provider/kol_pno_provider.dart create mode 100644 lib/contacts_module/provider_class/k2_provider/kol_training_provider.dart create mode 100644 lib/contacts_module/provider_class/location_provider.dart rename lib/{ => contacts_module}/provider_class/medicalinsightprovider.dart (80%) rename lib/{ => contacts_module}/provider_class/nih_provider.dart (55%) rename lib/{ => contacts_module}/provider_class/patent_provider.dart (54%) rename lib/{ => contacts_module}/provider_class/phoneno_provider.dart (53%) rename lib/{ => contacts_module}/provider_class/procedureprovider.dart (56%) rename lib/{ => contacts_module}/provider_class/publications_provider.dart (61%) rename lib/{ => contacts_module}/provider_class/single_hcpprovider.dart (74%) create mode 100644 lib/contacts_module/provider_class/speaker_provider.dart rename lib/{ => contacts_module}/provider_class/training_provider.dart (53%) rename lib/{ => contacts_module}/provider_class/trials_provider.dart (51%) rename lib/{ => contacts_module}/row_class.dart (100%) create mode 100644 lib/contacts_module/service.dart/k2_service/Apicall_k2.dart create mode 100644 lib/contacts_module/service.dart/service.dart create mode 100644 lib/contacts_module/storage_hive/aff_data/aff_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/aff_data/aff_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/aff_data/insert_aff.dart create mode 100644 lib/contacts_module/storage_hive/awa_data/awa_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/awa_data/awa_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/awa_data/crud_awa.dart create mode 100644 lib/contacts_module/storage_hive/cer_hive/cer_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/cer_hive/cer_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/cer_hive/crud_cer.dart create mode 100644 lib/contacts_module/storage_hive/edu_data/crud_edu.dart create mode 100644 lib/contacts_module/storage_hive/edu_data/edu_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/edu_data/edu_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/email_data/crud_email.dart create mode 100644 lib/contacts_module/storage_hive/email_data/email_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/email_data/email_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/events_data/crud_event.dart create mode 100644 lib/contacts_module/storage_hive/events_data/event_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/events_data/event_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/kol_info/curd_kol.dart create mode 100644 lib/contacts_module/storage_hive/kol_info/kol_info_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/kol_info/kol_info_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/loc_data/crud_loc.dart create mode 100644 lib/contacts_module/storage_hive/loc_data/location_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/loc_data/location_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/nih_grant_data/crud_nih.dart create mode 100644 lib/contacts_module/storage_hive/nih_grant_data/nih_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/nih_grant_data/nih_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/note_data/crud_note.dart create mode 100644 lib/contacts_module/storage_hive/note_data/note_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/note_data/note_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/patent_data/crud_patent.dart create mode 100644 lib/contacts_module/storage_hive/patent_data/patent_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/patent_data/patent_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/pno_data/crud_pno.dart create mode 100644 lib/contacts_module/storage_hive/pno_data/pno_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/pno_data/pno_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/procedure_data/crud_pro.dart create mode 100644 lib/contacts_module/storage_hive/procedure_data/pro_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/procedure_data/pro_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/pub_data/curd_pub.dart create mode 100644 lib/contacts_module/storage_hive/pub_data/pub_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/pub_data/pub_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/speaker_data/crud.speaker.dart create mode 100644 lib/contacts_module/storage_hive/speaker_data/speaker_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/speaker_data/speaker_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/traning_data/crud_training.dart create mode 100644 lib/contacts_module/storage_hive/traning_data/traning_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/traning_data/traning_model_hive.g.dart create mode 100644 lib/contacts_module/storage_hive/trials_data/crud_trials.dart create mode 100644 lib/contacts_module/storage_hive/trials_data/trial_model_hive.dart create mode 100644 lib/contacts_module/storage_hive/trials_data/trial_model_hive.g.dart rename lib/{ => contacts_module}/textScalar.dart (100%) rename lib/{ => contacts_module}/ui_screen/activity_tab.dart (94%) rename lib/{ => contacts_module}/ui_screen/add_event/add_event.dart (100%) rename lib/{ => contacts_module}/ui_screen/add_event/add_hcp.dart (100%) rename lib/{ => contacts_module}/ui_screen/add_event/model/event_model.dart (86%) rename lib/{ => contacts_module}/ui_screen/add_event/model/event_model.g.dart (100%) rename lib/{ => contacts_module}/ui_screen/affiliation_data.dart (69%) rename lib/{ => contacts_module}/ui_screen/awardshowmore.dart (92%) rename lib/{ => contacts_module}/ui_screen/bottom_sheet.dart (98%) rename lib/{ => contacts_module}/ui_screen/bottommmsheet.dart (100%) rename lib/{ => contacts_module}/ui_screen/bottomsheet_dynamicheight.dart (100%) rename lib/{ => contacts_module}/ui_screen/cer_show_more.dart (92%) rename lib/{ => contacts_module}/ui_screen/chart.dart (100%) create mode 100644 lib/contacts_module/ui_screen/contact_filters.dart rename lib/{ => contacts_module}/ui_screen/contacts.dart (100%) rename lib/{ => contacts_module}/ui_screen/discover.dart (100%) rename lib/{ => contacts_module}/ui_screen/edu_show_more.dart (92%) rename lib/{ => contacts_module}/ui_screen/email_show_more.dart (92%) rename lib/{ => contacts_module}/ui_screen/engagementlist.dart (98%) rename lib/{ => contacts_module}/ui_screen/engagementtab.dart (52%) rename lib/{ => contacts_module}/ui_screen/events_data.dart (89%) rename lib/{ => contacts_module}/ui_screen/filters_menu.dart (97%) rename lib/{ => contacts_module}/ui_screen/horizontal_listview.dart (100%) rename lib/{ => contacts_module}/ui_screen/interactionform/NewtworkConnectivity.dart (100%) rename lib/{ => contacts_module}/ui_screen/interactionform/configprovider.dart (89%) rename lib/{ => contacts_module}/ui_screen/interactionform/edit_interaction_screen.dart (98%) rename lib/{ => contacts_module}/ui_screen/interactionform/interaction_screen.dart (99%) rename lib/{ => contacts_module}/ui_screen/interactionform/interactionlistscreen.dart (89%) rename lib/{ => contacts_module}/ui_screen/interactionform/interactionprovider.dart (97%) rename lib/{ => contacts_module}/ui_screen/interactionform/mockapi.dart (99%) rename lib/{ => contacts_module}/ui_screen/interactionform/model/engagement_interaction.dart (93%) rename lib/{ => contacts_module}/ui_screen/interactionform/model/engagement_interaction.g.dart (91%) rename lib/{ => contacts_module}/ui_screen/interactionform/model/interaction_config_data.dart (93%) rename lib/{ => contacts_module}/ui_screen/interactionform/model/interaction_config_data.g.dart (100%) rename lib/{ => contacts_module}/ui_screen/interactionform/model/interaction_config_data.g1.dart (100%) rename lib/{ => contacts_module}/ui_screen/interactionform/model/interaction_data.dart (100%) rename lib/{ => contacts_module}/ui_screen/interactionform/model/interaction_data.g.dart (100%) rename lib/{ => contacts_module}/ui_screen/interactionform/model/json_form_data.dart (100%) rename lib/{ => contacts_module}/ui_screen/interactionform/model/json_form_data.g.dart (100%) rename lib/{ => contacts_module}/ui_screen/interactionform/model/location_model.dart (100%) rename lib/{ => contacts_module}/ui_screen/interactionform/model/medical_insight.dart (100%) rename lib/{ => contacts_module}/ui_screen/interactionform/model/save_interaction.dart (94%) rename lib/{ => contacts_module}/ui_screen/interactionform/model/save_interaction.g.dart (100%) rename lib/{ => contacts_module}/ui_screen/interactionform/new_dynamicform.dart (94%) rename lib/{ => contacts_module}/ui_screen/interactionform/repository/hive_repository.dart (87%) rename lib/{ => contacts_module}/ui_screen/interactionform/util.dart (80%) rename lib/{ => contacts_module}/ui_screen/interactionform/view_forms_list.dart (86%) rename lib/{ => contacts_module}/ui_screen/interactionform/view_interaction_screen.dart (97%) rename lib/{ => contacts_module}/ui_screen/interactionform/viewinteractionprovider.dart (97%) rename lib/{ => contacts_module}/ui_screen/interactionform/widget/custombutton.dart (100%) rename lib/{ => contacts_module}/ui_screen/interactionform/widget/customrangeslider.dart (86%) rename lib/{ => contacts_module}/ui_screen/interactionform/widget/interatciontextfield.dart (100%) rename lib/{ => contacts_module}/ui_screen/interactionform/widget/location_showmore.dart (92%) rename lib/{ => contacts_module}/ui_screen/interactionform/widget/responsive_ext.dart (100%) create mode 100644 lib/contacts_module/ui_screen/k2api_integrated_ui/activityk2_tab.dart create mode 100644 lib/contacts_module/ui_screen/k2api_integrated_ui/bottomsheetk2.dart create mode 100644 lib/contacts_module/ui_screen/k2api_integrated_ui/callbottomsheet.dart create mode 100644 lib/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart create mode 100644 lib/contacts_module/ui_screen/k2api_integrated_ui/kol_list.dart create mode 100644 lib/contacts_module/ui_screen/k2api_integrated_ui/locationk2_tab.dart rename lib/{ => contacts_module}/ui_screen/listview.dart (100%) rename lib/{ => contacts_module}/ui_screen/location_tab.dart (75%) create mode 100644 lib/contacts_module/ui_screen/medical_insight.dart create mode 100644 lib/contacts_module/ui_screen/new_contacts.dart rename lib/{ => contacts_module}/ui_screen/new_editinteraction.dart (87%) create mode 100644 lib/contacts_module/ui_screen/new_new_profile.dart rename lib/{ => contacts_module}/ui_screen/new_new_profile_offline.dart (100%) rename lib/{ => contacts_module}/ui_screen/new_viewinteraction.dart (95%) rename lib/{ => contacts_module}/ui_screen/newformlist.dart (91%) rename lib/{ => contacts_module}/ui_screen/nih_show_more.dart (92%) rename lib/{ => contacts_module}/ui_screen/patent_show_more.dart (92%) rename lib/{ => contacts_module}/ui_screen/pno_showmore.dart (92%) rename lib/{ => contacts_module}/ui_screen/pro_show_more.dart (92%) rename lib/{ => contacts_module}/ui_screen/publication_data.dart (90%) rename lib/{ => contacts_module}/ui_screen/ranking.dart (100%) rename lib/{ => contacts_module}/ui_screen/rising_stars.dart (93%) create mode 100644 lib/contacts_module/ui_screen/saved_profiles/saved_activity.dart rename lib/{ui_screen/new_contacts.dart => contacts_module/ui_screen/saved_profiles/saved_contact.dart} (71%) create mode 100644 lib/contacts_module/ui_screen/saved_profiles/saved_profile_info.dart rename lib/{ => contacts_module}/ui_screen/training_showmore.dart (95%) rename lib/{ => contacts_module}/ui_screen/trends.dart (96%) rename lib/{ => contacts_module}/ui_screen/trials_show_more.dart (92%) rename lib/{ => contacts_module}/ui_screen/view_insight.dart (96%) delete mode 100644 lib/provider_class/speaker_provider.dart delete mode 100644 lib/service.dart/service.dart delete mode 100644 lib/ui_screen/medical_insight.dart delete mode 100644 lib/ui_screen/new_new_profile.dart diff --git a/lib/check.dart b/lib/contacts_module/check.dart similarity index 100% rename from lib/check.dart rename to lib/contacts_module/check.dart diff --git a/lib/connectivity.dart b/lib/contacts_module/connectivity.dart similarity index 100% rename from lib/connectivity.dart rename to lib/contacts_module/connectivity.dart diff --git a/lib/constants.dart b/lib/contacts_module/constants.dart similarity index 67% rename from lib/constants.dart rename to lib/contacts_module/constants.dart index bdf08cc..e4d24b4 100644 --- a/lib/constants.dart +++ b/lib/contacts_module/constants.dart @@ -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"; } diff --git a/lib/contacts_module/custom_widget/custom_expansiontile.dart b/lib/contacts_module/custom_widget/custom_expansiontile.dart new file mode 100644 index 0000000..7b2cd26 --- /dev/null +++ b/lib/contacts_module/custom_widget/custom_expansiontile.dart @@ -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 extends StatefulWidget { + final String title; + final List 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(); +} + +class _CustomExpansionTileState extends State> { + 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}"); + } + } +} diff --git a/lib/custom_widget/elevation_btn.dart b/lib/contacts_module/custom_widget/elevation_btn.dart similarity index 100% rename from lib/custom_widget/elevation_btn.dart rename to lib/contacts_module/custom_widget/elevation_btn.dart diff --git a/lib/custom_widget/floating_btn.dart b/lib/contacts_module/custom_widget/floating_btn.dart similarity index 100% rename from lib/custom_widget/floating_btn.dart rename to lib/contacts_module/custom_widget/floating_btn.dart diff --git a/lib/custom_widget/show_alert.dart b/lib/contacts_module/custom_widget/show_alert.dart similarity index 89% rename from lib/custom_widget/show_alert.dart rename to lib/contacts_module/custom_widget/show_alert.dart index 66b4fbd..34d9f9a 100644 --- a/lib/custom_widget/show_alert.dart +++ b/lib/contacts_module/custom_widget/show_alert.dart @@ -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'; diff --git a/lib/custom_widget/text.dart b/lib/contacts_module/custom_widget/text.dart similarity index 100% rename from lib/custom_widget/text.dart rename to lib/contacts_module/custom_widget/text.dart diff --git a/lib/custom_widget/textfield.dart b/lib/contacts_module/custom_widget/textfield.dart similarity index 100% rename from lib/custom_widget/textfield.dart rename to lib/contacts_module/custom_widget/textfield.dart diff --git a/lib/hive_fun.dart b/lib/contacts_module/hive_fun.dart similarity index 55% rename from lib/hive_fun.dart rename to lib/contacts_module/hive_fun.dart index f36a3b6..53a22ff 100644 --- a/lib/hive_fun.dart +++ b/lib/contacts_module/hive_fun.dart @@ -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 deleteUser(int selectedremoveIndic) async { @@ -186,17 +201,27 @@ class HiveFunctions { return apihcpdata.values.toList(); } - static Future 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 selectedIndices, [List displayedHCPList]) async { + // print("Iam selectedd $selectedIndices"); + + // for (int i = 0; i < selectedIndices.length; i++) { + // Map? row = await findRecordById1(selectedIndices[i]); + + // print("StoringgggMyContactneww_isss_isss:Row $row"); + // } + // } + + // Map findRecordById(String selectedIndic) { + // final list = _contactbox.values.toList(); + // } + + static Map? findRecordById1(String selectedIndic) { + final list = _contactbox.values.toList(); + return list + .firstWhere((element) => element['id'] == int.parse(selectedIndic)); + } + + static savemyContact(Map 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 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 getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; + } } diff --git a/lib/model_class/affiliations.dart b/lib/contacts_module/model_class/affiliations.dart similarity index 100% rename from lib/model_class/affiliations.dart rename to lib/contacts_module/model_class/affiliations.dart diff --git a/lib/contacts_module/model_class/awards_model.dart b/lib/contacts_module/model_class/awards_model.dart new file mode 100644 index 0000000..11f4eee --- /dev/null +++ b/lib/contacts_module/model_class/awards_model.dart @@ -0,0 +1,59 @@ +// To parse this JSON data, do +// +// final awa = awaFromJson(jsonString); + +import 'dart:convert'; + +List awaFromJson(String str) => + List.from(json.decode(str).map((x) => Awa.fromJson(x))); + +String awaToJson(List data) => + json.encode(List.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 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 toJson() => { + "id": id, + "user_id": userId, + "Education Type": educationType, + "Institution Name": institutionName, + "Degree": degree, + "Specialty": specialty, + "Time Frame": timeFrame, + "Url1": url1, + "Url2": url2, + }; +} diff --git a/lib/contacts_module/model_class/certificate_model.dart b/lib/contacts_module/model_class/certificate_model.dart new file mode 100644 index 0000000..c190c37 --- /dev/null +++ b/lib/contacts_module/model_class/certificate_model.dart @@ -0,0 +1,59 @@ +// To parse this JSON data, do +// +// final cer = cerFromJson(jsonString); + +import 'dart:convert'; + +List cerFromJson(String str) => + List.from(json.decode(str).map((x) => Cer.fromJson(x))); + +String cerToJson(List data) => + json.encode(List.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 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 toJson() => { + "id": id, + "user_id": userId, + "Education Type": educationType, + "Institution Name": institutionName, + "Degree": degree, + "Specialty": specialty, + "Time Frame": timeFrame, + "Url1": url1, + "Url2": url2, + }; +} diff --git a/lib/contacts_module/model_class/education_model.dart b/lib/contacts_module/model_class/education_model.dart new file mode 100644 index 0000000..7bcc9bb --- /dev/null +++ b/lib/contacts_module/model_class/education_model.dart @@ -0,0 +1,51 @@ +// To parse this JSON data, do +// +// final edu = eduFromJson(jsonString); + +import 'dart:convert'; + +List eduFromJson(String str) => + List.from(json.decode(str).map((x) => Edu.fromJson(x))); + +String eduToJson(List data) => + json.encode(List.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 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 toJson() => { + "id": id, + "user_id": userId, + "Education Type": educationType, + "Institution Name": institutionName, + "Degree": degree, + "Specialty": specialty, + "Time Frame": timeFrame, + }; +} diff --git a/lib/contacts_module/model_class/email_model.dart b/lib/contacts_module/model_class/email_model.dart new file mode 100644 index 0000000..5e3b096 --- /dev/null +++ b/lib/contacts_module/model_class/email_model.dart @@ -0,0 +1,39 @@ +// To parse this JSON data, do +// +// final email = emailFromJson(jsonString); + +import 'dart:convert'; + +List emailFromJson(String str) => + List.from(json.decode(str).map((x) => Email.fromJson(x))); + +String emailToJson(List data) => + json.encode(List.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 json) => Email( + id: json["id"], + userId: json["user_id"], + emailType: json["Email Type"], + email: json["Email"], + ); + + Map toJson() => { + "id": id, + "user_id": userId, + "Email Type": emailType, + "Email": email, + }; +} diff --git a/lib/model_class/event_model.dart b/lib/contacts_module/model_class/event_model.dart similarity index 100% rename from lib/model_class/event_model.dart rename to lib/contacts_module/model_class/event_model.dart diff --git a/lib/model_class/hcp_details.dart b/lib/contacts_module/model_class/hcp_details.dart similarity index 100% rename from lib/model_class/hcp_details.dart rename to lib/contacts_module/model_class/hcp_details.dart diff --git a/lib/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart b/lib/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart new file mode 100644 index 0000000..4f1458f --- /dev/null +++ b/lib/contacts_module/model_class/k2_api_model/kol_Certificate_k2.dart @@ -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? data; + int? lastPage; + int? lastRow; + int? count; + + DataCertificate({ + this.code, + this.message, + this.data, + this.lastPage, + this.lastRow, + this.count, + }); + + factory DataCertificate.fromJson(Map json) => + DataCertificate( + code: json["code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from( + json["data"]!.map((x) => CertificateList.fromJson(x))), + lastPage: json["last_page"], + lastRow: json["last_row"], + count: json["count"], + ); + + Map toJson() => { + "code": code, + "message": message, + "data": data == null + ? [] + : List.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 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 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(), + }; +} diff --git a/lib/contacts_module/model_class/k2_api_model/kol_aff_k2.dart b/lib/contacts_module/model_class/k2_api_model/kol_aff_k2.dart new file mode 100644 index 0000000..9384967 --- /dev/null +++ b/lib/contacts_module/model_class/k2_api_model/kol_aff_k2.dart @@ -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? data; + int? lastPage; + int? lastRow; + int? count; + + DataAffiliations({ + this.code, + this.message, + this.data, + this.lastPage, + this.lastRow, + this.count, + }); + + factory DataAffiliations.fromJson(Map json) => + DataAffiliations( + code: json["code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from(json["data"]!.map((x) => AffList.fromJson(x))), + lastPage: json["last_page"], + lastRow: json["last_row"], + count: json["count"], + ); + + Map toJson() => { + "code": code, + "message": message, + "data": data == null + ? [] + : List.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 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 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, + }; +} diff --git a/lib/contacts_module/model_class/k2_api_model/kol_awards_k2.dart b/lib/contacts_module/model_class/k2_api_model/kol_awards_k2.dart new file mode 100644 index 0000000..4158ca7 --- /dev/null +++ b/lib/contacts_module/model_class/k2_api_model/kol_awards_k2.dart @@ -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? data; + int? lastPage; + int? lastRow; + int? count; + + DataAwards({ + this.code, + this.message, + this.data, + this.lastPage, + this.lastRow, + this.count, + }); + + factory DataAwards.fromJson(Map json) => DataAwards( + code: json["code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from( + json["data"]!.map((x) => AwardsList.fromJson(x))), + lastPage: json["last_page"], + lastRow: json["last_row"], + count: json["count"], + ); + + Map toJson() => { + "code": code, + "message": message, + "data": data == null + ? [] + : List.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 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 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(), + }; +} diff --git a/lib/contacts_module/model_class/k2_api_model/kol_education_k2.dart b/lib/contacts_module/model_class/k2_api_model/kol_education_k2.dart new file mode 100644 index 0000000..41b5424 --- /dev/null +++ b/lib/contacts_module/model_class/k2_api_model/kol_education_k2.dart @@ -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? data; + int? lastPage; + int? lastRow; + int? count; + + DataEducation({ + this.code, + this.message, + this.data, + this.lastPage, + this.lastRow, + this.count, + }); + + factory DataEducation.fromJson(Map json) => DataEducation( + code: json["code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from( + json["data"]!.map((x) => EducationList.fromJson(x))), + lastPage: json["last_page"], + lastRow: json["last_row"], + count: json["count"], + ); + + Map toJson() => { + "code": code, + "message": message, + "data": data == null + ? [] + : List.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 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 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(), + }; +} diff --git a/lib/contacts_module/model_class/k2_api_model/kol_email_k2.dart b/lib/contacts_module/model_class/k2_api_model/kol_email_k2.dart new file mode 100644 index 0000000..19f36f1 --- /dev/null +++ b/lib/contacts_module/model_class/k2_api_model/kol_email_k2.dart @@ -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? data; + int? lastPage; + int? lastRow; + int? count; + + DataEmail({ + this.code, + this.message, + this.data, + this.lastPage, + this.lastRow, + this.count, + }); + + factory DataEmail.fromJson(Map json) => DataEmail( + code: json["code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from( + json["data"]!.map((x) => EmailData.fromJson(x))), + lastPage: json["last_page"], + lastRow: json["last_row"], + count: json["count"], + ); + + Map toJson() => { + "code": code, + "message": message, + "data": data == null + ? [] + : List.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 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 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(), + }; +} diff --git a/lib/contacts_module/model_class/k2_api_model/kol_event_k2.dart b/lib/contacts_module/model_class/k2_api_model/kol_event_k2.dart new file mode 100644 index 0000000..9a67a7e --- /dev/null +++ b/lib/contacts_module/model_class/k2_api_model/kol_event_k2.dart @@ -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? data; + int? lastPage; + int? lastRow; + int? count; + + DataEvent({ + this.code, + this.message, + this.data, + this.lastPage, + this.lastRow, + this.count, + }); + + factory DataEvent.fromJson(Map json) => DataEvent( + code: json["code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from( + json["data"]!.map((x) => EventList.fromJson(x))), + lastPage: json["last_page"], + lastRow: json["last_row"], + count: json["count"], + ); + + Map toJson() => { + "code": code, + "message": message, + "data": data == null + ? [] + : List.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 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 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(), + }; +} diff --git a/lib/contacts_module/model_class/k2_api_model/kol_location_k2.dart b/lib/contacts_module/model_class/k2_api_model/kol_location_k2.dart new file mode 100644 index 0000000..845c5ee --- /dev/null +++ b/lib/contacts_module/model_class/k2_api_model/kol_location_k2.dart @@ -0,0 +1,128 @@ +class KolLocation { + int? code; + String? message; + List? data; + int? lastPage; + int? lastRow; + int? count; + + KolLocation( + {this.code, + this.message, + this.data, + this.lastPage, + this.lastRow, + this.count}); + + KolLocation.fromJson(Map json) { + code = json['code']; + message = json['message']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(new Data.fromJson(v)); + }); + } + lastPage = json['last_page']; + lastRow = json['last_row']; + count = json['count']; + } + + Map toJson() { + final Map data = new Map(); + 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 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 toJson() { + final Map data = new Map(); + 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; + } +} diff --git a/lib/contacts_module/model_class/k2_api_model/kol_pno_k2.dart b/lib/contacts_module/model_class/k2_api_model/kol_pno_k2.dart new file mode 100644 index 0000000..bdc5290 --- /dev/null +++ b/lib/contacts_module/model_class/k2_api_model/kol_pno_k2.dart @@ -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? data; + int? lastPage; + int? lastRow; + int? count; + + DataaPnoresponse({ + this.code, + this.message, + this.data, + this.lastPage, + this.lastRow, + this.count, + }); + + factory DataaPnoresponse.fromJson(Map json) => + DataaPnoresponse( + code: json["code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from( + json["data"]!.map((x) => DataPhno.fromJson(x))), + lastPage: json["last_page"], + lastRow: json["last_row"], + count: json["count"], + ); + + Map toJson() => { + "code": code, + "message": message, + "data": data == null + ? [] + : List.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 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 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(), + }; +} diff --git a/lib/contacts_module/model_class/k2_api_model/kol_training_k2.dart b/lib/contacts_module/model_class/k2_api_model/kol_training_k2.dart new file mode 100644 index 0000000..2ef2a63 --- /dev/null +++ b/lib/contacts_module/model_class/k2_api_model/kol_training_k2.dart @@ -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? data; + int? lastPage; + int? lastRow; + int? count; + + DataTraining({ + this.code, + this.message, + this.data, + this.lastPage, + this.lastRow, + this.count, + }); + + factory DataTraining.fromJson(Map json) => DataTraining( + code: json["code"], + message: json["message"], + data: json["data"] == null + ? [] + : List.from( + json["data"]!.map((x) => TrainingList.fromJson(x))), + lastPage: json["last_page"], + lastRow: json["last_row"], + count: json["count"], + ); + + Map toJson() => { + "code": code, + "message": message, + "data": data == null + ? [] + : List.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 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 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(), + }; +} diff --git a/lib/contacts_module/model_class/k2_api_model/kolcontact_list_k2.dart b/lib/contacts_module/model_class/k2_api_model/kolcontact_list_k2.dart new file mode 100644 index 0000000..d8b2fb3 --- /dev/null +++ b/lib/contacts_module/model_class/k2_api_model/kolcontact_list_k2.dart @@ -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 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 json) => Kolcontact( + code: json["code"], + message: json["message"], + data: List.from(json["data"].map((x) => Datum.fromJson(x))), + lastPage: json["last_page"], + lastRow: json["last_row"], + count: json["count"], + ); + + Map toJson() => { + "code": code, + "message": message, + "data": List.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 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 organizations; + List emails; + List
address; + List 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 json) => Datum( + uniqueId: json["unique_id"], + profileImage: json["profile_image"], + npiNum: json["npi_num"], + fullName: json["full_name"], + specialityName: json["speciality_name"], + subSpecialities: + List.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.from(json["organizations"].map((x) => x)), + emails: List.from(json["emails"].map((x) => Email.fromJson(x))), + address: + List
.from(json["address"].map((x) => Address.fromJson(x))), + stateLicense: List.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 toJson() => { + "unique_id": uniqueId, + "profile_image": profileImage, + "npi_num": npiNum, + "full_name": fullName, + "speciality_name": specialityName, + "sub_specialities": List.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.from(organizations.map((x) => x)), + "emails": List.from(emails.map((x) => x.toJson())), + "address": List.from(address.map((x) => x.toJson())), + "state_license": + List.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 json) => Address( + address1: json["address1"], + address2: json["address2"], + country: json["country"], + state: json["state"], + city: cityValues.map[json["city"]]!, + ); + + Map 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 json) => Email( + type: json["type"], + phoneNo: json["phone_no"], + ); + + Map toJson() => { + "type": type, + "phone_no": phoneNo, + }; +} + +class StateLicense { + String licenseNumber; + dynamic stateCode; + + StateLicense({ + required this.licenseNumber, + required this.stateCode, + }); + + factory StateLicense.fromJson(Map json) => StateLicense( + licenseNumber: json["license_number"], + stateCode: json["state_code"], + ); + + Map toJson() => { + "license_number": licenseNumber, + "state_code": stateCode, + }; +} + +class EnumValues { + Map map; + late Map reverseMap; + + EnumValues(this.map); + + Map get reverse { + reverseMap = map.map((k, v) => MapEntry(v, k)); + return reverseMap; + } +} diff --git a/lib/contacts_module/model_class/location_model.dart b/lib/contacts_module/model_class/location_model.dart new file mode 100644 index 0000000..d2370a4 --- /dev/null +++ b/lib/contacts_module/model_class/location_model.dart @@ -0,0 +1,51 @@ +// To parse this JSON data, do +// +// final loc = locFromJson(jsonString); + +import 'dart:convert'; + +List locFromJson(String str) => + List.from(json.decode(str).map((x) => Loc.fromJson(x))); + +String locToJson(List data) => + json.encode(List.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 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 toJson() => { + "id": id, + "user_id": userId, + "Institution": institution, + "Address": address, + "City": city, + "State": state, + "Postal_code": postalCode, + }; +} diff --git a/lib/contacts_module/model_class/nih_model.dart b/lib/contacts_module/model_class/nih_model.dart new file mode 100644 index 0000000..2f4f6d7 --- /dev/null +++ b/lib/contacts_module/model_class/nih_model.dart @@ -0,0 +1,100 @@ +// To parse this JSON data, do +// +// final nih = nihFromJson(jsonString); + +import 'dart:convert'; + +List nihFromJson(String str) => + List.from(json.decode(str).map((x) => Nih.fromJson(x))); + +String nihToJson(List data) => + json.encode(List.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 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 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, + }; +} diff --git a/lib/contacts_module/model_class/patent_model.dart b/lib/contacts_module/model_class/patent_model.dart new file mode 100644 index 0000000..a6c920c --- /dev/null +++ b/lib/contacts_module/model_class/patent_model.dart @@ -0,0 +1,39 @@ +// To parse this JSON data, do +// +// final patent = patentFromJson(jsonString); + +import 'dart:convert'; + +List patentFromJson(String str) => + List.from(json.decode(str).map((x) => Patent.fromJson(x))); + +String patentToJson(List data) => + json.encode(List.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 json) => Patent( + id: json["id"], + userId: json["user_id"], + patentTitle: json["Patent Title"], + status: json["Status"], + ); + + Map toJson() => { + "id": id, + "user_id": userId, + "Patent Title": patentTitle, + "Status": status, + }; +} diff --git a/lib/contacts_module/model_class/pno_model.dart b/lib/contacts_module/model_class/pno_model.dart new file mode 100644 index 0000000..334af4e --- /dev/null +++ b/lib/contacts_module/model_class/pno_model.dart @@ -0,0 +1,43 @@ +// To parse this JSON data, do +// +// final phoneno = phonenoFromJson(jsonString); + +import 'dart:convert'; + +List phonenoFromJson(String str) => + List.from(json.decode(str).map((x) => Phoneno.fromJson(x))); + +String phonenoToJson(List data) => + json.encode(List.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 json) => Phoneno( + id: json["id"], + userId: json["user_id"], + phoneType: json["Phone type"], + locations: json["Locations"], + phoneNumber: json["phone Number"], + ); + + Map toJson() => { + "id": id, + "user_id": userId, + "Phone type": phoneType, + "Locations": locations, + "phone Number": phoneNumber, + }; +} diff --git a/lib/contacts_module/model_class/procedure_model.dart b/lib/contacts_module/model_class/procedure_model.dart new file mode 100644 index 0000000..3bed015 --- /dev/null +++ b/lib/contacts_module/model_class/procedure_model.dart @@ -0,0 +1,59 @@ +// To parse this JSON data, do +// +// final pro = proFromJson(jsonString); + +import 'dart:convert'; + +List proFromJson(String str) => + List.from(json.decode(str).map((x) => Pro.fromJson(x))); + +String proToJson(List data) => + json.encode(List.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 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 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, + }; +} diff --git a/lib/model_class/publication_model.dart b/lib/contacts_module/model_class/publication_model.dart similarity index 100% rename from lib/model_class/publication_model.dart rename to lib/contacts_module/model_class/publication_model.dart diff --git a/lib/model_class/section.dart b/lib/contacts_module/model_class/section.dart similarity index 100% rename from lib/model_class/section.dart rename to lib/contacts_module/model_class/section.dart diff --git a/lib/model_class/single_hcpinfo.dart b/lib/contacts_module/model_class/single_hcpinfo.dart similarity index 100% rename from lib/model_class/single_hcpinfo.dart rename to lib/contacts_module/model_class/single_hcpinfo.dart diff --git a/lib/model_class/speaker.dart b/lib/contacts_module/model_class/speaker.dart similarity index 75% rename from lib/model_class/speaker.dart rename to lib/contacts_module/model_class/speaker.dart index 68eba25..753d690 100644 --- a/lib/model_class/speaker.dart +++ b/lib/contacts_module/model_class/speaker.dart @@ -1,17 +1,16 @@ // To parse this JSON data, do // -// final medicalInsight = medicalInsightFromJson(jsonString); +// final speaker = speakerFromJson(jsonString); import 'dart:convert'; -List medicalInsightFromJson(String str) => - List.from( - json.decode(str).map((x) => MedicalInsight.fromJson(x))); +List speakerFromJson(String str) => + List.from(json.decode(str).map((x) => Speaker.fromJson(x))); -String medicalInsightToJson(List data) => +String speakerToJson(List data) => json.encode(List.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 json) => MedicalInsight( + factory Speaker.fromJson(Map json) => Speaker( id: json["id"], programtopic: json["programtopic"], speakername: json["speakername"], diff --git a/lib/contacts_module/model_class/trainig_model.dart b/lib/contacts_module/model_class/trainig_model.dart new file mode 100644 index 0000000..b2a4230 --- /dev/null +++ b/lib/contacts_module/model_class/trainig_model.dart @@ -0,0 +1,51 @@ +// To parse this JSON data, do +// +// final traning = traningFromJson(jsonString); + +import 'dart:convert'; + +List traningFromJson(String str) => + List.from(json.decode(str).map((x) => Traning.fromJson(x))); + +String traningToJson(List data) => + json.encode(List.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 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 toJson() => { + "id": id, + "user_id": userId, + "Education Type": educationType, + "Institution Name": institutionName, + "Degree": degree, + "Specialty": specialty, + "Time Frame": timeFrame, + }; +} diff --git a/lib/model_class/trials.dart b/lib/contacts_module/model_class/trials.dart similarity index 100% rename from lib/model_class/trials.dart rename to lib/contacts_module/model_class/trials.dart diff --git a/lib/network_connection/network_check.dart b/lib/contacts_module/network_connection/network_check.dart similarity index 100% rename from lib/network_connection/network_check.dart rename to lib/contacts_module/network_connection/network_check.dart diff --git a/lib/provider_class/affiliationsprovider.dart b/lib/contacts_module/provider_class/affiliationsprovider.dart similarity index 73% rename from lib/provider_class/affiliationsprovider.dart rename to lib/contacts_module/provider_class/affiliationsprovider.dart index 723379c..2bcac5e 100644 --- a/lib/provider_class/affiliationsprovider.dart +++ b/lib/contacts_module/provider_class/affiliationsprovider.dart @@ -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); + } } diff --git a/lib/provider_class/award_provider.dart b/lib/contacts_module/provider_class/award_provider.dart similarity index 55% rename from lib/provider_class/award_provider.dart rename to lib/contacts_module/provider_class/award_provider.dart index 744555b..1d9ea6a 100644 --- a/lib/provider_class/award_provider.dart +++ b/lib/contacts_module/provider_class/award_provider.dart @@ -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); + } } diff --git a/lib/provider_class/certificate_provider.dart b/lib/contacts_module/provider_class/certificate_provider.dart similarity index 56% rename from lib/provider_class/certificate_provider.dart rename to lib/contacts_module/provider_class/certificate_provider.dart index 0b455cc..f0c6cc6 100644 --- a/lib/provider_class/certificate_provider.dart +++ b/lib/contacts_module/provider_class/certificate_provider.dart @@ -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); + } } diff --git a/lib/provider_class/educationprovider.dart b/lib/contacts_module/provider_class/educationprovider.dart similarity index 55% rename from lib/provider_class/educationprovider.dart rename to lib/contacts_module/provider_class/educationprovider.dart index 50ee63c..b257fa9 100644 --- a/lib/provider_class/educationprovider.dart +++ b/lib/contacts_module/provider_class/educationprovider.dart @@ -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); + } } diff --git a/lib/provider_class/email_provider.dart b/lib/contacts_module/provider_class/email_provider.dart similarity index 55% rename from lib/provider_class/email_provider.dart rename to lib/contacts_module/provider_class/email_provider.dart index 9147117..7d6b8b7 100644 --- a/lib/provider_class/email_provider.dart +++ b/lib/contacts_module/provider_class/email_provider.dart @@ -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); + } } diff --git a/lib/provider_class/engagement_provider.dart b/lib/contacts_module/provider_class/engagement_provider.dart similarity index 95% rename from lib/provider_class/engagement_provider.dart rename to lib/contacts_module/provider_class/engagement_provider.dart index 3544db5..3189c38 100644 --- a/lib/provider_class/engagement_provider.dart +++ b/lib/contacts_module/provider_class/engagement_provider.dart @@ -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 { diff --git a/lib/provider_class/events_provider.dart b/lib/contacts_module/provider_class/events_provider.dart similarity index 65% rename from lib/provider_class/events_provider.dart rename to lib/contacts_module/provider_class/events_provider.dart index f66fd09..53d3ced 100644 --- a/lib/provider_class/events_provider.dart +++ b/lib/contacts_module/provider_class/events_provider.dart @@ -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); + } } diff --git a/lib/provider_class/hcp _provider.dart b/lib/contacts_module/provider_class/hcp _provider.dart similarity index 55% rename from lib/provider_class/hcp _provider.dart rename to lib/contacts_module/provider_class/hcp _provider.dart index 2e15d61..7863c40 100644 --- a/lib/provider_class/hcp _provider.dart +++ b/lib/contacts_module/provider_class/hcp _provider.dart @@ -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 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', + ]; + } + } } diff --git a/lib/contacts_module/provider_class/k2_provider/kol_aff_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_aff_provider.dart new file mode 100644 index 0000000..7f30ce6 --- /dev/null +++ b/lib/contacts_module/provider_class/k2_provider/kol_aff_provider.dart @@ -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 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 jsonData = json.decode(affdata); + // // final List 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(); + } +} diff --git a/lib/contacts_module/provider_class/k2_provider/kol_awards_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_awards_provider.dart new file mode 100644 index 0000000..f35468d --- /dev/null +++ b/lib/contacts_module/provider_class/k2_provider/kol_awards_provider.dart @@ -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 awalist = []; + + List get awardlist => awalist; + + awainfo(text) async { + print("Location_Text"); + final email_result = await apicall.getawarddata(text); + awalist = email_result!; + notifyListeners(); + } +} diff --git a/lib/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart new file mode 100644 index 0000000..922a2c5 --- /dev/null +++ b/lib/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart @@ -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 cerlist = []; + + List get certificatelist => cerlist; + + certificateinfo(text) async { + print("Location_Text"); + final email_result = await apicall.getcerlistdata(text); + cerlist = email_result!; + notifyListeners(); + } +} diff --git a/lib/contacts_module/provider_class/k2_provider/kol_education_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_education_provider.dart new file mode 100644 index 0000000..c6889ca --- /dev/null +++ b/lib/contacts_module/provider_class/k2_provider/kol_education_provider.dart @@ -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 edulist = []; + + List get educationlist => edulist; + + eduinfo(text) async { + print("Location_Text"); + final email_result = await apicall.getedulistdata(text); + edulist = email_result!; + notifyListeners(); + } +} diff --git a/lib/contacts_module/provider_class/k2_provider/kol_email_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_email_provider.dart new file mode 100644 index 0000000..04a5809 --- /dev/null +++ b/lib/contacts_module/provider_class/k2_provider/kol_email_provider.dart @@ -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 emaillist = []; + + List get emailkollist => emaillist; + + emailinfo(text) async { + print("Location_Text"); + final email_result = await apicall.getemaildata(text); + emaillist = email_result!; + notifyListeners(); + } +} diff --git a/lib/contacts_module/provider_class/k2_provider/kol_event_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_event_provider.dart new file mode 100644 index 0000000..8dacf19 --- /dev/null +++ b/lib/contacts_module/provider_class/k2_provider/kol_event_provider.dart @@ -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 = []; + + 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(); + } +} diff --git a/lib/contacts_module/provider_class/k2_provider/kol_list_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_list_provider.dart new file mode 100644 index 0000000..47c802d --- /dev/null +++ b/lib/contacts_module/provider_class/k2_provider/kol_list_provider.dart @@ -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()}"); + } +} diff --git a/lib/provider_class/location_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_locationprovider.dart similarity index 62% rename from lib/provider_class/location_provider.dart rename to lib/contacts_module/provider_class/k2_provider/kol_locationprovider.dart index b5ca471..d2383e0 100644 --- a/lib/provider_class/location_provider.dart +++ b/lib/contacts_module/provider_class/k2_provider/kol_locationprovider.dart @@ -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; diff --git a/lib/contacts_module/provider_class/k2_provider/kol_pno_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_pno_provider.dart new file mode 100644 index 0000000..33ffbc3 --- /dev/null +++ b/lib/contacts_module/provider_class/k2_provider/kol_pno_provider.dart @@ -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? phonelist = []; + + List get phonenolist => phonelist!; + + phonek2info(text) async { + print("Location_Text"); + final phone_result = await apicall.getphonedata(text); + phonelist = phone_result; + notifyListeners(); + } +} diff --git a/lib/contacts_module/provider_class/k2_provider/kol_training_provider.dart b/lib/contacts_module/provider_class/k2_provider/kol_training_provider.dart new file mode 100644 index 0000000..c4053ae --- /dev/null +++ b/lib/contacts_module/provider_class/k2_provider/kol_training_provider.dart @@ -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 tralist = []; + + List get traininglist => tralist; + + traininginfo(text) async { + print("Location_Text"); + final email_result = await apicall.gettrainingdata(text); + tralist = email_result!; + notifyListeners(); + } +} diff --git a/lib/contacts_module/provider_class/location_provider.dart b/lib/contacts_module/provider_class/location_provider.dart new file mode 100644 index 0000000..4dda768 --- /dev/null +++ b/lib/contacts_module/provider_class/location_provider.dart @@ -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); + } +} diff --git a/lib/provider_class/medicalinsightprovider.dart b/lib/contacts_module/provider_class/medicalinsightprovider.dart similarity index 80% rename from lib/provider_class/medicalinsightprovider.dart rename to lib/contacts_module/provider_class/medicalinsightprovider.dart index d1d7b40..4edc85e 100644 --- a/lib/provider_class/medicalinsightprovider.dart +++ b/lib/contacts_module/provider_class/medicalinsightprovider.dart @@ -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 { diff --git a/lib/provider_class/nih_provider.dart b/lib/contacts_module/provider_class/nih_provider.dart similarity index 55% rename from lib/provider_class/nih_provider.dart rename to lib/contacts_module/provider_class/nih_provider.dart index 04298f6..79663fe 100644 --- a/lib/provider_class/nih_provider.dart +++ b/lib/contacts_module/provider_class/nih_provider.dart @@ -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); + } } diff --git a/lib/provider_class/patent_provider.dart b/lib/contacts_module/provider_class/patent_provider.dart similarity index 54% rename from lib/provider_class/patent_provider.dart rename to lib/contacts_module/provider_class/patent_provider.dart index 4ecdfd9..fb79eae 100644 --- a/lib/provider_class/patent_provider.dart +++ b/lib/contacts_module/provider_class/patent_provider.dart @@ -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); + } } diff --git a/lib/provider_class/phoneno_provider.dart b/lib/contacts_module/provider_class/phoneno_provider.dart similarity index 53% rename from lib/provider_class/phoneno_provider.dart rename to lib/contacts_module/provider_class/phoneno_provider.dart index 6c86bd9..0759a45 100644 --- a/lib/provider_class/phoneno_provider.dart +++ b/lib/contacts_module/provider_class/phoneno_provider.dart @@ -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); + } } diff --git a/lib/provider_class/procedureprovider.dart b/lib/contacts_module/provider_class/procedureprovider.dart similarity index 56% rename from lib/provider_class/procedureprovider.dart rename to lib/contacts_module/provider_class/procedureprovider.dart index 84091d4..739b119 100644 --- a/lib/provider_class/procedureprovider.dart +++ b/lib/contacts_module/provider_class/procedureprovider.dart @@ -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); + } } diff --git a/lib/provider_class/publications_provider.dart b/lib/contacts_module/provider_class/publications_provider.dart similarity index 61% rename from lib/provider_class/publications_provider.dart rename to lib/contacts_module/provider_class/publications_provider.dart index 19c026a..b3884d0 100644 --- a/lib/provider_class/publications_provider.dart +++ b/lib/contacts_module/provider_class/publications_provider.dart @@ -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); + } } diff --git a/lib/provider_class/single_hcpprovider.dart b/lib/contacts_module/provider_class/single_hcpprovider.dart similarity index 74% rename from lib/provider_class/single_hcpprovider.dart rename to lib/contacts_module/provider_class/single_hcpprovider.dart index edc5f35..8e14f78 100644 --- a/lib/provider_class/single_hcpprovider.dart +++ b/lib/contacts_module/provider_class/single_hcpprovider.dart @@ -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 { diff --git a/lib/contacts_module/provider_class/speaker_provider.dart b/lib/contacts_module/provider_class/speaker_provider.dart new file mode 100644 index 0000000..5a11e38 --- /dev/null +++ b/lib/contacts_module/provider_class/speaker_provider.dart @@ -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); + } +} diff --git a/lib/provider_class/training_provider.dart b/lib/contacts_module/provider_class/training_provider.dart similarity index 53% rename from lib/provider_class/training_provider.dart rename to lib/contacts_module/provider_class/training_provider.dart index 3c370e5..f3362bf 100644 --- a/lib/provider_class/training_provider.dart +++ b/lib/contacts_module/provider_class/training_provider.dart @@ -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); + } } diff --git a/lib/provider_class/trials_provider.dart b/lib/contacts_module/provider_class/trials_provider.dart similarity index 51% rename from lib/provider_class/trials_provider.dart rename to lib/contacts_module/provider_class/trials_provider.dart index 1190c23..ad8c2df 100644 --- a/lib/provider_class/trials_provider.dart +++ b/lib/contacts_module/provider_class/trials_provider.dart @@ -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); + } } diff --git a/lib/row_class.dart b/lib/contacts_module/row_class.dart similarity index 100% rename from lib/row_class.dart rename to lib/contacts_module/row_class.dart diff --git a/lib/contacts_module/service.dart/k2_service/Apicall_k2.dart b/lib/contacts_module/service.dart/k2_service/Apicall_k2.dart new file mode 100644 index 0000000..a015398 --- /dev/null +++ b/lib/contacts_module/service.dart/k2_service/Apicall_k2.dart @@ -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 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 Json = json.decode(responsehcp.data); + + print("Singlejsondata : ${jsonresponse1}"); + return jsonresponse1; + } + + Future?> 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 = 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?> 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 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 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 kolLocation = jsonEvent.map((e) => Data.fromJson(e)).toList(); + + print("All_locDataaK22: ${kolLocation}"); + + return kolLocation; + } + } + + Future?> 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? datalist = dataPno.data; + + // List kol_pno = jsonpno.map((e) => pno.PhnoData.fromJson(e)).toList(); + + print("All_kol_pnoDataa123: ${datalist}"); + + // List 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?> 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? 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?> 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? 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?> 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? 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?> 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 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?> 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 = 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(); + } +} diff --git a/lib/contacts_module/service.dart/service.dart b/lib/contacts_module/service.dart/service.dart new file mode 100644 index 0000000..bc6bf22 --- /dev/null +++ b/lib/contacts_module/service.dart/service.dart @@ -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 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> filteredData = Affiliation['Affiliations'] +// // .where((item) => item['user_id'] == id) +// // .cast>() +// // .toList(); +// // print("filteredDatafilteredDatafilteredData: ${filteredData}"); + +// // // Print filtered data + +// // final List 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 publication = Publications['Publications']; + + // ///////////////////////////////////////////////////// + // final List> filteredData = Publications['Publications'] + // .where((item) => item['user_id'] == id) + // .cast>() + // .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 event = Events['Events']; + + // ///////////////////////////////////////////////////// + // final List> filteredData = Events['Events'] + // .where((item) => item['user_id'] == id) + // .cast>() + // .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 trials = Trials['Trials']; + // ///////////////////////////////////////////////////// + // final List> filteredData = Trials['Trials'] + // .where((item) => item['user_id'] == id) + // .cast>() + // .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 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 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 event = Location['Location']; + + // ///////////////////////////////////////////////////// + // final List> filteredData = Location['Location'] + // .where((item) => item['user_id'] == id) + // .cast>() + // .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 event = PhoneNo['Location']; + + // ///////////////////////////////////////////////////// + // final List> filteredData = PhoneNo['PhoneNo'] + // .where((item) => item['user_id'] == id) + // .cast>() + // .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 event = Email['Email']; + + // ///////////////////////////////////////////////////// + // final List> filteredData = Email['Email'] + // .where((item) => item['user_id'] == id) + // .cast>() + // .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 event = Patent['Patent']; + + // ///////////////////////////////////////////////////// + // final List> filteredData = Patent['Patent'] + // .where((item) => item['user_id'] == id) + // .cast>() + // .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 event = Certificate['Certificate']; + + // ///////////////////////////////////////////////////// + // final List> filteredData = Certificate['Certificate'] + // .where((item) => item['user_id'] == id) + // .cast>() + // .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 event = Education['Education']; + + // ///////////////////////////////////////////////////// + // final List> filteredData = Education['Education'] + // .where((item) => item['user_id'] == id) + // .cast>() + // .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 event = Awards['Awards']; + + // ///////////////////////////////////////////////////// + // final List> filteredData = Awards['Awards'] + // .where((item) => item['user_id'] == id) + // .cast>() + // .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 event = Training['Training']; + + // ///////////////////////////////////////////////////// + // final List> filteredData = Training['Training'] + // .where((item) => item['user_id'] == id) + // .cast>() + // .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 event = Nih['NIHGrants']; + + // ///////////////////////////////////////////////////// + // final List> filteredData = Nih['NIHGrants'] + // .where((item) => item['user_id'] == id) + // .cast>() + // .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 event = Pro['Procedure']; + + // ///////////////////////////////////////////////////// + // final List> filteredData = Pro['Procedure'] + // .where((item) => item['user_id'] == id) + // .cast>() + // .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(); + } +} diff --git a/lib/contacts_module/storage_hive/aff_data/aff_model_hive.dart b/lib/contacts_module/storage_hive/aff_data/aff_model_hive.dart new file mode 100644 index 0000000..baf6f40 --- /dev/null +++ b/lib/contacts_module/storage_hive/aff_data/aff_model_hive.dart @@ -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, + }); +} diff --git a/lib/contacts_module/storage_hive/aff_data/aff_model_hive.g.dart b/lib/contacts_module/storage_hive/aff_data/aff_model_hive.g.dart new file mode 100644 index 0000000..c3b8f3e --- /dev/null +++ b/lib/contacts_module/storage_hive/aff_data/aff_model_hive.g.dart @@ -0,0 +1,68 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'aff_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class AffiliationAdapter extends TypeAdapter { + @override + final int typeId = 30; + + @override + Affiliation read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + 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; +} diff --git a/lib/contacts_module/storage_hive/aff_data/insert_aff.dart b/lib/contacts_module/storage_hive/aff_data/insert_aff.dart new file mode 100644 index 0000000..cb24b27 --- /dev/null +++ b/lib/contacts_module/storage_hive/aff_data/insert_aff.dart @@ -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('affiliationshive'); + + var box = await Hive.openBox('affiliationshive'); + + print("IamAffiliation_dataaa: ${affilist}"); + + // Convert JSON list to List + List 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('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('affiliationshive'); + print('Retrive Doctor123 ${text}}'); + + var affiliations = box.get(text); + + List 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; +} diff --git a/lib/contacts_module/storage_hive/awa_data/awa_model_hive.dart b/lib/contacts_module/storage_hive/awa_data/awa_model_hive.dart new file mode 100644 index 0000000..6cf95ad --- /dev/null +++ b/lib/contacts_module/storage_hive/awa_data/awa_model_hive.dart @@ -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, + }); +} diff --git a/lib/contacts_module/storage_hive/awa_data/awa_model_hive.g.dart b/lib/contacts_module/storage_hive/awa_data/awa_model_hive.g.dart new file mode 100644 index 0000000..9437f2d --- /dev/null +++ b/lib/contacts_module/storage_hive/awa_data/awa_model_hive.g.dart @@ -0,0 +1,59 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'awa_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class AwaAdapter extends TypeAdapter { + @override + final int typeId = 40; + + @override + Awa read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + 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; +} diff --git a/lib/contacts_module/storage_hive/awa_data/crud_awa.dart b/lib/contacts_module/storage_hive/awa_data/crud_awa.dart new file mode 100644 index 0000000..417477f --- /dev/null +++ b/lib/contacts_module/storage_hive/awa_data/crud_awa.dart @@ -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('awahive'); +// + //var box = await Hive.openBox('affiliationshive'); + + // print("IamPublication_dataaa: ${publist},${publist.}"); + + // Convert JSON list to List + List 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 retrievePublications() async { +// var box = await Hive.openBox('pubhive'); +// print('Retrive Doctor}'); + +// List 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('awahive'); + + print('Retrive Doctor}'); + + var edus = box.get(id); + print('Retrive Doctor Eduuu ${edus}}'); + + List dataedu = []; + if (edus != null) { + dataedu.add(edus); // Add to the list if not null + } + return dataedu; +} diff --git a/lib/contacts_module/storage_hive/cer_hive/cer_model_hive.dart b/lib/contacts_module/storage_hive/cer_hive/cer_model_hive.dart new file mode 100644 index 0000000..ed1a9e0 --- /dev/null +++ b/lib/contacts_module/storage_hive/cer_hive/cer_model_hive.dart @@ -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, + }); +} diff --git a/lib/contacts_module/storage_hive/cer_hive/cer_model_hive.g.dart b/lib/contacts_module/storage_hive/cer_hive/cer_model_hive.g.dart new file mode 100644 index 0000000..c8938b8 --- /dev/null +++ b/lib/contacts_module/storage_hive/cer_hive/cer_model_hive.g.dart @@ -0,0 +1,59 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'cer_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class CerAdapter extends TypeAdapter { + @override + final int typeId = 41; + + @override + Cer read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + 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; +} diff --git a/lib/contacts_module/storage_hive/cer_hive/crud_cer.dart b/lib/contacts_module/storage_hive/cer_hive/crud_cer.dart new file mode 100644 index 0000000..99b74fa --- /dev/null +++ b/lib/contacts_module/storage_hive/cer_hive/crud_cer.dart @@ -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('cerhive'); +// + //var box = await Hive.openBox('affiliationshive'); + + // print("IamPublication_dataaa: ${publist},${publist.}"); + + // Convert JSON list to List + List 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 retrievePublications() async { +// var box = await Hive.openBox('pubhive'); +// print('Retrive Doctor}'); + +// List 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('cerhive'); + + print('Retrive Doctor}'); + + var cers = box.get(id); + print('Retrive Doctor Eduuu ${cers}}'); + + List datacer = []; + if (cers != null) { + datacer.add(cers); // Add to the list if not null + } + return datacer; +} diff --git a/lib/contacts_module/storage_hive/edu_data/crud_edu.dart b/lib/contacts_module/storage_hive/edu_data/crud_edu.dart new file mode 100644 index 0000000..3c8dcf6 --- /dev/null +++ b/lib/contacts_module/storage_hive/edu_data/crud_edu.dart @@ -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('edulhive'); +// + //var box = await Hive.openBox('affiliationshive'); + + // print("IamPublication_dataaa: ${publist},${publist.}"); + + // Convert JSON list to List + List 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 retrievePublications() async { +// var box = await Hive.openBox('pubhive'); +// print('Retrive Doctor}'); + +// List 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('edulhive'); + + print('Retrive Doctor}'); + + var edus = box.get(4); + print('Retrive Doctor Eduuu ${edus}}'); + + List dataedu = []; + if (edus != null) { + dataedu.add(edus); // Add to the list if not null + } + return dataedu; +} diff --git a/lib/contacts_module/storage_hive/edu_data/edu_model_hive.dart b/lib/contacts_module/storage_hive/edu_data/edu_model_hive.dart new file mode 100644 index 0000000..00371ef --- /dev/null +++ b/lib/contacts_module/storage_hive/edu_data/edu_model_hive.dart @@ -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, + }); +} diff --git a/lib/contacts_module/storage_hive/edu_data/edu_model_hive.g.dart b/lib/contacts_module/storage_hive/edu_data/edu_model_hive.g.dart new file mode 100644 index 0000000..c357644 --- /dev/null +++ b/lib/contacts_module/storage_hive/edu_data/edu_model_hive.g.dart @@ -0,0 +1,59 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'edu_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class EduAdapter extends TypeAdapter { + @override + final int typeId = 39; + + @override + Edu read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + 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; +} diff --git a/lib/contacts_module/storage_hive/email_data/crud_email.dart b/lib/contacts_module/storage_hive/email_data/crud_email.dart new file mode 100644 index 0000000..6cd7c76 --- /dev/null +++ b/lib/contacts_module/storage_hive/email_data/crud_email.dart @@ -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('emailhive'); +// + //var box = await Hive.openBox('affiliationshive'); + + // print("IamPublication_dataaa: ${publist},${publist.}"); + + // Convert JSON list to List + List 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 retrievePublications() async { +// var box = await Hive.openBox('pubhive'); +// print('Retrive Doctor}'); + +// List 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('emailhive'); + print('Retrive Doctor}'); + + var pnos = box.get(id); + print('Retrive Doctor locations ${pnos}}'); + + List dataemail = []; + if (pnos != null) { + dataemail.add(pnos); // Add to the list if not null + } + return dataemail; +} diff --git a/lib/contacts_module/storage_hive/email_data/email_model_hive.dart b/lib/contacts_module/storage_hive/email_data/email_model_hive.dart new file mode 100644 index 0000000..bb51363 --- /dev/null +++ b/lib/contacts_module/storage_hive/email_data/email_model_hive.dart @@ -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, + }); +} diff --git a/lib/contacts_module/storage_hive/email_data/email_model_hive.g.dart b/lib/contacts_module/storage_hive/email_data/email_model_hive.g.dart new file mode 100644 index 0000000..1e697d2 --- /dev/null +++ b/lib/contacts_module/storage_hive/email_data/email_model_hive.g.dart @@ -0,0 +1,50 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'email_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class EmailAdapter extends TypeAdapter { + @override + final int typeId = 38; + + @override + Email read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + 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; +} diff --git a/lib/contacts_module/storage_hive/events_data/crud_event.dart b/lib/contacts_module/storage_hive/events_data/crud_event.dart new file mode 100644 index 0000000..e48964d --- /dev/null +++ b/lib/contacts_module/storage_hive/events_data/crud_event.dart @@ -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('eventhive'); +// + //var box = await Hive.openBox('affiliationshive'); + + // print("IamPublication_dataaa: ${publist},${publist.}"); + + // Convert JSON list to List + List 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 retrieveEventss() async { + var box = await Hive.openBox('eventhive'); + print('Retrive Doctor}'); + + List 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('eventhive'); + print('Retrive Doctor}'); + + var events = box.get(id); + print('Retrive Doctor publications ${events}}'); + + List datapub = []; + if (events != null) { + datapub.add(events); // Add to the list if not null + } + return datapub; +} diff --git a/lib/contacts_module/storage_hive/events_data/event_model_hive.dart b/lib/contacts_module/storage_hive/events_data/event_model_hive.dart new file mode 100644 index 0000000..2338455 --- /dev/null +++ b/lib/contacts_module/storage_hive/events_data/event_model_hive.dart @@ -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, + }); +} diff --git a/lib/contacts_module/storage_hive/events_data/event_model_hive.g.dart b/lib/contacts_module/storage_hive/events_data/event_model_hive.g.dart new file mode 100644 index 0000000..35b138c --- /dev/null +++ b/lib/contacts_module/storage_hive/events_data/event_model_hive.g.dart @@ -0,0 +1,104 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'event_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class EventsAdapter extends TypeAdapter { + @override + final int typeId = 33; + + @override + Events read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + 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; +} diff --git a/lib/contacts_module/storage_hive/kol_info/curd_kol.dart b/lib/contacts_module/storage_hive/kol_info/curd_kol.dart new file mode 100644 index 0000000..4dc6f5f --- /dev/null +++ b/lib/contacts_module/storage_hive/kol_info/curd_kol.dart @@ -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 kollist) async { + var box = await Hive.openBox('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('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('kolshive'); + + print("DeletingKolll"); + + await box.delete(id); +} + +searchkol(String query) async { + var box = await Hive.openBox('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(); +} diff --git a/lib/contacts_module/storage_hive/kol_info/kol_info_model_hive.dart b/lib/contacts_module/storage_hive/kol_info/kol_info_model_hive.dart new file mode 100644 index 0000000..1751520 --- /dev/null +++ b/lib/contacts_module/storage_hive/kol_info/kol_info_model_hive.dart @@ -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}); +} diff --git a/lib/contacts_module/storage_hive/kol_info/kol_info_model_hive.g.dart b/lib/contacts_module/storage_hive/kol_info/kol_info_model_hive.g.dart new file mode 100644 index 0000000..baf20a5 --- /dev/null +++ b/lib/contacts_module/storage_hive/kol_info/kol_info_model_hive.g.dart @@ -0,0 +1,80 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'kol_info_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class KolInfoAdapter extends TypeAdapter { + @override + final int typeId = 31; + + @override + KolInfo read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + 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; +} diff --git a/lib/contacts_module/storage_hive/loc_data/crud_loc.dart b/lib/contacts_module/storage_hive/loc_data/crud_loc.dart new file mode 100644 index 0000000..466c30f --- /dev/null +++ b/lib/contacts_module/storage_hive/loc_data/crud_loc.dart @@ -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('lochive'); +// + //var box = await Hive.openBox('affiliationshive'); + + // print("IamPublication_dataaa: ${publist},${publist.}"); + + // Convert JSON list to List + List 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 retrievePublications() async { +// var box = await Hive.openBox('pubhive'); +// print('Retrive Doctor}'); + +// List 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('lochive'); + print('Retrive Doctor}'); + + var locations = box.get(id); + print('Retrive Doctor locations ${locations}}'); + + List dataloc = []; + if (locations != null) { + dataloc.add(locations); // Add to the list if not null + } + return dataloc; +} diff --git a/lib/contacts_module/storage_hive/loc_data/location_model_hive.dart b/lib/contacts_module/storage_hive/loc_data/location_model_hive.dart new file mode 100644 index 0000000..666b0cd --- /dev/null +++ b/lib/contacts_module/storage_hive/loc_data/location_model_hive.dart @@ -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, + }); +} diff --git a/lib/contacts_module/storage_hive/loc_data/location_model_hive.g.dart b/lib/contacts_module/storage_hive/loc_data/location_model_hive.g.dart new file mode 100644 index 0000000..9904d8c --- /dev/null +++ b/lib/contacts_module/storage_hive/loc_data/location_model_hive.g.dart @@ -0,0 +1,59 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'location_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class LocationAdapter extends TypeAdapter { + @override + final int typeId = 36; + + @override + Location read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + 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; +} diff --git a/lib/contacts_module/storage_hive/nih_grant_data/crud_nih.dart b/lib/contacts_module/storage_hive/nih_grant_data/crud_nih.dart new file mode 100644 index 0000000..b0cb95a --- /dev/null +++ b/lib/contacts_module/storage_hive/nih_grant_data/crud_nih.dart @@ -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('nihhive'); + + List 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('nihhive'); + + print('Retrive Doctor}'); + + var nihs = box.get(id); + print('Retrive Doctor Eduuu ${nihs}}'); + + List datanih = []; + if (nihs != null) { + datanih.add(nihs); // Add to the list if not null + } + return datanih; +} diff --git a/lib/contacts_module/storage_hive/nih_grant_data/nih_model_hive.dart b/lib/contacts_module/storage_hive/nih_grant_data/nih_model_hive.dart new file mode 100644 index 0000000..019770b --- /dev/null +++ b/lib/contacts_module/storage_hive/nih_grant_data/nih_model_hive.dart @@ -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, + }); +} diff --git a/lib/contacts_module/storage_hive/nih_grant_data/nih_model_hive.g.dart b/lib/contacts_module/storage_hive/nih_grant_data/nih_model_hive.g.dart new file mode 100644 index 0000000..513a9e4 --- /dev/null +++ b/lib/contacts_module/storage_hive/nih_grant_data/nih_model_hive.g.dart @@ -0,0 +1,95 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'nih_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class NihAdapter extends TypeAdapter { + @override + final int typeId = 43; + + @override + Nih read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + 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; +} diff --git a/lib/contacts_module/storage_hive/note_data/crud_note.dart b/lib/contacts_module/storage_hive/note_data/crud_note.dart new file mode 100644 index 0000000..7d961d9 --- /dev/null +++ b/lib/contacts_module/storage_hive/note_data/crud_note.dart @@ -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 box = Hive.box('notehive'); + +addNote(String text) async { + // var box = await Hive.openBox('notehive'); + + print("Text_issss: $text"); + + box.add(text); // Save text with a key +} + +List getText() { + //var box = await Hive.openBox('notehive'); + print("SavedNotesssL : ${box.values.toList()}"); + return box.values.toList(); +} diff --git a/lib/contacts_module/storage_hive/note_data/note_model_hive.dart b/lib/contacts_module/storage_hive/note_data/note_model_hive.dart new file mode 100644 index 0000000..d842c22 --- /dev/null +++ b/lib/contacts_module/storage_hive/note_data/note_model_hive.dart @@ -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, + }); +} diff --git a/lib/contacts_module/storage_hive/note_data/note_model_hive.g.dart b/lib/contacts_module/storage_hive/note_data/note_model_hive.g.dart new file mode 100644 index 0000000..612832d --- /dev/null +++ b/lib/contacts_module/storage_hive/note_data/note_model_hive.g.dart @@ -0,0 +1,44 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'note_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class NoteAdapter extends TypeAdapter { + @override + final int typeId = 47; + + @override + Note read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Note( + id: fields[0] as int, + note: fields[1] as String?, + ); + } + + @override + void write(BinaryWriter writer, Note obj) { + writer + ..writeByte(2) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.note); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is NoteAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/contacts_module/storage_hive/patent_data/crud_patent.dart b/lib/contacts_module/storage_hive/patent_data/crud_patent.dart new file mode 100644 index 0000000..fefd723 --- /dev/null +++ b/lib/contacts_module/storage_hive/patent_data/crud_patent.dart @@ -0,0 +1,40 @@ +// import 'package:discover_module/storage_hive/awa_data/awa_model_hive.dart'; +// import 'package:discover_module/storage_hive/patent_data/patent_model_hive.dart'; + +import 'package:discover_module/contacts_module/storage_hive/patent_data/patent_model_hive.dart'; +import 'package:hive_flutter/hive_flutter.dart'; + +addPatent(List cerpat) async { + var box = await Hive.openBox('pethive'); + + List pets = cerpat.map((json) { + return Patent( + id: json.id, + userId: json.userId, + patentTitle: json.patentTitle ?? '', + status: json.status ?? '', + ); + }).toList(); + + print("Eduactionnsss ${pets}"); + + for (var pet in pets) { + print("Storing_Eduactionnsss: ${pet.patentTitle}"); + await box.put(pet.id, pet); // Use `put` with id as key + } +} + +retrieveidpatent(int id) async { + var box = await Hive.openBox('pethive'); + + print('Retrive Doctor}'); + + var cers = box.get(id); + print('Retrive Doctor Eduuu ${cers}}'); + + List datapet = []; + if (cers != null) { + datapet.add(cers); // Add to the list if not null + } + return datapet; +} diff --git a/lib/contacts_module/storage_hive/patent_data/patent_model_hive.dart b/lib/contacts_module/storage_hive/patent_data/patent_model_hive.dart new file mode 100644 index 0000000..3bbc7a9 --- /dev/null +++ b/lib/contacts_module/storage_hive/patent_data/patent_model_hive.dart @@ -0,0 +1,24 @@ +import 'package:hive_flutter/hive_flutter.dart'; +part 'patent_model_hive.g.dart'; // This part file will be generated + +@HiveType(typeId: 42) +class Patent extends HiveObject { + @HiveField(0) + final int id; + + @HiveField(1) + final int userId; + + @HiveField(2) + final String? patentTitle; + + @HiveField(3) + final String? status; + + Patent({ + required this.id, + required this.userId, + this.patentTitle, + this.status, + }); +} diff --git a/lib/contacts_module/storage_hive/patent_data/patent_model_hive.g.dart b/lib/contacts_module/storage_hive/patent_data/patent_model_hive.g.dart new file mode 100644 index 0000000..c57cbf8 --- /dev/null +++ b/lib/contacts_module/storage_hive/patent_data/patent_model_hive.g.dart @@ -0,0 +1,50 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'patent_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class PatentAdapter extends TypeAdapter { + @override + final int typeId = 42; + + @override + Patent read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Patent( + id: fields[0] as int, + userId: fields[1] as int, + patentTitle: fields[2] as String?, + status: fields[3] as String?, + ); + } + + @override + void write(BinaryWriter writer, Patent obj) { + writer + ..writeByte(4) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.userId) + ..writeByte(2) + ..write(obj.patentTitle) + ..writeByte(3) + ..write(obj.status); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PatentAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/contacts_module/storage_hive/pno_data/crud_pno.dart b/lib/contacts_module/storage_hive/pno_data/crud_pno.dart new file mode 100644 index 0000000..58831ff --- /dev/null +++ b/lib/contacts_module/storage_hive/pno_data/crud_pno.dart @@ -0,0 +1,60 @@ +// 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/pno_data/pno_model_hive.dart'; +import 'package:hive_flutter/hive_flutter.dart'; + +addPno(List pnolist) async { + // static final apihcpdata = Hive.box("hcpdata"); + + var box = await Hive.openBox('pnohive'); +// + //var box = await Hive.openBox('affiliationshive'); + + // print("IamPublication_dataaa: ${publist},${publist.}"); + + // Convert JSON list to List + List pnonos = pnolist.map((json) { + return PhoneNo( + id: json.id, + userId: json.userId, + phoneType: json.phoneType ?? '', + locations: json.locations ?? '', + phoneNumber: json.phoneNumber ?? '', + ); + }).toList(); + + print("Publicattionnsss_isss: ${pnonos}"); + + for (var pno in pnonos) { + print("Storing_Affff: ${pno.phoneNumber}"); + await box.put(pno.id, pno); // Use `put` with id as key + } +} + +// Future retrievePublications() async { +// var box = await Hive.openBox('pubhive'); +// print('Retrive Doctor}'); + +// List 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 +// } +// } + +retrieveidpnos(int id) async { + var box = await Hive.openBox('pnohive'); + print('Retrive Doctor}'); + + var pnos = box.get(id); + print('Retrive Doctor locations ${pnos}}'); + + List datapno = []; + if (pnos != null) { + datapno.add(pnos); // Add to the list if not null + } + return datapno; +} diff --git a/lib/contacts_module/storage_hive/pno_data/pno_model_hive.dart b/lib/contacts_module/storage_hive/pno_data/pno_model_hive.dart new file mode 100644 index 0000000..008cd44 --- /dev/null +++ b/lib/contacts_module/storage_hive/pno_data/pno_model_hive.dart @@ -0,0 +1,29 @@ +import 'package:hive_flutter/hive_flutter.dart'; +part 'pno_model_hive.g.dart'; // This part file will be generated + +@HiveType(typeId: 37) +class PhoneNo extends HiveObject { + @HiveField(0) + final int id; + + @HiveField(1) + final int userId; + + @HiveField(2) + final String? phoneType; + + @HiveField(3) + final String? locations; + + @HiveField(4) + final String? phoneNumber; + + PhoneNo({ + required this.id, + required this.userId, + this.phoneType, + this.locations, + this.phoneNumber, + e, + }); +} diff --git a/lib/contacts_module/storage_hive/pno_data/pno_model_hive.g.dart b/lib/contacts_module/storage_hive/pno_data/pno_model_hive.g.dart new file mode 100644 index 0000000..05b4c27 --- /dev/null +++ b/lib/contacts_module/storage_hive/pno_data/pno_model_hive.g.dart @@ -0,0 +1,53 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'pno_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class PhoneNoAdapter extends TypeAdapter { + @override + final int typeId = 37; + + @override + PhoneNo read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return PhoneNo( + id: fields[0] as int, + userId: fields[1] as int, + phoneType: fields[2] as String?, + locations: fields[3] as String?, + phoneNumber: fields[4] as String?, + ); + } + + @override + void write(BinaryWriter writer, PhoneNo obj) { + writer + ..writeByte(5) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.userId) + ..writeByte(2) + ..write(obj.phoneType) + ..writeByte(3) + ..write(obj.locations) + ..writeByte(4) + ..write(obj.phoneNumber); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PhoneNoAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/contacts_module/storage_hive/procedure_data/crud_pro.dart b/lib/contacts_module/storage_hive/procedure_data/crud_pro.dart new file mode 100644 index 0000000..e8c5cbc --- /dev/null +++ b/lib/contacts_module/storage_hive/procedure_data/crud_pro.dart @@ -0,0 +1,44 @@ +// import 'package:discover_module/storage_hive/procedure_data/pro_model_hive.dart'; + +import 'package:discover_module/contacts_module/storage_hive/procedure_data/pro_model_hive.dart'; +import 'package:hive_flutter/hive_flutter.dart'; + +addPro(List nihlist) async { + var box = await Hive.openBox('prohive'); + + List pros = nihlist.map((json) { + return Pro( + id: json.id, + userId: json.userId, + procedureCode: json.procedureCode.toString() ?? '', + placeOfService: json.placeOfService ?? '', + totalBeneficiaries: json.totalBeneficiaries.toString() ?? '', + totalServices: json.totalServices.toString() ?? '', + totalBeneDayServices: json.totalBeneDayServices.toString() ?? '', + programYear: json.programYear.toString() ?? '', + procedure: json.procedure.toString() ?? '', + ); + }).toList(); + + print("Eduactionnsss ${pros}"); + + for (var pro in pros) { + print("Storing_Eduactionnsss: ${pro.placeOfService}"); + await box.put(pro.id, pro); // Use `put` with id as key + } +} + +retrieveidpro(int id) async { + var box = await Hive.openBox('prohive'); + + print('Retrive Doctor}'); + + var pros = box.get(id); + print('Retrive Doctor Procedure123 ${pros}'); + + List datapro = []; + if (pros != null) { + datapro.add(pros); // Add to the list if not null + } + return datapro; +} diff --git a/lib/contacts_module/storage_hive/procedure_data/pro_model_hive.dart b/lib/contacts_module/storage_hive/procedure_data/pro_model_hive.dart new file mode 100644 index 0000000..1dbec67 --- /dev/null +++ b/lib/contacts_module/storage_hive/procedure_data/pro_model_hive.dart @@ -0,0 +1,43 @@ +import 'package:hive_flutter/hive_flutter.dart'; +part 'pro_model_hive.g.dart'; // This part file will be generated + +@HiveType(typeId: 44) +class Pro extends HiveObject { + @HiveField(0) + final int id; + + @HiveField(1) + final int userId; + + @HiveField(2) + final String? procedureCode; + + @HiveField(3) + final String? placeOfService; + + @HiveField(4) + final String? totalBeneficiaries; + + @HiveField(5) + final String? totalServices; + + @HiveField(6) + final String? totalBeneDayServices; + + @HiveField(7) + final String? programYear; + + @HiveField(8) + final String? procedure; + + Pro( + {required this.id, + required this.userId, + this.procedureCode, + this.placeOfService, + this.totalBeneficiaries, + this.totalServices, + this.totalBeneDayServices, + this.programYear, + this.procedure}); +} diff --git a/lib/contacts_module/storage_hive/procedure_data/pro_model_hive.g.dart b/lib/contacts_module/storage_hive/procedure_data/pro_model_hive.g.dart new file mode 100644 index 0000000..86443f3 --- /dev/null +++ b/lib/contacts_module/storage_hive/procedure_data/pro_model_hive.g.dart @@ -0,0 +1,65 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'pro_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class ProAdapter extends TypeAdapter { + @override + final int typeId = 44; + + @override + Pro read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Pro( + id: fields[0] as int, + userId: fields[1] as int, + procedureCode: fields[2] as String?, + placeOfService: fields[3] as String?, + totalBeneficiaries: fields[4] as String?, + totalServices: fields[5] as String?, + totalBeneDayServices: fields[6] as String?, + programYear: fields[7] as String?, + procedure: fields[8] as String?, + ); + } + + @override + void write(BinaryWriter writer, Pro obj) { + writer + ..writeByte(9) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.userId) + ..writeByte(2) + ..write(obj.procedureCode) + ..writeByte(3) + ..write(obj.placeOfService) + ..writeByte(4) + ..write(obj.totalBeneficiaries) + ..writeByte(5) + ..write(obj.totalServices) + ..writeByte(6) + ..write(obj.totalBeneDayServices) + ..writeByte(7) + ..write(obj.programYear) + ..writeByte(8) + ..write(obj.procedure); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ProAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/contacts_module/storage_hive/pub_data/curd_pub.dart b/lib/contacts_module/storage_hive/pub_data/curd_pub.dart new file mode 100644 index 0000000..3c28b0b --- /dev/null +++ b/lib/contacts_module/storage_hive/pub_data/curd_pub.dart @@ -0,0 +1,64 @@ +import 'package:discover_module/contacts_module/storage_hive/pub_data/pub_model_hive.dart'; +// import 'package:discover_module/storage_hive/pub_data/pub_model_hive.dart'; +import 'package:hive_flutter/hive_flutter.dart'; + +addPublication(List publist) async { + // static final apihcpdata = Hive.box("hcpdata"); + + var box = await Hive.openBox('pubhive'); +// + //var box = await Hive.openBox('affiliationshive'); + + // print("IamPublication_dataaa: ${publist},${publist.}"); + + // Convert JSON list to List + List publications = publist.map((json) { + return Publication( + id: json.id, + user_id: json.userId, + artical_title: json.articalTitle ?? '', + pmid: '', + journal_name: json.journalName ?? '', + date: json.date.toString() ?? '', + author: json.author ?? '', + auth_pos: '', + meshterms: '', + authorshipType: '', + kol_name: ''); + }).toList(); + + print("Publicattionnsss_isss: ${publications}"); + + for (var pub in publications) { + print("Storing_Affff: ${pub.artical_title}"); + await box.put(pub.id, pub); // Use `put` with id as key + } +} + +Future retrievePublications() async { + var box = await Hive.openBox('pubhive'); + print('Retrive Doctor}'); + + List 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 + } +} + +retrieveidPublications(int id) async { + var box = await Hive.openBox('pubhive'); + print('Retrive Doctor}'); + + var publications = box.get(id); + print('Retrive Doctor publications ${publications}}'); + + List datapub = []; + if (publications != null) { + datapub.add(publications); // Add to the list if not null + } + return datapub; +} diff --git a/lib/contacts_module/storage_hive/pub_data/pub_model_hive.dart b/lib/contacts_module/storage_hive/pub_data/pub_model_hive.dart new file mode 100644 index 0000000..fffe64f --- /dev/null +++ b/lib/contacts_module/storage_hive/pub_data/pub_model_hive.dart @@ -0,0 +1,52 @@ +import 'package:hive_flutter/hive_flutter.dart'; +part 'pub_model_hive.g.dart'; // This part file will be generated + +@HiveType(typeId: 32) +class Publication extends HiveObject { + @HiveField(0) + final int id; + + @HiveField(1) + final int user_id; + + @HiveField(2) + final String? artical_title; + + @HiveField(3) + final String? pmid; + + @HiveField(4) + final String? journal_name; + + @HiveField(5) + final String? date; + + @HiveField(6) + final String? author; + + @HiveField(7) + final String? auth_pos; + + @HiveField(8) + final String? meshterms; + + @HiveField(9) + final String? authorshipType; + + @HiveField(10) + final String? kol_name; + + Publication({ + required this.id, + required this.user_id, + this.artical_title, + this.pmid, + this.journal_name, + this.date, + this.author, + this.auth_pos, + this.meshterms, + this.authorshipType, + this.kol_name, + }); +} diff --git a/lib/contacts_module/storage_hive/pub_data/pub_model_hive.g.dart b/lib/contacts_module/storage_hive/pub_data/pub_model_hive.g.dart new file mode 100644 index 0000000..54c4af6 --- /dev/null +++ b/lib/contacts_module/storage_hive/pub_data/pub_model_hive.g.dart @@ -0,0 +1,71 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'pub_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class PublicationAdapter extends TypeAdapter { + @override + final int typeId = 32; + + @override + Publication read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Publication( + id: fields[0] as int, + user_id: fields[1] as int, + artical_title: fields[2] as String?, + pmid: fields[3] as String?, + journal_name: fields[4] as String?, + date: fields[5] as String?, + author: fields[6] as String?, + auth_pos: fields[7] as String?, + meshterms: fields[8] as String?, + authorshipType: fields[9] as String?, + kol_name: fields[10] as String?, + ); + } + + @override + void write(BinaryWriter writer, Publication obj) { + writer + ..writeByte(11) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.user_id) + ..writeByte(2) + ..write(obj.artical_title) + ..writeByte(3) + ..write(obj.pmid) + ..writeByte(4) + ..write(obj.journal_name) + ..writeByte(5) + ..write(obj.date) + ..writeByte(6) + ..write(obj.author) + ..writeByte(7) + ..write(obj.auth_pos) + ..writeByte(8) + ..write(obj.meshterms) + ..writeByte(9) + ..write(obj.authorshipType) + ..writeByte(10) + ..write(obj.kol_name); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is PublicationAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/contacts_module/storage_hive/speaker_data/crud.speaker.dart b/lib/contacts_module/storage_hive/speaker_data/crud.speaker.dart new file mode 100644 index 0000000..0411802 --- /dev/null +++ b/lib/contacts_module/storage_hive/speaker_data/crud.speaker.dart @@ -0,0 +1,42 @@ +// import 'package:discover_module/storage_hive/speaker_data/speaker_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/speaker_data/speaker_model_hive.dart'; +import 'package:hive_flutter/hive_flutter.dart'; + +addSpeaker(List nihlist) async { + var box = await Hive.openBox('speahive'); + + List pros = nihlist.map((json) { + return Spe( + id: json.id, + programtopic: json.programtopic, + speakername: json.speakername.toString() ?? '', + role: json.role ?? '', + evaluatorname: json.evaluatorname.toString() ?? '', + programdate: json.programdate.toString() ?? '', + createdAt: json.createdAt.toString() ?? '', + updatedAt: json.updatedAt.toString() ?? '', + ); + }).toList(); + + print("Eduactionnsss ${pros}"); + + for (var pro in pros) { + print("Storing_Eduactionnsss: ${pro.evaluatorname}"); + await box.put(pro.id, pro); // Use `put` with id as key + } +} + +retrieveidspeaker(int id) async { + var box = await Hive.openBox('speahive'); + + print('Retrive Doctor}'); + + var pros = box.get(id); + print('Retrive Doctor Procedure123 ${pros}'); + + List datapro = []; + if (pros != null) { + datapro.add(pros); // Add to the list if not null + } + return datapro; +} diff --git a/lib/contacts_module/storage_hive/speaker_data/speaker_model_hive.dart b/lib/contacts_module/storage_hive/speaker_data/speaker_model_hive.dart new file mode 100644 index 0000000..4b47076 --- /dev/null +++ b/lib/contacts_module/storage_hive/speaker_data/speaker_model_hive.dart @@ -0,0 +1,39 @@ +import 'package:hive_flutter/hive_flutter.dart'; +part 'speaker_model_hive.g.dart'; // This part file will be generated + +@HiveType(typeId: 46) +class Spe extends HiveObject { + @HiveField(0) + final int id; + + @HiveField(1) + final String? programtopic; + + @HiveField(2) + final String? role; + + @HiveField(3) + final String? evaluatorname; + + @HiveField(4) + final String? programdate; + + @HiveField(5) + final String? createdAt; + + @HiveField(6) + final String? updatedAt; + + @HiveField(7) + final String? speakername; + + Spe( + {required this.id, + this.programtopic, + this.role, + this.evaluatorname, + this.programdate, + this.createdAt, + this.updatedAt, + this.speakername}); +} diff --git a/lib/contacts_module/storage_hive/speaker_data/speaker_model_hive.g.dart b/lib/contacts_module/storage_hive/speaker_data/speaker_model_hive.g.dart new file mode 100644 index 0000000..42626a8 --- /dev/null +++ b/lib/contacts_module/storage_hive/speaker_data/speaker_model_hive.g.dart @@ -0,0 +1,62 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'speaker_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class SpeAdapter extends TypeAdapter { + @override + final int typeId = 46; + + @override + Spe read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Spe( + id: fields[0] as int, + programtopic: fields[1] as String?, + role: fields[2] as String?, + evaluatorname: fields[3] as String?, + programdate: fields[4] as String?, + createdAt: fields[5] as String?, + updatedAt: fields[6] as String?, + speakername: fields[7] as String?, + ); + } + + @override + void write(BinaryWriter writer, Spe obj) { + writer + ..writeByte(8) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.programtopic) + ..writeByte(2) + ..write(obj.role) + ..writeByte(3) + ..write(obj.evaluatorname) + ..writeByte(4) + ..write(obj.programdate) + ..writeByte(5) + ..write(obj.createdAt) + ..writeByte(6) + ..write(obj.updatedAt) + ..writeByte(7) + ..write(obj.speakername); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is SpeAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/contacts_module/storage_hive/traning_data/crud_training.dart b/lib/contacts_module/storage_hive/traning_data/crud_training.dart new file mode 100644 index 0000000..74bb001 --- /dev/null +++ b/lib/contacts_module/storage_hive/traning_data/crud_training.dart @@ -0,0 +1,41 @@ +// import 'package:discover_module/storage_hive/traning_data/traning_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/traning_data/traning_model_hive.dart'; +import 'package:hive_flutter/hive_flutter.dart'; + +addtraining(List nihlist) async { + var box = await Hive.openBox('traininghive'); + + List trai = nihlist.map((json) { + return Training1( + id: json.id, + userId: json.userId, + educationType: json.educationType ?? '', + institutionName: json.institutionName ?? '', + degree: json.degree.toString() ?? '', + specialty: json.specialty.toString() ?? '', + timeFrame: json.timeFrame.toString() ?? '', + ); + }).toList(); + + print("Eduactionnsss ${trai}"); + + for (var pro in trai) { + print("Storing_Eduactionnsss: ${pro.institutionName}"); + await box.put(pro.id, pro); // Use `put` with id as key + } +} + +retrieveidtri(int id) async { + var box = await Hive.openBox('traininghive'); + + print('Retrive Doctor}'); + + var tris = box.get(id); + print('Retrive Doctor Procedure123 ${tris}'); + + List datatri = []; + if (tris != null) { + datatri.add(tris); // Add to the list if not null + } + return datatri; +} diff --git a/lib/contacts_module/storage_hive/traning_data/traning_model_hive.dart b/lib/contacts_module/storage_hive/traning_data/traning_model_hive.dart new file mode 100644 index 0000000..f495a7a --- /dev/null +++ b/lib/contacts_module/storage_hive/traning_data/traning_model_hive.dart @@ -0,0 +1,36 @@ +import 'package:hive_flutter/hive_flutter.dart'; +part 'traning_model_hive.g.dart'; // This part file will be generated + +@HiveType(typeId: 45) +class Training1 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; + + Training1({ + required this.id, + required this.userId, + this.educationType, + this.institutionName, + this.degree, + this.specialty, + this.timeFrame, + }); +} diff --git a/lib/contacts_module/storage_hive/traning_data/traning_model_hive.g.dart b/lib/contacts_module/storage_hive/traning_data/traning_model_hive.g.dart new file mode 100644 index 0000000..a022b9b --- /dev/null +++ b/lib/contacts_module/storage_hive/traning_data/traning_model_hive.g.dart @@ -0,0 +1,59 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'traning_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class Training1Adapter extends TypeAdapter { + @override + final int typeId = 45; + + @override + Training1 read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Training1( + 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, Training1 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 Training1Adapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/contacts_module/storage_hive/trials_data/crud_trials.dart b/lib/contacts_module/storage_hive/trials_data/crud_trials.dart new file mode 100644 index 0000000..4f71bf3 --- /dev/null +++ b/lib/contacts_module/storage_hive/trials_data/crud_trials.dart @@ -0,0 +1,80 @@ +// import 'package:discover_module/storage_hive/events_data/event_model_hive.dart'; +// import 'package:discover_module/storage_hive/trials_data/trial_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/trials_data/trial_model_hive.dart'; +import 'package:hive_flutter/hive_flutter.dart'; + +addTrials(List publist) async { + // static final apihcpdata = Hive.box("hcpdata"); + + var box = await Hive.openBox('trialshive'); +// + //var box = await Hive.openBox('affiliationshive'); + + // print("IamPublication_dataaa: ${publist},${publist.}"); + + // Convert JSON list to List + List trials = publist.map((json) { + return Trials( + id: json.id, + userId: json.userId, + ct_id: json.ctId ?? '', + study_Type: '', + trial_name: json.trialName ?? '', + condition: json.condition ?? '', + intervention: json.intervention ?? '', + phase: json.phase ?? '', + role: '', + enrollees: '', + trial_sites: '', + sponsors: '', + status: '', + start_Date: '', + end_Date: '', + min_Age: '', + max_Age: '', + gender: '', + investigators: '', + collaborator: '', + purpose: '', + official_Title: '', + keywords: '', + meSH_Terms: '', + url: '', + ); + }).toList(); + + print("Events_isss: ${trials}"); + + for (var trials in trials) { + print("Storing_Affff: ${trials.trial_name}"); + await box.put(trials.id, trials); // Use `put` with id as key + } +} + +Future retrieveTrials() async { + var box = await Hive.openBox('trialshive'); + print('Retrive Doctor}'); + + List events1 = box.values.toList(); + print('Retrive Doctor Trials ${events1}}'); + + for (var Events in events1) { + print('Retrive Trials Name: ${Events.trial_name}'); + print('Trials: ${Events.status}'); + // Access other fields as needed + } +} + +retrieveidTrials(int id) async { + var box = await Hive.openBox('trialshive'); + print('Retrive Doctor}'); + + var trials = box.get(id); + print('Retrive Doctor publications ${trials}}'); + + List datatrials = []; + if (trials != null) { + datatrials.add(trials); // Add to the list if not null + } + return datatrials; +} diff --git a/lib/contacts_module/storage_hive/trials_data/trial_model_hive.dart b/lib/contacts_module/storage_hive/trials_data/trial_model_hive.dart new file mode 100644 index 0000000..a917c01 --- /dev/null +++ b/lib/contacts_module/storage_hive/trials_data/trial_model_hive.dart @@ -0,0 +1,107 @@ +import 'package:hive/hive.dart'; + +part 'trial_model_hive.g.dart'; // This part file will be generated + +@HiveType(typeId: 34) // Use a unique typeId for this class +class Trials extends HiveObject { + @HiveField(0) + final int? id; + + @HiveField(1) + final int? userId; + + @HiveField(2) + final String? ct_id; + + @HiveField(3) + final String? study_Type; + + @HiveField(4) + final String? trial_name; + + @HiveField(5) + final String? condition; + + @HiveField(6) + final String? intervention; + + @HiveField(7) + final String? phase; + + @HiveField(8) + final String? role; + + @HiveField(9) + final String? enrollees; + + @HiveField(10) + final String? trial_sites; + + @HiveField(11) + final String? sponsors; + + @HiveField(12) + final String? status; + + @HiveField(13) + final String? start_Date; + + @HiveField(14) + final String? end_Date; + + @HiveField(15) + final String? min_Age; + + @HiveField(16) + final String? max_Age; + + @HiveField(17) + final String? gender; + + @HiveField(18) + final String? investigators; + + @HiveField(19) + final String? collaborator; + + @HiveField(20) + final String? purpose; // Nullable + @HiveField(21) + final String? official_Title; // Nullable + + @HiveField(22) + final String? keywords; + + @HiveField(23) + final String? meSH_Terms; // Nullable + @HiveField(24) + final String? url; + + Trials({ + this.id, + this.userId, + this.ct_id, + this.study_Type, + this.trial_name, + this.condition, + this.intervention, + this.phase, + this.role, + this.enrollees, + this.trial_sites, + this.sponsors, + this.status, + this.start_Date, + this.end_Date, + this.min_Age, + this.max_Age, + this.gender, + this.investigators, + this.collaborator, + this.purpose, + this.official_Title, + this.keywords, + this.meSH_Terms, + this.url, + }); +} diff --git a/lib/contacts_module/storage_hive/trials_data/trial_model_hive.g.dart b/lib/contacts_module/storage_hive/trials_data/trial_model_hive.g.dart new file mode 100644 index 0000000..1310ad2 --- /dev/null +++ b/lib/contacts_module/storage_hive/trials_data/trial_model_hive.g.dart @@ -0,0 +1,113 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'trial_model_hive.dart'; + +// ************************************************************************** +// TypeAdapterGenerator +// ************************************************************************** + +class TrialsAdapter extends TypeAdapter { + @override + final int typeId = 34; + + @override + Trials read(BinaryReader reader) { + final numOfFields = reader.readByte(); + final fields = { + for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(), + }; + return Trials( + id: fields[0] as int?, + userId: fields[1] as int?, + ct_id: fields[2] as String?, + study_Type: fields[3] as String?, + trial_name: fields[4] as String?, + condition: fields[5] as String?, + intervention: fields[6] as String?, + phase: fields[7] as String?, + role: fields[8] as String?, + enrollees: fields[9] as String?, + trial_sites: fields[10] as String?, + sponsors: fields[11] as String?, + status: fields[12] as String?, + start_Date: fields[13] as String?, + end_Date: fields[14] as String?, + min_Age: fields[15] as String?, + max_Age: fields[16] as String?, + gender: fields[17] as String?, + investigators: fields[18] as String?, + collaborator: fields[19] as String?, + purpose: fields[20] as String?, + official_Title: fields[21] as String?, + keywords: fields[22] as String?, + meSH_Terms: fields[23] as String?, + url: fields[24] as String?, + ); + } + + @override + void write(BinaryWriter writer, Trials obj) { + writer + ..writeByte(25) + ..writeByte(0) + ..write(obj.id) + ..writeByte(1) + ..write(obj.userId) + ..writeByte(2) + ..write(obj.ct_id) + ..writeByte(3) + ..write(obj.study_Type) + ..writeByte(4) + ..write(obj.trial_name) + ..writeByte(5) + ..write(obj.condition) + ..writeByte(6) + ..write(obj.intervention) + ..writeByte(7) + ..write(obj.phase) + ..writeByte(8) + ..write(obj.role) + ..writeByte(9) + ..write(obj.enrollees) + ..writeByte(10) + ..write(obj.trial_sites) + ..writeByte(11) + ..write(obj.sponsors) + ..writeByte(12) + ..write(obj.status) + ..writeByte(13) + ..write(obj.start_Date) + ..writeByte(14) + ..write(obj.end_Date) + ..writeByte(15) + ..write(obj.min_Age) + ..writeByte(16) + ..write(obj.max_Age) + ..writeByte(17) + ..write(obj.gender) + ..writeByte(18) + ..write(obj.investigators) + ..writeByte(19) + ..write(obj.collaborator) + ..writeByte(20) + ..write(obj.purpose) + ..writeByte(21) + ..write(obj.official_Title) + ..writeByte(22) + ..write(obj.keywords) + ..writeByte(23) + ..write(obj.meSH_Terms) + ..writeByte(24) + ..write(obj.url); + } + + @override + int get hashCode => typeId.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is TrialsAdapter && + runtimeType == other.runtimeType && + typeId == other.typeId; +} diff --git a/lib/textScalar.dart b/lib/contacts_module/textScalar.dart similarity index 100% rename from lib/textScalar.dart rename to lib/contacts_module/textScalar.dart diff --git a/lib/ui_screen/activity_tab.dart b/lib/contacts_module/ui_screen/activity_tab.dart similarity index 94% rename from lib/ui_screen/activity_tab.dart rename to lib/contacts_module/ui_screen/activity_tab.dart index 424a1ee..0c88ad1 100644 --- a/lib/ui_screen/activity_tab.dart +++ b/lib/contacts_module/ui_screen/activity_tab.dart @@ -1,14 +1,25 @@ -import 'package:discover_module/constants.dart'; -import 'package:discover_module/custom_widget/text.dart'; -import 'package:discover_module/provider_class/affiliationsprovider.dart'; -import 'package:discover_module/provider_class/events_provider.dart'; -import 'package:discover_module/provider_class/publications_provider.dart'; -import 'package:discover_module/provider_class/trials_provider.dart'; -import 'package:discover_module/ui_screen/affiliation_data.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; -import 'package:discover_module/ui_screen/events_data.dart'; -import 'package:discover_module/ui_screen/publication_data.dart'; -import 'package:discover_module/ui_screen/trials_show_more.dart'; +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/provider_class/affiliationsprovider.dart'; +// import 'package:discover_module/provider_class/events_provider.dart'; +// import 'package:discover_module/provider_class/publications_provider.dart'; +// import 'package:discover_module/provider_class/trials_provider.dart'; +// import 'package:discover_module/ui_screen/affiliation_data.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/ui_screen/events_data.dart'; +// import 'package:discover_module/ui_screen/publication_data.dart'; +// import 'package:discover_module/ui_screen/trials_show_more.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/provider_class/affiliationsprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/events_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/publications_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/trials_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/affiliation_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/ui_screen/events_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/publication_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/trials_show_more.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -92,7 +103,7 @@ class _ActivitiesState extends State { // eng = engtypelist; }); - print("Affiliations_data_isNewOff: $affiliation_data"); + print("Affiliations_data_isNewOff123: ${affiliation_data}"); print("Publication_data_isNewOff: $publication_data"); // print("trialslist_data_is: $trialslist"); @@ -203,13 +214,14 @@ class _ActivitiesState extends State { }), cells: [ DataCell(Text( - affiliation_data[index]['org_name'] + affiliation_data[index] + .orgName .toString(), softWrap: true)), DataCell(Text( affiliation_data[index] - ['time_frame'] + .timeFrame .toString(), softWrap: true)), @@ -366,12 +378,13 @@ class _ActivitiesState extends State { cells: [ DataCell(Text( publication_data[index] - ['artical_title'] + .articalTitle .toString(), softWrap: true)), DataCell(Text( - publication_data[index]['author'] + publication_data[index] + .author .toString(), softWrap: true)), @@ -521,13 +534,13 @@ class _ActivitiesState extends State { }, cells: [ DataCell(Text( - event_data[index]['event_name'] + event_data[index] + .eventName .toString(), softWrap: true)), DataCell(Text( - event_data[index]['role'] - .toString(), + event_data[index].role.toString(), softWrap: true)), // Add more DataCells as needed @@ -679,12 +692,12 @@ class _ActivitiesState extends State { }, cells: [ DataCell(Text( - trial_data[index]['trial_name'] + trial_data[index] + .trialName .toString(), softWrap: true)), DataCell(Text( - trial_data[index]['status'] - .toString(), + trial_data[index].status.toString(), softWrap: true)), ], ), @@ -802,7 +815,7 @@ class _ActivitiesState extends State { child: Padding( padding: const EdgeInsets.all(18.0), child: Text( - affiliation_data['org_name'], + affiliation_data.org_name, softWrap: true, maxLines: 4, style: TextStyle( diff --git a/lib/ui_screen/add_event/add_event.dart b/lib/contacts_module/ui_screen/add_event/add_event.dart similarity index 100% rename from lib/ui_screen/add_event/add_event.dart rename to lib/contacts_module/ui_screen/add_event/add_event.dart diff --git a/lib/ui_screen/add_event/add_hcp.dart b/lib/contacts_module/ui_screen/add_event/add_hcp.dart similarity index 100% rename from lib/ui_screen/add_event/add_hcp.dart rename to lib/contacts_module/ui_screen/add_event/add_hcp.dart diff --git a/lib/ui_screen/add_event/model/event_model.dart b/lib/contacts_module/ui_screen/add_event/model/event_model.dart similarity index 86% rename from lib/ui_screen/add_event/model/event_model.dart rename to lib/contacts_module/ui_screen/add_event/model/event_model.dart index c1f63ff..e1e7b9d 100644 --- a/lib/ui_screen/add_event/model/event_model.dart +++ b/lib/contacts_module/ui_screen/add_event/model/event_model.dart @@ -1,4 +1,5 @@ -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; import 'package:hive_flutter/hive_flutter.dart'; // import 'package:pwa_ios/model/interaction_data.dart'; diff --git a/lib/ui_screen/add_event/model/event_model.g.dart b/lib/contacts_module/ui_screen/add_event/model/event_model.g.dart similarity index 100% rename from lib/ui_screen/add_event/model/event_model.g.dart rename to lib/contacts_module/ui_screen/add_event/model/event_model.g.dart diff --git a/lib/ui_screen/affiliation_data.dart b/lib/contacts_module/ui_screen/affiliation_data.dart similarity index 69% rename from lib/ui_screen/affiliation_data.dart rename to lib/contacts_module/ui_screen/affiliation_data.dart index f6bfa67..abbd3b7 100644 --- a/lib/ui_screen/affiliation_data.dart +++ b/lib/contacts_module/ui_screen/affiliation_data.dart @@ -1,8 +1,9 @@ -import 'package:discover_module/provider_class/affiliationsprovider.dart'; +// import 'package:discover_module/provider_class/affiliationsprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/affiliationsprovider.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:discover_module/ui_screen/new_new_profile.dart'; +// import 'package:discover_module/ui_screen/new_new_profile.dart'; class AffiliationsData extends StatefulWidget { final int text; @@ -45,76 +46,140 @@ class _AffiliationsDataState extends State { appBar: AppBar( title: Text('Affiliations'), ), - body: Scrollbar( - child: SingleChildScrollView( - scrollDirection: Axis.horizontal, - child: SingleChildScrollView( - scrollDirection: Axis.vertical, - child: Container( - constraints: - BoxConstraints(minWidth: MediaQuery.of(context).size.width), - color: Colors.white, - child: DataTable( - showCheckboxColumn: false, - columns: const [ - //DataColumn(label: Expanded(child: Text('sl no'))), - DataColumn( - label: Expanded( - child: Text('Organization Name'), - )), - DataColumn( - label: Expanded( - child: Text('Department', softWrap: true))), - DataColumn( - label: Expanded(child: Text('Role', softWrap: true))), - DataColumn( - label: Expanded( - child: Text('Time Frame', softWrap: true))), - DataColumn( - label: - Expanded(child: Text('Org Type', softWrap: true))), - DataColumn( - label: - Expanded(child: Text('Eng Type', softWrap: true))), - // Add more columns as needed - ], - rows: List.generate( - hcpaffiliations.length, - (index) => DataRow( - onSelectChanged: (value) { - // =======> Use onSelectChanged for tab - print("message11 ${hcpaffiliations[index]}"); - - bottomshet(hcpaffiliations[index]); - }, - cells: [ - // DataCell(Text(hcpaffiliations[index]['id'].toString(), - // softWrap: true)), - DataCell(Text( - hcpaffiliations[index]['org_name'].toString(), - softWrap: true)), - DataCell(Text(hcpaffiliations[index]['dept'].toString(), - softWrap: true)), - DataCell(Text(hcpaffiliations[index]['role'].toString(), - softWrap: true)), - DataCell(Text( - hcpaffiliations[index]['time_frame'].toString(), - softWrap: true)), - DataCell(Text( - hcpaffiliations[index]['org_type'].toString(), - softWrap: true)), - DataCell(Text( - hcpaffiliations[index]['emg_type'].toString(), - softWrap: true)), - // Add more DataCells as needed + body: ListView.builder( + itemCount: hcpaffiliations.length, + itemBuilder: (context, index) { + return Column( + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("Organization Name"), + Text( + hcpaffiliations[index]['org_name'], + style: TextStyle(fontSize: 15.0, color: Colors.black), + ), + SizedBox( + height: 10.0, + ), + Text("Department"), + Text(hcpaffiliations[index]['dept'], + style: + TextStyle(fontSize: 15.0, color: Colors.black)), + SizedBox( + height: 10.0, + ), + Text("Role"), + Text(hcpaffiliations[index]['role'], + style: + TextStyle(fontSize: 15.0, color: Colors.black)), + SizedBox( + height: 10.0, + ), + Text("Time Frame"), + Text(hcpaffiliations[index]['time_frame'], + style: + TextStyle(fontSize: 15.0, color: Colors.black)), + SizedBox( + height: 10.0, + ), + Text("Organization Type"), + Text(hcpaffiliations[index]['org_type'], + style: + TextStyle(fontSize: 15.0, color: Colors.black)), + SizedBox( + height: 10.0, + ), + Text("Engagement Type"), + Text(hcpaffiliations[index]['emg_type'], + style: + TextStyle(fontSize: 15.0, color: Colors.black)), + Divider() ], ), ), - ), - ), - ), - ), - )); + ], + ); + + // ListTile( + // title: Text(hcpaffiliations[index]['org_name'].toString())); + }) + + // Scrollbar(, + // child: SingleChildScrollView( + // scrollDirection: Axis.horizontal, + // child: SingleChildScrollView( + // scrollDirection: Axis.vertical, + // child: Container( + // constraints: + // BoxConstraints(minWidth: MediaQuery.of(context).size.width), + // color: Colors.white, + // child: DataTable( + // showCheckboxColumn: false, + // columns: const [ + // //DataColumn(label: Expanded(child: Text('sl no'))), + // DataColumn( + // label: Expanded( + // child: Text('Organization Name'), + // )), + // DataColumn( + // label: Expanded( + // child: Text('Department', softWrap: true))), + // DataColumn( + // label: Expanded(child: Text('Role', softWrap: true))), + // DataColumn( + // label: Expanded( + // child: Text('Time Frame', softWrap: true))), + // DataColumn( + // label: + // Expanded(child: Text('Org Type', softWrap: true))), + // DataColumn( + // label: + // Expanded(child: Text('Eng Type', softWrap: true))), + // // Add more columns as needed + // ], + // rows: List.generate( + // hcpaffiliations.length, + // (index) => DataRow( + // onSelectChanged: (value) { + // // =======> Use onSelectChanged for tab + // print("message11 ${hcpaffiliations[index]}"); + + // bottomshet(hcpaffiliations[index]); + // }, + // cells: [ + // // DataCell(Text(hcpaffiliations[index]['id'].toString(), + // // softWrap: true)), + // DataCell(Text( + // hcpaffiliations[index]['org_name'].toString(), + // softWrap: true)), + // DataCell(Text(hcpaffiliations[index]['dept'].toString(), + // softWrap: true)), + // DataCell(Text(hcpaffiliations[index]['role'].toString(), + // softWrap: true)), + // DataCell(Text( + // hcpaffiliations[index]['time_frame'].toString(), + // softWrap: true)), + // DataCell(Text( + // hcpaffiliations[index]['org_type'].toString(), + // softWrap: true)), + // DataCell(Text( + // hcpaffiliations[index]['emg_type'].toString(), + // softWrap: true)), + // // Add more DataCells as needed + // ], + // ), + // ), + // ), + // ), + // ), + // ), + // ) + + ); } void bottomshet(affiliation_data) { diff --git a/lib/ui_screen/awardshowmore.dart b/lib/contacts_module/ui_screen/awardshowmore.dart similarity index 92% rename from lib/ui_screen/awardshowmore.dart rename to lib/contacts_module/ui_screen/awardshowmore.dart index 05cd45f..33592ea 100644 --- a/lib/ui_screen/awardshowmore.dart +++ b/lib/contacts_module/ui_screen/awardshowmore.dart @@ -1,5 +1,7 @@ -import 'package:discover_module/provider_class/award_provider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/provider_class/award_provider.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/provider_class/award_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/bottom_sheet.dart b/lib/contacts_module/ui_screen/bottom_sheet.dart similarity index 98% rename from lib/ui_screen/bottom_sheet.dart rename to lib/contacts_module/ui_screen/bottom_sheet.dart index 35fe32e..40ad098 100644 --- a/lib/ui_screen/bottom_sheet.dart +++ b/lib/contacts_module/ui_screen/bottom_sheet.dart @@ -1,6 +1,9 @@ -import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; +// import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/configprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/view_forms_list.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; diff --git a/lib/ui_screen/bottommmsheet.dart b/lib/contacts_module/ui_screen/bottommmsheet.dart similarity index 100% rename from lib/ui_screen/bottommmsheet.dart rename to lib/contacts_module/ui_screen/bottommmsheet.dart diff --git a/lib/ui_screen/bottomsheet_dynamicheight.dart b/lib/contacts_module/ui_screen/bottomsheet_dynamicheight.dart similarity index 100% rename from lib/ui_screen/bottomsheet_dynamicheight.dart rename to lib/contacts_module/ui_screen/bottomsheet_dynamicheight.dart diff --git a/lib/ui_screen/cer_show_more.dart b/lib/contacts_module/ui_screen/cer_show_more.dart similarity index 92% rename from lib/ui_screen/cer_show_more.dart rename to lib/contacts_module/ui_screen/cer_show_more.dart index b53ea23..6e24178 100644 --- a/lib/ui_screen/cer_show_more.dart +++ b/lib/contacts_module/ui_screen/cer_show_more.dart @@ -1,5 +1,7 @@ -import 'package:discover_module/provider_class/certificate_provider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/provider_class/certificate_provider.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/provider_class/certificate_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/chart.dart b/lib/contacts_module/ui_screen/chart.dart similarity index 100% rename from lib/ui_screen/chart.dart rename to lib/contacts_module/ui_screen/chart.dart diff --git a/lib/contacts_module/ui_screen/contact_filters.dart b/lib/contacts_module/ui_screen/contact_filters.dart new file mode 100644 index 0000000..89ff661 --- /dev/null +++ b/lib/contacts_module/ui_screen/contact_filters.dart @@ -0,0 +1,314 @@ +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/hive_fun.dart'; +// import 'package:discover_module/provider_class/hcp%20_provider.dart'; +// import 'package:discover_module/ui_screen/new_contacts.dart'; +// import 'package:discover_module/ui_screen/saved_profiles/saved_contact.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/hive_fun.dart'; +import 'package:discover_module/contacts_module/provider_class/hcp%20_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/new_contacts.dart'; +import 'package:discover_module/contacts_module/ui_screen/saved_profiles/saved_contact.dart'; +import 'package:dropdown_button2/dropdown_button2.dart'; +import 'package:dropdownfield2/dropdownfield2.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class FilterDrawer extends StatefulWidget { + FilterDrawer(this.switchValue, this.searchController); + bool switchValue; + TextEditingController searchController = TextEditingController(); + @override + State createState() => _FilterDrawerState(); +} + +class _FilterDrawerState extends State { + var items = [ + 'Profile Type', + 'HCP Name', + 'Speciality', + 'Country', + 'Region', + 'State', + 'City', + 'List', + 'Organization', + 'Event', + ]; + + @override + Widget build(BuildContext context) { + final dropdownProvider = + Provider.of(context); // Adjust to your provider + + return Drawer( + child: ValueListenableBuilder>( + valueListenable: ddlist, + builder: (context, value, child) { + return ListView( + children: [ + // DrawerHeader removed + ListTile( + title: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Icon( + Icons.sort, + size: 30.0, + ), + const Text( + "Filters", + style: TextStyle( + fontSize: 18.0, fontWeight: FontWeight.bold), + ), + GestureDetector( + onTap: () { + Navigator.pop(context); + // print("hiii"); + }, + child: const Icon(Icons.cancel)) + ], + ), + ), + ), + + ListTile( + title: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + OutlinedButton( + onPressed: () { + setState(() {}); + }, + child: Text( + 'Reset Filter', + style: TextStyle(color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ], + ), + ), + + ListTile( + title: DropdownButtonHideUnderline( + child: DropdownButtonFormField2( + hint: Text("Select the Type"), + decoration: InputDecoration( + // Add Horizontal padding using menuItemStyleData.padding so it matches + // the menu padding when button's width is not specified. + isDense: true, + contentPadding: + const EdgeInsets.symmetric(vertical: 9), + + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + ), + // Add more decoration.. + ), + isExpanded: true, + value: selectedType, + items: items.map((String item) { + return DropdownMenuItem( + value: item, + child: Text(item), + ); + }).toList(), + onChanged: (String? newValue) { + setState(() { + selectedType = newValue; + optionsData(); + }); + }, + buttonStyleData: const ButtonStyleData( + padding: EdgeInsets.symmetric(horizontal: 16), + height: 50, + width: 200, + ), + dropdownStyleData: DropdownStyleData( + maxHeight: 200, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(14), + ), + ), + menuItemStyleData: const MenuItemStyleData( + height: 40, + ), + dropdownSearchData: DropdownSearchData( + searchController: textEditingController, + searchInnerWidgetHeight: 50, + searchInnerWidget: Container( + height: 50, + // padding: const EdgeInsets.only( + // top: 8, + // bottom: 4, + // right: 8, + // left: 8, + // ), + child: TextFormField( + expands: true, + maxLines: null, + controller: textEditingController, + decoration: InputDecoration( + isDense: true, + contentPadding: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 18, + ), + hintText: 'Search for an item...', + hintStyle: const TextStyle(fontSize: 12), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + ), + ), + ), + ), + searchMatchFn: (item, searchValue) { + final itemString = + item.value.toString().toLowerCase(); + final searchString = searchValue.toLowerCase(); + return itemString.contains(searchString); + }, + ), + onMenuStateChange: (isOpen) { + if (!isOpen) { + textEditingController.clear(); + } + }, + iconStyleData: IconStyleData( + icon: Icon(Icons.arrow_drop_down), + iconSize: 20, + ), + ), + ), + ), + ListTile( + title: Container( + decoration: BoxDecoration( + border: Border.all(color: Colors.black), + borderRadius: BorderRadius.circular(10)), + child: Padding( + padding: const EdgeInsets.all(3.5), + child: DropDownField( + hintText: 'Select an option', + items: value, + onValueChanged: (newValue) { + // setState(() { + selectedValue = newValue; + + searchController.text = selectedValue; + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => Contacts1()), + ).then((value) => setState(() {})); + // }); + }, + value: selectedValue, + ), + ), + ), + ), + + ListTile( + title: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + OutlinedButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + const SavedContacts1())); + print("refresh done 111"); + // }) + }, + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: Text1( + title: 'Saved Profiles123', + txtcolor: Constants.k2color, + ), + ), + ], + ), + ), + ], + ); + })); + } + + optionsData() async { + print("hiiiiiiiii"); + if (selectedType == "Profile Type") { + print("PPPP11"); + setState(() { + ddlist.value = [ + "All Profile", + 'Full Profile', + 'Basic Profile', + ]; + }); + } else if (selectedType == "HCP Name") { + print("FilterHcpNameeeNeww"); + fetchhcpname(selectedType); + } else if (selectedType == "Speciality") { + fetchhcpname(selectedType); + } else if (selectedType == "Country") { + print("kkk"); + setState(() { + ddlist.value = [ + "United States", + "United States", + "United States", + ]; + }); + } else if (selectedType == "State") { + print("kkk"); + setState(() { + ddlist.value = [ + "Karnataka", + 'Karnataka', + 'Karnataka', + ]; + }); + } else if (selectedType == "City") { + print("kkk"); + setState(() { + ddlist.value = [ + "Hubli", + 'Hubli', + 'Hubli', + ]; + }); + } + } + + Future fetchhcpname([String? selectedType]) async { + print("selectedTypeselectedType: ${selectedType}, ${widget.switchValue}"); + var hcpDataProvider1 = Provider.of(context, listen: false); + + if (widget.switchValue == false) { + List namelist = + await hcpDataProvider1.gethcpNamefilter(selectedType); + ddlist.value = namelist; + setState(() {}); + } else { + List offlinenamelist = + await HiveFunctions.getAllhcpdata(selectedType); + ddlist.value = offlinenamelist; + } + } +} diff --git a/lib/ui_screen/contacts.dart b/lib/contacts_module/ui_screen/contacts.dart similarity index 100% rename from lib/ui_screen/contacts.dart rename to lib/contacts_module/ui_screen/contacts.dart diff --git a/lib/ui_screen/discover.dart b/lib/contacts_module/ui_screen/discover.dart similarity index 100% rename from lib/ui_screen/discover.dart rename to lib/contacts_module/ui_screen/discover.dart diff --git a/lib/ui_screen/edu_show_more.dart b/lib/contacts_module/ui_screen/edu_show_more.dart similarity index 92% rename from lib/ui_screen/edu_show_more.dart rename to lib/contacts_module/ui_screen/edu_show_more.dart index 9237c19..47d3b7f 100644 --- a/lib/ui_screen/edu_show_more.dart +++ b/lib/contacts_module/ui_screen/edu_show_more.dart @@ -1,5 +1,7 @@ -import 'package:discover_module/provider_class/educationprovider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/provider_class/educationprovider.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/provider_class/educationprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/email_show_more.dart b/lib/contacts_module/ui_screen/email_show_more.dart similarity index 92% rename from lib/ui_screen/email_show_more.dart rename to lib/contacts_module/ui_screen/email_show_more.dart index 228185e..b39fa20 100644 --- a/lib/ui_screen/email_show_more.dart +++ b/lib/contacts_module/ui_screen/email_show_more.dart @@ -1,5 +1,7 @@ -import 'package:discover_module/provider_class/email_provider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/provider_class/email_provider.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/provider_class/email_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/engagementlist.dart b/lib/contacts_module/ui_screen/engagementlist.dart similarity index 98% rename from lib/ui_screen/engagementlist.dart rename to lib/contacts_module/ui_screen/engagementlist.dart index 369b23e..81ec6d1 100644 --- a/lib/ui_screen/engagementlist.dart +++ b/lib/contacts_module/ui_screen/engagementlist.dart @@ -1,10 +1,13 @@ import 'dart:collection'; import 'dart:convert'; -import 'package:discover_module/constants.dart'; -import 'package:discover_module/provider_class/engagement_provider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; -import 'package:flutter/cupertino.dart'; +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/provider_class/engagement_provider.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:flutter/cupertino.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/provider_class/engagement_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:intl/intl.dart'; diff --git a/lib/ui_screen/engagementtab.dart b/lib/contacts_module/ui_screen/engagementtab.dart similarity index 52% rename from lib/ui_screen/engagementtab.dart rename to lib/contacts_module/ui_screen/engagementtab.dart index ffbdef9..e00126e 100644 --- a/lib/ui_screen/engagementtab.dart +++ b/lib/contacts_module/ui_screen/engagementtab.dart @@ -1,28 +1,56 @@ -import 'package:discover_module/constants.dart'; -import 'package:discover_module/custom_widget/text.dart'; -import 'package:discover_module/provider_class/medicalinsightprovider.dart'; -import 'package:discover_module/provider_class/nih_provider.dart'; -import 'package:discover_module/provider_class/patent_provider.dart'; -import 'package:discover_module/provider_class/procedureprovider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; -import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; -import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; -import 'package:discover_module/ui_screen/medical_insight.dart'; -import 'package:discover_module/ui_screen/new_editinteraction.dart'; -import 'package:discover_module/ui_screen/new_viewinteraction.dart'; -import 'package:discover_module/ui_screen/nih_show_more.dart'; -import 'package:discover_module/ui_screen/patent_show_more.dart'; -import 'package:discover_module/ui_screen/pro_show_more.dart'; +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/model_class/speaker.dart'; +// import 'package:discover_module/provider_class/medicalinsightprovider.dart'; +// import 'package:discover_module/provider_class/nih_provider.dart'; +// import 'package:discover_module/provider_class/patent_provider.dart'; +// import 'package:discover_module/provider_class/procedureprovider.dart'; +// import 'package:discover_module/provider_class/speaker_provider.dart'; +// import 'package:discover_module/provider_class/training_provider.dart'; +// import 'package:discover_module/storage_hive/nih_grant_data/crud_nih.dart'; +// import 'package:discover_module/storage_hive/patent_data/crud_patent.dart'; +// import 'package:discover_module/storage_hive/procedure_data/crud_pro.dart'; +// import 'package:discover_module/storage_hive/speaker_data/crud.speaker.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +// import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; +// import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; +// import 'package:discover_module/ui_screen/medical_insight.dart'; +// import 'package:discover_module/ui_screen/new_editinteraction.dart'; +// import 'package:discover_module/ui_screen/new_viewinteraction.dart'; +// import 'package:discover_module/ui_screen/nih_show_more.dart'; +// import 'package:discover_module/ui_screen/patent_show_more.dart'; +// import 'package:discover_module/ui_screen/pro_show_more.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/provider_class/nih_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/patent_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/procedureprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/speaker_provider.dart'; +import 'package:discover_module/contacts_module/storage_hive/nih_grant_data/crud_nih.dart'; +import 'package:discover_module/contacts_module/storage_hive/patent_data/crud_patent.dart'; +import 'package:discover_module/contacts_module/storage_hive/procedure_data/crud_pro.dart'; +import 'package:discover_module/contacts_module/storage_hive/speaker_data/crud.speaker.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/view_forms_list.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/new_editinteraction.dart'; +import 'package:discover_module/contacts_module/ui_screen/new_viewinteraction.dart'; +import 'package:discover_module/contacts_module/ui_screen/nih_show_more.dart'; +import 'package:discover_module/contacts_module/ui_screen/patent_show_more.dart'; +import 'package:discover_module/contacts_module/ui_screen/pro_show_more.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class EngagementTab extends StatefulWidget { - EngagementTab({required this.text, Key? key}) : super(key: key); + EngagementTab({required this.text, this.offline, Key? key}) : super(key: key); final int text; + int? offline; @override State createState() => _EngagementTabState(); } @@ -33,6 +61,9 @@ class _EngagementTabState extends State { List patent = []; List nihgrants = []; List procedure = []; + List speakerlistt = []; + + // List training = []; // List eng = []; @@ -47,34 +78,60 @@ class _EngagementTabState extends State { getdata() async { var form = Provider.of(context, listen: false); form.savedList; - + final patentt1, nih1, pro1, tri1, speakerlist; //var med = Provider.of(context, listen: false); //await med.medicalinsightdata(); // final medlist = med.trialsinfo; - var patentt = Provider.of(context, listen: false); - await patentt.patentinfo(widget.text); - final patentt1 = patentt.patentlist; + if (widget.offline == 1) { + patentt1 = await retrieveidpatent(widget.text); + print("Savedd_CheckingloclistEdu123: $patentt1"); + } else { + var patentt = Provider.of(context, listen: false); + await patentt.patentinfo(widget.text); + patentt1 = patentt.patentlist; + } - var nih = Provider.of(context, listen: false); - await nih.nihinfo(widget.text); - final nih1 = nih.nihgrantslist; + if (widget.offline == 1) { + nih1 = await retrieveidnih(widget.text); + print("Savedd_CheckingloclistEdu123: $nih1"); + } else { + var nih = Provider.of(context, listen: false); + await nih.nihinfo(widget.text); + nih1 = nih.nihgrantslist; + } - var pro = Provider.of(context, listen: false); - await pro.proinfo(widget.text); - final pro1 = pro.prolist; + if (widget.offline == 1) { + pro1 = await retrieveidpro(widget.text); + print("Savedd_CheckingloclistEdupro1123: $pro1"); + } else { + var pro = Provider.of(context, listen: false); + await pro.proinfo(widget.text); + pro1 = pro.prolist; + } + + if (widget.offline == 1) { + speakerlist = await retrieveidspeaker(widget.text); + print("Savedd_CheckingloclistEdupro1123: $pro1"); + } else { + var speaker1 = + Provider.of(context, listen: false); + await speaker1.getspeakerdata(); + speakerlist = speaker1.speakerlist; + } setState(() { // medinsightData = medlist; patent = patentt1; nihgrants = nih1; procedure = pro1; - // speaker = speakerlist; + // training = tri1; + speakerlistt = speakerlist; // eng = engtypelist; }); - print("CheckingPatent: $patent"); - print("Checkingnihgrants: $nihgrants"); + // print("CheckingPro: ${pro1.procedure}"); + // print("Checkingnihgrants: $nihgrants"); } @override @@ -527,383 +584,173 @@ class _EngagementTabState extends State { ), ), - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Speaker Evalution", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(4)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.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: const [ - // DataColumn( - // label: Expanded( - // child: Text( - // 'Program Topic', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // ), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Speaker Name', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // speaker.take(2).length, - // (index) => DataRow( - // onSelectChanged: (value) { - // // =======> Use onSelectChanged for tab - // print( - // "message ${speaker[index]}"); + speakerlistt.length != 0 + ? ListTileTheme( + dense: true, + child: Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Card( + margin: EdgeInsets.all(1.0), + // elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + color: Constants.k2color11, + child: ExpansionTile( + initiallyExpanded: false, + maintainState: true, + onExpansionChanged: (bool expanded) { + setState(() { + _isExpanded = expanded; + }); + }, + backgroundColor: Constants.k2color11, + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.black), + // backgroundColor: Colors.white, + // collapsedBackgroundColor: Color(0xFF2b9af3), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Speaker Evalution", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + const SizedBox( + width: 8.0, + ), + Text1( + title: "(${speakerlistt.length.toString()})", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.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: const [ + DataColumn( + label: Expanded( + child: Text( + 'Program Topic', + style: TextStyle( + fontWeight: FontWeight.w600), + ), + )), + DataColumn( + label: Expanded( + child: Text('Speaker Name', + style: TextStyle( + fontWeight: + FontWeight.w600)))), + ], + rows: List.generate( + speakerlistt.take(2).length, + (index) => DataRow( + onSelectChanged: (value) { + // =======> Use onSelectChanged for tab + print( + "message ${speakerlistt[index]}"); - // // bsheet( - // // publication_data[ - // // index]); - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular(0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // speaker[index]); - // }, - // ); - // }, - // color: MaterialStateProperty - // .resolveWith< - // Color?>((Set< - // MaterialState> - // states) { - // if (index.isEven) { - // return Colors.grey - // .withOpacity(0.1); - // } - // return null; - // }), - // cells: [ - // DataCell(Text( - // speaker[index][ - // 'programtopic'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // speaker[index][ - // 'speakername'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // AffiliationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Engagements", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.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: const [ - // DataColumn( - // label: Expanded( - // child: Text( - // 'Main Therapeutic Area', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // ), - // )), - // DataColumn( - // label: Expanded( - // child: Text('Date', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // eng.take(2).length, - // (index) => DataRow( - // onSelectChanged: (value) { - // // =======> Use onSelectChanged for tab - // print( - // "message ${eng[index]}"); - - // // bsheet( - // // publication_data[ - // // index]); - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular(0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // eng[index]); - // }, - // ); - // }, - // color: MaterialStateProperty - // .resolveWith< - // Color?>((Set< - // MaterialState> - // states) { - // if (index.isEven) { - // return Colors.grey - // .withOpacity(0.1); - // } - // return null; - // }), - // cells: [ - // DataCell(Text( - // eng[index][ - // 'main thereutic area'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // eng[index]['date'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (_) => - // EngagementList())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), + // bsheet( + // publication_data[ + // index]); + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + shape: RoundedRectangleBorder( + borderRadius: + BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: + Clip.antiAliasWithSaveLayer, + context: context, + builder: (context) { + return bsheet( + speakerlistt[index]); + }, + ); + }, + color: MaterialStateProperty + .resolveWith( + (Set states) { + if (index.isEven) { + return Colors.grey.withOpacity(0.1); + } + return null; + }), + cells: [ + DataCell(Text( + speakerlistt[index] + .programtopic + .toString(), + softWrap: true)), + DataCell(Text( + speakerlistt[index] + .speakername + .toString(), + softWrap: true)), + ], + ), + ), + ), + ), + ), + ), + Container( + color: Colors.white, + child: Align( + alignment: Alignment.center, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: OutlinedButton( + onPressed: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (_) => + // AffiliationsData())); + }, + child: Text( + 'Show More', + style: + TextStyle(color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ), + ) + ]), + ), + ), + ) + : Container(), // adds spacing between the text and image nihgrants.length != 0 ? ListTileTheme( @@ -1008,12 +855,13 @@ class _EngagementTabState extends State { }, cells: [ DataCell(Text( - nihgrants[index]['pi_names'] + nihgrants[index] + .piNames .toString(), softWrap: true)), DataCell(Text( nihgrants[index] - ['NIH Center/Institute'] + .institute .toString(), softWrap: true)), ], @@ -1160,12 +1008,13 @@ class _EngagementTabState extends State { }, cells: [ DataCell(Text( - procedure[index]['Procedure'] + procedure[index] + .procedure .toString(), softWrap: true)), DataCell(Text( procedure[index] - ['Place of Service'] + .placeOfService .toString(), softWrap: true)), ], @@ -1312,12 +1161,12 @@ class _EngagementTabState extends State { }, cells: [ DataCell(Text( - patent[index]['Patent Title'] + patent[index] + .patentTitle .toString(), softWrap: true)), DataCell(Text( - patent[index]['Status'] - .toString(), + patent[index].status.toString(), softWrap: true)), ], ), @@ -1359,519 +1208,6 @@ class _EngagementTabState extends State { ), ) : Container(), - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Container( - // child: Card( - // margin: EdgeInsets.all(1.0), - // //elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Patient Referrals", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 16.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.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: const [ - // DataColumn( - // label: Expanded( - // child: Text( - // 'Referred By', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Type of Referrals', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: - // (value) { - // print( - // "message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: double - // .infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular( - // 0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // publication_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index] - // [ - // 'artical_title'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[ - // index] - // ['author'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: Constants - // .k2color), - // ), - // style: OutlinedButton - // .styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .circular(12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - // ), // adds spacing between the text and image -////////////////////////////////////////////// -// ListTileTheme( -// dense: true, -// child: Padding( -// padding: const EdgeInsets.only(left: 8.0, right: 8.0), -// child: Card( -// margin: EdgeInsets.all(1.0), -// // elevation: 5, -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(0.0), -// ), -// color: Constants.k2color11, -// child: ExpansionTile( -// initiallyExpanded: false, -// maintainState: true, -// // backgroundColor: Colors.white, -// // collapsedBackgroundColor: Color(0xFF2b9af3), -// onExpansionChanged: (bool expanded) { -// setState(() { -// _isExpanded = expanded; -// }); -// }, -// backgroundColor: Constants.k2color11, -// trailing: Icon( -// _isExpanded -// ? Icons.keyboard_arrow_up -// : Icons.keyboard_arrow_down, -// color: Colors.black), -// title: Row( -// mainAxisAlignment: MainAxisAlignment.start, -// // mainAxisSize: MainAxisSize.min, -// children: [ -// Text1( -// title: "Training", -// txtcolor: Colors.black, -// fontweight: FontWeight.normal, -// txtfont: 16.0), -// const SizedBox( -// width: 8.0, -// ), -// Text1( -// title: "(3)", -// 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: const [ -// DataColumn( -// label: Expanded( -// child: Text('Institute Name', -// style: TextStyle( -// fontWeight: FontWeight.w600), -// softWrap: true), -// )), -// DataColumn( -// label: Expanded( -// child: Text('Degree', -// style: TextStyle( -// fontWeight: FontWeight.w600)))), -// ], -// rows: List.generate( -// publication_data.length, -// (index) => DataRow( -// onSelectChanged: (value) { -// print("message ${publication_data[index]}"); - -// showModalBottomSheet( -// useRootNavigator: true, -// isScrollControlled: false, -// enableDrag: true, -// useSafeArea: true, -// constraints: const BoxConstraints( -// maxWidth: double.infinity, -// ), -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.vertical( -// top: Radius.circular(0), -// ), -// ), -// clipBehavior: Clip.antiAliasWithSaveLayer, -// context: context, -// builder: (context) { -// return bsheet(publication_data[index]); -// }, -// ); -// }, -// cells: [ -// DataCell(Text( -// publication_data[index]['artical_title'] -// .toString(), -// softWrap: true)), -// DataCell(Text( -// publication_data[index]['author'] -// .toString(), -// softWrap: true)), -// ], -// ), -// ), -// ), -// ), -// ), -// ), -// Container( -// color: Colors.white, -// child: Align( -// alignment: Alignment.center, -// child: Padding( -// padding: const EdgeInsets.all(8.0), -// child: OutlinedButton( -// onPressed: () { -// // Navigator.push( -// // context, -// // MaterialPageRoute( -// // builder: (_) => -// // PublicationsData())); -// }, -// child: Text( -// 'Show More', -// style: TextStyle(color: Constants.k2color), -// ), -// style: OutlinedButton.styleFrom( -// shape: RoundedRectangleBorder( -// borderRadius: BorderRadius.circular(12), -// ), -// ), -// ), -// ), -// ), -// ) -// ]), -// ), -// ), -// ), // adds spacing between the text and image -// //////////////////////////////////////////////////// - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Container( - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // backgroundColor: Constants.k2color11, - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // 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, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Case", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 16.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // 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: const [ - // DataColumn( - // label: Expanded( - // child: Text('Name', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Type', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: - // (value) { - // print( - // "message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: double - // .infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular( - // 0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // publication_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index] - // [ - // 'artical_title'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[ - // index] - // ['author'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: Constants - // .k2color), - // ), - // style: OutlinedButton - // .styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .circular(12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - // ), // adds spacing between the text and image ], ), ); diff --git a/lib/ui_screen/events_data.dart b/lib/contacts_module/ui_screen/events_data.dart similarity index 89% rename from lib/ui_screen/events_data.dart rename to lib/contacts_module/ui_screen/events_data.dart index 2cddd54..d220528 100644 --- a/lib/ui_screen/events_data.dart +++ b/lib/contacts_module/ui_screen/events_data.dart @@ -1,7 +1,9 @@ -import 'package:discover_module/provider_class/affiliationsprovider.dart'; -import 'package:discover_module/provider_class/events_provider.dart'; -import 'package:discover_module/provider_class/publications_provider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/provider_class/affiliationsprovider.dart'; +// import 'package:discover_module/provider_class/events_provider.dart'; +// import 'package:discover_module/provider_class/publications_provider.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/provider_class/events_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/filters_menu.dart b/lib/contacts_module/ui_screen/filters_menu.dart similarity index 97% rename from lib/ui_screen/filters_menu.dart rename to lib/contacts_module/ui_screen/filters_menu.dart index 903c362..fa2543c 100644 --- a/lib/ui_screen/filters_menu.dart +++ b/lib/contacts_module/ui_screen/filters_menu.dart @@ -1,5 +1,7 @@ -import 'package:discover_module/custom_widget/elevation_btn.dart'; -import 'package:discover_module/custom_widget/show_alert.dart'; +// import 'package:discover_module/custom_widget/elevation_btn.dart'; +// import 'package:discover_module/custom_widget/show_alert.dart'; +import 'package:discover_module/contacts_module/custom_widget/elevation_btn.dart'; +import 'package:discover_module/contacts_module/custom_widget/show_alert.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:hive_flutter/hive_flutter.dart'; diff --git a/lib/ui_screen/horizontal_listview.dart b/lib/contacts_module/ui_screen/horizontal_listview.dart similarity index 100% rename from lib/ui_screen/horizontal_listview.dart rename to lib/contacts_module/ui_screen/horizontal_listview.dart diff --git a/lib/ui_screen/interactionform/NewtworkConnectivity.dart b/lib/contacts_module/ui_screen/interactionform/NewtworkConnectivity.dart similarity index 100% rename from lib/ui_screen/interactionform/NewtworkConnectivity.dart rename to lib/contacts_module/ui_screen/interactionform/NewtworkConnectivity.dart diff --git a/lib/ui_screen/interactionform/configprovider.dart b/lib/contacts_module/ui_screen/interactionform/configprovider.dart similarity index 89% rename from lib/ui_screen/interactionform/configprovider.dart rename to lib/contacts_module/ui_screen/interactionform/configprovider.dart index a7bb46a..5652599 100644 --- a/lib/ui_screen/interactionform/configprovider.dart +++ b/lib/contacts_module/ui_screen/interactionform/configprovider.dart @@ -1,8 +1,13 @@ -import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; -import 'package:discover_module/ui_screen/interactionform/mockapi.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -import 'package:discover_module/ui_screen/interactionform/util.dart'; +// import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; +// import 'package:discover_module/ui_screen/interactionform/mockapi.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/NewtworkConnectivity.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/mockapi.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_config_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; import 'package:flutter/foundation.dart'; import 'package:hive_flutter/hive_flutter.dart'; diff --git a/lib/ui_screen/interactionform/edit_interaction_screen.dart b/lib/contacts_module/ui_screen/interactionform/edit_interaction_screen.dart similarity index 98% rename from lib/ui_screen/interactionform/edit_interaction_screen.dart rename to lib/contacts_module/ui_screen/interactionform/edit_interaction_screen.dart index 7016997..40ec217 100644 --- a/lib/ui_screen/interactionform/edit_interaction_screen.dart +++ b/lib/contacts_module/ui_screen/interactionform/edit_interaction_screen.dart @@ -1,16 +1,25 @@ import 'dart:convert'; import 'dart:io'; -import 'package:discover_module/constants.dart'; -import 'package:discover_module/textScalar.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -import 'package:discover_module/ui_screen/interactionform/util.dart'; -import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/customrangeslider.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/interatciontextfield.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/textScalar.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +// import 'package:discover_module/ui_screen/interactionform/util.dart'; +// import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/customrangeslider.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/interatciontextfield.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/custombutton.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/customrangeslider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/interatciontextfield.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/responsive_ext.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -1414,24 +1423,24 @@ class _EditInteractionScreenState extends State { ); } - String textFieldsValidation(ViewInteractionProvider provider) { - if (provider.sectionList - .any((element) => element.controller!.text.isEmpty)) { - return 'Fields cannot be empty'; - } - if (provider.textEditingControllerList.isNotEmpty) { - if (provider.validateTextFields()) { - return 'Fields cannot be empty'; - } - } - if (provider.multipletextEditingControllerList.isNotEmpty) { - if (provider.validateMultipleRows()) { - return 'Fields cannot be empty'; - } - } + // String textFieldsValidation(ViewInteractionProvider provider) { + // if (provider.sectionList + // .any((element) => element.controller!.text.isEmpty)) { + // return 'Fields cannot be empty'; + // } + // if (provider.textEditingControllerList.isNotEmpty) { + // if (provider.validateTextFields()) { + // return 'Fields cannot be empty'; + // } + // } + // if (provider.multipletextEditingControllerList.isNotEmpty) { + // if (provider.validateMultipleRows()) { + // return 'Fields cannot be empty'; + // } + // } - return ''; - } + // return ''; + // } _displaySnackBar(String msg) { final snackBar = SnackBar( diff --git a/lib/ui_screen/interactionform/interaction_screen.dart b/lib/contacts_module/ui_screen/interactionform/interaction_screen.dart similarity index 99% rename from lib/ui_screen/interactionform/interaction_screen.dart rename to lib/contacts_module/ui_screen/interactionform/interaction_screen.dart index 2fa3c47..d8c7500 100644 --- a/lib/ui_screen/interactionform/interaction_screen.dart +++ b/lib/contacts_module/ui_screen/interactionform/interaction_screen.dart @@ -1,15 +1,24 @@ import 'dart:convert'; import 'dart:io'; -import 'package:discover_module/constants.dart'; -import 'package:discover_module/ui_screen/add_event/add_hcp.dart'; -import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -import 'package:discover_module/ui_screen/interactionform/util.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/customrangeslider.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/interatciontextfield.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/ui_screen/add_event/add_hcp.dart'; +// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/util.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/customrangeslider.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/interatciontextfield.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/ui_screen/add_event/add_hcp.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/custombutton.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/customrangeslider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/interatciontextfield.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/responsive_ext.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -1311,15 +1320,15 @@ class _InteractionScreenState extends State { //); } - String fieldsValidation(InteractionProvider provider) { - List secList = provider.sectionList - .where((element) => element.validation!.isRequired = true) - .toList(); - if (secList.any((element) => element.selectedValue!.isEmpty)) { - return 'Fields cannot be empty'; - } - return ''; - } + // String fieldsValidation(InteractionProvider provider) { + // List secList = provider.sectionList + // .where((element) => element.validation!.isRequired = true) + // .toList(); + // if (secList.any((element) => element.selectedValue!.isEmpty)) { + // return 'Fields cannot be empty'; + // } + // return ''; + // } String textFieldsValidation(InteractionProvider provider) { return ''; diff --git a/lib/ui_screen/interactionform/interactionlistscreen.dart b/lib/contacts_module/ui_screen/interactionform/interactionlistscreen.dart similarity index 89% rename from lib/ui_screen/interactionform/interactionlistscreen.dart rename to lib/contacts_module/ui_screen/interactionform/interactionlistscreen.dart index 571fae1..93a2954 100644 --- a/lib/ui_screen/interactionform/interactionlistscreen.dart +++ b/lib/contacts_module/ui_screen/interactionform/interactionlistscreen.dart @@ -1,8 +1,12 @@ -import 'package:discover_module/ui_screen/interactionform/interaction_screen.dart'; -import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -import 'package:discover_module/ui_screen/interactionform/new_dynamicform.dart'; -import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/new_dynamicform.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/view_forms_list.dart'; +// import 'package:discover_module/ui_screen/interactionform/interaction_screen.dart'; +// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +// import 'package:discover_module/ui_screen/interactionform/new_dynamicform.dart'; +// import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/interactionform/interactionprovider.dart b/lib/contacts_module/ui_screen/interactionform/interactionprovider.dart similarity index 97% rename from lib/ui_screen/interactionform/interactionprovider.dart rename to lib/contacts_module/ui_screen/interactionform/interactionprovider.dart index c16bb84..c67a33b 100644 --- a/lib/ui_screen/interactionform/interactionprovider.dart +++ b/lib/contacts_module/ui_screen/interactionform/interactionprovider.dart @@ -950,18 +950,25 @@ import 'dart:convert'; // import 'dart:html'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -import 'package:discover_module/ui_screen/interactionform/repository/hive_repository.dart'; -import 'package:discover_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_config_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/json_form_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/location_model.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/repository/hive_repository.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/repository/hive_repository.dart'; +// import 'package:discover_module/ui_screen/interactionform/util.dart'; import 'package:flutter/cupertino.dart'; import 'package:hive_flutter/hive_flutter.dart'; -import 'package:discover_module/ui_screen/interactionform/model/json_form_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/json_form_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/location_model.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/location_model.dart'; -import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; class InteractionProvider extends ChangeNotifier { List interactionReponseList = []; diff --git a/lib/ui_screen/interactionform/mockapi.dart b/lib/contacts_module/ui_screen/interactionform/mockapi.dart similarity index 99% rename from lib/ui_screen/interactionform/mockapi.dart rename to lib/contacts_module/ui_screen/interactionform/mockapi.dart index c6dd4b2..d373baf 100644 --- a/lib/ui_screen/interactionform/mockapi.dart +++ b/lib/contacts_module/ui_screen/interactionform/mockapi.dart @@ -4,7 +4,8 @@ import 'dart:io'; import 'package:dio/dio.dart'; import 'package:dio/io.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_config_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; import 'package:flutter/services.dart'; import 'package:http_mock_adapter/http_mock_adapter.dart'; // import 'package:pwa_ios/model/interaction_config_data.dart'; diff --git a/lib/ui_screen/interactionform/model/engagement_interaction.dart b/lib/contacts_module/ui_screen/interactionform/model/engagement_interaction.dart similarity index 93% rename from lib/ui_screen/interactionform/model/engagement_interaction.dart rename to lib/contacts_module/ui_screen/interactionform/model/engagement_interaction.dart index 274b08e..2e496dc 100644 --- a/lib/ui_screen/interactionform/model/engagement_interaction.dart +++ b/lib/contacts_module/ui_screen/interactionform/model/engagement_interaction.dart @@ -56,7 +56,8 @@ //pooja -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; import 'package:hive_flutter/hive_flutter.dart'; // import 'package:pwa_ios/model/interaction_data.dart'; diff --git a/lib/ui_screen/interactionform/model/engagement_interaction.g.dart b/lib/contacts_module/ui_screen/interactionform/model/engagement_interaction.g.dart similarity index 91% rename from lib/ui_screen/interactionform/model/engagement_interaction.g.dart rename to lib/contacts_module/ui_screen/interactionform/model/engagement_interaction.g.dart index 7bbea37..5b86662 100644 --- a/lib/ui_screen/interactionform/model/engagement_interaction.g.dart +++ b/lib/contacts_module/ui_screen/interactionform/model/engagement_interaction.g.dart @@ -6,10 +6,10 @@ part of 'engagement_interaction.dart'; // TypeAdapterGenerator // ************************************************************************** -class InteractionConfigDataAdapter +class InteractionConfigDataEngAdapter extends TypeAdapter { @override - final int typeId = 19; + final int typeId = 29; @override InteractionConfigDataEng read(BinaryReader reader) { @@ -45,7 +45,7 @@ class InteractionConfigDataAdapter @override bool operator ==(Object other) => identical(this, other) || - other is InteractionConfigDataAdapter && + other is InteractionConfigDataEngAdapter && runtimeType == other.runtimeType && typeId == other.typeId; } diff --git a/lib/ui_screen/interactionform/model/interaction_config_data.dart b/lib/contacts_module/ui_screen/interactionform/model/interaction_config_data.dart similarity index 93% rename from lib/ui_screen/interactionform/model/interaction_config_data.dart rename to lib/contacts_module/ui_screen/interactionform/model/interaction_config_data.dart index 696b986..7175bcc 100644 --- a/lib/ui_screen/interactionform/model/interaction_config_data.dart +++ b/lib/contacts_module/ui_screen/interactionform/model/interaction_config_data.dart @@ -56,7 +56,8 @@ //pooja -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; import 'package:hive_flutter/hive_flutter.dart'; // import 'package:pwa_ios/model/interaction_data.dart'; diff --git a/lib/ui_screen/interactionform/model/interaction_config_data.g.dart b/lib/contacts_module/ui_screen/interactionform/model/interaction_config_data.g.dart similarity index 100% rename from lib/ui_screen/interactionform/model/interaction_config_data.g.dart rename to lib/contacts_module/ui_screen/interactionform/model/interaction_config_data.g.dart diff --git a/lib/ui_screen/interactionform/model/interaction_config_data.g1.dart b/lib/contacts_module/ui_screen/interactionform/model/interaction_config_data.g1.dart similarity index 100% rename from lib/ui_screen/interactionform/model/interaction_config_data.g1.dart rename to lib/contacts_module/ui_screen/interactionform/model/interaction_config_data.g1.dart diff --git a/lib/ui_screen/interactionform/model/interaction_data.dart b/lib/contacts_module/ui_screen/interactionform/model/interaction_data.dart similarity index 100% rename from lib/ui_screen/interactionform/model/interaction_data.dart rename to lib/contacts_module/ui_screen/interactionform/model/interaction_data.dart diff --git a/lib/ui_screen/interactionform/model/interaction_data.g.dart b/lib/contacts_module/ui_screen/interactionform/model/interaction_data.g.dart similarity index 100% rename from lib/ui_screen/interactionform/model/interaction_data.g.dart rename to lib/contacts_module/ui_screen/interactionform/model/interaction_data.g.dart diff --git a/lib/ui_screen/interactionform/model/json_form_data.dart b/lib/contacts_module/ui_screen/interactionform/model/json_form_data.dart similarity index 100% rename from lib/ui_screen/interactionform/model/json_form_data.dart rename to lib/contacts_module/ui_screen/interactionform/model/json_form_data.dart diff --git a/lib/ui_screen/interactionform/model/json_form_data.g.dart b/lib/contacts_module/ui_screen/interactionform/model/json_form_data.g.dart similarity index 100% rename from lib/ui_screen/interactionform/model/json_form_data.g.dart rename to lib/contacts_module/ui_screen/interactionform/model/json_form_data.g.dart diff --git a/lib/ui_screen/interactionform/model/location_model.dart b/lib/contacts_module/ui_screen/interactionform/model/location_model.dart similarity index 100% rename from lib/ui_screen/interactionform/model/location_model.dart rename to lib/contacts_module/ui_screen/interactionform/model/location_model.dart diff --git a/lib/ui_screen/interactionform/model/medical_insight.dart b/lib/contacts_module/ui_screen/interactionform/model/medical_insight.dart similarity index 100% rename from lib/ui_screen/interactionform/model/medical_insight.dart rename to lib/contacts_module/ui_screen/interactionform/model/medical_insight.dart diff --git a/lib/ui_screen/interactionform/model/save_interaction.dart b/lib/contacts_module/ui_screen/interactionform/model/save_interaction.dart similarity index 94% rename from lib/ui_screen/interactionform/model/save_interaction.dart rename to lib/contacts_module/ui_screen/interactionform/model/save_interaction.dart index 56dd893..8f1b576 100644 --- a/lib/ui_screen/interactionform/model/save_interaction.dart +++ b/lib/contacts_module/ui_screen/interactionform/model/save_interaction.dart @@ -4,7 +4,8 @@ import 'dart:convert'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; import 'package:hive_flutter/hive_flutter.dart'; // import 'package:pwa_ios/model/interaction_data.dart'; part 'save_interaction.g.dart'; diff --git a/lib/ui_screen/interactionform/model/save_interaction.g.dart b/lib/contacts_module/ui_screen/interactionform/model/save_interaction.g.dart similarity index 100% rename from lib/ui_screen/interactionform/model/save_interaction.g.dart rename to lib/contacts_module/ui_screen/interactionform/model/save_interaction.g.dart diff --git a/lib/ui_screen/interactionform/new_dynamicform.dart b/lib/contacts_module/ui_screen/interactionform/new_dynamicform.dart similarity index 94% rename from lib/ui_screen/interactionform/new_dynamicform.dart rename to lib/contacts_module/ui_screen/interactionform/new_dynamicform.dart index ec5160d..97f012b 100644 --- a/lib/ui_screen/interactionform/new_dynamicform.dart +++ b/lib/contacts_module/ui_screen/interactionform/new_dynamicform.dart @@ -1,15 +1,13 @@ import 'dart:convert'; import 'dart:io'; -import 'package:discover_module/constants.dart'; -import 'package:discover_module/ui_screen/add_event/add_hcp.dart'; -import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -import 'package:discover_module/ui_screen/interactionform/util.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/customrangeslider.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/interatciontextfield.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/custombutton.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/customrangeslider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/responsive_ext.dart'; import 'package:dropdownfield2/dropdownfield2.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -29,6 +27,8 @@ import 'package:path/path.dart' as p; //import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter_carousel_widget/flutter_carousel_widget.dart'; +import 'widget/interatciontextfield.dart'; + // import 'package:popover/popover.dart'; class InteractionScreen1 extends StatefulWidget { @@ -791,177 +791,182 @@ class _InteractionScreen1State extends State { // ), // ) - Expanded( - child: Stack( - children: [ - Column( - children: [ - TextField( - controller: _controller11, - onChanged: (text) { - setState(() { - _showSuggestions = text - .isNotEmpty; // Show suggestions if text is not empty - }); - }, - decoration: InputDecoration( - hintText: 'Start typing...', - ), - ), - // Additional widgets can go here if needed - ], - ), - if (_showSuggestions) - Container( - // height: 1200, - color: Colors.white, - child: SizedBox( - height: MediaQuery.of(context).size.height, - child: Expanded( - child: ListView( - shrinkWrap: true, - padding: EdgeInsets.zero, - children: _suggestions - .where((suggestion) => suggestion - .toLowerCase() - .contains(_controller11.text - .toLowerCase())) - .map((suggestion) { - final startIndex = suggestion - .toLowerCase() - .indexOf( - _controller11.text.toLowerCase()); - final endIndex = startIndex + - _controller11.text.length; + // Expanded( + // child: Stack( + // children: [ + // Column( + // children: [ + // TextField( + // controller: _controller11, + // onChanged: (text) { + // setState(() { + // _showSuggestions = text + // .isNotEmpty; // Show suggestions if text is not empty + // }); + // }, + // decoration: InputDecoration( + // hintText: 'Start typing...', + // ), + // ), + // // Additional widgets can go here if needed + // ], + // ), + // if (_showSuggestions) + // Container( + // // height: 1200, + // color: Colors.white, + // child: SizedBox( + // height: MediaQuery.of(context).size.height, + // child: Expanded( + // child: ListView( + // shrinkWrap: true, + // padding: EdgeInsets.zero, + // children: _suggestions + // .where((suggestion) => suggestion + // .toLowerCase() + // .contains(_controller11.text + // .toLowerCase())) + // .map((suggestion) { + // final startIndex = suggestion + // .toLowerCase() + // .indexOf( + // _controller11.text.toLowerCase()); + // final endIndex = startIndex + + // _controller11.text.length; - return ListTile( - title: RichText( - text: TextSpan( - children: [ - TextSpan( - text: suggestion.substring( - 0, startIndex), - style: TextStyle( - color: Colors.black), - ), - TextSpan( - text: suggestion.substring( - startIndex, endIndex), - style: TextStyle( - color: Colors.blue, - fontWeight: - FontWeight.bold), - ), - TextSpan( - text: suggestion - .substring(endIndex), - style: TextStyle( - color: Colors.black), - ), - ], - ), - ), - onTap: () { - _controller11.text = suggestion; - _controller11.selection = - TextSelection.fromPosition( - TextPosition( - offset: - _controller11.text.length), - ); - setState(() { - _showSuggestions = - false; // Hide suggestions after selection - }); - }, - ); - }).toList(), - ), - ), - ), - ), - ], + // return ListTile( + // title: RichText( + // text: TextSpan( + // children: [ + // TextSpan( + // text: suggestion.substring( + // 0, startIndex), + // style: TextStyle( + // color: Colors.black), + // ), + // TextSpan( + // text: suggestion.substring( + // startIndex, endIndex), + // style: TextStyle( + // color: Colors.blue, + // fontWeight: + // FontWeight.bold), + // ), + // TextSpan( + // text: suggestion + // .substring(endIndex), + // style: TextStyle( + // color: Colors.black), + // ), + // ], + // ), + // ), + // onTap: () { + // _controller11.text = suggestion; + // _controller11.selection = + // TextSelection.fromPosition( + // TextPosition( + // offset: + // _controller11.text.length), + // ); + // setState(() { + // _showSuggestions = + // false; // Hide suggestions after selection + // }); + // }, + // ); + // }).toList(), + // ), + // ), + // ), + // ), + // ], + // ) + // // child: Column( + // // children: [ + // // TextField( + // // controller: _controller11, + // // onChanged: (text) { + // // setState(() { + // // _showSuggestions = text + // // .isNotEmpty; // Show suggestions if text is not empty + // // }); + // // }, + // // decoration: InputDecoration( + // // hintText: 'Start typing...', + // // ), + // // ), + // // if (_showSuggestions) + // // Container( + // // height: 400, + // // child: Expanded( + // // child: ListView( + // // children: _suggestions + // // .where((suggestion) => suggestion + // // .toLowerCase() + // // .contains(_controller11.text + // // .toLowerCase())) + // // .map((suggestion) { + // // final startIndex = suggestion + // // .toLowerCase() + // // .indexOf( + // // _controller11.text.toLowerCase()); + // // final endIndex = startIndex + + // // _controller11.text.length; + + // // return ListTile( + // // title: RichText( + // // text: TextSpan( + // // children: [ + // // TextSpan( + // // text: suggestion.substring( + // // 0, startIndex), + // // style: TextStyle( + // // color: Colors.black), + // // ), + // // TextSpan( + // // text: suggestion.substring( + // // startIndex, endIndex), + // // style: TextStyle( + // // color: Colors.blue, + // // fontWeight: + // // FontWeight.bold), + // // ), + // // TextSpan( + // // text: suggestion + // // .substring(endIndex), + // // style: TextStyle( + // // color: Colors.black), + // // ), + // // ], + // // ), + // // ), + // // onTap: () { + // // _controller11.text = suggestion; + // // _controller11.selection = + // // TextSelection.fromPosition( + // // TextPosition( + // // offset: + // // _controller11.text.length), + // // ); + // // setState(() { + // // _showSuggestions = + // // false; // Hide suggestions after selection + // // }); + // // }, + // // ); + // // }).toList(), + // // ), + // // ), + // // ), + // // ], + // // ), + // ) + Text( + sectionItem.depid!, + style: TextStyle( + fontSize: 18.0, fontWeight: FontWeight.normal), ) - // child: Column( - // children: [ - // TextField( - // controller: _controller11, - // onChanged: (text) { - // setState(() { - // _showSuggestions = text - // .isNotEmpty; // Show suggestions if text is not empty - // }); - // }, - // decoration: InputDecoration( - // hintText: 'Start typing...', - // ), - // ), - // if (_showSuggestions) - // Container( - // height: 400, - // child: Expanded( - // child: ListView( - // children: _suggestions - // .where((suggestion) => suggestion - // .toLowerCase() - // .contains(_controller11.text - // .toLowerCase())) - // .map((suggestion) { - // final startIndex = suggestion - // .toLowerCase() - // .indexOf( - // _controller11.text.toLowerCase()); - // final endIndex = startIndex + - // _controller11.text.length; - - // return ListTile( - // title: RichText( - // text: TextSpan( - // children: [ - // TextSpan( - // text: suggestion.substring( - // 0, startIndex), - // style: TextStyle( - // color: Colors.black), - // ), - // TextSpan( - // text: suggestion.substring( - // startIndex, endIndex), - // style: TextStyle( - // color: Colors.blue, - // fontWeight: - // FontWeight.bold), - // ), - // TextSpan( - // text: suggestion - // .substring(endIndex), - // style: TextStyle( - // color: Colors.black), - // ), - // ], - // ), - // ), - // onTap: () { - // _controller11.text = suggestion; - // _controller11.selection = - // TextSelection.fromPosition( - // TextPosition( - // offset: - // _controller11.text.length), - // ); - // setState(() { - // _showSuggestions = - // false; // Hide suggestions after selection - // }); - // }, - // ); - // }).toList(), - // ), - // ), - // ), - // ], - // ), - ) : Expanded( child: Padding( padding: const EdgeInsets.only(left: 8.0, right: 8.0), diff --git a/lib/ui_screen/interactionform/repository/hive_repository.dart b/lib/contacts_module/ui_screen/interactionform/repository/hive_repository.dart similarity index 87% rename from lib/ui_screen/interactionform/repository/hive_repository.dart rename to lib/contacts_module/ui_screen/interactionform/repository/hive_repository.dart index 3248fd6..954acb6 100644 --- a/lib/ui_screen/interactionform/repository/hive_repository.dart +++ b/lib/contacts_module/ui_screen/interactionform/repository/hive_repository.dart @@ -1,4 +1,5 @@ -import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_config_data.dart'; import 'package:flutter/material.dart'; import 'package:hive/hive.dart'; diff --git a/lib/ui_screen/interactionform/util.dart b/lib/contacts_module/ui_screen/interactionform/util.dart similarity index 80% rename from lib/ui_screen/interactionform/util.dart rename to lib/contacts_module/ui_screen/interactionform/util.dart index 2e20268..200d5a6 100644 --- a/lib/ui_screen/interactionform/util.dart +++ b/lib/contacts_module/ui_screen/interactionform/util.dart @@ -1,9 +1,13 @@ import 'dart:io'; -import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/model/json_form_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/json_form_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +// import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/json_form_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart'; import 'package:flutter/material.dart'; import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:hive_flutter/hive_flutter.dart'; diff --git a/lib/ui_screen/interactionform/view_forms_list.dart b/lib/contacts_module/ui_screen/interactionform/view_forms_list.dart similarity index 86% rename from lib/ui_screen/interactionform/view_forms_list.dart rename to lib/contacts_module/ui_screen/interactionform/view_forms_list.dart index ec99fb7..3b17a2a 100644 --- a/lib/ui_screen/interactionform/view_forms_list.dart +++ b/lib/contacts_module/ui_screen/interactionform/view_forms_list.dart @@ -1,12 +1,19 @@ -import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/edit_interaction_screen.dart'; -import 'package:discover_module/ui_screen/interactionform/mockapi.dart'; -import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -import 'package:discover_module/ui_screen/interactionform/util.dart'; -import 'package:discover_module/ui_screen/interactionform/view_interaction_screen.dart'; -import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; -import 'package:discover_module/ui_screen/new_editinteraction.dart'; -import 'package:discover_module/ui_screen/new_viewinteraction.dart'; +// import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/edit_interaction_screen.dart'; +// import 'package:discover_module/ui_screen/interactionform/mockapi.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +// import 'package:discover_module/ui_screen/interactionform/util.dart'; +// import 'package:discover_module/ui_screen/interactionform/view_interaction_screen.dart'; +// import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; +// import 'package:discover_module/ui_screen/new_editinteraction.dart'; +// import 'package:discover_module/ui_screen/new_viewinteraction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/configprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/mockapi.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/new_editinteraction.dart'; +import 'package:discover_module/contacts_module/ui_screen/new_viewinteraction.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/interactionform/view_interaction_screen.dart b/lib/contacts_module/ui_screen/interactionform/view_interaction_screen.dart similarity index 97% rename from lib/ui_screen/interactionform/view_interaction_screen.dart rename to lib/contacts_module/ui_screen/interactionform/view_interaction_screen.dart index 1f0f02d..0a612d5 100644 --- a/lib/ui_screen/interactionform/view_interaction_screen.dart +++ b/lib/contacts_module/ui_screen/interactionform/view_interaction_screen.dart @@ -1,10 +1,17 @@ -import 'package:discover_module/constants.dart'; -import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -import 'package:discover_module/ui_screen/interactionform/util.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +// import 'package:discover_module/ui_screen/interactionform/util.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/custombutton.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/responsive_ext.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/interactionform/viewinteractionprovider.dart b/lib/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart similarity index 97% rename from lib/ui_screen/interactionform/viewinteractionprovider.dart rename to lib/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart index 317a335..093ee1b 100644 --- a/lib/ui_screen/interactionform/viewinteractionprovider.dart +++ b/lib/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart @@ -1,13 +1,20 @@ import 'dart:convert'; import 'package:dio/dio.dart'; -import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/json_form_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/location_model.dart'; -import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -import 'package:discover_module/ui_screen/interactionform/repository/hive_repository.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_config_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/json_form_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/location_model.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/repository/hive_repository.dart'; +// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/json_form_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/location_model.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +// import 'package:discover_module/ui_screen/interactionform/repository/hive_repository.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/services.dart'; import 'package:hive_flutter/hive_flutter.dart'; diff --git a/lib/ui_screen/interactionform/widget/custombutton.dart b/lib/contacts_module/ui_screen/interactionform/widget/custombutton.dart similarity index 100% rename from lib/ui_screen/interactionform/widget/custombutton.dart rename to lib/contacts_module/ui_screen/interactionform/widget/custombutton.dart diff --git a/lib/ui_screen/interactionform/widget/customrangeslider.dart b/lib/contacts_module/ui_screen/interactionform/widget/customrangeslider.dart similarity index 86% rename from lib/ui_screen/interactionform/widget/customrangeslider.dart rename to lib/contacts_module/ui_screen/interactionform/widget/customrangeslider.dart index bda0dc9..f89aff0 100644 --- a/lib/ui_screen/interactionform/widget/customrangeslider.dart +++ b/lib/contacts_module/ui_screen/interactionform/widget/customrangeslider.dart @@ -1,4 +1,5 @@ -import 'package:discover_module/ui_screen/interactionform/util.dart'; +// import 'package:discover_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; import 'package:flutter/material.dart'; // ignore: must_be_immutable diff --git a/lib/ui_screen/interactionform/widget/interatciontextfield.dart b/lib/contacts_module/ui_screen/interactionform/widget/interatciontextfield.dart similarity index 100% rename from lib/ui_screen/interactionform/widget/interatciontextfield.dart rename to lib/contacts_module/ui_screen/interactionform/widget/interatciontextfield.dart diff --git a/lib/ui_screen/interactionform/widget/location_showmore.dart b/lib/contacts_module/ui_screen/interactionform/widget/location_showmore.dart similarity index 92% rename from lib/ui_screen/interactionform/widget/location_showmore.dart rename to lib/contacts_module/ui_screen/interactionform/widget/location_showmore.dart index 928b826..3170cce 100644 --- a/lib/ui_screen/interactionform/widget/location_showmore.dart +++ b/lib/contacts_module/ui_screen/interactionform/widget/location_showmore.dart @@ -1,5 +1,7 @@ -import 'package:discover_module/provider_class/location_provider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/provider_class/location_provider.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/provider_class/location_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/interactionform/widget/responsive_ext.dart b/lib/contacts_module/ui_screen/interactionform/widget/responsive_ext.dart similarity index 100% rename from lib/ui_screen/interactionform/widget/responsive_ext.dart rename to lib/contacts_module/ui_screen/interactionform/widget/responsive_ext.dart diff --git a/lib/contacts_module/ui_screen/k2api_integrated_ui/activityk2_tab.dart b/lib/contacts_module/ui_screen/k2api_integrated_ui/activityk2_tab.dart new file mode 100644 index 0000000..2cb3f17 --- /dev/null +++ b/lib/contacts_module/ui_screen/k2api_integrated_ui/activityk2_tab.dart @@ -0,0 +1,737 @@ +// import 'package:discover_module/constants.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/custom_expansiontile.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.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_event_k2.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_aff_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_event_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/publications_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/trials_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart'; +import 'package:discover_module/contacts_module/ui_screen/publication_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/trials_show_more.dart'; +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_aff_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_event_k2.dart'; +// import 'package:discover_module/provider_class/affiliationsprovider.dart'; +// import 'package:discover_module/provider_class/events_provider.dart'; +// import 'package:discover_module/provider_class/k2_provider/kol_aff_provider.dart'; +// import 'package:discover_module/provider_class/k2_provider/kol_event_provider.dart'; +// import 'package:discover_module/provider_class/publications_provider.dart'; +// import 'package:discover_module/provider_class/trials_provider.dart'; +// import 'package:discover_module/ui_screen/affiliation_data.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/ui_screen/events_data.dart'; +// import 'package:discover_module/ui_screen/k2api_integrated_ui/bottomsheetk2.dart'; +// import 'package:discover_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart'; +// import 'package:discover_module/ui_screen/publication_data.dart'; +// import 'package:discover_module/ui_screen/trials_show_more.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class ActivitiesK2 extends StatefulWidget { + //Activities({super.key, required text}); + ActivitiesK2({required this.text, Key? key}) : super(key: key); + + final int text; + + @override + State createState() => _ActivitiesState(); +} + +class _ActivitiesState extends State { + bool _isExpanded = false; + + List affiliation_data = []; + List publication_data = []; + List event_data = []; + List trial_data = []; + List medinsightData = []; + List speaker = []; + List eng = []; + @override + void initState() { + // TODO: implement initState + super.initState(); + getaffiliations(); + } + + getaffiliations() async { + var publist; + var affiliations = + Provider.of(context, listen: false); + + await affiliations.getAffiliationsdata(widget.text); + final affilist = affiliations.adddta; + setState(() { + affiliation_data = affilist; + }); + + print("CheckingAfflist: $affilist"); + + if (mounted) { + var publication = Provider.of(context, listen: false); + + await publication.publicatininfo(widget.text); + publist = publication.publicationlist; + setState(() { + publication_data = publist; + }); + } + + if (mounted) { + var events = Provider.of(context, listen: false); + await events.geteventdata(widget.text); + final eventlist = events.EventsList; + + setState(() { + event_data = eventlist; + }); + } + + if (mounted) { + var trials = Provider.of(context, listen: false); + await trials.trialsdata(widget.text); + + final trialslist = trials.trialsinfo; + + setState(() { + trial_data = trialslist; + }); + } + + print("Affiliations_data_isNewOff123: ${affiliation_data}"); + print("Publication_data_isNewOff: $publication_data"); + } + + @override + Widget build(BuildContext context) { + return Center( + child: ListView(children: [ + affiliation_data.length != 0 + ? CustomExpansionTile( + title: "Affiliations", + itemList: affiliation_data.cast(), + buttonText: 'Show More', + field1: 'Organization Name', + field2: 'TimeFrame', + onItemSelected: (AffList selectedLocation) { + List> keyValue = [ + { + "Department": selectedLocation.department, + "Title": selectedLocation.title, + "Start Year": selectedLocation.startYear, + "End Year": selectedLocation.endYear, + "Role": selectedLocation.role, + "Organization Type": selectedLocation.kolOrganizationType, + "Engagement Type": selectedLocation.kolEngagementType, + } + ]; + modelbsheet(keyValue); + }, + ) + : Container(), + + publication_data.length != 0 + ? ListTileTheme( + dense: true, + child: Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Card( + margin: EdgeInsets.all(1.0), + // elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + color: Constants.k2color11, + child: ExpansionTile( + initiallyExpanded: false, + maintainState: true, + // backgroundColor: Colors.white, + // collapsedBackgroundColor: Color(0xFF2b9af3), + onExpansionChanged: (bool expanded) { + setState(() { + _isExpanded = expanded; + }); + }, + backgroundColor: Constants.k2color11, + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.black), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Publications", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + const SizedBox( + width: 8.0, + ), + Text1( + title: + "(${publication_data.length.toString()})", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + ], + ), + children: [ + Scrollbar( + //isAlwaysShown: true, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Container( + constraints: BoxConstraints( + minWidth: + MediaQuery.of(context).size.width), + color: Colors.white, + child: DataTable( + showCheckboxColumn: false, + columns: const [ + DataColumn( + label: Expanded( + child: Text('Article Title', + style: TextStyle( + fontWeight: FontWeight.w600), + softWrap: true), + )), + + DataColumn( + label: Expanded( + child: Text('Authors', + style: TextStyle( + fontWeight: + FontWeight.w600)))), + + // Add more columns as needed + ], + rows: List.generate( + publication_data.take(2).length, + (index) => DataRow( + onSelectChanged: (value) { + // =======> Use onSelectChanged for tab + print( + "message ${publication_data[index]}"); + + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: + Clip.antiAliasWithSaveLayer, + context: context, + builder: (context) { + return bsheet( + publication_data[index]); + }, + ); + }, + cells: [ + DataCell(Text( + publication_data[index] + .articalTitle + .toString(), + softWrap: true)), + + DataCell(Text( + publication_data[index] + .author + .toString(), + softWrap: true)), + + // Add more DataCells as needed + ], + ), + ), + ), + ), + ), + ), + Container( + color: Colors.white, + child: Align( + alignment: Alignment.center, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: OutlinedButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => PublicationsData( + text: widget.text))); + }, + child: Text( + 'Show More', + style: TextStyle(color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ), + ) + ]), + ), + ), + ) + : Container(), // adds spacing between the text and image + + event_data.length != 0 + ? CustomExpansionTile( + title: "Events", + itemList: event_data.cast(), + buttonText: 'Show More', + field1: 'Event Name', + field2: 'Role', + onItemSelected: (EventList selectedLocation) { + List> keyValue = [ + { + "Name": selectedLocation.name, + "Notes": selectedLocation.notes, + "Partially Released Event": + selectedLocation.partiallyReleasedEvent, + } + ]; + modelbsheet(keyValue); + }, + ) + : Container(), + + trial_data.length != 0 + ? ListTileTheme( + dense: true, + child: Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Card( + margin: EdgeInsets.all(1.0), + //elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + color: Constants.k2color11, + child: ExpansionTile( + initiallyExpanded: false, + maintainState: true, + onExpansionChanged: (bool expanded) { + setState(() { + _isExpanded = expanded; + }); + }, + backgroundColor: Constants.k2color11, + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.black), + // backgroundColor: Colors.white, + // collapsedBackgroundColor: Color(0xFF2b9af3), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Trials", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + const SizedBox( + width: 8.0, + ), + Text1( + title: "(${trial_data.length.toString()})", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.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: const [ + DataColumn( + label: Expanded( + child: Text('Trial Name', + softWrap: true, + style: TextStyle( + fontWeight: FontWeight.w600)), + )), + DataColumn( + label: Expanded( + child: Text('Status', + softWrap: true, + style: TextStyle( + fontWeight: + FontWeight.w600)))), + ], + rows: List.generate( + trial_data.take(2).length, + (index) => DataRow( + onSelectChanged: (value) { + // =======> Use onSelectChanged for tab + print("message ${trial_data[index]}"); + + // bsheet( + // publication_data[ + // index]); + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: + Clip.antiAliasWithSaveLayer, + context: context, + builder: (context) { + return bsheet(trial_data[index]); + }, + ); + }, + cells: [ + DataCell(Text( + trial_data[index] + .trialName + .toString(), + softWrap: true)), + DataCell(Text( + trial_data[index].status.toString(), + softWrap: true)), + ], + ), + ), + ), + ), + ), + ), + Container( + color: Colors.white, + child: Align( + alignment: Alignment.center, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: OutlinedButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => TrialsShowmore( + text: widget.text))); + }, + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: Text( + 'Show More', + style: TextStyle(color: Constants.k2color), + ), + ), + ), + ), + ) + ]), + ), + ), + ) + : Container(), // adds spacing between the text and image + ]), + ); + } + + void bottomshet(affiliation_data) { + // print("Aff_index_data: ${affiliation_data}"); + showModalBottomSheet( + // isScrollControlled: + // true, + + context: context, + + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: Clip.antiAliasWithSaveLayer, + // sheetAnimationStyle: _animationStyle, + builder: (BuildContext context) { + return + // makeDismissible( + // child: + DraggableScrollableSheet( + expand: false, + builder: (BuildContext context, ScrollController scrollController) { + return Container( + width: MediaQuery.of(context).size.width, + //color: Colors.white, + color: Color.fromARGB(255, 246, 248, 252), + + // decoration: + // BoxDecoration(borderRadius: BorderRadius.circular(10)), + // child: ListView( + // children: [ + + // ], + // ), + + child: Column( + children: [ + Expanded( + child: ListView.builder( + controller: scrollController, + itemCount: 1, + itemBuilder: (BuildContext context, int index) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // Row( + // children: [ + // Text( + // "Affiliation", + // style: TextStyle(fontSize: 20.0), + // ) + // ], + // ), + SizedBox( + height: 18.0, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Text( + affiliation_data.org_name, + softWrap: true, + maxLines: 4, + style: TextStyle( + fontSize: 16.0, color: Colors.black), + ), + ), + ), + ], + ), + SizedBox( + height: 18.0, + ), + Divider(), + SizedBox( + height: 8.0, + ), + + affiliation_data['dept'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + "Department", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['dept'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + affiliation_data['role'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Role", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['role'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + affiliation_data['time_frame'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Time Frame".toString(), + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['time_frame'] + .toString(), + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + affiliation_data['org_type'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Oraganization Type", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['org_type'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + + affiliation_data['emg_type'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Eng Type", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['emg_type'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + ], + ); + }, + ), + ), + ], + ), + ); + }, + ); + //); + }, + ); + } + + void modelbsheet(List> keyValue) { + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: Clip.antiAliasWithSaveLayer, + context: context, + builder: (context) { + return bsheetk2new(keyValue); + }, + ); + } +} diff --git a/lib/contacts_module/ui_screen/k2api_integrated_ui/bottomsheetk2.dart b/lib/contacts_module/ui_screen/k2api_integrated_ui/bottomsheetk2.dart new file mode 100644 index 0000000..283121e --- /dev/null +++ b/lib/contacts_module/ui_screen/k2api_integrated_ui/bottomsheetk2.dart @@ -0,0 +1,292 @@ +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_Certificate_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_aff_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_awards_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_education_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_email_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_event_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_location_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_pno_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_training_k2.dart'; +// import 'package:discover_module/storage_hive/email_data/email_model_hive.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 bsheetk2 extends StatefulWidget { + bsheetk2(this.selectedLocation, {super.key}); + final selectedLocation; + + @override + State createState() => _bsheetk2State(); +} + +class _bsheetk2State extends State { + @override + Widget build(BuildContext context) { + return DraggableScrollableSheet( + expand: false, + builder: (BuildContext context, ScrollController scrollController) { + return Container( + width: MediaQuery.of(context).size.width, + //color: Color.fromARGB(255, 246, 248, 252), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(0)), + child: Column( + children: [ + Expanded( + child: ListView.builder( + controller: scrollController, + itemCount: 1, + itemBuilder: (BuildContext context, int index) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + getPostalCodeText(widget.selectedLocation), + // Padding( + // padding: const EdgeInsets.all(8.0), + // child: Text1( + // title: (widget.selectedLocation is Data) + // ? "PostalCode \n${widget.selectedLocation.postalCode}" + // : (widget.selectedLocation is DataPhno) + // ? "phoneTypeName \n${(widget.selectedLocation as DataPhno).phoneTypeName}" + // : (widget.selectedLocation is EmailData) + // ? "PhoneNo1 \n${(widget.selectedLocation as EmailData).emailTypeName}" + // : ""), + // ), + ], + ); + }), + ), + ], + ), + ); + }, + ); + } + + getPostalCodeText(location) { + if (location is Data) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Address \n${location.address1}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "PostalCode \n${location.postalCode}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1( + title: "Organization Name \n${location.organizationName}"), + ), + ], + ); + } else if (location is DataPhno) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Phone Type \n${location.phoneTypeName}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Phone Number \n${location.number}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1( + title: "Organization Name \n${location.organizationName}"), + ), + ], + ); + } else if (location is EmailData) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Email Type \n${location.emailTypeName}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Email \n${location.email}"), + ), + ], + ); + } else if (location is TrainingList) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Institution \n${location.organizationId}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Degree \n${location.degree}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Specialty \n${location.specialty}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "StartDate \n${location.startDate}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "EndDate \n${location.endDate}"), + ), + ], + ); + } else if (location is EducationList) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Institution \n${location.organizationId}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Degree \n${location.degree}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Specialty \n${location.specialty}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "StartDate \n${location.startDate}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "EndDate \n${location.endDate}"), + ), + ], + ); + } else if (location is AwardsList) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Name \n${location.name}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Start Date \n${location.startDate}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "End Date \n${location.endDate}"), + ), + ], + ); + } else if (location is CertificateList) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Name \n${location.organizationId}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Specialty \n${location.specialty}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Start Date \n${location.startDate}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "End Date \n${location.endDate}"), + ), + ], + ); + } else if (location is AffList) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Title \n${location.title}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Role \n${location.role}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Start Year \n${location.startYear}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "End Year \n${location.endYear}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Start Year \n${location.startYear}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1( + title: "Organization Name \n${location.kolOrganizationName}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1( + title: "Organization Type \n${location.kolOrganizationType}"), + ), + ], + ); + } else if (location is EventList) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Name \n${location.name}"), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Text1(title: "Notes \n${location.notes}"), + ), + ], + ); + } + } +} diff --git a/lib/contacts_module/ui_screen/k2api_integrated_ui/callbottomsheet.dart b/lib/contacts_module/ui_screen/k2api_integrated_ui/callbottomsheet.dart new file mode 100644 index 0000000..712c995 --- /dev/null +++ b/lib/contacts_module/ui_screen/k2api_integrated_ui/callbottomsheet.dart @@ -0,0 +1,34 @@ +// import 'package:flutter/material.dart'; + +// class callbsheet extends StatefulWidget { +// const callbsheet({super.key}); + +// @override +// State createState() => _callbsheetState(); +// } + +// class _callbsheetState extends State { +// @override +// Widget build(BuildContext context) { +// return const showModalBottomSheet( +// useRootNavigator: true, +// isScrollControlled: false, +// enableDrag: true, +// useSafeArea: true, +// constraints: const BoxConstraints( +// maxWidth: double.infinity, +// ), +// shape: const RoundedRectangleBorder( +// borderRadius: BorderRadius.vertical( +// top: Radius.circular(0), +// ), +// ), +// clipBehavior: Clip.antiAliasWithSaveLayer, +// context: context, +// builder: (context) { +// return bsheetk2new(keyValue); +// }, +// ); +// ; +// } +// } diff --git a/lib/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart b/lib/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart new file mode 100644 index 0000000..b92d1ab --- /dev/null +++ b/lib/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart @@ -0,0 +1,72 @@ +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_Certificate_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_aff_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_awards_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_education_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_email_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_event_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_location_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_pno_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_training_k2.dart'; +// import 'package:discover_module/storage_hive/email_data/email_model_hive.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:flutter/material.dart'; + +class bsheetk2new extends StatefulWidget { + bsheetk2new(this.selectedLocation, {super.key}); + final selectedLocation; + + @override + State createState() => _bsheetk2State(); +} + +class _bsheetk2State extends State { + @override + Widget build(BuildContext context) { + return DraggableScrollableSheet( + expand: false, + builder: (BuildContext context, ScrollController scrollController) { + return Container( + width: MediaQuery.of(context).size.width, + //color: Color.fromARGB(255, 246, 248, 252), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(0)), + child: Column( + children: [ + Expanded( + child: ListView.builder( + controller: scrollController, + itemCount: widget.selectedLocation.length, + itemBuilder: (BuildContext context, int index) { + var data = widget.selectedLocation[index]; + + List keys = data.keys.toList(); + + print("Checkingdata: $data"); + print("Checkingdata: $keys"); + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // getPostalCodeText(widget.selectedLocation), + for (var key in keys) + Padding( + padding: + const EdgeInsets.symmetric(vertical: 4.0), + child: Text1( + title: + ' $key \n ${data[key]}', // Display key and corresponding value + ), + ) // Text1(title: data.keyValue) + ], + ); + }), + ), + ], + ), + ); + }, + ); + } +} diff --git a/lib/contacts_module/ui_screen/k2api_integrated_ui/kol_list.dart b/lib/contacts_module/ui_screen/k2api_integrated_ui/kol_list.dart new file mode 100644 index 0000000..4d2a032 --- /dev/null +++ b/lib/contacts_module/ui_screen/k2api_integrated_ui/kol_list.dart @@ -0,0 +1,1372 @@ +import 'dart:io'; + +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/hive_fun.dart'; +import 'package:discover_module/contacts_module/provider_class/affiliationsprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/award_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/certificate_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/educationprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/email_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/events_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_list_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/location_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/nih_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/patent_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/phoneno_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/procedureprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/publications_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/speaker_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/training_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/trials_provider.dart'; +import 'package:discover_module/contacts_module/storage_hive/aff_data/insert_aff.dart'; +import 'package:discover_module/contacts_module/storage_hive/awa_data/crud_awa.dart'; +import 'package:discover_module/contacts_module/storage_hive/cer_hive/crud_cer.dart'; +import 'package:discover_module/contacts_module/storage_hive/edu_data/crud_edu.dart'; +import 'package:discover_module/contacts_module/storage_hive/email_data/crud_email.dart'; +import 'package:discover_module/contacts_module/storage_hive/events_data/crud_event.dart'; +import 'package:discover_module/contacts_module/storage_hive/kol_info/curd_kol.dart'; +import 'package:discover_module/contacts_module/storage_hive/loc_data/crud_loc.dart'; +import 'package:discover_module/contacts_module/storage_hive/nih_grant_data/crud_nih.dart'; +import 'package:discover_module/contacts_module/storage_hive/patent_data/crud_patent.dart'; +import 'package:discover_module/contacts_module/storage_hive/pno_data/crud_pno.dart'; +import 'package:discover_module/contacts_module/storage_hive/procedure_data/crud_pro.dart'; +import 'package:discover_module/contacts_module/storage_hive/pub_data/curd_pub.dart'; +import 'package:discover_module/contacts_module/storage_hive/speaker_data/crud.speaker.dart'; +import 'package:discover_module/contacts_module/storage_hive/traning_data/crud_training.dart'; +import 'package:discover_module/contacts_module/storage_hive/trials_data/crud_trials.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/contacts_module/ui_screen/new_new_profile.dart'; +import 'package:discover_module/contacts_module/ui_screen/saved_profiles/saved_contact.dart'; +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/hive_fun.dart'; +// import 'package:discover_module/provider_class/affiliationsprovider.dart'; +// import 'package:discover_module/provider_class/award_provider.dart'; +// import 'package:discover_module/provider_class/certificate_provider.dart'; +// import 'package:discover_module/provider_class/educationprovider.dart'; +// import 'package:discover_module/provider_class/email_provider.dart'; +// import 'package:discover_module/provider_class/events_provider.dart'; +// import 'package:discover_module/provider_class/k2_provider/kol_list_provider.dart'; +// import 'package:discover_module/provider_class/location_provider.dart'; +// import 'package:discover_module/provider_class/nih_provider.dart'; +// import 'package:discover_module/provider_class/patent_provider.dart'; +// import 'package:discover_module/provider_class/phoneno_provider.dart'; +// import 'package:discover_module/provider_class/procedureprovider.dart'; +// import 'package:discover_module/provider_class/publications_provider.dart'; +// import 'package:discover_module/provider_class/speaker_provider.dart'; +// import 'package:discover_module/provider_class/training_provider.dart'; +// import 'package:discover_module/provider_class/trials_provider.dart'; +// import 'package:discover_module/storage_hive/aff_data/insert_aff.dart'; +// import 'package:discover_module/storage_hive/awa_data/crud_awa.dart'; +// import 'package:discover_module/storage_hive/cer_hive/crud_cer.dart'; +// import 'package:discover_module/storage_hive/edu_data/crud_edu.dart'; +// import 'package:discover_module/storage_hive/email_data/crud_email.dart'; +// import 'package:discover_module/storage_hive/events_data/crud_event.dart'; +// import 'package:discover_module/storage_hive/kol_info/curd_kol.dart'; +// import 'package:discover_module/storage_hive/loc_data/crud_loc.dart'; +// import 'package:discover_module/storage_hive/nih_grant_data/crud_nih.dart'; +// import 'package:discover_module/storage_hive/patent_data/crud_patent.dart'; +// import 'package:discover_module/storage_hive/pno_data/crud_pno.dart'; +// import 'package:discover_module/storage_hive/procedure_data/crud_pro.dart'; +// import 'package:discover_module/storage_hive/pub_data/curd_pub.dart'; +// import 'package:discover_module/storage_hive/speaker_data/crud.speaker.dart'; +// import 'package:discover_module/storage_hive/traning_data/crud_training.dart'; +// import 'package:discover_module/storage_hive/trials_data/crud_trials.dart'; +// import 'package:discover_module/ui_screen/filters_menu.dart'; +// import 'package:discover_module/ui_screen/interactionform/util.dart'; +// import 'package:discover_module/ui_screen/new_new_profile.dart'; +// import 'package:discover_module/ui_screen/new_new_profile_offline.dart'; +// import 'package:discover_module/ui_screen/saved_profiles/saved_contact.dart'; +import 'package:dropdown_button2/dropdown_button2.dart'; +import 'package:dropdownfield2/dropdownfield2.dart'; +import 'package:expandable/expandable.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:provider/provider.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_profile_picture/flutter_profile_picture.dart'; +import 'package:hive_flutter/hive_flutter.dart'; +// import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; + +class Contactsk2 extends StatefulWidget { + const Contactsk2({Key? key}) : super(key: key); + + @override + State createState() => _Contactsk2State(); +} + +class _Contactsk2State extends State { + final GlobalKey _scaffoldKey = GlobalKey(); + + // final contactBox = Hive.box("mycontact"); + bool _switchValue = false; + bool isOnline2 = true; + + final TextEditingController _searchController = TextEditingController(); + + List ddlist = ["aaaa", 'bbb']; + + List ddlist1 = []; + + String _selectedValue = ''; + String? _selectedValue1; + + String dropdownvalue = 'Profile Type'; + + var items = [ + 'Profile Type', + 'HCP Name', + 'Speciality', + 'Country', + 'Region', + 'State', + 'City', + 'List', + 'Organization', + 'Event', + ]; + + bool isSearchClickd = false; + + final List _items = ['Option 1', 'Option 2', 'Option 3']; + + TextEditingController textEditingController = TextEditingController(); + + List displayedHCPList = []; + bool ActiveConnection = false; + String T = ""; + + bool isChecked = false; + //final Set _selectedIndices = Set(); + final List _selectedIndices = []; + final List _selectedremoveIndices = []; + + bool longpress = false; + bool longpressmy = false; + + @override + void initState() { + super.initState(); + // CheckUserConnection(); + Provider.of(context, listen: false).getHCPProvider(); + } + + @override + Widget build(BuildContext context) { + print("ProfileType $dropdownvalue, $_selectedValue1"); + + // print("all StoredUser: ${HiveFunctions.getAllUsers11()}"); + + if (_selectedValue1 == "Profile Type") { + print("PPPP11"); + setState(() { + ddlist = [ + "All Profile", + 'Full Profile', + 'Basic Profile', + ]; + }); + } else if (_selectedValue1 == "HCP Name") { + print("kkk_HcpNamess"); + fecthhcpbyname(); + } else if (_selectedValue1 == "Speciality") { + print("kkk"); + setState(() { + ddlist = [ + "Cardiovascular Disease", + 'Interventional Cardiology', + "Cardiovascular Disease", + ]; + }); + } else if (_selectedValue1 == "Country") { + print("kkk"); + setState(() { + ddlist = [ + "United States", + "United States", + "United States", + ]; + }); + } else if (_selectedValue1 == "State") { + print("kkk"); + setState(() { + ddlist = [ + "Karnataka", + 'Karnataka', + 'Karnataka', + ]; + }); + } else if (_selectedValue1 == "City") { + print("kkk"); + setState(() { + ddlist = [ + "Hubli", + 'Hubli', + 'Hubli', + ]; + }); + } + + SystemChrome.setSystemUIOverlayStyle( + SystemUiOverlayStyle(statusBarColor: Color.fromARGB(255, 0, 71, 132))); + + return SafeArea( + child: Scaffold( + key: _scaffoldKey, // Assign the key to the Scaffold + + appBar: AppBar( + automaticallyImplyLeading: false, + title: isSearchClickd + ? Container( + height: 40, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5.0)), + child: TextField( + controller: _searchController, + onChanged: (value) { + setState(() {}); + }, + decoration: InputDecoration( + fillColor: Constants.k2color, + contentPadding: EdgeInsets.symmetric(vertical: 9.0), + border: OutlineInputBorder(), + hintText: "Search", + // labelText: ' Search', + prefixIcon: Icon( + Icons.search, + ), + ), + ), + ) + : Text("Contacts"), + actions: [ + IconButton( + onPressed: () { + setState(() { + isSearchClickd = !isSearchClickd; + if (!isSearchClickd) { + _searchController.clear(); + } + }); + }, + icon: Icon(isSearchClickd ? Icons.close : Icons.search)) + ], + ), + endDrawer: Drawer( + // width: MediaQuery.of(context).size.width * 99.2, + child: listdata(), + ), + body: Consumer( + builder: (context, hcpProvider, child) { + print("_selectedValueConsumerConsumer_isss: $_selectedValue"); + + if (_selectedValue.isNotEmpty) { + _searchController.text = _selectedValue; + } + + displayedHCPList = hcpProvider.searchHCP(_searchController.text); + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + //mainAxisSize: MainAxisSize.min, + children: [ + Container( + child: Wrap( + children: [ + Padding( + padding: + const EdgeInsets.only(left: 8.0, right: 2.0), + child: CupertinoSwitch( + activeColor: Color.fromARGB(255, 0, 71, 132), + value: _switchValue, + onChanged: (value) { + setState(() { + _switchValue = value; + }); + }, + ), + ), + Padding( + padding: + const EdgeInsets.only(right: 8.0, top: 9.0), + child: !_switchValue + ? Text1( + title: 'My Contacts', + txtfont: 15, + txtcolor: Colors.grey, + ) + : Text1( + title: 'My Contacts', + txtfont: 15, + txtcolor: Colors.grey, + )) + ], + ), + ), + Padding( + padding: const EdgeInsets.only(right: 8.0), + child: Row( + children: [ + Text1(title: 'My Filters'), + IconButton( + onPressed: () async { + List kol = await retrievekol(); + + print("IamKollll: ${kol}, ${kol.length}"); + + _scaffoldKey.currentState?.openEndDrawer(); + }, + icon: Icon( + Icons.sort, + size: 30, + )), + ], + ), + ) + ], + ), + SizedBox( + height: 5, + ), + !_switchValue + ? Expanded( + child: ListView.builder( + itemCount: displayedHCPList.length, + itemBuilder: (BuildContext context, int index) { + var data = displayedHCPList[index]; + + print("Checkinggggk2_data: ${data.profileImage}"); + + return Column( + children: [ + ListTile( + onLongPress: () { + print("LongPresss"); + setState(() { + longpress = true; + }); + }, + onTap: () async { + print("Check_data11 = ${data}"); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + NewProfile1(text: data), + ), + ); + }, + leading: data.profileImage == null + ? ProfilePicture( + name: data.fullName, + radius: 30, + fontsize: 12, + ) + : ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(30), + child: CachedNetworkImage( + imageUrl: data.profileImage, + imageBuilder: + (context, imageProvider) => + Container( + decoration: BoxDecoration( + image: DecorationImage( + image: imageProvider, + fit: BoxFit.fill, + ), + ), + ), + ), + ), + ), + trailing: Visibility( + visible: longpress, + child: Checkbox( + value: _selectedIndices + .contains(data.npiNum.toString()), + onChanged: (value) { + setState(() { + if (value!) { + print( + "Datata_issss_iddd: ${data["id"]}"); + _selectedIndices + .add(data["id"].toString()); + } else { + _selectedIndices.remove( + data["id"].toString()); + } + print( + "id_total123: ${_selectedIndices}"); + }); + }), + ), + title: Text1( + title: data.fullName, + fontweight: FontWeight.bold, + txtfont: isTablet ? 22 : 16, + ), + subtitle: Column( + children: [ + Row( + children: [ + Expanded( + child: Text1( + title: data.specialityName ?? "", + fontweight: FontWeight.normal, + txtfont: isTablet ? 20 : 14, + ), + ), + ], + ), + Row( + children: [ + Text1( + title: data.primaryState ?? '', + fontweight: FontWeight.normal, + txtfont: 14, + ), + SizedBox( + width: 3.0, + ), + Expanded( + child: Text1( + title: data.primaryCountry ?? '', + fontweight: FontWeight.normal, + txtfont: 14, + ), + ), + ], + ), + ], + ), + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + Expanded( + //padding: EdgeInsets.only(left: 10.0), + child: Padding( + padding: + const EdgeInsets.only(left: 10.0), + child: Text1( + title: + "Added by ${data.createdByUser}", + // title: "Added by Pooja k", + fontweight: FontWeight.normal, + txtfont: 14, + ), + ), + ), + Expanded( + //padding: EdgeInsets.only(right: 10.0), + child: Padding( + padding: + const EdgeInsets.only(right: 10.0), + child: Text1( + title: + "Added on ${data.formattedCreatedAt.toIso8601String().toString()}", + + // title: "Added on 01/07/2023", + fontweight: FontWeight.normal, + txtfont: 14, + ), + ), + ) + ], + ), + Divider(), + ], + ); + }, + ), + ) + : Expanded( + child: ListView.builder( + itemCount: HiveFunctions.getAllUsers11().length, + itemBuilder: (BuildContext context, int index) { + var data = HiveFunctions.getAllUsers11()[index]; + + print("CheckinggggImage_path: ${data['img_path']}"); + print( + "CheckinggggImage_path: ${data['name']},${data['inid']}"); + + return Column( + children: [ + ListTile( + onLongPress: () { + print("LongPresss"); + setState(() { + longpressmy = true; + }); + }, + onTap: () async { + print("Check_data = $data"); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + NewProfile1(text: data), + ), + ); + }, + leading: data["img_path"] == "" + ? ProfilePicture( + name: data["name"], + radius: 30, + fontsize: 12, + ) + : ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(30), + child: CachedNetworkImage( + imageUrl: data["img_path"], + imageBuilder: + (context, imageProvider) => + Container( + decoration: BoxDecoration( + image: DecorationImage( + image: imageProvider, + fit: BoxFit.fill, + ), + ), + ), + // placeholder: (context, url) => + // CircularProgressIndicator(), + // errorWidget: (context, url, error) => + // Icon(Icons.error), + ), + ), + ), + trailing: Visibility( + visible: longpressmy, + child: Checkbox( + value: _selectedremoveIndices + .contains(data["id"]), + onChanged: (value) { + setState(() { + if (value!) { + _selectedremoveIndices + .add(data["id"]); + } else { + _selectedremoveIndices + .remove(data["id"]); + } + print( + "id_total: ${_selectedremoveIndices}"); + }); + }), + ), + title: Text( + "${data["name"]}", + style: TextStyle( + fontSize: isTablet ? 22 : 16, + fontWeight: FontWeight.bold, + ), + ), + subtitle: Column( + children: [ + Row( + children: [ + Expanded( + child: Text( + "${data["speciality"] ?? data['spl']},", + style: TextStyle( + fontSize: isTablet ? 20 : 14, + fontWeight: FontWeight.normal, + ), + ), + ), + ], + ), + Row( + children: [ + Text( + "${data["addr"]},", + style: const TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.normal, + ), + ), + ], + ), + ], + ), + ), + const Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: EdgeInsets.only(left: 10.0), + child: Text( + "Added by Pooja k", + style: TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.normal, + ), + ), + ), + Padding( + padding: EdgeInsets.only(right: 10.0), + child: Text( + "Added on 01/07/2023", + style: TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.normal, + ), + ), + ) + ], + ), + Divider(), + ], + ); + }, + ), + ), + !_switchValue + ? Align( + alignment: Alignment.bottomCenter, + child: longpress + ? Container( + color: const Color.fromARGB(255, 251, 242, 242), + width: MediaQuery.of(context).size.width, + height: 200.0, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () async { + print("Selected: ${_selectedIndices}"); + print( + "Selected: ${_selectedIndices.length}"); + + for (int i = 0; + i < _selectedIndices.length; + i++) {} + _showMyDialog( + "Selected contact has been added to my contacts "); + }, + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(15.0), + child: Icon( + Icons.add, + color: Colors.green, + ), + ), + Text( + 'Add to My Contacts', + style: TextStyle( + color: Colors.black, + fontSize: 14.0), + ), + ], + ), + ), + Row( + children: [ + Padding( + padding: const EdgeInsets.all(15.0), + child: Icon( + Icons.download, + color: Colors.blue, + ), + ), + GestureDetector( + onTap: () {}, + child: Text( + 'Download', + style: + TextStyle(color: Colors.black), + ), + ), + ], + ), + GestureDetector( + onTap: () { + setState(() { + longpress = false; + _selectedIndices.clear(); + _selectedremoveIndices.clear(); + }); + }, + child: const Row( + children: [ + Padding( + padding: EdgeInsets.all(15.0), + child: Icon( + Icons.close, + color: Colors.red, + ), + ), + Text( + 'Cancel', + style: + TextStyle(color: Colors.black), + ), + ], + ), + ), + Expanded( + child: GestureDetector( + onTap: () async { + print( + "Selected: ${_selectedIndices}"); + for (int i = 0; + i < _selectedIndices.length; + i++) { + print( + 'The id id : ${_selectedIndices[i]}'); + + Map? row = + findRecordById(displayedHCPList, + _selectedIndices[i]); + + print("Storingggg_isss:Row $row"); + + print( + "checking_value_istrends: ${_selectedIndices[i]},${row!["license_no"]}, ${row["email"]}, ${row["img_path"]} "); + + await addKolInfo(row); + + var affiliations = Provider.of< + AffiliationsProvider>( + context, + listen: false); + + await affiliations + .getAffiliationsdata(row["id"]); + final affilist = + affiliations.adddta; + + print( + "CheckingAfflistInCon: $affilist"); + + await addAffiliation(affilist); + + var publication = + Provider.of( + context, + listen: false); + + await publication + .publicatininfo(row["id"]); + final publist = + publication.publicationlist; + print("Checkingpublist: $publist"); + + await addPublication(publist); + + var events = + Provider.of( + context, + listen: false); + await events + .geteventdata(row["id"]); + final eventlist = events.EventsList; + + print( + "Checkingeventlist: $eventlist"); + + await addEvent(eventlist); + + var trials = + Provider.of( + context, + listen: false); + await trials.trialsdata(row["id"]); + + final trialslist = + trials.trialsinfo; + print( + "Checkingtrialslist: $trialslist"); + + await addTrials(trialslist); + + var location = + Provider.of( + context, + listen: false); + await location + .locationinfo(row["id"]); + + final loclist = + location.locationlist; + print( + "Checkingloclist321: $loclist"); + + await addLoc(loclist); + + var phoneno = + Provider.of( + context, + listen: false); + await phoneno.phoneinfo(row["id"]); + + final pnolist = phoneno.phonenolist; + print( + "Checkingloclist321: $pnolist"); + + await addPno(pnolist); + + var emails = + Provider.of( + context, + listen: false); + await emails.emailinfo(row["id"]); + + final emailkollist = + emails.emailkollist; + print( + "Checkingloclist321: $emailkollist"); + + await addEmail(emailkollist); + + var edu = + Provider.of( + context, + listen: false); + await edu.eduinfo(row["id"]); + + final edukollist = + edu.educationlist; + print( + "Checkingloclist321: $edukollist"); + + await addEdu(edukollist); + + var awa = + Provider.of( + context, + listen: false); + await awa.awainfo(row["id"]); + + final awakollist = awa.awardlist; + print( + "Checkingloclist321: $awakollist"); + + await addAwa(awakollist); + + var cer = Provider.of< + CertificateProvider>( + context, + listen: false); + await cer + .certificateinfo(row["id"]); + + final cerlist = cer.certificatelist; + print( + "Checkingloclist321: $awakollist"); + + await addCer(cerlist); + + var pet = + Provider.of( + context, + listen: false); + await pet.patentinfo(row["id"]); + + final petlist = pet.patentlist; + print( + "Checkingloclist321: $petlist"); + + await addPatent(petlist); + + var nih = + Provider.of( + context, + listen: false); + await nih.nihinfo(row["id"]); + + final nihlist = nih.nihgrantslist; + print( + "Checkingloclist321: $nihlist"); + + await addNih(nihlist); + + var pro = + Provider.of( + context, + listen: false); + await pro.proinfo(row["id"]); + + final prolist = pro.procedurelist; + print( + "Checkingloclist321: $nihlist"); + + await addPro(prolist); + + var tri = + Provider.of( + context, + listen: false); + await tri.traininginfo(row["id"]); + + final trilist = tri.traininglist; + print( + "Checkingloclist321: $nihlist"); + + await addtraining(trilist); + + var spe = Provider.of< + SpekerEvalutionProvider>( + context, + listen: false); + await spe.getspeakerdata(); + + final spelist = spe.speakerlist; + print( + "Checkingloclist321: $spelist"); + + await addSpeaker(spelist); + + _showMyDialog( + "selected contact has been added to offline"); + } + + setState(() {}); + }, + child: const Row( + children: [ + Padding( + padding: EdgeInsets.all(15.0), + child: Icon( + Icons.save, + color: Colors.deepOrange, + ), + ), + Padding( + padding: + EdgeInsets.only(top: 15.0), + child: Text( + 'Save Offline', + style: TextStyle( + color: Colors.black), + ), + ), + ], + ), + ), + ), + ], + ), + ) + : Container(), + ) + : Align( + alignment: Alignment.bottomCenter, + child: longpressmy + ? Container( + color: const Color.fromARGB(255, 251, 242, 242), + width: MediaQuery.of(context).size.width, + height: 200.0, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GestureDetector( + onTap: () async { + print( + "SelectedRemoveee: ${_selectedremoveIndices}"); + print( + "Selected: ${_selectedremoveIndices.length}"); + + for (int i = 0; + i < _selectedremoveIndices.length; + i++) { + print( + 'The id id : ${_selectedremoveIndices[i]}'); + + final row = + await HiveFunctions.getuser( + _selectedremoveIndices[i]); + // var data = HiveFunctions.getuser()[i]; + + print("Delete_Row ${row[i]}"); + print("Delete_Row ${row[i]["inid"]}"); + + final row1 = + await HiveFunctions.deleteUser11( + row[i]["inid"]); + setState(() {}); + } + _showMyDialog( + "selected contact has been removed"); + }, + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(15.0), + child: Icon( + Icons.remove, + color: Colors.green, + ), + ), + Text( + 'Remove from My Contacts', + style: + TextStyle(color: Colors.black), + ), + ], + ), + ), + Row( + children: [ + Padding( + padding: const EdgeInsets.all(15.0), + child: Icon( + Icons.download, + color: Colors.blue, + ), + ), + GestureDetector( + onTap: () {}, + child: Text( + 'Download', + style: + TextStyle(color: Colors.black), + ), + ), + ], + ), + GestureDetector( + onTap: () { + setState(() { + longpressmy = false; + _selectedIndices.clear(); + _selectedremoveIndices.clear(); + }); + }, + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(15.0), + child: Icon( + Icons.close, + color: Colors.red, + ), + ), + Text( + 'Cancel', + style: TextStyle( + color: Constants.k2color), + ), + ], + ), + ), + ], + ), + ) + : Container(), + ), + ], + ); + }, + ), + ), + ); + } + + listdata() { + return ListView( + children: [ + // DrawerHeader removed + ListTile( + title: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Icon( + Icons.sort, + size: 30.0, + ), + const Text( + "Filters", + style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold), + ), + GestureDetector( + onTap: () { + Navigator.pop(context); + // print("hiii"); + }, + child: const Icon(Icons.cancel)) + ], + ), + ), + ), + + ListTile( + title: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + OutlinedButton( + onPressed: () { + //setState(() {}); + + Navigator.push( + context, + MaterialPageRoute(builder: (context) => Contactsk2()), + ).then((value) => setState(() {})); + print("refresh done "); + // }) + }, + child: Text( + 'Reset Filter', + style: TextStyle(color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ], + ), + ), + ListTile( + title: DropdownButtonHideUnderline( + child: DropdownButtonFormField2( + // decoration: InputDecoration( + // border: OutlineInputBorder(), + // labelText: 'Select an option', + // ), + hint: Text("Select the Type"), + decoration: InputDecoration( + // Add Horizontal padding using menuItemStyleData.padding so it matches + // the menu padding when button's width is not specified. + isDense: true, + contentPadding: const EdgeInsets.symmetric(vertical: 9), + + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + ), + // Add more decoration.. + ), + isExpanded: true, + value: _selectedValue1, + items: items.map((String item) { + return DropdownMenuItem( + value: item, + child: Text(item), + ); + }).toList(), + onChanged: (String? newValue) { + setState(() { + _selectedValue1 = newValue; + }); + }, + // buttonStyleData: ButtonStyleData( + // height: 50, + // padding: EdgeInsets.symmetric(horizontal: 14), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10), + // border: Border.all(color: Colors.grey), + // ), + // ), + buttonStyleData: const ButtonStyleData( + padding: EdgeInsets.symmetric(horizontal: 16), + height: 50, + width: 200, + ), + dropdownStyleData: DropdownStyleData( + maxHeight: 200, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(14), + ), + ), + menuItemStyleData: const MenuItemStyleData( + height: 40, + ), + dropdownSearchData: DropdownSearchData( + searchController: textEditingController, + searchInnerWidgetHeight: 50, + searchInnerWidget: Container( + height: 50, + // padding: const EdgeInsets.only( + // top: 8, + // bottom: 4, + // right: 8, + // left: 8, + // ), + child: TextFormField( + expands: true, + maxLines: null, + controller: textEditingController, + decoration: InputDecoration( + isDense: true, + contentPadding: const EdgeInsets.symmetric( + horizontal: 10, + vertical: 18, + ), + hintText: 'Search for an item...', + hintStyle: const TextStyle(fontSize: 12), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10.0), + ), + ), + ), + ), + searchMatchFn: (item, searchValue) { + final itemString = item.value.toString().toLowerCase(); + final searchString = searchValue.toLowerCase(); + return itemString.contains(searchString); + }, + ), + onMenuStateChange: (isOpen) { + if (!isOpen) { + textEditingController.clear(); + } + }, + iconStyleData: IconStyleData( + icon: Icon(Icons.arrow_drop_down), + iconSize: 20, + ), + ), + ), + ), + ListTile( + title: Container( + decoration: BoxDecoration( + border: Border.all(color: Colors.black), + borderRadius: BorderRadius.circular(10)), + child: Padding( + padding: const EdgeInsets.all(3.5), + child: DropDownField( + hintText: 'Select an option', + items: ddlist, + onValueChanged: (newValue) { + setState(() { + _selectedValue = newValue; + }); + }, + value: _selectedValue, + ), + ), + ), + ), + + ListTile( + title: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + OutlinedButton( + onPressed: () { + ; + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const SavedContacts1())); + print("refresh done 111"); + // }) + }, + child: Text( + 'Saved Profiles123', + style: TextStyle(color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ], + ), + ), + ], + ); + } + + filterss(String selectedValue) async { + setState(() { + print("_selectedValue_isss: $_selectedValue"); + }); + } + + Future _showMyDialog(String data) async { + return showDialog( + context: context, + barrierDismissible: false, // user must tap button! + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Successfully'), + content: SingleChildScrollView( + child: ListBody( + children: [ + // Text('This is a demo alert dialog.'), + Text(data), + ], + ), + ), + actions: [ + TextButton( + child: const Text('Ok'), + onPressed: () { + Navigator.of(context).pop(); + setState(() { + _selectedIndices.clear(); + _selectedremoveIndices.clear(); + longpress = false; + longpressmy = false; + }); + }, + ), + ], + ); + }, + ); + } + + Future getNextAutoIncrementValue() async { + var counterBox = await Hive.openBox('counterBox'); + if (!counterBox.containsKey('counter')) { + counterBox.put('counter', 0); + } + + int? counter = counterBox.get('counter'); + counterBox.put('counter', counter! + 1); + + await counterBox.close(); + + return counter; + } + + Map findRecordById( + List displayedHCPList, String selectedIndic) { + // print( + // "Gettt11111 ${displayedHCPList.firstWhere((element) => element['id'] == int.parse(selectedIndic))}"); + return displayedHCPList + .firstWhere((element) => element['id'] == int.parse(selectedIndic)); + } + + fecthhcpbyname() async { + var hcp = Provider.of(context, listen: false); + await hcp.getHCPProvider(); + + final hcplist = hcp.list; + // print("HCP_namessss: ${hcplist}"); + + final namelist = await hcplist.map((e) => e["name"] as String).toList(); + print("HCP_namessssListttt: ${namelist}"); + + setState(() { + ddlist = namelist; + }); + + //return namelist; + } +} diff --git a/lib/contacts_module/ui_screen/k2api_integrated_ui/locationk2_tab.dart b/lib/contacts_module/ui_screen/k2api_integrated_ui/locationk2_tab.dart new file mode 100644 index 0000000..363b30a --- /dev/null +++ b/lib/contacts_module/ui_screen/k2api_integrated_ui/locationk2_tab.dart @@ -0,0 +1,362 @@ +// import 'package:discover_module/custom_widget/custom_expansiontile.dart'; +import 'package:discover_module/contacts_module/custom_widget/custom_expansiontile.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_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_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/provider_class/k2_provider/kol_awards_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_education_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_email_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_locationprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_pno_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_training_provider.dart'; +import 'package:discover_module/contacts_module/storage_hive/awa_data/crud_awa.dart'; +import 'package:discover_module/contacts_module/storage_hive/cer_hive/crud_cer.dart'; +import 'package:discover_module/contacts_module/storage_hive/edu_data/crud_edu.dart'; +import 'package:discover_module/contacts_module/storage_hive/email_data/crud_email.dart'; +import 'package:discover_module/contacts_module/storage_hive/loc_data/crud_loc.dart'; +import 'package:discover_module/contacts_module/storage_hive/pno_data/crud_pno.dart'; +import 'package:discover_module/contacts_module/storage_hive/traning_data/crud_training.dart'; +import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_Certificate_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_awards_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_education_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_email_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_location_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_pno_k2.dart'; +// import 'package:discover_module/model_class/k2_api_model/kol_training_k2.dart'; +// import 'package:discover_module/provider_class/k2_provider/kol_awards_provider.dart'; +// import 'package:discover_module/provider_class/k2_provider/kol_certificate_provider.dart'; +// import 'package:discover_module/provider_class/k2_provider/kol_education_provider.dart'; +// import 'package:discover_module/provider_class/k2_provider/kol_email_provider.dart'; +// import 'package:discover_module/provider_class/k2_provider/kol_locationprovider.dart'; +// import 'package:discover_module/provider_class/k2_provider/kol_pno_provider.dart'; +// import 'package:discover_module/provider_class/k2_provider/kol_training_provider.dart'; +// import 'package:discover_module/storage_hive/awa_data/crud_awa.dart'; +// import 'package:discover_module/storage_hive/cer_hive/crud_cer.dart'; +// import 'package:discover_module/storage_hive/edu_data/crud_edu.dart'; +// import 'package:discover_module/storage_hive/email_data/crud_email.dart'; +// import 'package:discover_module/storage_hive/loc_data/crud_loc.dart'; +// import 'package:discover_module/storage_hive/pno_data/crud_pno.dart'; +// import 'package:discover_module/storage_hive/traning_data/crud_training.dart'; +// import 'package:discover_module/ui_screen/k2api_integrated_ui/k2testbshhet.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class LocationK2Tab extends StatefulWidget { + // const LocationTab({super.key}); + LocationK2Tab({required this.text, this.offline, Key? key}) : super(key: key); + + final int text; + int? offline; + @override + State createState() => _LocationK2TabState(); +} + +class _LocationK2TabState extends State { + List locationList = []; + List pno = []; + List emailid = []; + + List training = []; + List education = []; + List award = []; + List certificate = []; + + @override + void initState() { + // TODO: implement initState + super.initState(); + + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + getAffiliations(); + }); + } + + Future getAffiliations() async { + // ignore: prefer_typing_uninitialized_variables + var loclist, phoneno, emailno1, edu1, awa1, cer1, training1; + + if (widget.offline == 1) { + loclist = await retrieveidlocations(widget.text); + print("Saved_Checkingloclist: $loclist"); + } else { + var location = Provider.of(context, listen: false); + await location.locationinfo(widget.text); + loclist = location.locationlist; + + setState(() { + locationList = loclist; + }); + } + + if (mounted) { + if (widget.offline == 1) { + phoneno = await retrieveidpnos(widget.text); + print("Saved_Checkingloclist: $loclist"); + } else { + var phone = Provider.of(context, listen: false); + await phone.phonek2info(widget.text); + phoneno = phone.phonenolist; + } + setState(() { + pno = phoneno; + }); + } + + if (mounted) { + if (widget.offline == 1) { + emailno1 = await retrieveidemails(widget.text); + print("Saved_CheckingloclistEmailll: $emailno1"); + } else { + var email = Provider.of(context, listen: false); + await email.emailinfo(widget.text); + emailno1 = email.emailkollist; + print("Saved_CheckingloclistEmailll123: $emailno1"); + } + + setState(() { + emailid = emailno1; + }); + } + + if (mounted) { + if (widget.offline == 1) { + training1 = await retrieveidtri(widget.text); + print("Saved_CheckingloclistEmailll: $emailno1"); + } else { + var trai = Provider.of(context, listen: false); + await trai.traininginfo(widget.text); + training1 = trai.traininglist; + } + + setState(() { + training = training1; + }); + } + + if (mounted) { + if (widget.offline == 1) { + edu1 = await retrieveidedus(widget.text); + print("Saved_CheckingloclistEdu: $edu1"); + } else { + var edu = Provider.of(context, listen: false); + await edu.eduinfo(widget.text); + edu1 = edu.educationlist; + print("Saved_CheckingloclistEdu123: $edu1"); + } + + setState(() { + education = edu1; + }); + } + + if (mounted) { + if (widget.offline == 1) { + awa1 = await retrieveidawa(widget.text); + print("Saved_CheckingloclistEdu: $edu1"); + } else { + var awa = Provider.of(context, listen: false); + await awa.awainfo(widget.text); + awa1 = awa.awardlist; + } + setState(() { + award = awa1; + }); + } + + if (mounted) { + if (widget.offline == 1) { + cer1 = await retrieveidcer(widget.text); + print("Saved_CheckingloclistEdu: $edu1"); + } else { + var cer = Provider.of(context, listen: false); + await cer.certificateinfo(widget.text); + cer1 = cer.certificatelist; + } + + setState(() { + certificate = cer1; + }); + } + } + + @override + Widget build(BuildContext context) { + return Center( + child: ListView(children: [ + locationList.length != 0 + ? CustomExpansionTile( + title: "Locations", + itemList: locationList.cast(), + buttonText: 'Show More', + field1: 'Institutation', + field2: 'Address', + onItemSelected: (Data selectedPhoneNumber) { + List> keyValue = [ + { + "Address": selectedPhoneNumber.address1, + "Postal Code": selectedPhoneNumber.postalCode, + "Primary": selectedPhoneNumber.formattedIsPrimary, + "organization Name": selectedPhoneNumber.organizationName, + "Country Name": selectedPhoneNumber.countryName, + "State Name": selectedPhoneNumber.stateName, + "City Name": selectedPhoneNumber.cityName, + } + ]; + + modelbsheet(keyValue); + }, + ) + : Container(), + pno.length != 0 + ? CustomExpansionTile( + title: "Phone Numbers", + itemList: pno.cast(), + buttonText: 'Show More', + field1: 'Phone Type', + field2: 'Phone No', + onItemSelected: (DataPhno selectedPhoneNumber) { + List> keyValue = [ + { + "Phone Number": selectedPhoneNumber.number, + "Phone Type": selectedPhoneNumber.phoneTypeName, + "Primary": selectedPhoneNumber.formattedIsPrimary, + "organization Name": selectedPhoneNumber.organizationName, + } + ]; + + modelbsheet(keyValue); + }, + ) + : Container(), + emailid.length != 0 + ? CustomExpansionTile( + title: "Emails", + itemList: emailid.cast(), + buttonText: 'Show More', + field1: 'Email Type', + field2: 'Email', + onItemSelected: (EmailData selectedPhoneNumber) { + List> keyValue = [ + { + "Email": selectedPhoneNumber.email, + "Email Type": selectedPhoneNumber.emailTypeName, + } + ]; + + modelbsheet(keyValue); + }, + ) + : Container(), + training.length != 0 + ? CustomExpansionTile( + title: "Trainings", + itemList: training.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + onItemSelected: (TrainingList selectedPhoneNumber) { + List> keyValue = [ + { + "organization Id": selectedPhoneNumber.organizationId, + "Degree": selectedPhoneNumber.degree, + "Specialty": selectedPhoneNumber.specialty, + "Start Date": selectedPhoneNumber.startDate, + "End Date": selectedPhoneNumber.endDate, + } + ]; + modelbsheet(keyValue); + }, + ) + : Container(), + education.length != 0 + ? CustomExpansionTile( + title: "Education", + itemList: education.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + onItemSelected: (EducationList selectedPhoneNumber) { + List> keyValue = [ + { + "organization Id": selectedPhoneNumber.organizationId, + "Degree": selectedPhoneNumber.degree, + "Specialty": selectedPhoneNumber.specialty, + "Start Date": selectedPhoneNumber.startDate, + "End Date": selectedPhoneNumber.endDate, + } + ]; + modelbsheet(keyValue); + }, + ) + : Container(), + award.length != 0 + ? CustomExpansionTile( + title: "Awards", + itemList: award.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + onItemSelected: (AwardsList selectedPhoneNumber) { + List> keyValue = [ + { + "Name": selectedPhoneNumber.name, + "Start Date": selectedPhoneNumber.startDate, + "End Date": selectedPhoneNumber.endDate, + } + ]; + modelbsheet(keyValue); + }, + ) + : Container(), + certificate.length != 0 + ? CustomExpansionTile( + title: "Certificates", + itemList: certificate.cast(), + buttonText: 'Show More', + field1: 'Education Type', + field2: 'Institution Name', + onItemSelected: (CertificateList selectedPhoneNumber) { + List> keyValue = [ + { + "Organization Id": selectedPhoneNumber.organizationId, + "specialty": selectedPhoneNumber.specialty, + "Start Date": selectedPhoneNumber.startDate, + "End Date": selectedPhoneNumber.endDate, + } + ]; + modelbsheet(keyValue); + }, + ) + : Container(), + ]), + ); + } + + void modelbsheet(List> keyValue) { + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: Clip.antiAliasWithSaveLayer, + context: context, + builder: (context) { + return bsheetk2new(keyValue); + }, + ); + } +} diff --git a/lib/ui_screen/listview.dart b/lib/contacts_module/ui_screen/listview.dart similarity index 100% rename from lib/ui_screen/listview.dart rename to lib/contacts_module/ui_screen/listview.dart diff --git a/lib/ui_screen/location_tab.dart b/lib/contacts_module/ui_screen/location_tab.dart similarity index 75% rename from lib/ui_screen/location_tab.dart rename to lib/contacts_module/ui_screen/location_tab.dart index ec900fe..fe1abbf 100644 --- a/lib/ui_screen/location_tab.dart +++ b/lib/contacts_module/ui_screen/location_tab.dart @@ -1,30 +1,61 @@ -import 'package:discover_module/constants.dart'; -import 'package:discover_module/custom_widget/text.dart'; -import 'package:discover_module/provider_class/award_provider.dart'; -import 'package:discover_module/provider_class/certificate_provider.dart'; -import 'package:discover_module/provider_class/educationprovider.dart'; -import 'package:discover_module/provider_class/email_provider.dart'; -import 'package:discover_module/provider_class/location_provider.dart'; -import 'package:discover_module/provider_class/phoneno_provider.dart'; -import 'package:discover_module/provider_class/training_provider.dart'; -import 'package:discover_module/ui_screen/awardshowmore.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; -import 'package:discover_module/ui_screen/cer_show_more.dart'; -import 'package:discover_module/ui_screen/edu_show_more.dart'; -import 'package:discover_module/ui_screen/email_show_more.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/location_showmore.dart'; -import 'package:discover_module/ui_screen/pno_showmore.dart'; -import 'package:discover_module/ui_screen/training_showmore.dart'; +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/provider_class/award_provider.dart'; +// import 'package:discover_module/provider_class/certificate_provider.dart'; +// import 'package:discover_module/provider_class/educationprovider.dart'; +// import 'package:discover_module/provider_class/email_provider.dart'; +// import 'package:discover_module/provider_class/location_provider.dart'; +// import 'package:discover_module/provider_class/phoneno_provider.dart'; +// import 'package:discover_module/provider_class/training_provider.dart'; +// import 'package:discover_module/storage_hive/awa_data/crud_awa.dart'; +// import 'package:discover_module/storage_hive/cer_hive/crud_cer.dart'; +// import 'package:discover_module/storage_hive/edu_data/crud_edu.dart'; +// import 'package:discover_module/storage_hive/email_data/crud_email.dart'; +// import 'package:discover_module/storage_hive/loc_data/crud_loc.dart'; +// import 'package:discover_module/storage_hive/pno_data/crud_pno.dart'; +// import 'package:discover_module/storage_hive/traning_data/crud_training.dart'; +// import 'package:discover_module/ui_screen/awardshowmore.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/ui_screen/cer_show_more.dart'; +// import 'package:discover_module/ui_screen/edu_show_more.dart'; +// import 'package:discover_module/ui_screen/email_show_more.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/location_showmore.dart'; +// import 'package:discover_module/ui_screen/pno_showmore.dart'; +// import 'package:discover_module/ui_screen/training_showmore.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/provider_class/award_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/certificate_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/educationprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/email_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/location_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/phoneno_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/training_provider.dart'; +import 'package:discover_module/contacts_module/storage_hive/awa_data/crud_awa.dart'; +import 'package:discover_module/contacts_module/storage_hive/cer_hive/crud_cer.dart'; +import 'package:discover_module/contacts_module/storage_hive/edu_data/crud_edu.dart'; +import 'package:discover_module/contacts_module/storage_hive/email_data/crud_email.dart'; +import 'package:discover_module/contacts_module/storage_hive/loc_data/crud_loc.dart'; +import 'package:discover_module/contacts_module/storage_hive/pno_data/crud_pno.dart'; +import 'package:discover_module/contacts_module/storage_hive/traning_data/crud_training.dart'; +import 'package:discover_module/contacts_module/ui_screen/awardshowmore.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/ui_screen/cer_show_more.dart'; +import 'package:discover_module/contacts_module/ui_screen/edu_show_more.dart'; +import 'package:discover_module/contacts_module/ui_screen/email_show_more.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/location_showmore.dart'; +import 'package:discover_module/contacts_module/ui_screen/pno_showmore.dart'; +import 'package:discover_module/contacts_module/ui_screen/training_showmore.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class LocationTab extends StatefulWidget { // const LocationTab({super.key}); - LocationTab({required this.text, Key? key}) : super(key: key); + LocationTab({required this.text, this.offline, Key? key}) : super(key: key); final int text; - + int? offline; @override State createState() => _LocationTabState(); } @@ -45,44 +76,86 @@ class _LocationTabState extends State { // TODO: implement initState super.initState(); getaffiliations(); + + print("OfflineeStored_loccc: ${widget.offline}"); } getaffiliations() async { - var location = Provider.of(context, listen: false); + final loclist, phoneno, emailno1, edu1, awa1, cer1, training1; + if (widget.offline == 1) { + loclist = await retrieveidlocations(widget.text); + print("Savedd_Checkingloclist: $loclist"); + } else { + var location = Provider.of(context, listen: false); - await location.locationinfo(widget.text); - final loclist = location.locationlist; + await location.locationinfo(widget.text); + loclist = location.locationlist; + print("Savedd_Checkingloclist123: $loclist"); + } - var phone = Provider.of(context, listen: false); + if (widget.offline == 1) { + phoneno = await retrieveidpnos(widget.text); + print("Savedd_Checkingloclist: $loclist"); + } else { + var phone = Provider.of(context, listen: false); - await phone.phoneinfo(widget.text); - final phoneno = phone.phonenolist; + await phone.phoneinfo(widget.text); + phoneno = phone.phonenolist; + } - var email = Provider.of(context, listen: false); + if (widget.offline == 1) { + emailno1 = await retrieveidemails(widget.text); + print("Savedd_CheckingloclistEmailll: $emailno1"); + } else { + var email = Provider.of(context, listen: false); - await email.emailinfo(widget.text); - final emailno1 = email.emailkollist; + await email.emailinfo(widget.text); + emailno1 = email.emailkollist; - var trai = Provider.of(context, listen: false); + print("Savedd_CheckingloclistEmailll123: $emailno1"); + } - await trai.traininginfo(widget.text); - final training1 = trai.traininglist; + if (widget.offline == 1) { + training1 = await retrieveidtri(widget.text); + print("Savedd_CheckingloclistEmailll: $emailno1"); + } else { + var trai = Provider.of(context, listen: false); - var edu = Provider.of(context, listen: false); + await trai.traininginfo(widget.text); + training1 = trai.traininglist; + } - await edu.eduinfo(widget.text); - final edu1 = edu.educationlist; + if (widget.offline == 1) { + edu1 = await retrieveidedus(widget.text); + print("Savedd_CheckingloclistEdu: $edu1"); + } else { + var edu = Provider.of(context, listen: false); - var awa = Provider.of(context, listen: false); + await edu.eduinfo(widget.text); + edu1 = edu.educationlist; - await awa.awainfo(widget.text); - final awa1 = awa.awardlist; + print("Savedd_CheckingloclistEdu123: $edu1"); + } - var cer = Provider.of(context, listen: false); + if (widget.offline == 1) { + awa1 = await retrieveidawa(widget.text); + print("Savedd_CheckingloclistEdu: $edu1"); + } else { + var awa = Provider.of(context, listen: false); - await cer.certificateinfo(widget.text); - final cer1 = cer.certificatelist; + await awa.awainfo(widget.text); + awa1 = awa.awardlist; + } + if (widget.offline == 1) { + cer1 = await retrieveidcer(widget.text); + print("Savedd_CheckingloclistEdu: $edu1"); + } else { + var cer = Provider.of(context, listen: false); + + await cer.certificateinfo(widget.text); + cer1 = cer.certificatelist; + } setState(() { locationList = loclist; pno = phoneno; @@ -94,7 +167,8 @@ class _LocationTabState extends State { award = awa1; }); - print("emailidemailid_isss: $emailid"); + print( + "locationListlocationList_isss: $locationList, ${locationList.length}"); //final affiliationsss = affiliation_data['Affiliations'] as List>; } @@ -181,7 +255,7 @@ class _LocationTabState extends State { (index) => DataRow( onSelectChanged: (value) { print( - "message ${locationList[index]}"); + "message123 ${locationList[index]}"); showModalBottomSheet( useRootNavigator: true, @@ -208,12 +282,10 @@ class _LocationTabState extends State { }, cells: [ DataCell(Text( - locationList[index]['Institution'] - .toString(), + locationList[index].institution, softWrap: true)), DataCell(Text( - locationList[index]['Address'] - .toString(), + locationList[index].address, softWrap: true)), ], ), @@ -361,12 +433,10 @@ class _LocationTabState extends State { }, cells: [ DataCell(Text( - pno[index]['Phone type'] - .toString(), + pno[index].phoneType.toString(), softWrap: true)), DataCell(Text( - pno[index]['phone Number'] - .toString(), + pno[index].phoneNumber.toString(), softWrap: true)), ], ), @@ -514,12 +584,12 @@ class _LocationTabState extends State { }, cells: [ DataCell(Text( - emailid[index]['Email Type'] + emailid[index] + .emailType .toString(), softWrap: true)), DataCell(Text( - emailid[index]['Email'] - .toString(), + emailid[index].email.toString(), softWrap: true)), ], ), @@ -667,12 +737,13 @@ class _LocationTabState extends State { }, cells: [ DataCell(Text( - training[index]['Education Type'] + training[index] + .educationType .toString(), softWrap: true)), DataCell(Text( training[index] - ['Institution Name'] + .institutionName .toString(), softWrap: true)), ], @@ -816,11 +887,13 @@ class _LocationTabState extends State { }, cells: [ DataCell(Text( - education[index]['Education Type'] + education[index] + .educationType .toString(), softWrap: true)), DataCell(Text( - education[index]['Institution Name'] + education[index] + .institutionName .toString(), softWrap: true)), ], @@ -967,11 +1040,13 @@ class _LocationTabState extends State { }, cells: [ DataCell(Text( - award[index]['Education Type'] + award[index] + .educationType .toString(), softWrap: true)), DataCell(Text( - award[index]['Institution Name'] + award[index] + .institutionName .toString(), softWrap: true)), ], @@ -1121,12 +1196,12 @@ class _LocationTabState extends State { cells: [ DataCell(Text( certificate[index] - ['Education Type'] + .educationType .toString(), softWrap: true)), DataCell(Text( certificate[index] - ['Institution Name'] + .institutionName .toString(), softWrap: true)), ], @@ -1170,299 +1245,6 @@ class _LocationTabState extends State { ), ) : Container(), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only(left: 8.0, right: 8.0), - // child: Container( - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // backgroundColor: Constants.k2color11, - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // 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, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Staff/Assistant", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 16.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // 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: const [ - // DataColumn( - // label: Expanded( - // child: Text('Title', - // style: TextStyle( - // fontWeight: FontWeight.w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text('Location', - // style: TextStyle( - // fontWeight: FontWeight.w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: (value) { - // print("message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: true, - // isScrollControlled: false, - // enableDrag: true, - // useSafeArea: true, - // constraints: const BoxConstraints( - // maxWidth: double.infinity, - // ), - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.vertical( - // top: Radius.circular(0), - // ), - // ), - // clipBehavior: Clip.antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet(publication_data[index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[index]['Institution'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[index]['Address'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle(color: Constants.k2color), - // ), - // style: OutlinedButton.styleFrom( - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only(left: 8.0, right: 8.0), - // child: Container( - // child: Card( - // margin: EdgeInsets.all(1.0), - - // ///elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // backgroundColor: Constants.k2color11, - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // 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, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "State License", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 16.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // 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: const [ - // DataColumn( - // label: Expanded( - // child: Text('License No', - // style: TextStyle( - // fontWeight: FontWeight.w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text('State', - // style: TextStyle( - // fontWeight: FontWeight.w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: (value) { - // print("message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: true, - // isScrollControlled: false, - // enableDrag: true, - // useSafeArea: true, - // constraints: const BoxConstraints( - // maxWidth: double.infinity, - // ), - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.vertical( - // top: Radius.circular(0), - // ), - // ), - // clipBehavior: Clip.antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet(publication_data[index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[index]['Institution'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[index]['Address'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle(color: Constants.k2color), - // ), - // style: OutlinedButton.styleFrom( - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - // ), // ], ]), ); } diff --git a/lib/contacts_module/ui_screen/medical_insight.dart b/lib/contacts_module/ui_screen/medical_insight.dart new file mode 100644 index 0000000..31c2d56 --- /dev/null +++ b/lib/contacts_module/ui_screen/medical_insight.dart @@ -0,0 +1,364 @@ +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/provider_class/medicalinsightprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/view_insight.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class MedicalInsight1 extends StatefulWidget { + const MedicalInsight1({super.key}); + + @override + State createState() => _MedicalInsightState(); +} + +class _MedicalInsightState extends State { + final List> cardData = [ + {'id': 'ID ', 'number': 'MI1688128025', 'id1': "jjj", 'number1': '265'}, + {'id': 'ID ', 'number': 20}, + {'id': 'ID ', 'number': 30}, + // Add more data entries as needed + ]; + + String selectedOption = 'None'; + late GlobalKey actionKey; + // DateTime? pickedDate; + + var item; + final TextEditingController textController = TextEditingController(); + + DateTime? selectedDate; + + bool calview = false; + String? start, end; + + final TextEditingController startController = TextEditingController(); + final TextEditingController endController = TextEditingController(); + + @override + void initState() { + actionKey = GlobalKey(); + super.initState(); + getapicall(); + } + + void getapicall() async { + await Provider.of(context, listen: false) + .medicalinsightdata(); + } + + // GlobalKey actionKey; + // final List> data = [ + // {'id': 'Data ID 1', 'number': 10}, + // {'id': 'Data ID 2', 'number': 20}, + // {'id': 'Data ID 3', 'number': 30}, + // // Add more data entries as needed + // ]; + @override + Widget build(BuildContext context) { + return Directionality( + textDirection: TextDirection.ltr, + child: SafeArea( + child: Scaffold( + // backgroundColor: const Color.fromARGB(255, 222, 237, 247), + backgroundColor: const Color.fromARGB(255, 246, 248, 252), + + appBar: AppBar( + title: const Text('Medical Insight'), + actions: [ + GestureDetector( + onTap: () { + setState(() { + calview = true; + }); + }, + child: Icon(Icons.calendar_month)) + ], + ), + body: Consumer( + builder: (context, value, child) { + return Column( + children: [ + // GestureDetector( + // onTap: () => _selectDate(context), + // child: AbsorbPointer( + // child: TextField( + // controller: textController, + // decoration: InputDecoration( + // focusedBorder: InputBorder.none, + // enabledBorder: InputBorder.none, + // contentPadding: EdgeInsets.all(10.0), + // labelText: "date", + // labelStyle: + // TextStyle(color: Colors.black, fontSize: 16), + // // pass the hint text parameter here + // hintStyle: TextStyle(color: Colors.black, fontSize: 16), + // suffixIcon: Icon(Icons.calendar_today), + // ), + // style: TextStyle(color: Colors.black, fontSize: 18), + // ), + // ), + // ), + Visibility( + visible: calview, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + // OutlinedButton( + // onPressed: () { + // _selectDate(context); + // }, + // child: + // start == null ? Text('Start Date') : Text(start!), + // ), + Expanded( + flex: 1, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: TextFormField( + controller: startController, + decoration: InputDecoration( + isDense: true, + border: OutlineInputBorder(), + hintText: "ff", + labelText: + startController.text ?? 'Start Date'), + // focusNode: AlwaysDisabledFocusNode(), + onTap: () { + _selectDate(context); + }, + ), + ), + ), + Expanded( + flex: 1, + child: OutlinedButton( + onPressed: () { + _selectDate1(context); + }, + child: end == null ? Text('Start Date') : Text(end!), + ), + ), + ], + ), + ), + + Padding( + padding: const EdgeInsets.all(8.0), + child: TextField( + //controller: _searchController, + onChanged: (value) { + setState(() {}); + }, + decoration: InputDecoration( + fillColor: Constants.k2color, + contentPadding: const EdgeInsets.symmetric(vertical: 9.0), + border: const OutlineInputBorder( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(0))), + labelText: ' Search', + prefixIcon: const Icon( + Icons.search, + ), + ), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + // OutlinedButton( + // style: OutlinedButton.styleFrom( + // backgroundColor: Constants.k2color, + // foregroundColor: Colors.white), + // onPressed: () {}, + // child: Text("Create Medical Insight")) + ], + ), + Expanded( + child: ListView.builder( + physics: const ScrollPhysics(), + // scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: value.med.length, + itemBuilder: (context, index) { + item = value.med[index]; + + print( + "Item_Medical_insight ${item['Therapeutic Area']}"); + return GestureDetector( + onTap: () { + _showAlertDialog(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Card( + margin: EdgeInsets.zero, + + elevation: 4, + surfaceTintColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.zero, + ), + + // shape: RoundedRectangleBorder( + // side: BorderSide(color: Colors.black, width: 1), + // borderRadius: BorderRadius.only( + // bottomRight: Radius.circular(30)), + // ), + child: SizedBox( + width: MediaQuery.sizeOf(context).width, + child: ListTile( + dense: true, + title: Column( + // crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // Text( + // "Acute neurology is the therapeutic area of the medical insight for Product A. The age of treatment is the topic of interest for this source type publication."), + + RichText( + text: TextSpan( + text: '', + style: DefaultTextStyle.of(context) + .style, + children: const [ + TextSpan( + text: 'Acute neurology ', + style: TextStyle( + fontWeight: + FontWeight.bold)), + // TextSpan( + // text: ' therapeutic area ', + // style: TextStyle( + // fontWeight: + // FontWeight.bold)), + TextSpan( + text: + 'is the therapeutic area of the medical insight for '), + TextSpan( + text: + 'Product A. The age of treatment', + style: TextStyle( + fontWeight: + FontWeight.bold)), + TextSpan( + text: + ' is the topic of interest for this source type'), + TextSpan( + text: ' publication.', + style: TextStyle( + fontWeight: + FontWeight.bold)), + ], + ), + ), + + const Padding( + padding: EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Icon( + Icons.person, + size: 20, + ), + Text( + "pooja", + style: + TextStyle(fontSize: 14.0), + ) + ], + ), + Row( + children: [ + Icon( + Icons.calendar_today, + size: 20, + ), + Text( + "11/11/2022 ", + style: + TextStyle(fontSize: 14.0), + ) + ], + ) + ], + ), + ), + ], + ), + ), + ), + // shape: BorderRadius.only(bottomRight: Radius.circular(50)), + ), + ), + ); + }), + ) + ], + ); + }), + ), + ), + ); + } + + void _showAlertDialog(BuildContext context) { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + // title: Text('Alert'), + content: const MyWidget22(), + actions: [ + TextButton( + child: const Text('Close'), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); + } + + Future _selectDate(BuildContext context) async { + final DateTime? picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: DateTime(1901, 1), + lastDate: DateTime(2100)); + if (picked != null && picked != selectedDate) + setState(() { + selectedDate = picked; + String convertedDateTime = + "${picked.year.toString()}-${picked.month.toString().padLeft(2, '0')}-${picked.day.toString().padLeft(2, '0')}"; + // widget.textController.value = TextEditingValue(text: picked.toString()); + startController.value = TextEditingValue(text: convertedDateTime); + + start = convertedDateTime; + ; + }); + } + + Future _selectDate1(BuildContext context) async { + final DateTime? picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: DateTime(1901, 1), + lastDate: DateTime(2100)); + if (picked != null && picked != selectedDate) + setState(() { + selectedDate = picked; + String convertedDateTime = + "${picked.year.toString()}-${picked.month.toString().padLeft(2, '0')}-${picked.day.toString().padLeft(2, '0')}"; + // widget.textController.value = TextEditingValue(text: picked.toString()); + textController.value = TextEditingValue(text: convertedDateTime); + + end = convertedDateTime; + ; + }); + } +} diff --git a/lib/contacts_module/ui_screen/new_contacts.dart b/lib/contacts_module/ui_screen/new_contacts.dart new file mode 100644 index 0000000..b6fe292 --- /dev/null +++ b/lib/contacts_module/ui_screen/new_contacts.dart @@ -0,0 +1,712 @@ +import 'dart:async'; + +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:connectivity_plus/connectivity_plus.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/hive_fun.dart'; +import 'package:discover_module/contacts_module/provider_class/affiliationsprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/award_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/certificate_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/educationprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/email_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/events_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/hcp%20_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/location_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/nih_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/patent_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/phoneno_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/procedureprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/publications_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/speaker_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/training_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/trials_provider.dart'; +import 'package:discover_module/contacts_module/storage_hive/kol_info/curd_kol.dart'; +import 'package:discover_module/contacts_module/ui_screen/contact_filters.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/contacts_module/ui_screen/new_new_profile.dart'; +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/hive_fun.dart'; +// import 'package:discover_module/provider_class/affiliationsprovider.dart'; +// import 'package:discover_module/provider_class/award_provider.dart'; +// import 'package:discover_module/provider_class/certificate_provider.dart'; +// import 'package:discover_module/provider_class/educationprovider.dart'; +// import 'package:discover_module/provider_class/email_provider.dart'; +// import 'package:discover_module/provider_class/events_provider.dart'; +// import 'package:discover_module/provider_class/hcp%20_provider.dart'; +// import 'package:discover_module/provider_class/location_provider.dart'; +// import 'package:discover_module/provider_class/nih_provider.dart'; +// import 'package:discover_module/provider_class/patent_provider.dart'; +// import 'package:discover_module/provider_class/phoneno_provider.dart'; +// import 'package:discover_module/provider_class/procedureprovider.dart'; +// import 'package:discover_module/provider_class/publications_provider.dart'; +// import 'package:discover_module/provider_class/speaker_provider.dart'; +// import 'package:discover_module/provider_class/training_provider.dart'; +// import 'package:discover_module/provider_class/trials_provider.dart'; +// import 'package:discover_module/storage_hive/kol_info/curd_kol.dart'; +// import 'package:discover_module/ui_screen/contact_filters.dart'; +// import 'package:discover_module/ui_screen/interactionform/util.dart'; +// import 'package:discover_module/ui_screen/new_new_profile.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_profile_picture/flutter_profile_picture.dart'; + +final ValueNotifier> ddlist = ValueNotifier>([]); +String selectedValue = ''; +String? selectedType; +final TextEditingController searchController = TextEditingController(); + +TextEditingController textEditingController = TextEditingController(); + +class Contacts1 extends StatefulWidget { + const Contacts1({Key? key}) : super(key: key); + + @override + State createState() => _Contacts1State(); +} + +class _Contacts1State extends State { + final GlobalKey _scaffoldKey = GlobalKey(); + + bool _switchValue = false; + bool isOnline2 = true; + + bool isSearchClickd = false; + + List displayedHCPList = []; + List myContactHCPList = []; + + final List _selectedIndices = []; + final List _selectedremoveIndices = []; + + bool longpress = false; + bool longpressmy = false; + + late List hcpdataList; + // ignore: prefer_typing_uninitialized_variables + + var hcpDataProvider1; + + List _connectionStatus = [ConnectivityResult.none]; + final Connectivity _connectivity = Connectivity(); + late StreamSubscription> _connectivitySubscription; + + get developer => null; + + @override + void initState() { + super.initState(); + + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + initConnectivity(); + + _connectivitySubscription = + _connectivity.onConnectivityChanged.listen(_updateConnectionStatus); + hcpList(); + }); + } + + Future hcpList() async { + hcpDataProvider1 = Provider.of(context, listen: false); + + await hcpDataProvider1.getHCPProvider(); + final hcplist = hcpDataProvider1.list; + + hcpdataList = hcplist; + } + + @override + Widget build(BuildContext context) { + SystemChrome.setSystemUIOverlayStyle( + SystemUiOverlayStyle(statusBarColor: Color.fromARGB(255, 0, 71, 132))); + + return SafeArea( + child: Scaffold( + key: _scaffoldKey, // Assign the key to the Scaffold + + appBar: AppBar( + automaticallyImplyLeading: false, + title: isSearchClickd + ? Container( + height: 40, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5.0)), + child: TextField( + controller: searchController, + onChanged: (value) { + setState(() {}); + }, + decoration: InputDecoration( + fillColor: Constants.k2color, + contentPadding: EdgeInsets.symmetric(vertical: 9.0), + border: OutlineInputBorder(), + hintText: "Search", + // labelText: ' Search', + prefixIcon: Icon( + Icons.search, + ), + ), + ), + ) + : Text1(title: "Contacts"), + actions: [ + IconButton( + onPressed: () { + setState(() { + isSearchClickd = !isSearchClickd; + if (!isSearchClickd) { + searchController.clear(); + } + }); + }, + icon: Icon(isSearchClickd ? Icons.close : Icons.search)) + ], + ), + endDrawer: FilterDrawer(_switchValue, searchController), + + // Drawer( + // child: listdata(), + // ), + body: Consumer( + builder: (context, hcpProvider, child) { + print("_selectedValueConsumerConsumer_isss: $selectedValue"); + + if (selectedValue.isNotEmpty) { + searchController.text = selectedValue; + } else { + searchController.text = ""; + } + !_switchValue + ? displayedHCPList = + hcpProvider.searchHCP(searchController.text) + : myContactHCPList = + HiveFunctions.getindexUser(searchController.text); + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Wrap( + children: [ + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 2.0), + child: CupertinoSwitch( + activeColor: Color.fromARGB(255, 0, 71, 132), + value: _switchValue, + onChanged: (value) { + setState(() { + _switchValue = value; + }); + }, + ), + ), + Padding( + padding: + const EdgeInsets.only(right: 8.0, top: 9.0), + child: !_switchValue + ? Text1( + title: 'My Contacts', + txtfont: 15, + txtcolor: Colors.grey, + ) + : Text1( + title: 'My Contacts', + txtfont: 15, + txtcolor: Colors.grey, + )) + ], + ), + Padding( + padding: const EdgeInsets.only(right: 8.0), + child: Row( + children: [ + GestureDetector( + onTap: () { + print("SearchVon: ${searchController.text}"); + + setState(() { + selectedValue = ''; + }); + }, + child: Text1(title: 'My Filters'), + // child: Text1( + // title: _connectionStatus[0].toString(), + // ) + ), + IconButton( + onPressed: () async { + _scaffoldKey.currentState?.openEndDrawer(); + }, + icon: const Icon( + Icons.sort, + size: 30, + )), + ], + ), + ) + ], + ), + const SizedBox( + height: 5, + ), + // !_switchValue + // ? hcpContactlistview(displayedHCPList) + // : hcpContactlistview(myContactHCPList), + // contactsBottomdailog() + !_switchValue + ? _connectionStatus[0] + .toString() + .contains("ConnectivityResult.none") + ? hcpContactlistview(myContactHCPList) + : hcpContactlistview(displayedHCPList) + : hcpContactlistview(myContactHCPList), + contactsBottomdailog() + ], + ); + }, + ), + ), + ); + } + + Future _showMyDialog(String data) async { + return showDialog( + context: context, + barrierDismissible: false, // user must tap button! + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Successfully'), + content: SingleChildScrollView( + child: ListBody( + children: [ + // Text('This is a demo alert dialog.'), + Text(data), + ], + ), + ), + actions: [ + TextButton( + child: const Text('Ok'), + onPressed: () { + Navigator.of(context).pop(); + setState(() { + _selectedIndices.clear(); + _selectedremoveIndices.clear(); + longpress = false; + longpressmy = false; + }); + }, + ), + ], + ); + }, + ); + } + + Map findRecordById( + List displayedHCPList, String selectedIndic) { + // print( + // "Gettt11111 ${displayedHCPList.firstWhere((element) => element['id'] == int.parse(selectedIndic))}"); + return displayedHCPList + .firstWhere((element) => element['id'] == int.parse(selectedIndic)); + } + + hcpContactlistview(List HCPList) { + return Expanded( + child: ListView.builder( + itemCount: HCPList.length, + itemBuilder: (BuildContext context, int index) { + var data = HCPList[index]; + + print("CheckinggggImage_path: ${data['img_path']}"); + + return Column( + children: [ + ListTile( + onLongPress: () { + print("LongPresss"); + setState(() { + longpress = true; + }); + }, + onTap: () async { + print("Check_data11 = ${data}"); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => NewProfile1(text: data), + ), + ); + }, + leading: data["img_path"] == "" + ? ProfilePicture( + name: data["First Name"], + radius: 30, + fontsize: 12, + ) + : ClipOval( + child: SizedBox.fromSize( + size: const Size.fromRadius(30), + child: CachedNetworkImage( + imageUrl: data["img_path"], + imageBuilder: (context, imageProvider) => Container( + decoration: BoxDecoration( + image: DecorationImage( + image: imageProvider, + fit: BoxFit.fill, + ), + ), + ), + ), + ), + ), + trailing: Visibility( + visible: longpress, + child: !_switchValue + ? Checkbox( + value: + _selectedIndices.contains(data["id"].toString()), + onChanged: (value) { + setState(() { + if (value!) { + print("Datata_issss_iddd: ${data["id"]}"); + _selectedIndices.add(data["id"].toString()); + } else { + _selectedIndices.remove(data["id"].toString()); + } + print("id_total123: ${_selectedIndices}"); + }); + }) + : Checkbox( + value: _selectedremoveIndices.contains(data["id"]), + onChanged: (value) { + setState(() { + if (value!) { + _selectedremoveIndices.add(data["id"]); + } else { + _selectedremoveIndices.remove(data["id"]); + } + print("id_total: ${_selectedremoveIndices}"); + }); + }), + ), + title: Text1( + title: data['name'], + fontweight: FontWeight.bold, + txtfont: isTablet ? 22 : 16, + ), + subtitle: Column( + children: [ + Row( + children: [ + Expanded( + child: Text1( + title: data["speciality"] ?? data['spl'], + fontweight: FontWeight.normal, + txtfont: isTablet ? 20 : 14, + ), + ), + ], + ), + Row( + children: [ + Text1( + title: data["State"] ?? '', + fontweight: FontWeight.normal, + txtfont: 14, + ), + SizedBox( + width: 3.0, + ), + Expanded( + child: Text1( + title: data["Country"] ?? '', + fontweight: FontWeight.normal, + txtfont: 14, + ), + ), + ], + ), + ], + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: EdgeInsets.only(left: 10.0), + child: Text1( + title: "Added by Pooja k", + fontweight: FontWeight.normal, + txtfont: 14, + ), + ), + Padding( + padding: EdgeInsets.only(right: 10.0), + child: Text1( + title: "Added on 01/07/2023", + fontweight: FontWeight.normal, + txtfont: 14, + ), + ) + ], + ), + Divider(), + ], + ); + }, + ), + ); + } + + Future offlineProfileStore(List selectedIndices) async { + for (int i = 0; i < selectedIndices.length; i++) { + print('The id id : ${selectedIndices[i]}'); + + Map? row = + findRecordById(displayedHCPList, selectedIndices[i]); + + print("Storingggg_isss:Row $row"); + + await addKolInfo(row); + + await Provider.of(context, listen: false) + .storeAff(row["id"]); + + await Provider.of(context, listen: false) + .storePub(row["id"]); + + await Provider.of(context, listen: false) + .storeEvent(row["id"]); + + await Provider.of(context, listen: false) + .storeTrials(row["id"]); + + await Provider.of(context, listen: false) + .storeLoc(row["id"]); + + await Provider.of(context, listen: false) + .storePno(row["id"]); + + await Provider.of(context, listen: false) + .storeEmail(row["id"]); + + await Provider.of(context, listen: false) + .storeEdu(row["id"]); + + await Provider.of(context, listen: false) + .storeAwa(row["id"]); + + await Provider.of(context, listen: false) + .storeCer(row["id"]); + + await Provider.of(context, listen: false) + .storePet(row["id"]); + + await Provider.of(context, listen: false) + .storeNih(row["id"]); + + await Provider.of(context, listen: false) + .storePro(row["id"]); + + await Provider.of(context, listen: false) + .storeTraining(row["id"]); + + await Provider.of(context, listen: false) + .storeSpeaker(row["id"]); + } + } + + contactsBottomdailog() { + return Align( + alignment: Alignment.bottomCenter, + child: longpress + ? Container( + color: const Color.fromARGB(255, 251, 242, 242), + width: MediaQuery.of(context).size.width, + height: 200.0, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + !_switchValue + ? GestureDetector( + onTap: () async { + print("Selected: ${_selectedIndices}"); + print("Selected: ${_selectedIndices.length}"); + + for (int i = 0; i < _selectedIndices.length; i++) { + Map? row = findRecordById( + displayedHCPList, _selectedIndices[i]); + print("StoringgggMyContact_isss_isss:Row $row"); + + await HiveFunctions.savemyContact(row); + } + + _showMyDialog( + "Selected contact has been added to my contacts "); + }, + child: Row( + children: [ + const Padding( + padding: EdgeInsets.all(15.0), + child: Icon( + Icons.add, + color: Colors.green, + ), + ), + Text1( + title: 'Add to My Contacts', + txtcolor: Colors.black, + txtfont: 14.0), + ], + ), + ) + : GestureDetector( + onTap: () async { + print( + "SelectedRemoveee: ${_selectedremoveIndices}"); + print("Selected: ${_selectedremoveIndices.length}"); + for (int i = 0; + i < _selectedremoveIndices.length; + i++) { + await HiveFunctions.deleteUser11( + _selectedremoveIndices[i]); + } + + setState(() {}); + + _showMyDialog("selected contact has been removed"); + }, + child: const Row( + children: [ + Padding( + padding: EdgeInsets.all(15.0), + child: Icon( + Icons.remove, + color: Colors.green, + ), + ), + Text( + 'Remove from My Contacts', + style: TextStyle(color: Colors.black), + ), + ], + ), + ), + Row( + children: [ + const Padding( + padding: EdgeInsets.all(15.0), + child: Icon( + Icons.download, + color: Colors.blue, + ), + ), + GestureDetector( + onTap: () {}, + child: Text1( + title: 'Download', + txtcolor: Colors.black, + ), + ), + ], + ), + GestureDetector( + onTap: () { + setState(() { + longpress = false; + _selectedIndices.clear(); + _selectedremoveIndices.clear(); + }); + }, + child: Row( + children: [ + const Padding( + padding: EdgeInsets.all(15.0), + child: Icon( + Icons.close, + color: Colors.red, + ), + ), + Text1( + title: 'Cancel', + txtcolor: Colors.black, + ), + ], + ), + ), + Visibility( + visible: !_switchValue ? true : false, + child: Expanded( + child: GestureDetector( + onTap: () async { + print("Selected: ${_selectedIndices}"); + offlineProfileStore(_selectedIndices); + _showMyDialog( + "selected contact has been added to offline"); + + setState(() {}); + }, + child: const Row( + children: [ + Padding( + padding: EdgeInsets.all(15.0), + child: Icon( + Icons.save, + color: Colors.deepOrange, + ), + ), + Padding( + padding: EdgeInsets.only(top: 15.0), + child: Text( + 'Save Offline', + style: TextStyle(color: Colors.black), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ) + : Container(), + ); + } + + Future initConnectivity() async { + late List result; + // Platform messages may fail, so we use a try/catch PlatformException. + try { + result = await _connectivity.checkConnectivity(); + } on PlatformException catch (e) { + developer.log('Couldn\'t check connectivity status', error: e); + return; + } + + // If the widget was removed from the tree while the asynchronous platform + // message was in flight, we want to discard the reply rather than calling + // setState to update our non-existent appearance. + if (!mounted) { + return Future.value(null); + } + + return _updateConnectionStatus(result); + } + + Future _updateConnectionStatus(List result) async { + setState(() { + _connectionStatus = result; + }); + // ignore: avoid_print + print('Connectivity changed: $_connectionStatus'); + } +} diff --git a/lib/ui_screen/new_editinteraction.dart b/lib/contacts_module/ui_screen/new_editinteraction.dart similarity index 87% rename from lib/ui_screen/new_editinteraction.dart rename to lib/contacts_module/ui_screen/new_editinteraction.dart index 3b6243b..a4a24b0 100644 --- a/lib/ui_screen/new_editinteraction.dart +++ b/lib/contacts_module/ui_screen/new_editinteraction.dart @@ -1,16 +1,25 @@ import 'dart:convert'; import 'dart:io'; -import 'package:discover_module/constants.dart'; -import 'package:discover_module/textScalar.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -import 'package:discover_module/ui_screen/interactionform/util.dart'; -import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/customrangeslider.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/interatciontextfield.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/textScalar.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +// import 'package:discover_module/ui_screen/interactionform/util.dart'; +// import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/customrangeslider.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/interatciontextfield.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/custombutton.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/customrangeslider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/interatciontextfield.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/responsive_ext.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -1086,168 +1095,6 @@ class _EditInteractionScreenState extends State { ); } - // Widget gridViewWidget( - // ViewInteractionProvider provider, - // String sectionName, - // List sectionList, - // Orientation orientation, - // FormFieldData item, - // int listIndex) { - // print("SectionListtt:isss: $sectionList"); - // return Padding( - // padding: isTablet - // ? const EdgeInsets.only(left: 8.0) - // : const EdgeInsets.only(left: 12.0, right: 12.0), - // child: GridView.count( - // physics: const NeverScrollableScrollPhysics(), - // crossAxisCount: context.responsive( - // 1, // default - // sm: 1, // small - // md: 1, // medium - // lg: sectionList.length == 1 ? 1 : 4, // large - // xl: 5, // extra large screen - // ), - // mainAxisSpacing: sectionList.length == 1 || !isTablet ? 1 : 2, - // shrinkWrap: true, - // padding: EdgeInsets.zero, - // childAspectRatio: sectionList.length == 1 || !isTablet - // ? orientation == Orientation.landscape - // ? 10 - // : 4.2 - // : 1.8, - // children: List.generate( - // sectionList.length, - // (i) { - // // print(sectionList); - // SectionList sectionItem = sectionList[i]; - // dropdownvalue = sectionItem.widget == InteractionWidget.DROPDOWN - // ? sectionItem.value ?? "Select" - // : ' '; - // List list = - // sectionItem.widget == InteractionWidget.DROPDOWN || - // sectionItem.widget == InteractionWidget.AUTOCOMPLETE || - // sectionItem.widget == InteractionWidget.MULTISELECT - // ? provider.getData2(sectionItem) - // : []; - // provider.checkboxlist = - // sectionItem.widget == InteractionWidget.CHECKBOX - // ? provider.getData2(sectionItem) - // : []; - - // return Wrap(children: [ - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // sectionItem.widget == InteractionWidget.BUTTON && - // sectionItem.param == 'add' || - // sectionItem.param == 'deletebtn' - // ? const SizedBox.shrink() - // : Text( - // '${sectionItem.name}:*', - // style: TextStyle( - // color: Colors.orange.shade800, - // fontSize: isTablet ? 18 : 14, - // ), - // ), - // const SizedBox( - // height: 15, - // ), - // sectionItem.widget == InteractionWidget.BUTTON - // ? sectionItem.input == 'chooseFile' - // ? Row( - // children: [ - // CustomButton( - // backgroundColor: const Color.fromARGB( - // 255, 233, 229, 229), - // onPressed: () async { - // if (sectionItem - // .selectedValue!.isNotEmpty) { - // showFilesAlertDialog( - // context, - // sectionItem.fileName!.join(','), - // sectionItem); - // } else { - // sectionItem.selectedValue = []; - // sectionItem.extension = []; - // sectionItem.fileName = []; - // await getEncodedFile(sectionItem); - // } - // setState(() {}); - // }, - // width: 120, - // height: 40, - // fontsize: 12, - // textColor: Colors.black, - // title: sectionItem.name), - // const SizedBox( - // width: 5, - // ), - // Text( - // sectionItem.selectedValue!.isNotEmpty - // ? 'File uploaded' - // : 'No file uploaded', - // style: TextStyle( - // color: - // sectionItem.selectedValue!.isNotEmpty - // ? Colors.green - // : Colors.red), - // ), - // ], - // ) - // : isTablet - // ? IconButton( - // onPressed: () { - // provider.deleteMultipleRows( - // sectionItem.gid!, - // sectionList[i], - // sectionName); - - // setState(() {}); - // }, - // icon: const Icon( - // Icons.cancel, - // size: 30, - // color: Color.fromARGB(255, 8, 39, 92), - // ), - // ) - // : Padding( - // padding: - // const EdgeInsets.only(left: 3.0, top: 5), - // child: CustomButton( - // backgroundColor: const Color.fromARGB( - // 255, 233, 75, 75), - // onPressed: () { - // provider.deleteMultipleRows( - // sectionItem.gid!, - // sectionList[i], - // sectionName); - - // setState(() {}); - // }, - // width: 80, - // height: 30, - // fontsize: 12, - // textColor: Colors.white, - // title: "Delete"), - // ) - // : returnWidget( - // sectionItem: sectionItem, - // item: item, - // provider: provider, - // list: list, - // gridIndex: i, - // listIndex: listIndex, - // widgetData: sectionItem.widget!, - // multiple: true), - // ], - // ), - // ]); - // }, - // ), - // ), - // ); - // } - Widget gridViewWidget( ViewInteractionProvider provider, String sectionName, diff --git a/lib/contacts_module/ui_screen/new_new_profile.dart b/lib/contacts_module/ui_screen/new_new_profile.dart new file mode 100644 index 0000000..3a3efbc --- /dev/null +++ b/lib/contacts_module/ui_screen/new_new_profile.dart @@ -0,0 +1,858 @@ +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/ui_screen/engagementtab.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +// import 'package:discover_module/ui_screen/k2api_integrated_ui/activityk2_tab.dart'; +// import 'package:discover_module/ui_screen/k2api_integrated_ui/locationk2_tab.dart'; +// import 'package:discover_module/ui_screen/newformlist.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/ui_screen/engagementtab.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/activityk2_tab.dart'; +import 'package:discover_module/contacts_module/ui_screen/k2api_integrated_ui/locationk2_tab.dart'; +import 'package:discover_module/contacts_module/ui_screen/newformlist.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_profile_picture/flutter_profile_picture.dart'; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class NewProfile1 extends StatefulWidget { + const NewProfile1({Key? key, required this.text}) : super(key: key); + final Map text; + + @override + State createState() => _NewProfileState(); +} + +class _NewProfileState extends State + with TickerProviderStateMixin { + List viewformData = []; + + bool _isExpanded = false; + + var item; + + TextEditingController firstNameController = TextEditingController(); + + final ScrollController _scrollController = ScrollController(); + late final TabController _tabController; + + @override + void initState() { + super.initState(); + print("pooja123"); + + //init(); + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + _tabController = TabController(length: 3, vsync: this); + }); + } + + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return DefaultTabController( + length: 3, + child: SafeArea( + child: headerview(context), + ), + ); + // }); + } + + Widget headerview(BuildContext context) { + return SafeArea( + child: Scaffold( + backgroundColor: Constants.bgcolor, + body: Stack( + children: [ + Container( + // color: Colors.blue, + child: Column( + children: [ + getAppBarUI(), + Expanded( + child: NestedScrollView( + controller: _scrollController, + headerSliverBuilder: + (BuildContext context, bool innerBoxIsScrolled) { + return [ + SliverList( + delegate: SliverChildBuilderDelegate( + (BuildContext context, int index) { + return Column( + children: [ + buildCardView( + context, + ) + ], + ); + }, childCount: 1), + ), + SliverPersistentHeader( + pinned: true, + floating: true, + delegate: ContestTabHeader( + Container( + //color: Constants.bgcolor2, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + Constants.tabbgColor, + Constants.k2color, + ]), + ), + child: TabBar( + indicatorColor: Colors.white, + labelColor: Colors + .white, // Color of the selected tab text + + unselectedLabelColor: Colors.black, + // unselectedLabelColor: + // Color.fromARGB(255, 163, 159, 159), + tabs: [ + // Tab(text: "Sentiment"), + Tab( + child: Text1( + title: "Details", + txtfont: 15.0, + ), + ), + Tab( + child: Text1( + title: "Activities", + txtfont: 15.0, + ), + ), + Tab( + child: Text1( + title: "Engagements", + txtfont: 15.0, + ), + ), + ], + ), + ), + ), + ) + ]; + }, + body: TabBarView( + //controller: _tabController, + children: [ + // LocationTab(text: widget.text["id"]), + + LocationK2Tab(text: widget.text["id"]), + + // Activities(text: widget.text["id"]), + ActivitiesK2(text: widget.text["id"]), + + EngagementTab(text: widget.text["id"]), + ], + ), + ), + ) + ], + ), + ), + ], + ), + floatingActionButton: Visibility( + visible: true, + child: FloatingActionButton( + onPressed: () async { + Navigator.push( + context, MaterialPageRoute(builder: (context) => FormList())); + }, + foregroundColor: Colors.white, + backgroundColor: const Color.fromARGB(255, 0, 71, 132), + child: new Icon(Icons.add), + ), + ), + ), + ); + } + + buildCardView(BuildContext context) { + MediaQuery.of(context).size.height * 0.35; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Stack( + clipBehavior: Clip.none, + alignment: Alignment.center, + children: [ + Container( + width: + MediaQuery.of(context).size.width, // Adjust width as needed + height: 110, // Adjust height as needed + decoration: BoxDecoration(color: Constants.k2color), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text1( + title: widget.text!["name"], + txtcolor: Colors.white, + fontweight: FontWeight.normal, + txtfont: 20.0), + Text1( + title: widget.text!["speciality"], + txtcolor: Colors.white, + fontweight: FontWeight.normal, + txtfont: 14.0), + ], + ), + ), + Positioned( + bottom: -45, + child: Container( + child: widget.text["img_path"] == "" + ? ProfilePicture( + name: widget.text!["name"], + radius: 48, + fontsize: 21, + ) + : ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(48), + child: CachedNetworkImage( + imageUrl: widget.text!["img_path"], + imageBuilder: (context, imageProvider) => Container( + decoration: BoxDecoration( + image: DecorationImage( + image: imageProvider, + fit: BoxFit.fill, + ), + ), + ), + ), + ), + ), + ), + ) + ], + ), + SizedBox( + height: 55.0, + ), + + _ProfileInfoRow(text: widget.text["id"]), + + locandpnoinfo(), + + const SizedBox( + height: 5.0, + ), + + Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Text1( + title: "Profile Summary", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 18.0), + ), + ), + const SizedBox( + height: 5.0, + ), + Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: const EdgeInsets.only(left: 15.0), + child: Text1( + title: widget.text!["summarry"], + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 14.0), + ), + ), + + SizedBox( + height: 10.0, + ), + + ListTileTheme( + dense: true, + child: Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Card( + margin: EdgeInsets.all(1.0), + // elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + color: Constants.k2color11, + child: ExpansionTile( + // collapsedBackgroundColor: Color(0xFF2b9af3), + onExpansionChanged: (bool expanded) { + setState(() { + _isExpanded = expanded; + }); + }, + backgroundColor: Constants.k2color11, + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.black), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Notes", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + const SizedBox( + width: 8.0, + ), + Text1( + title: "(0)", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + ], + ), + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: TextField( + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8.0), + ), + hintText: 'Write your note here', + contentPadding: EdgeInsets.all(16.0), + ), + maxLines: + null, // Allows the TextField to expand vertically + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: OutlinedButton( + onPressed: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (_) => PublicationsData())); + }, + child: Text( + 'Save', + style: TextStyle(color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ]), + ), + ), + ), // adds spacing between the text and image + + SizedBox( + height: 10.0, + ), + ], + // ), + ); + } + + void bottomshet(affiliation_data) { + // print("Aff_index_data: ${affiliation_data}"); + showModalBottomSheet( + // isScrollControlled: + // true, + + context: context, + + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: Clip.antiAliasWithSaveLayer, + // sheetAnimationStyle: _animationStyle, + builder: (BuildContext context) { + return + // makeDismissible( + // child: + DraggableScrollableSheet( + expand: false, + builder: (BuildContext context, ScrollController scrollController) { + return Container( + width: MediaQuery.of(context).size.width, + //color: Colors.white, + color: Color.fromARGB(255, 246, 248, 252), + + child: Column( + children: [ + Expanded( + child: ListView.builder( + controller: scrollController, + itemCount: 1, + itemBuilder: (BuildContext context, int index) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + height: 18.0, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Text( + affiliation_data['org_name'], + softWrap: true, + maxLines: 4, + style: TextStyle( + fontSize: 18.0, + color: Colors.grey[700]), + ), + ), + ), + ], + ), + const SizedBox( + height: 18.0, + ), + Divider(), + const SizedBox( + height: 8.0, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Padding( + padding: EdgeInsets.only(left: 18.0), + child: Text( + "Department", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['dept'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Padding( + padding: + EdgeInsets.only(left: 18.0, top: 18.0), + child: Text( + "Role", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['role'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Time Frame".toString(), + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['time_frame'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Padding( + padding: + EdgeInsets.only(left: 18.0, top: 18.0), + child: Text( + "Oraganization Type", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['org_type'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Padding( + padding: + EdgeInsets.only(left: 18.0, top: 18.0), + child: Text( + "Eng Type", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['emg_type'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ), + ], + ); + }, + ), + ), + ], + ), + ); + }, + ); + //); + }, + ); + } + + Widget getAppBarUI() { + return Container( + decoration: BoxDecoration( + color: Constants.k2color, + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.2), + offset: const Offset(0, 2), + blurRadius: 8.0), + ], + ), + child: Padding( + padding: EdgeInsets.only(top: 2, left: 8, right: 8), + child: Row( + children: [ + Container( + alignment: Alignment.topLeft, + // width: AppBar().preferredSize.height, + // height: AppBar().preferredSize.height, + child: Material( + color: Colors.transparent, + child: InkWell( + borderRadius: const BorderRadius.all( + Radius.circular(32.0), + ), + onTap: () { + Navigator.pop(context); + }, + child: const Padding( + padding: EdgeInsets.all(8.0), + child: Row( + children: [ + Icon( + Icons.arrow_back_ios_new, + size: 18, + color: Colors.white, + ), + SizedBox( + width: 8, + ), + Text( + "Contacts", + style: TextStyle(fontSize: 14.0, color: Colors.white), + ) + ], + ), + ), + ), + ), + ), + const Expanded( + child: Text( + "", + maxLines: 1, + softWrap: true, + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 14, + overflow: TextOverflow.ellipsis, + ), + ), + ), + ], + ), + ), + ); + } + + locandpnoinfo() { + return Column( + children: [ + const SizedBox( + height: 8.0, + ), + _buildClickableRow( + icon: Icons.location_city_sharp, + text: widget.text["addr"] ?? "Azienda Ospedaliera di Padova", + ), + const SizedBox( + height: 8.0, + ), + _buildClickableRow( + icon: Icons.location_pin, + text: widget.text?["Country"] ?? + "Via Giustiniani, 2, Padova, Veneto 35128, Italy", + onTap: _openMapsByAddress, + ), + const SizedBox( + height: 8.0, + ), + _buildClickableRow( + icon: Icons.email, + text: widget.text?["email"], + onTap: () async { + await emailSend(widget.text?["email"]); + }, + ), + SizedBox( + height: 8.0, + ), + _buildClickableRow( + icon: Icons.phone, + text: widget.text!["phone_no"].toString(), + onTap: () async { + await callinfo(widget.text?["phone_no"].toString()); + }, + ), + ], + ); + } + + Future _openMapsByAddress() async { + final address = 'Italy'; + final Uri mapsUri = Uri( + scheme: 'https', + host: 'www.google.com', + path: 'maps/search/', + query: address, + ); + + if (!await launchUrl(mapsUri)) { + throw 'Could not launch $mapsUri'; + } + } + + Future emailSend(email) async { + String? encodeQueryParameters(Map params) { + return params.entries + .map((MapEntry entry) => + Uri.encodeComponent(entry.key) + + '=' + + Uri.encodeComponent(entry.value)) + .join('&'); + } + + final Uri emailLaunchUri = Uri( + scheme: 'mailto', + path: email, + query: encodeQueryParameters({ + 'subject': 'Example Subject', + 'body': 'Hello, this is a sample body text.', + }), + ); + + if (await launchUrl(emailLaunchUri)) { + launchUrl(emailLaunchUri); + } else { + throw 'Could not launch $emailLaunchUri'; + } + } + + Future callinfo(pno) async { + final call = Uri.parse('tel:$pno'); + if (await canLaunchUrl(call)) { + launchUrl(call); + } else { + throw 'Could not launch $call'; + } + } +} + +dispalytext(dispalydata) { + return Text1( + title: dispalydata, + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 14.0); +} + +getIcon(IconData icons) { + return Icon( + icons, + color: Color.fromARGB(255, 0, 71, 132), + ); +} + +Widget _buildClickableRow({ + required IconData icon, + required String text, + VoidCallback? onTap, +}) { + return Padding( + padding: const EdgeInsets.only(left: 8.0), + child: InkWell( + onTap: onTap, + child: Row( + children: [ + getIcon(icon), + const SizedBox(width: 3.0), + Expanded(child: dispalytext(text)), + ], + ), + ), + ); +} + +class _ProfileInfoRow extends StatelessWidget { +// _ProfileInfoRow({Key? key}) : super(key: key); + final int text; + + _ProfileInfoRow({required this.text, Key? key}) : super(key: key); + + final List _items = const [ + ProfileInfoItem("Publication(s)", 688), + ProfileInfoItem("Event(s)", 111), + ProfileInfoItem("Trial(s)", 10), + ]; + + @override + Widget build(BuildContext context) { + return Container( + height: 80, + constraints: const BoxConstraints(maxWidth: 400), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: _items + .map((item) => Expanded( + child: Row( + children: [ + if (_items.indexOf(item) != 0) const VerticalDivider(), + Expanded(child: _singleItem(context, item)), + ], + ))) + .toList(), + ), + ); + } + + Widget _singleItem(BuildContext context, item) => Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + item.value.toString(), + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14, + ), + ), + ), + Text( + item.title, + // style: const TextStyle( + // fontWeight: FontWeight.normal, + // fontSize: 18, + // ), + // style: Theme.of(context).textTheme.caption, + ) + ], + ); +} + +class ProfileInfoItem { + final String title; + final int value; + const ProfileInfoItem(this.title, this.value); +} + +class ContestTabHeader extends SliverPersistentHeaderDelegate { + ContestTabHeader( + this.searchUI, + ); + final Widget searchUI; + + @override + Widget build( + BuildContext context, double shrinkOffset, bool overlapsContent) { + return Container(color: Colors.white, child: searchUI); + } + + @override + double get maxExtent => 52.0; + + @override + double get minExtent => 52.0; + + @override + bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) { + return true; + } +} diff --git a/lib/ui_screen/new_new_profile_offline.dart b/lib/contacts_module/ui_screen/new_new_profile_offline.dart similarity index 100% rename from lib/ui_screen/new_new_profile_offline.dart rename to lib/contacts_module/ui_screen/new_new_profile_offline.dart diff --git a/lib/ui_screen/new_viewinteraction.dart b/lib/contacts_module/ui_screen/new_viewinteraction.dart similarity index 95% rename from lib/ui_screen/new_viewinteraction.dart rename to lib/contacts_module/ui_screen/new_viewinteraction.dart index be80529..62aa3e7 100644 --- a/lib/ui_screen/new_viewinteraction.dart +++ b/lib/contacts_module/ui_screen/new_viewinteraction.dart @@ -1,10 +1,17 @@ -import 'package:discover_module/constants.dart'; -import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -import 'package:discover_module/ui_screen/interactionform/util.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; -import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +// import 'package:discover_module/ui_screen/interactionform/util.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart'; +// import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/custombutton.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/widget/responsive_ext.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/newformlist.dart b/lib/contacts_module/ui_screen/newformlist.dart similarity index 91% rename from lib/ui_screen/newformlist.dart rename to lib/contacts_module/ui_screen/newformlist.dart index a427136..9b1be27 100644 --- a/lib/ui_screen/newformlist.dart +++ b/lib/contacts_module/ui_screen/newformlist.dart @@ -1,11 +1,17 @@ -import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/interaction_screen.dart'; -import 'package:discover_module/ui_screen/interactionform/interactionlistscreen.dart'; -import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -import 'package:discover_module/ui_screen/interactionform/new_dynamicform.dart'; -import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; -import 'package:discover_module/ui_screen/medical_insight.dart'; +// import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/interaction_screen.dart'; +// import 'package:discover_module/ui_screen/interactionform/interactionlistscreen.dart'; +// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; +// import 'package:discover_module/ui_screen/interactionform/new_dynamicform.dart'; +// import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; +// import 'package:discover_module/ui_screen/medical_insight.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/configprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionlistscreen.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/new_dynamicform.dart'; +import 'package:discover_module/contacts_module/ui_screen/medical_insight.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; diff --git a/lib/ui_screen/nih_show_more.dart b/lib/contacts_module/ui_screen/nih_show_more.dart similarity index 92% rename from lib/ui_screen/nih_show_more.dart rename to lib/contacts_module/ui_screen/nih_show_more.dart index 3ed466f..1d63411 100644 --- a/lib/ui_screen/nih_show_more.dart +++ b/lib/contacts_module/ui_screen/nih_show_more.dart @@ -1,5 +1,7 @@ -import 'package:discover_module/provider_class/nih_provider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/provider_class/nih_provider.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/provider_class/nih_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/patent_show_more.dart b/lib/contacts_module/ui_screen/patent_show_more.dart similarity index 92% rename from lib/ui_screen/patent_show_more.dart rename to lib/contacts_module/ui_screen/patent_show_more.dart index ee777b3..3e1c3f1 100644 --- a/lib/ui_screen/patent_show_more.dart +++ b/lib/contacts_module/ui_screen/patent_show_more.dart @@ -1,5 +1,7 @@ -import 'package:discover_module/provider_class/patent_provider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/provider_class/patent_provider.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/provider_class/patent_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/pno_showmore.dart b/lib/contacts_module/ui_screen/pno_showmore.dart similarity index 92% rename from lib/ui_screen/pno_showmore.dart rename to lib/contacts_module/ui_screen/pno_showmore.dart index a489cbb..604a2df 100644 --- a/lib/ui_screen/pno_showmore.dart +++ b/lib/contacts_module/ui_screen/pno_showmore.dart @@ -1,5 +1,7 @@ -import 'package:discover_module/provider_class/phoneno_provider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/provider_class/phoneno_provider.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/provider_class/phoneno_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/pro_show_more.dart b/lib/contacts_module/ui_screen/pro_show_more.dart similarity index 92% rename from lib/ui_screen/pro_show_more.dart rename to lib/contacts_module/ui_screen/pro_show_more.dart index 3f48560..16b1b83 100644 --- a/lib/ui_screen/pro_show_more.dart +++ b/lib/contacts_module/ui_screen/pro_show_more.dart @@ -1,5 +1,7 @@ -import 'package:discover_module/provider_class/procedureprovider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/provider_class/procedureprovider.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/provider_class/procedureprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/publication_data.dart b/lib/contacts_module/ui_screen/publication_data.dart similarity index 90% rename from lib/ui_screen/publication_data.dart rename to lib/contacts_module/ui_screen/publication_data.dart index 9a4aa9c..7755bba 100644 --- a/lib/ui_screen/publication_data.dart +++ b/lib/contacts_module/ui_screen/publication_data.dart @@ -1,7 +1,9 @@ -import 'package:discover_module/provider_class/affiliationsprovider.dart'; -import 'package:discover_module/provider_class/publications_provider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; -import 'package:discover_module/ui_screen/bottommmsheet.dart'; +// import 'package:discover_module/provider_class/affiliationsprovider.dart'; +// import 'package:discover_module/provider_class/publications_provider.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/ui_screen/bottommmsheet.dart'; +import 'package:discover_module/contacts_module/provider_class/publications_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/ranking.dart b/lib/contacts_module/ui_screen/ranking.dart similarity index 100% rename from lib/ui_screen/ranking.dart rename to lib/contacts_module/ui_screen/ranking.dart diff --git a/lib/ui_screen/rising_stars.dart b/lib/contacts_module/ui_screen/rising_stars.dart similarity index 93% rename from lib/ui_screen/rising_stars.dart rename to lib/contacts_module/ui_screen/rising_stars.dart index 32919f0..2309fd4 100644 --- a/lib/ui_screen/rising_stars.dart +++ b/lib/contacts_module/ui_screen/rising_stars.dart @@ -1,7 +1,10 @@ -import 'package:discover_module/custom_widget/floating_btn.dart'; -import 'package:discover_module/custom_widget/show_alert.dart'; -import 'package:discover_module/hive_fun.dart'; -import 'package:discover_module/ui_screen/ranking.dart'; +// import 'package:discover_module/custom_widget/floating_btn.dart'; +// import 'package:discover_module/custom_widget/show_alert.dart'; +// import 'package:discover_module/hive_fun.dart'; +// import 'package:discover_module/ui_screen/ranking.dart'; +import 'package:discover_module/contacts_module/custom_widget/floating_btn.dart'; +import 'package:discover_module/contacts_module/custom_widget/show_alert.dart'; +import 'package:discover_module/contacts_module/hive_fun.dart'; import 'package:flutter/material.dart'; class RisingStar extends StatefulWidget { diff --git a/lib/contacts_module/ui_screen/saved_profiles/saved_activity.dart b/lib/contacts_module/ui_screen/saved_profiles/saved_activity.dart new file mode 100644 index 0000000..61266dd --- /dev/null +++ b/lib/contacts_module/ui_screen/saved_profiles/saved_activity.dart @@ -0,0 +1,978 @@ +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/provider_class/affiliationsprovider.dart'; +// import 'package:discover_module/provider_class/events_provider.dart'; +// import 'package:discover_module/provider_class/publications_provider.dart'; +// import 'package:discover_module/provider_class/trials_provider.dart'; +// import 'package:discover_module/storage_hive/aff_data/insert_aff.dart'; +// import 'package:discover_module/storage_hive/events_data/crud_event.dart'; +// import 'package:discover_module/storage_hive/pub_data/curd_pub.dart'; +// import 'package:discover_module/storage_hive/trials_data/crud_trials.dart'; +// import 'package:discover_module/ui_screen/affiliation_data.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/ui_screen/events_data.dart'; +// import 'package:discover_module/ui_screen/publication_data.dart'; +// import 'package:discover_module/ui_screen/trials_show_more.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/storage_hive/aff_data/insert_aff.dart'; +import 'package:discover_module/contacts_module/storage_hive/events_data/crud_event.dart'; +import 'package:discover_module/contacts_module/storage_hive/pub_data/curd_pub.dart'; +import 'package:discover_module/contacts_module/storage_hive/trials_data/crud_trials.dart'; +import 'package:discover_module/contacts_module/ui_screen/affiliation_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/ui_screen/events_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/publication_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/trials_show_more.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class SavedActivities extends StatefulWidget { + //Activities({super.key, required text}); + SavedActivities({required this.text, Key? key}) : super(key: key); + + final int text; + + @override + State createState() => _SavedActivitiesState(); +} + +class _SavedActivitiesState extends State { + bool _isExpanded = false; + + List affiliation_data = []; + List publication_data = []; + List event_data = []; + List trial_data = []; + List medinsightData = []; + List speaker = []; + List eng = []; + @override + void initState() { + // TODO: implement initState + super.initState(); + getaffiliations(); + } + + getaffiliations() async { + // var affiliations = + // Provider.of(context, listen: false); + + // await affiliations.getAffiliationsdata(widget.text); + // final affilist = affiliations.adddta; + + // print("CheckingAfflist: $affilist"); + + final affilist = await retrieveidAffiliations(widget.text); + print("Savedd_CheckingAfflist: $affilist"); + + // var publication = Provider.of(context, listen: false); + + // await publication.publicatininfo(widget.text); + // final publist = publication.publicationlist; + + final publist = await retrieveidPublications(widget.text); + print("Savedd_CheckingAfflist: $affilist"); + + // var events = Provider.of(context, listen: false); + // await events.geteventdata(widget.text); + // final eventlist = events.EventsList; + + final eventlist = await retrieveidEvent(widget.text); + print("Savedd_CheckingAfflist: $affilist"); + + // var trials = Provider.of(context, listen: false); + // await trials.trialsdata(widget.text); + + // final trialslist = trials.trialsinfo; + final trialslist = await retrieveidTrials(widget.text); + print("Savedd_CheckingAfflist: $affilist"); + + setState(() { + affiliation_data = affilist; + publication_data = publist; + event_data = eventlist; + trial_data = trialslist; + // medinsightData = medlist; + // speaker = speakerlist; + // eng = engtypelist; + }); + + print("Affiliations_data_isNewOff: $affiliation_data"); + print("Publication_data_isNewOff: $publication_data"); + + // print("trialslist_data_is: $trialslist"); + //final affiliationsss = affiliation_data['Affiliations'] as List>; + } + + @override + Widget build(BuildContext context) { + return Center( + child: ListView(children: [ + affiliation_data.length != 0 + ? ListTileTheme( + dense: true, + child: Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Card( + margin: EdgeInsets.all(1.0), + // elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + color: Constants.k2color11, + child: ExpansionTile( + initiallyExpanded: false, + maintainState: true, + onExpansionChanged: (bool expanded) async { + print("HeyyyPooja"); + + setState(() { + _isExpanded = expanded; + }); + }, + backgroundColor: Constants.k2color11, + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.black), + // backgroundColor: Colors.white, + // collapsedBackgroundColor: Color(0xFF2b9af3), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Affiliations", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + const SizedBox( + width: 8.0, + ), + Text1( + title: + "(${affiliation_data.length.toString()})", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + ], + ), + children: [ + Scrollbar( + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Container( + // width: + // MediaQuery.of(context) + // .size + // .width, + constraints: BoxConstraints( + minWidth: + MediaQuery.of(context).size.width), + color: Colors.white, + child: DataTable( + showCheckboxColumn: false, + columns: const [ + DataColumn( + label: Expanded( + child: Text( + 'Organization Name', + style: TextStyle( + fontWeight: FontWeight.w600), + ), + )), + DataColumn( + label: Expanded( + child: Text('Time Frame', + style: TextStyle( + fontWeight: + FontWeight.w600)))), + ], + rows: List.generate( + affiliation_data.take(2).length, + (index) => DataRow( + onSelectChanged: (value) { + // =======> Use onSelectChanged for tab + print( + "message11 ${affiliation_data[index]}"); + + bottomshet(affiliation_data[index]); + }, + color: MaterialStateProperty.resolveWith< + Color?>((Set states) { + if (index.isEven) { + return Colors.grey.withOpacity(0.1); + } + return null; + }), + cells: [ + DataCell(Text( + affiliation_data[index] + .orgName + .toString(), + softWrap: true)), + + DataCell(Text( + affiliation_data[index] + .timeFrame + .toString(), + softWrap: true)), + + // Add more DataCells as needed + ], + ), + ), + ), + ), + ), + ), + Container( + color: Colors.white, + child: Align( + alignment: Alignment.center, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: OutlinedButton( + onPressed: () { + print("Passing_Id_isss: ${widget.text}"); + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => AffiliationsData( + text: widget.text))); + }, + child: Text( + 'Show More', + style: TextStyle(color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ), + ) + ]), + ), + ), + ) + : Container(), // adds spacing between the text and image + + publication_data.length != 0 + ? ListTileTheme( + dense: true, + child: Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Card( + margin: EdgeInsets.all(1.0), + // elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + color: Constants.k2color11, + child: ExpansionTile( + initiallyExpanded: false, + maintainState: true, + // backgroundColor: Colors.white, + // collapsedBackgroundColor: Color(0xFF2b9af3), + onExpansionChanged: (bool expanded) { + setState(() { + _isExpanded = expanded; + }); + }, + backgroundColor: Constants.k2color11, + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.black), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Publications", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + const SizedBox( + width: 8.0, + ), + Text1( + title: + "(${publication_data.length.toString()})", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + ], + ), + children: [ + Scrollbar( + //isAlwaysShown: true, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Container( + constraints: BoxConstraints( + minWidth: + MediaQuery.of(context).size.width), + color: Colors.white, + child: DataTable( + showCheckboxColumn: false, + columns: const [ + DataColumn( + label: Expanded( + child: Text('Article Title', + style: TextStyle( + fontWeight: FontWeight.w600), + softWrap: true), + )), + + DataColumn( + label: Expanded( + child: Text('Authors', + style: TextStyle( + fontWeight: + FontWeight.w600)))), + + // Add more columns as needed + ], + rows: List.generate( + publication_data.take(2).length, + (index) => DataRow( + onSelectChanged: (value) { + // =======> Use onSelectChanged for tab + print( + "message ${publication_data[index]}"); + + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: + Clip.antiAliasWithSaveLayer, + context: context, + builder: (context) { + return bsheet( + publication_data[index]); + }, + ); + }, + cells: [ + DataCell(Text( + publication_data[index] + .artical_title + .toString(), + softWrap: true)), + + DataCell(Text( + publication_data[index] + .author + .toString(), + softWrap: true)), + + // Add more DataCells as needed + ], + ), + ), + ), + ), + ), + ), + Container( + color: Colors.white, + child: Align( + alignment: Alignment.center, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: OutlinedButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => PublicationsData( + text: widget.text))); + }, + child: Text( + 'Show More', + style: TextStyle(color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ), + ) + ]), + ), + ), + ) + : Container(), // adds spacing between the text and image + + event_data.length != 0 + ? ListTileTheme( + dense: true, + child: Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Card( + margin: EdgeInsets.all(1.0), + // elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + color: Constants.k2color11, + child: ExpansionTile( + initiallyExpanded: false, + maintainState: true, + onExpansionChanged: (bool expanded) { + setState(() { + _isExpanded = expanded; + }); + }, + backgroundColor: Constants.k2color11, + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.black), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Events", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + const SizedBox( + width: 8.0, + ), + Text1( + title: "(${event_data.length.toString()})", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.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: const [ + DataColumn( + label: Expanded( + child: Text('Event Name', + softWrap: true, + style: TextStyle( + fontWeight: FontWeight.w600)), + )), + + DataColumn( + label: Expanded( + child: Text('Role', + softWrap: true, + style: TextStyle( + fontWeight: + FontWeight.w600)))), + + // Add more columns as needed + ], + rows: List.generate( + event_data.take(2).length, + (index) => DataRow( + onSelectChanged: (value) { + // =======> Use onSelectChanged for tab + print("message ${event_data[index]}"); + + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: + Clip.antiAliasWithSaveLayer, + context: context, + builder: (context) { + return bsheet(event_data[index]); + }, + ); + }, + cells: [ + DataCell(Text( + event_data[index] + .event_name + .toString(), + softWrap: true)), + + DataCell(Text( + event_data[index].role.toString(), + softWrap: true)), + + // Add more DataCells as needed + ], + ), + ), + ), + ), + ), + ), + Container( + color: Colors.white, + child: Align( + alignment: Alignment.center, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: OutlinedButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => EventsData( + text: widget.text, + ))); + }, + child: Text( + 'Show More', + style: TextStyle(color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ), + ) + ]), + ), + ), + ) + : Container(), // adds spacing between the text and image + + trial_data.length != 0 + ? ListTileTheme( + dense: true, + child: Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Card( + margin: EdgeInsets.all(1.0), + //elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + color: Constants.k2color11, + child: ExpansionTile( + initiallyExpanded: false, + maintainState: true, + onExpansionChanged: (bool expanded) { + setState(() { + _isExpanded = expanded; + }); + }, + backgroundColor: Constants.k2color11, + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.black), + // backgroundColor: Colors.white, + // collapsedBackgroundColor: Color(0xFF2b9af3), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Trials", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + const SizedBox( + width: 8.0, + ), + Text1( + title: "(${trial_data.length.toString()})", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.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: const [ + DataColumn( + label: Expanded( + child: Text('Trial Name', + softWrap: true, + style: TextStyle( + fontWeight: FontWeight.w600)), + )), + DataColumn( + label: Expanded( + child: Text('Status', + softWrap: true, + style: TextStyle( + fontWeight: + FontWeight.w600)))), + ], + rows: List.generate( + trial_data.take(2).length, + (index) => DataRow( + onSelectChanged: (value) { + // =======> Use onSelectChanged for tab + print("message ${trial_data[index]}"); + + // bsheet( + // publication_data[ + // index]); + showModalBottomSheet( + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: + Clip.antiAliasWithSaveLayer, + context: context, + builder: (context) { + return bsheet(trial_data[index]); + }, + ); + }, + cells: [ + DataCell(Text( + trial_data[index] + .trial_name + .toString(), + softWrap: true)), + DataCell(Text( + trial_data[index].status.toString(), + softWrap: true)), + ], + ), + ), + ), + ), + ), + ), + Container( + color: Colors.white, + child: Align( + alignment: Alignment.center, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: OutlinedButton( + onPressed: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => TrialsShowmore( + text: widget.text))); + }, + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + child: Text( + 'Show More', + style: TextStyle(color: Constants.k2color), + ), + ), + ), + ), + ) + ]), + ), + ), + ) + : Container(), // adds spacing between the text and image + ]), + ); + } + + void bottomshet(affiliation_data) { + // print("Aff_index_data: ${affiliation_data}"); + showModalBottomSheet( + // isScrollControlled: + // true, + + context: context, + + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: Clip.antiAliasWithSaveLayer, + // sheetAnimationStyle: _animationStyle, + builder: (BuildContext context) { + return + // makeDismissible( + // child: + DraggableScrollableSheet( + expand: false, + builder: (BuildContext context, ScrollController scrollController) { + return Container( + width: MediaQuery.of(context).size.width, + //color: Colors.white, + color: Color.fromARGB(255, 246, 248, 252), + + // decoration: + // BoxDecoration(borderRadius: BorderRadius.circular(10)), + // child: ListView( + // children: [ + + // ], + // ), + + child: Column( + children: [ + Expanded( + child: ListView.builder( + controller: scrollController, + itemCount: 1, + itemBuilder: (BuildContext context, int index) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // Row( + // children: [ + // Text( + // "Affiliation", + // style: TextStyle(fontSize: 20.0), + // ) + // ], + // ), + SizedBox( + height: 18.0, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Text( + affiliation_data['org_name'], + softWrap: true, + maxLines: 4, + style: TextStyle( + fontSize: 16.0, color: Colors.black), + ), + ), + ), + ], + ), + SizedBox( + height: 18.0, + ), + Divider(), + SizedBox( + height: 8.0, + ), + + affiliation_data['dept'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + "Department", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['dept'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + affiliation_data['role'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Role", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['role'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + affiliation_data['time_frame'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Time Frame".toString(), + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['time_frame'] + .toString(), + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + affiliation_data['org_type'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Oraganization Type", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['org_type'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + + affiliation_data['emg_type'] != "" + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Eng Type", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: + const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['emg_type'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ) + : Container(), + ], + ); + }, + ), + ), + ], + ), + ); + }, + ); + //); + }, + ); + } +} diff --git a/lib/ui_screen/new_contacts.dart b/lib/contacts_module/ui_screen/saved_profiles/saved_contact.dart similarity index 71% rename from lib/ui_screen/new_contacts.dart rename to lib/contacts_module/ui_screen/saved_profiles/saved_contact.dart index d3bb522..c9b4b1e 100644 --- a/lib/ui_screen/new_contacts.dart +++ b/lib/contacts_module/ui_screen/saved_profiles/saved_contact.dart @@ -1,13 +1,36 @@ import 'dart:io'; import 'package:cached_network_image/cached_network_image.dart'; -import 'package:discover_module/constants.dart'; -import 'package:discover_module/hive_fun.dart'; -import 'package:discover_module/provider_class/hcp%20_provider.dart'; -import 'package:discover_module/ui_screen/filters_menu.dart'; -import 'package:discover_module/ui_screen/interactionform/util.dart'; -import 'package:discover_module/ui_screen/new_new_profile.dart'; -import 'package:discover_module/ui_screen/new_new_profile_offline.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/hive_fun.dart'; +import 'package:discover_module/contacts_module/provider_class/hcp%20_provider.dart'; +import 'package:discover_module/contacts_module/storage_hive/aff_data/insert_aff.dart'; +import 'package:discover_module/contacts_module/storage_hive/events_data/crud_event.dart'; +import 'package:discover_module/contacts_module/storage_hive/kol_info/curd_kol.dart'; +import 'package:discover_module/contacts_module/storage_hive/pub_data/curd_pub.dart'; +import 'package:discover_module/contacts_module/storage_hive/trials_data/crud_trials.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/util.dart'; +import 'package:discover_module/contacts_module/ui_screen/saved_profiles/saved_profile_info.dart'; +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/hive_fun.dart'; +// import 'package:discover_module/provider_class/affiliationsprovider.dart'; +// import 'package:discover_module/provider_class/events_provider.dart'; +// import 'package:discover_module/provider_class/hcp%20_provider.dart'; +// import 'package:discover_module/provider_class/publications_provider.dart'; +// import 'package:discover_module/provider_class/trials_provider.dart'; +// import 'package:discover_module/storage_hive/aff_data/insert_aff.dart'; +// import 'package:discover_module/storage_hive/events_data/crud_event.dart'; +// import 'package:discover_module/storage_hive/kol_info/curd_kol.dart'; +// import 'package:discover_module/storage_hive/kol_info/kol_info_model_hive.dart'; +// import 'package:discover_module/storage_hive/pub_data/curd_pub.dart'; +// import 'package:discover_module/storage_hive/trials_data/crud_trials.dart'; +// import 'package:discover_module/ui_screen/filters_menu.dart'; +// import 'package:discover_module/ui_screen/interactionform/util.dart'; +// import 'package:discover_module/ui_screen/new_new_profile.dart'; +// import 'package:discover_module/ui_screen/new_new_profile_offline.dart'; +// import 'package:discover_module/ui_screen/saved_profiles/saved_profile_info.dart'; import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdownfield2/dropdownfield2.dart'; import 'package:flutter/cupertino.dart'; @@ -18,16 +41,16 @@ import 'package:provider/provider.dart'; import 'package:flutter/services.dart'; import 'package:flutter_profile_picture/flutter_profile_picture.dart'; import 'package:hive_flutter/hive_flutter.dart'; -import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; +// import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; -class Contacts1 extends StatefulWidget { - const Contacts1({Key? key}) : super(key: key); +class SavedContacts1 extends StatefulWidget { + const SavedContacts1({Key? key}) : super(key: key); @override - State createState() => _Contacts1State(); + State createState() => SavedContacts1State(); } -class _Contacts1State extends State { +class SavedContacts1State extends State { final GlobalKey _scaffoldKey = GlobalKey(); // final contactBox = Hive.box("mycontact"); @@ -71,50 +94,30 @@ class _Contacts1State extends State { bool isChecked = false; //final Set _selectedIndices = Set(); - final List _selectedIndices = []; + final List _selectedIndices = []; final List _selectedremoveIndices = []; bool longpress = false; bool longpressmy = false; - // Future CheckUserConnection() async { - // try { - // final result = await InternetAddress.lookup('google.com'); - // if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) { - // setState(() { - // ActiveConnection = true; - // T = "Turn off the data and repress again"; - // print("Isssss Off $ActiveConnection"); - // Provider.of(context, listen: false).getHCPProvider(); - // }); - // } - // } on SocketException catch (_) { - // setState(() { - // ActiveConnection = false; - // T = "Turn On the data and repress again"; - // print("Isssss Off $ActiveConnection"); - // Provider.of(context, listen: false).getHCPProviderHive(); - // }); - // } - // } + List offlinekoldata = []; @override void initState() { super.initState(); - // CheckUserConnection(); - Provider.of(context, listen: false).getHCPProvider(); + data(); + } - // HiveFunctions.getAllUsers11(); + data() async { + offlinekoldata = await retrievekol(); + setState(() {}); - //Provider.of(context, listen: false).getHCPProviderHive(); - - //print("Get_hcp_dataaaL ${HiveFunctions.gethcpdata()}"); - // getDropdownlist(); + print("Lenghtttthhhh: ${offlinekoldata.length}"); } @override Widget build(BuildContext context) { - print("ProfileType $dropdownvalue, $_selectedValue1"); + // print("ProfileType $dropdownvalue, $_selectedValue1"); // print("all StoredUser: ${HiveFunctions.getAllUsers11()}"); @@ -128,23 +131,31 @@ class _Contacts1State extends State { ]; }); } else if (_selectedValue1 == "HCP Name") { - print("kkk"); + print("kkkofflinekoldata ${offlinekoldata.map((e) => e.name)}"); + + List data = offlinekoldata.map((e) => e.name.toString()).toList(); + + print("Kol_name_data: $data"); setState(() { - ddlist = [ - 'Abraham, William', - "Abbas,Samer", - 'Butler, Javed', - ]; + ddlist = data; }); } else if (_selectedValue1 == "Speciality") { print("kkk"); + + List dataspl = + offlinekoldata.map((e) => e.speciality.toString()).toList(); + setState(() { - ddlist = [ - "Cardiovascular Disease", - 'Interventional Cardiology', - "Cardiovascular Disease", - ]; + ddlist = dataspl; }); + + // setState(() { + // ddlist = [ + // "Cardiovascular Disease", + // 'Interventional Cardiology', + // "Cardiovascular Disease", + // ]; + // }); } else if (_selectedValue1 == "Country") { print("kkk"); setState(() { @@ -208,7 +219,7 @@ class _Contacts1State extends State { ), ), ) - : Text("Contacts"), + : Text("Offline Contacts"), actions: [ IconButton( onPressed: () { @@ -223,10 +234,22 @@ class _Contacts1State extends State { ], ), endDrawer: Drawer( - // width: MediaQuery.of(context).size.width * 99.2, + //width: MediaQuery.of(context).size.width * 99.2, child: listdata(), ), - body: Consumer( + body: + + // ListView.builder( + // itemCount: offlinekoldata.length, + // itemBuilder: (context, index) { + // var data11 = offlinekoldata[index]; + // print("Imammmm_data111: $data11"); + // return ListTile( + // title: Text("dd ${data11.name}"), + // ); + // }) + + Consumer( builder: (context, hcpProvider, child) { print("_selectedValueConsumerConsumer_isss: $_selectedValue"); @@ -234,7 +257,26 @@ class _Contacts1State extends State { _searchController.text = _selectedValue; } - displayedHCPList = hcpProvider.searchHCP(_searchController.text); + // displayedHCPList = hcpProvider.searchHCP(_searchController.text); + + // offlinekoldata = HiveFunctions.OfflineStored_getindexUser( + // _searchController.text); + + // where((hcp) => + // hcp['name'].toLowerCase().contains(query.toLowerCase()) + + offlinekoldata = offlinekoldata + .where((element) => + element.name + .toLowerCase() + .contains(_searchController.text.toLowerCase()) || + element.speciality + .toLowerCase() + .contains(_searchController.text.toLowerCase()) || + element.addr + .toLowerCase() + .contains(_searchController.text.toLowerCase())) + .toList(); return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -275,21 +317,33 @@ class _Contacts1State extends State { ), ), Padding( - padding: - const EdgeInsets.only(right: 8.0, top: 9.0), - child: !_switchValue - ? const Text( - 'My Contacts', - style: TextStyle( - fontSize: 15, color: Colors.grey), - ) - : const Text( - 'My Contacts', - style: TextStyle( - fontSize: 15, - ), - ), - ) + padding: + const EdgeInsets.only(right: 8.0, top: 9.0), + child: !_switchValue + ? Text1( + title: 'My Contacts', + txtfont: 15, + txtcolor: Colors.grey, + ) + + // Text( + // 'My Contacts', + // style: TextStyle( + // fontSize: 15, color: Colors.grey), + // ) + : Text1( + title: 'My Contacts', + txtfont: 15, + txtcolor: Colors.grey, + ) + + // const Text( + // 'My Contacts', + // style: TextStyle( + // fontSize: 15, + // ), + // ), + ) ], ), ), @@ -298,9 +352,15 @@ class _Contacts1State extends State { padding: const EdgeInsets.only(right: 8.0), child: Row( children: [ - Text("Filters"), + Text1(title: 'My Filters'), IconButton( onPressed: () { + retrievekol(); + + retrieveAffiliations(); + retrievePublications(); + retrieveEventss(); + retrieveTrials(); _scaffoldKey.currentState?.openEndDrawer(); }, icon: Icon( @@ -355,11 +415,12 @@ class _Contacts1State extends State { !_switchValue ? Expanded( child: ListView.builder( - itemCount: displayedHCPList.length, + itemCount: offlinekoldata.length, itemBuilder: (BuildContext context, int index) { - var data = displayedHCPList[index]; + var data = offlinekoldata[index]; - print("CheckinggggImage_path: ${data['img_path']}"); + print( + "CheckinggggImage_pathOffline: ${data.img_path}"); return Column( children: [ @@ -371,19 +432,19 @@ class _Contacts1State extends State { }); }, onTap: () async { - print("Check_data = ${data["Location"]}"); + print("Check_data11123 = ${data.name}"); Navigator.push( context, MaterialPageRoute( builder: (context) => - NewProfile1(text: data), + SavedNewProfile1(text: data), ), ); }, - leading: data["img_path"] == "" + leading: data.img_path == "" ? ProfilePicture( - name: data["First Name"], + name: data.name, radius: 30, fontsize: 12, ) @@ -391,7 +452,7 @@ class _Contacts1State extends State { child: SizedBox.fromSize( size: Size.fromRadius(30), child: CachedNetworkImage( - imageUrl: data["img_path"], + imageUrl: data.img_path, imageBuilder: (context, imageProvider) => Container( @@ -413,7 +474,7 @@ class _Contacts1State extends State { visible: longpress, child: Checkbox( value: _selectedIndices - .contains(data["uid"]), + .contains(data.id.toString()), onChanged: (value) { // setState(() { // _selectedIndices.add(data["id"]); @@ -422,58 +483,81 @@ class _Contacts1State extends State { // }); setState(() { if (value!) { - _selectedIndices.add(data["uid"]); + _selectedIndices + .add(data.id.toString()); } else { _selectedIndices - .remove(data["uid"]); + .remove(data.id.toString()); } print( - "id_total: ${_selectedIndices}"); + "id_total123: ${_selectedIndices}"); }); }), ), - title: Text( - "${data["name"]}", - style: TextStyle( - fontSize: isTablet ? 22 : 16, - fontWeight: FontWeight.bold, - ), + title: Text1( + title: data.name, + fontweight: FontWeight.bold, + txtfont: isTablet ? 22 : 16, ), + // Text( + // "${data["name"]}", + // style: TextStyle( + // fontSize: isTablet ? 22 : 16, + // fontWeight: FontWeight.bold, + // ), + // ), subtitle: Column( children: [ Row( children: [ Expanded( - child: Text( - "${data["speciality"] ?? data['spl']},", - style: TextStyle( - fontSize: isTablet ? 20 : 14, - fontWeight: FontWeight.normal, - ), + child: Text1( + title: data.speciality ?? + data['spl'], + fontweight: FontWeight.normal, + txtfont: isTablet ? 20 : 14, ), + + // Text( + // "${data["speciality"] ?? data['spl']},", + // style: TextStyle( + // fontSize: isTablet ? 20 : 14, + // fontWeight: FontWeight.normal, + // ), + // ), ), ], ), Row( children: [ - Text( - "${data["State"] ?? ""},", - style: const TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.normal, - ), + Text1( + title: data.name ?? '', + fontweight: FontWeight.normal, + txtfont: 14, ), + // Text( + // "${data["State"] ?? ""},", + // style: const TextStyle( + // fontSize: 14.0, + // fontWeight: FontWeight.normal, + // ), + // ), SizedBox( width: 3.0, ), Expanded( - child: Text( - "${data["Country"] ?? ""}", - style: const TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.normal, - ), + child: Text1( + title: data.name ?? '', + fontweight: FontWeight.normal, + txtfont: 14, ), + // Text( + // "${data["Country"] ?? ""}", + // style: const TextStyle( + // fontSize: 14.0, + // fontWeight: FontWeight.normal, + // ), + // ), ), ], ), @@ -491,28 +575,24 @@ class _Contacts1State extends State { ], ), ), - const Row( + Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Padding( padding: EdgeInsets.only(left: 10.0), - child: Text( - "Added by Pooja k", - style: TextStyle( - fontSize: 12.0, - fontWeight: FontWeight.normal, - ), + child: Text1( + title: "Added by Pooja k", + fontweight: FontWeight.normal, + txtfont: 14, ), ), Padding( padding: EdgeInsets.only(right: 10.0), - child: Text( - "Added on 01/07/2023", - style: TextStyle( - fontSize: 12.0, - fontWeight: FontWeight.normal, - ), + child: Text1( + title: "Added on 01/07/2023", + fontweight: FontWeight.normal, + txtfont: 14, ), ) ], @@ -543,15 +623,15 @@ class _Contacts1State extends State { }); }, onTap: () async { - print("Check_data = $data"); + print("Check_data12345 = $data"); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - NewProfile1(text: data), - ), - ); + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // NewProfile1(text: data), + // ), + // ); }, leading: data["img_path"] == "" ? ProfilePicture( @@ -689,35 +769,35 @@ class _Contacts1State extends State { for (int i = 0; i < _selectedIndices.length; i++) { - print( - 'The id id : ${_selectedIndices[i]}'); - //List<_Row> _rows = []; + // print( + // 'The id id : ${_selectedIndices[i]}'); + // //List<_Row> _rows = []; - final row = displayedHCPList[ - _selectedIndices[i] - 1]; - var data = displayedHCPList[i]; + // final row = displayedHCPList[ + // _selectedIndices[i] - 1]; + // var data = displayedHCPList[i]; - print( - "checking_value_istrends: ${_selectedIndices[i]},${row["name"]}, ${row["id"]}"); - int autoIncrementKey1 = - await getNextAutoIncrementValue(); - print(autoIncrementKey1); + // print( + // "checking_value_istrends: ${_selectedIndices[i]},${row["name"]}, ${row["id"]}"); + // int autoIncrementKey1 = + // await getNextAutoIncrementValue(); + // print(autoIncrementKey1); - HiveFunctions.createUser({ - "inid": autoIncrementKey1, - "id": autoIncrementKey1, - "name": row["name"], - "org": "med", - "addr": row["addr"], - "phone": row["phone_no"], - "phone_no": row["phone_no"], - "email": row["email"], - "summarry": row["summarry"], - "speciality": row["speciality"], - "sub_speciality": - row["sub_speciality"], - "img_path": row["img_path"], - }); + // HiveFunctions.createUser({ + // "inid": autoIncrementKey1, + // "id": autoIncrementKey1, + // "name": row["name"], + // "org": "med", + // "addr": row["addr"], + // "phone": row["phone_no"], + // "phone_no": row["phone_no"], + // "email": row["email"], + // "summarry": row["summarry"], + // "speciality": row["speciality"], + // "sub_speciality": + // row["sub_speciality"], + // "img_path": row["img_path"], + // }); } _showMyDialog( "Selected contact has been added to my contacts "); @@ -784,6 +864,59 @@ class _Contacts1State extends State { ], ), ), + Expanded( + child: GestureDetector( + onTap: () async { + print( + "Selected: ${_selectedIndices}"); + for (int i = 0; + i < _selectedIndices.length; + i++) { + print( + 'The id id : ${_selectedIndices[i]}'); + + // Map? row = + // findRecordById(offlinekoldata, + // _selectedIndices[i]); + + // print("Storingggg_isss:Row $row"); + + // print( + // "checking_Deleted_istrends: ${_selectedIndices[i]},${row!["license_no"]}, ${row["email"]}, ${row["img_path"]} "); + + await deletekol( + _selectedIndices[i]); + + _showMyDialog( + "selected contact has been removed"); + } + + // print( + // "CheckingAfflist: $affilist"); + setState(() {}); + }, + child: const Row( + children: [ + Padding( + padding: EdgeInsets.all(15.0), + child: Icon( + Icons.save, + color: Colors.deepOrange, + ), + ), + Padding( + padding: + EdgeInsets.only(top: 15.0), + child: Text( + 'Delete Offline', + style: TextStyle( + color: Colors.black), + ), + ), + ], + ), + ), + ), ], ), ) @@ -954,7 +1087,7 @@ class _Contacts1State extends State { Navigator.push( context, - MaterialPageRoute(builder: (context) => Contacts1()), + MaterialPageRoute(builder: (context) => SavedContacts1()), ).then((value) => setState(() {})); print("refresh done "); // }) @@ -972,49 +1105,10 @@ class _Contacts1State extends State { ], ), ), - // ListTile( - // title: SizedBox( - // width: MediaQuery.of(context).size.width, - // child: DropdownButtonFormField( - // decoration: InputDecoration( - // enabledBorder: OutlineInputBorder( - // borderRadius: BorderRadius.circular(10), - // borderSide: BorderSide(width: 1, color: Colors.black)), - // focusedBorder: OutlineInputBorder( - // borderRadius: BorderRadius.circular(10), - // borderSide: BorderSide(width: 1, color: Colors.black), - // ), - // ), - - // value: dropdownvalue, - - // items: items.map((String items) { - // return DropdownMenuItem( - // value: items, - // child: Text( - // items, - // style: TextStyle(fontSize: 14.0), - // ), - // ); - // }).toList(), - // // After selecting the desired option,it will - // // change button value to selected value - // onChanged: (String? newValue) { - // setState(() { - // dropdownvalue = newValue!; - // }); - // }, - // ), - // ), - // ), ListTile( title: DropdownButtonHideUnderline( child: DropdownButtonFormField2( - // decoration: InputDecoration( - // border: OutlineInputBorder(), - // labelText: 'Select an option', - // ), hint: Text("Select the Type"), decoration: InputDecoration( // Add Horizontal padding using menuItemStyleData.padding so it matches @@ -1040,14 +1134,6 @@ class _Contacts1State extends State { _selectedValue1 = newValue; }); }, - // buttonStyleData: ButtonStyleData( - // height: 50, - // padding: EdgeInsets.symmetric(horizontal: 14), - // decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(10), - // border: Border.all(color: Colors.grey), - // ), - // ), buttonStyleData: const ButtonStyleData( padding: EdgeInsets.symmetric(horizontal: 16), height: 50, @@ -1129,25 +1215,31 @@ class _Contacts1State extends State { ), ), ), + // ListTile( - // title: Padding( - // padding: const EdgeInsets.only(left: 35.0, right: 35.0), - // child: OutlinedButton( - // onPressed: () async { - // filterss(_selectedValue); - // }, - // child: Text( - // 'Filter', - // style: TextStyle(color: Constants.k2color), - // ), - // style: OutlinedButton.styleFrom( - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(12), + // title: Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // OutlinedButton( + // onPressed: () { + // setState(() {}); + + // print("refresh done 111"); + + // }, + // child: Text( + // 'Saved Profiles', + // style: TextStyle(color: Constants.k2color), + // ), + // style: OutlinedButton.styleFrom( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(12), + // ), // ), // ), - // ), + // ], // ), - // ) + // ), ], ); } @@ -1205,4 +1297,12 @@ class _Contacts1State extends State { return counter; } + + Map findRecordById( + List displayedHCPList, String selectedIndic) { + // print( + // "Gettt11111 ${displayedHCPList.firstWhere((element) => element['id'] == int.parse(selectedIndic))}"); + return displayedHCPList + .firstWhere((element) => element['id'] == int.parse(selectedIndic)); + } } diff --git a/lib/contacts_module/ui_screen/saved_profiles/saved_profile_info.dart b/lib/contacts_module/ui_screen/saved_profiles/saved_profile_info.dart new file mode 100644 index 0000000..f95b7a4 --- /dev/null +++ b/lib/contacts_module/ui_screen/saved_profiles/saved_profile_info.dart @@ -0,0 +1,1257 @@ +// import 'package:discover_module/check.dart'; +// import 'package:discover_module/constants.dart'; +// import 'package:discover_module/custom_widget/text.dart'; +// import 'package:discover_module/storage_hive/note_data/crud_note.dart'; + +// import 'package:discover_module/ui_screen/activity_tab.dart'; + +// import 'package:discover_module/ui_screen/engagementtab.dart'; + +// import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; +// import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; + +// import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; +// import 'package:discover_module/ui_screen/location_tab.dart'; + +// import 'package:discover_module/ui_screen/newformlist.dart'; +// import 'package:discover_module/ui_screen/saved_profiles/saved_activity.dart'; +import 'package:discover_module/contacts_module/constants.dart'; +import 'package:discover_module/contacts_module/custom_widget/text.dart'; +import 'package:discover_module/contacts_module/storage_hive/note_data/crud_note.dart'; +import 'package:discover_module/contacts_module/ui_screen/engagementtab.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/location_tab.dart'; +import 'package:discover_module/contacts_module/ui_screen/newformlist.dart'; +import 'package:discover_module/contacts_module/ui_screen/saved_profiles/saved_activity.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/painting.dart'; +import 'package:flutter/rendering.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_profile_picture/flutter_profile_picture.dart'; +import 'package:provider/provider.dart'; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:url_launcher/url_launcher.dart'; + +class SavedNewProfile1 extends StatefulWidget { + const SavedNewProfile1({Key? key, required this.text}) : super(key: key); + final dynamic text; + + @override + State createState() => SavedNewProfile1State(); +} + +class SavedNewProfile1State extends State + with TickerProviderStateMixin { + //bool isonline = false; + List affiliation_data = []; + List publication_data = []; + List event_data = []; + List trial_data = []; + List medinsightData = []; + List speaker = []; + List eng = []; + + // final PageController _controller = PageController(viewportFraction: 0.8); + + List viewformData = []; + + bool _isExpanded = false; + + var item; + + TextEditingController firstNameController = TextEditingController(); + + final List gradients = [ + const Color.fromARGB(255, 23, 162, 184), + const Color.fromARGB(255, 40, 167, 69), + Color.fromARGB(255, 187, 163, 7), + const Color.fromARGB(255, 220, 53, 69), + const Color.fromARGB(255, 23, 162, 184), + ]; + final ScrollController _scrollController = ScrollController(); + late final TabController _tabController; + + static const _tabs = [ + Tab(text: "Details"), + Tab(text: "Speakers"), + Tab(text: "Speakers"), + ]; + + final TextEditingController _controller = TextEditingController(); + + @override + void initState() { + // TODO: implement initState + super.initState(); + print("pooja123455667 ${widget.text}"); + _tabController = TabController(length: 3, vsync: this); + + //init(); + WidgetsBinding.instance.addPostFrameCallback((timeStamp) {}); + } + + init() async { + await Provider.of(context, listen: false) + .initConfigData(); + final data = + await Provider.of(context, listen: false); + + // if(data.g) + data.getRecords("form-3 demo"); + // setState(() {}); + } + + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + // return Consumer( + // builder: (BuildContext context, provider, Widget? child) { + return DefaultTabController( + length: 3, + child: SafeArea( + child: headerview(context), + ), + ); + // }); + } + + Widget headerview(BuildContext context) { + return SafeArea( + child: Scaffold( + backgroundColor: Constants.bgcolor, + // appBar: AppBar(), + body: Stack( + children: [ + Container( + // color: Colors.blue, + child: Column( + children: [ + getAppBarUI(), + Expanded( + child: NestedScrollView( + controller: _scrollController, + headerSliverBuilder: + (BuildContext context, bool innerBoxIsScrolled) { + return [ + SliverList( + delegate: SliverChildBuilderDelegate( + (BuildContext context, int index) { + return Container( + //color: Constants.blueColor, + child: Column( + children: [ + buildCardView( + context, + ) + + // getTimeDateUI(), + ], + ), + ); + }, childCount: 1), + ), + SliverPersistentHeader( + pinned: true, + floating: true, + delegate: ContestTabHeader( + Container( + //color: Constants.bgcolor2, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.bottomCenter, + end: Alignment.topCenter, + colors: [ + // Constants.blueColor, + Constants.tabbgColor, + Constants.k2color, + // Constants.tabbgColor, + // const Color.fromARGB(255, 222, 237, 247), + // const Color.fromARGB(255, 222, 237, 247), + // Color(0xff006df1) + ]), + ), + child: const TabBar( + indicatorColor: Colors.white, + labelColor: Colors + .white, // Color of the selected tab text + + unselectedLabelColor: + Color.fromARGB(255, 241, 163, 163), + // unselectedLabelColor: + // Color.fromARGB(255, 163, 159, 159), + tabs: [ + // Tab(text: "Sentiment"), + Tab( + // text: "Related " + child: Text( + 'Details', + style: TextStyle( + fontWeight: FontWeight.normal, + fontSize: 15.0), + ), + ), + Tab( + // text: "Activities " + child: Text( + 'Activities', + style: TextStyle( + fontWeight: FontWeight.normal, + fontSize: 15.0), + ), + ), + Tab( + //text: "Engagement " + + child: Text( + 'Engagements', + style: TextStyle( + fontWeight: FontWeight.normal, + fontSize: 15.0), + ), + ), + + // Tab(icon: Icon(Icons.email)), + ], + ), + ), + // const TabBar( + // indicatorSize: TabBarIndicatorSize.label, + // labelColor: Colors.black, + // unselectedLabelColor: Colors.grey, + // tabs: _tabs, + // ), + ), + ) + ]; + }, + body: + + //Text("hiiii") + + TabBarView( + //controller: _tabController, + children: [ + //LocationTab(text: widget.text.id), + LocationTab(text: 1, offline: 1), + SavedActivities(text: widget.text.id), + // SavedActivities(text: widget.text.id), + EngagementTab(text: 1, offline: 1), + + //EngagementTab(text: widget.text.id), + ], + ), + ), + ) + ], + ), + ), + ], + ), + floatingActionButton: Visibility( + visible: true, + child: FloatingActionButton( + onPressed: () async { + // final ConfigDataProvider configDataProvider = + // ConfigDataProvider(); + + // await configDataProvider.initConfigUIData(); + Navigator.push( + context, MaterialPageRoute(builder: (context) => FormList())); + }, + foregroundColor: Colors.white, + backgroundColor: const Color.fromARGB(255, 0, 71, 132), + child: new Icon(Icons.add), + ), + ), + ), + ); + } + + buildCardView(BuildContext context) { + MediaQuery.of(context).size.height * 0.35; + + return Container( + //color: Colors.yellowAccent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + //mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Stack( + clipBehavior: Clip.none, + alignment: Alignment.center, + children: [ + Container( + width: + MediaQuery.of(context).size.width, // Adjust width as needed + height: 110, // Adjust height as needed + decoration: BoxDecoration(color: Constants.k2color), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text1( + title: widget.text!.name, + txtcolor: Colors.white, + fontweight: FontWeight.normal, + txtfont: 20.0), + Text1( + title: widget.text!.speciality, + txtcolor: Colors.white, + fontweight: FontWeight.normal, + txtfont: 14.0), + ], + ), + ), + // Column( + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Text1( + // title: "Dr " + widget.text!["name"], + // txtcolor: Colors.white, + // fontweight: FontWeight.normal, + // txtfont: 22.0), + // Text1( + // title: widget.text!["speciality"], + // txtcolor: Colors.white, + // fontweight: FontWeight.normal, + // txtfont: 15.0), + // ], + // ), + Positioned( + bottom: -45, + child: Container( + child: widget.text.img_path == "" + ? ProfilePicture( + name: widget.text!.name, + radius: 48, + fontsize: 21, + ) + : ClipOval( + child: SizedBox.fromSize( + size: Size.fromRadius(48), + child: CachedNetworkImage( + imageUrl: widget.text!.img_path, + imageBuilder: (context, imageProvider) => + Container( + decoration: BoxDecoration( + image: DecorationImage( + image: imageProvider, + fit: BoxFit.fill, + ), + ), + ), + // placeholder: (context, url) => + // CircularProgressIndicator(), + // errorWidget: (context, url, error) => + // Icon(Icons.error), + ), + ), + ), + + // ClipOval( + // child: SizedBox.fromSize( + // size: Size.fromRadius(48), // Image radius + // child: Image.network(widget.text!["img_path"], + // fit: BoxFit.fill), + // ), + // ), + ), + ) + ], + ), + SizedBox( + height: 55.0, + ), + + _ProfileInfoRow(text: widget.text.id), + + // Profile photo + Column( + children: [ + // Text1( + // title: "Dr " + widget.text!["name"], + // txtcolor: Colors.black, + // fontweight: FontWeight.normal, + // txtfont: 22.0), + // Text1( + // title: widget.text!["speciality"], + // txtcolor: Colors.black, + // fontweight: FontWeight.normal, + // txtfont: 15.0), + SizedBox( + height: 8.0, + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: + Row(mainAxisAlignment: MainAxisAlignment.center, children: [ + const Icon( + Icons.location_city_sharp, + color: Color.fromARGB(255, 0, 71, 132), + ), + const SizedBox( + width: 3.0, + ), + Expanded( + child: Text1( + title: widget.text!.name ?? + "Florida Hospital Medical Group Inc", + txtcolor: Colors.black, + txtfont: 14.0, + fontweight: FontWeight.normal, + ), + // child: RichText( + // text: TextSpan( + // text: widget.text!["addr"] ?? + // "Azienda Ospedaliera di Padova", + // style: TextStyle( + // fontSize: 16.0, color: Colors.black), + // ), + // ), + ), + ]), + ), + const SizedBox( + height: 8.0, + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: InkWell( + onTap: () { + _openMapsByAddress(); + }, + child: Row(children: [ + const Icon( + Icons.location_pin, + color: Color.fromARGB(255, 0, 71, 132), + ), + const SizedBox( + width: 3.0, + ), + Expanded( + // child: Text( + // "Via Giustiniani, 2, Padova, Veneto 35128, Italy", + // style: TextStyle( + // fontWeight: FontWeight.bold, fontSize: 14.0), + // ), + child: Text1( + title: + //widget.text!["Country"] ?? + "Via Giustiniani, 2, Padova, Veneto 35128, Italy", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 14.0), + + // child: RichText( + // text: TextSpan( + // text: widget.text!["adrr"] ?? + // "Via Giustiniani, 2, Padova, Veneto 35128, Italy", + // style: TextStyle( + // fontSize: 16.0, color: Colors.black), + // ), + // ), + ), + ]), + ), + ), + const SizedBox( + height: 8.0, + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: InkWell( + onTap: () async { + print("Emailll"); + String? encodeQueryParameters(Map params) { + return params.entries + .map((MapEntry entry) => + Uri.encodeComponent(entry.key) + + '=' + + Uri.encodeComponent(entry.value)) + .join('&'); + } + + final Uri emailLaunchUri = Uri( + scheme: 'mailto', + path: 'example@example.com', + query: encodeQueryParameters({ + 'subject': 'Example Subject', + 'body': 'Hello, this is a sample body text.', + }), + ); + + if (await launchUrl(emailLaunchUri)) { + launchUrl(emailLaunchUri); + } else { + throw 'Could not launch $emailLaunchUri'; + } + }, + child: Row(children: [ + const Icon( + Icons.email, + color: Color.fromARGB(255, 0, 71, 132), + ), + const SizedBox( + width: 3.0, + ), + Expanded( + child: Text1( + title: widget.text!.email, + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 14.0), + ), + ]), + ), + ), + SizedBox( + height: 8.0, + ), + Padding( + padding: const EdgeInsets.only(left: 8.0), + child: InkWell( + onTap: () async { + final call = Uri.parse('tel:${widget.text!.phone_no}'); + if (await canLaunchUrl(call)) { + launchUrl(call); + } else { + throw 'Could not launch $call'; + } + }, + child: Row(children: [ + const Icon( + Icons.phone, + color: Color.fromARGB(255, 0, 71, 132), + ), + const SizedBox( + width: 3.0, + ), + // Text( + // "+390498212410 X 12", + // style: TextStyle( + // fontWeight: FontWeight.bold, fontSize: 14.0), + // ), + Text1( + title: widget.text!.phone_no, + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 14.0), + ]), + ), + ), + // const SizedBox( + // height: 8.0, + // ), + // Padding( + // padding: const EdgeInsets.only(left: 8.0), + // child: Row(children: [ + // const Icon( + // Icons.call, + // color: Color.fromARGB(255, 0, 71, 132), + // ), + // const SizedBox( + // width: 3.0, + // ), + // Expanded( + // child: Text1( + // title: widget.text!["phone_no"].toString(), + // txtcolor: Colors.black, + // fontweight: FontWeight.normal, + // txtfont: 15.0), + // ), + // ]), + // ), + ], + ), + + const SizedBox( + height: 5.0, + ), + + Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Text1( + title: "Profile Summary", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 18.0), + ), + ), + const SizedBox( + height: 5.0, + ), + Align( + alignment: Alignment.centerLeft, + child: Padding( + padding: const EdgeInsets.only(left: 15.0), + child: Text1( + title: widget.text!.summarry, + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 14.0), + ), + ), + + SizedBox( + height: 10.0, + ), + + ListTileTheme( + dense: true, + child: Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Card( + margin: EdgeInsets.all(1.0), + // elevation: 5, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(0.0), + ), + color: Constants.k2color11, + child: ExpansionTile( + // collapsedBackgroundColor: Color(0xFF2b9af3), + onExpansionChanged: (bool expanded) { + setState(() { + _isExpanded = expanded; + }); + }, + backgroundColor: Constants.k2color11, + trailing: Icon( + _isExpanded + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.black), + title: Row( + mainAxisAlignment: MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.min, + children: [ + Text1( + title: "Notes", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + const SizedBox( + width: 8.0, + ), + Text1( + title: "(0)", + txtcolor: Colors.black, + fontweight: FontWeight.normal, + txtfont: 17.0), + ], + ), + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: TextField( + controller: _controller, + decoration: InputDecoration( + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8.0), + ), + hintText: 'Write your note here', + contentPadding: EdgeInsets.all(16.0), + ), + maxLines: + null, // Allows the TextField to expand vertically + ), + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: OutlinedButton( + onPressed: () async { + await addNote(_controller.text); + + _controller.clear(); + setState(() { + getText(); + }); + }, + child: Text( + 'Save', + style: TextStyle(color: Constants.k2color), + ), + style: OutlinedButton.styleFrom( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + + Padding( + padding: EdgeInsets.all(10.0), + + // child: Text(getText().toString()), + + child: SizedBox( + height: 100, // Set a height for the list + child: ListView.builder( + itemCount: getText().length, // Number of notes + itemBuilder: (context, index) { + final note = + getText()[index]; // Get note at current index + return ListTile( + title: Text(note), // Display the note + ); + }, + ), + ), + // child: ListView.builder( + // itemCount: getText().length, + // itemBuilder: (context, index) { + // final data = getText()[index]; + + // return ListTile( + // title: Text(data), + // ); + // }), + ) + + // ListView.builder( + // itemCount: getText().length, + // itemBuilder: (context, index) { + // final text = getText()[index]; + // return ListTile( + // title: Text(text), + // ); + // }, + // ), + ]), + ), + ), + ), // adds spacing between the text and image + + SizedBox( + height: 10.0, + ), + ], + // ), + ), + ); + } + + Widget listViewTopicCard(String title, String content, bool visible) { + return Visibility( + visible: visible, + child: Card( + child: Container( + padding: EdgeInsets.all(8.0), + width: double.maxFinite, + decoration: BoxDecoration( + // color: Color.fromARGB(179, 248, 238, 238), + // color: Colors.white, + ), + child: Padding( + padding: const EdgeInsets.only(left: 8.0, right: 14.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + ), + ), + Text( + content, + style: TextStyle( + fontSize: 14, + color: Colors.grey[700], + ), + ), + ], + ), + ), + ), + ), + ); + } + + Future getCount(String form, InteractionProvider provider) async { + await provider.getRecords(); + + return provider.savedList.where((element) => element.form == form).length; + } + + buidCard() { + Text("Hiii"); + } + + showDeleteRecordAlertDialog( + BuildContext context, String record, SaveInteraction saveInteraction) { + // set up the buttons + ViewInteractionProvider provider = + Provider.of(context, listen: false); + Widget cancelButton = TextButton( + child: const Text("YES"), + onPressed: () async { + await provider.deleteRecord(saveInteraction).then((value) { + _displaySnackBar("Deleted sucessfully!"); + Navigator.of(context).pop(); + }); + }, + ); + Widget continueButton = TextButton( + child: const Text("NO"), + onPressed: () { + Navigator.of(context).pop(); + }, + ); + + // set up the AlertDialog + AlertDialog alert = AlertDialog( + title: const Text(""), + content: Text("Are you sure you want to delete the record $record ?"), + actions: [ + cancelButton, + continueButton, + ], + ); + + // show the dialog + showDialog( + context: context, + builder: (BuildContext context) { + return alert; + }, + ); + } + + _displaySnackBar(String msg) { + final snackBar = SnackBar( + content: Text( + msg, + style: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), + )); + ScaffoldMessenger.of(context).showSnackBar(snackBar); + //scaffoldKeyLogin.currentState!.showSnackBar(snackBar); + } + + Widget makeDismissible({required DraggableScrollableSheet child}) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () => Navigator.of(context).pop(), + child: GestureDetector( + onTap: () {}, + child: child, + ), + ); + } + + void bottomshet(affiliation_data) { + // print("Aff_index_data: ${affiliation_data}"); + showModalBottomSheet( + // isScrollControlled: + // true, + + context: context, + + useRootNavigator: true, + isScrollControlled: false, + enableDrag: true, + useSafeArea: true, + constraints: const BoxConstraints( + maxWidth: double.infinity, + ), + + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical( + top: Radius.circular(0), + ), + ), + clipBehavior: Clip.antiAliasWithSaveLayer, + // sheetAnimationStyle: _animationStyle, + builder: (BuildContext context) { + return + // makeDismissible( + // child: + DraggableScrollableSheet( + expand: false, + builder: (BuildContext context, ScrollController scrollController) { + return Container( + width: MediaQuery.of(context).size.width, + //color: Colors.white, + color: Color.fromARGB(255, 246, 248, 252), + + // decoration: + // BoxDecoration(borderRadius: BorderRadius.circular(10)), + // child: ListView( + // children: [ + + // ], + // ), + + child: Column( + children: [ + Expanded( + child: ListView.builder( + controller: scrollController, + itemCount: 1, + itemBuilder: (BuildContext context, int index) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // Row( + // children: [ + // Text( + // "Affiliation", + // style: TextStyle(fontSize: 20.0), + // ) + // ], + // ), + SizedBox( + height: 18.0, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.all(18.0), + child: Text( + affiliation_data['org_name'], + softWrap: true, + maxLines: 4, + style: TextStyle( + fontSize: 18.0, + color: Colors.grey[700]), + ), + ), + ), + ], + ), + SizedBox( + height: 18.0, + ), + Divider(), + SizedBox( + height: 8.0, + ), + + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(left: 18.0), + child: Text( + "Department", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['dept'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Role", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['role'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Time Frame".toString(), + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['time_frame'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Oraganization Type", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['org_type'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only( + left: 18.0, top: 18.0), + child: Text( + "Eng Type", + style: TextStyle(fontSize: 13.0), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 18.0), + child: Text( + affiliation_data['emg_type'], + style: TextStyle( + fontSize: 14.0, + color: Colors.grey[700]), + ), + ) + ], + ), + ], + ); + }, + ), + ), + ], + ), + ); + }, + ); + //); + }, + ); + } + + Widget _buildPaginationDots() { + return Container( + padding: EdgeInsets.symmetric(vertical: 8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: List.generate(10, (index) { + return Container( + margin: EdgeInsets.symmetric(horizontal: 4.0), + width: 8.0, + height: 8.0, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: 1 == index ? Colors.blue : Colors.grey, + ), + ); + }), + ), + ); + } + + Widget getAppBarUI() { + return Container( + decoration: BoxDecoration( + color: Constants.k2color, + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.2), + offset: const Offset(0, 2), + blurRadius: 8.0), + ], + ), + child: Padding( + padding: EdgeInsets.only(top: 2, left: 8, right: 8), + child: Row( + children: [ + Container( + alignment: Alignment.topLeft, + // width: AppBar().preferredSize.height, + // height: AppBar().preferredSize.height, + child: Material( + color: Colors.transparent, + child: InkWell( + borderRadius: const BorderRadius.all( + Radius.circular(32.0), + ), + onTap: () { + Navigator.pop(context); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + Icon( + Icons.arrow_back_ios_new, + size: 18, + color: Colors.white, + ), + SizedBox( + width: 8, + ), + Text( + "Contacts", + style: TextStyle(fontSize: 14.0, color: Colors.white), + ) + ], + ), + ), + ), + ), + ), + Expanded( + child: Text( + "", + maxLines: 1, + softWrap: true, + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 14, + overflow: TextOverflow.ellipsis, + ), + ), + ), + ], + ), + ), + ); + } + + Future _openMapsByAddress() async { + final address = 'Italy'; + final Uri mapsUri = Uri( + scheme: 'https', + host: 'www.google.com', + path: 'maps/search/', + query: address, + ); + + if (!await launchUrl(mapsUri)) { + throw 'Could not launch $mapsUri'; + } + } +} + +class _ProfileInfoRow extends StatelessWidget { +// _ProfileInfoRow({Key? key}) : super(key: key); + final int text; + + _ProfileInfoRow({required this.text, Key? key}) : super(key: key); + + final List _items = const [ + ProfileInfoItem("Publication(s)", 688), + ProfileInfoItem("Event(s)", 111), + ProfileInfoItem("Trial(s)", 10), + ]; + + @override + Widget build(BuildContext context) { + return Container( + height: 80, + constraints: const BoxConstraints(maxWidth: 400), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: _items + .map((item) => Expanded( + child: Row( + children: [ + if (_items.indexOf(item) != 0) const VerticalDivider(), + Expanded(child: _singleItem(context, item)), + ], + ))) + .toList(), + ), + ); + } + + Widget _singleItem(BuildContext context, item) => Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + item.value.toString(), + style: const TextStyle( + fontWeight: FontWeight.bold, + fontSize: 14, + ), + ), + ), + Text( + item.title, + // style: const TextStyle( + // fontWeight: FontWeight.normal, + // fontSize: 18, + // ), + // style: Theme.of(context).textTheme.caption, + ) + ], + ); +} + +class ProfileInfoItem { + final String title; + final int value; + const ProfileInfoItem(this.title, this.value); +} + +class ContestTabHeader extends SliverPersistentHeaderDelegate { + ContestTabHeader( + this.searchUI, + ); + final Widget searchUI; + + @override + Widget build( + BuildContext context, double shrinkOffset, bool overlapsContent) { + return Container(color: Colors.white, child: searchUI); + } + + @override + double get maxExtent => 52.0; + + @override + double get minExtent => 52.0; + + @override + bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) { + return true; + } +} diff --git a/lib/ui_screen/training_showmore.dart b/lib/contacts_module/ui_screen/training_showmore.dart similarity index 95% rename from lib/ui_screen/training_showmore.dart rename to lib/contacts_module/ui_screen/training_showmore.dart index 36d8b17..04cb628 100644 --- a/lib/ui_screen/training_showmore.dart +++ b/lib/contacts_module/ui_screen/training_showmore.dart @@ -1,5 +1,5 @@ -import 'package:discover_module/provider_class/training_provider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/provider_class/training_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/trends.dart b/lib/contacts_module/ui_screen/trends.dart similarity index 96% rename from lib/ui_screen/trends.dart rename to lib/contacts_module/ui_screen/trends.dart index 426754d..58a500b 100644 --- a/lib/ui_screen/trends.dart +++ b/lib/contacts_module/ui_screen/trends.dart @@ -1,8 +1,6 @@ -import 'package:discover_module/custom_widget/floating_btn.dart'; -import 'package:discover_module/custom_widget/show_alert.dart'; -import 'package:discover_module/hive_fun.dart'; -import 'package:discover_module/ui_screen/ranking.dart'; - +import 'package:discover_module/contacts_module/custom_widget/floating_btn.dart'; +import 'package:discover_module/contacts_module/custom_widget/show_alert.dart'; +import 'package:discover_module/contacts_module/hive_fun.dart'; import 'package:flutter/material.dart'; class Trends extends StatefulWidget { diff --git a/lib/ui_screen/trials_show_more.dart b/lib/contacts_module/ui_screen/trials_show_more.dart similarity index 92% rename from lib/ui_screen/trials_show_more.dart rename to lib/contacts_module/ui_screen/trials_show_more.dart index f8a4cfb..3c7a4f6 100644 --- a/lib/ui_screen/trials_show_more.dart +++ b/lib/contacts_module/ui_screen/trials_show_more.dart @@ -1,5 +1,7 @@ -import 'package:discover_module/provider_class/trials_provider.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; +// import 'package:discover_module/provider_class/trials_provider.dart'; +// import 'package:discover_module/ui_screen/bottom_sheet.dart'; +import 'package:discover_module/contacts_module/provider_class/trials_provider.dart'; +import 'package:discover_module/contacts_module/ui_screen/bottom_sheet.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/ui_screen/view_insight.dart b/lib/contacts_module/ui_screen/view_insight.dart similarity index 96% rename from lib/ui_screen/view_insight.dart rename to lib/contacts_module/ui_screen/view_insight.dart index 793e606..0af7b76 100644 --- a/lib/ui_screen/view_insight.dart +++ b/lib/contacts_module/ui_screen/view_insight.dart @@ -1,4 +1,5 @@ -import 'package:discover_module/constants.dart'; +// import 'package:discover_module/constants.dart'; +import 'package:discover_module/contacts_module/constants.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/main.dart b/lib/main.dart index c03a60e..da3b8be 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,36 +1,58 @@ -import 'package:discover_module/check.dart'; -import 'package:discover_module/provider_class/affiliationsprovider.dart'; -import 'package:discover_module/provider_class/award_provider.dart'; -import 'package:discover_module/provider_class/certificate_provider.dart'; -import 'package:discover_module/provider_class/educationprovider.dart'; -import 'package:discover_module/provider_class/email_provider.dart'; -import 'package:discover_module/provider_class/engagement_provider.dart'; -import 'package:discover_module/provider_class/events_provider.dart'; -import 'package:discover_module/provider_class/hcp%20_provider.dart'; -import 'package:discover_module/provider_class/location_provider.dart'; -import 'package:discover_module/provider_class/medicalinsightprovider.dart'; -import 'package:discover_module/provider_class/nih_provider.dart'; -import 'package:discover_module/provider_class/patent_provider.dart'; -import 'package:discover_module/provider_class/phoneno_provider.dart'; -import 'package:discover_module/provider_class/procedureprovider.dart'; -import 'package:discover_module/provider_class/publications_provider.dart'; -import 'package:discover_module/provider_class/single_hcpprovider.dart'; -import 'package:discover_module/provider_class/speaker_provider.dart'; -import 'package:discover_module/provider_class/training_provider.dart'; -import 'package:discover_module/provider_class/trials_provider.dart'; -import 'package:discover_module/ui_screen/contacts.dart'; -import 'package:discover_module/ui_screen/discover.dart'; -import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/json_form_data.dart'; -import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -import 'package:discover_module/ui_screen/interactionform/repository/hive_repository.dart'; -import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; -import 'package:discover_module/ui_screen/listview.dart'; -import 'package:discover_module/ui_screen/filters_menu.dart'; -import 'package:discover_module/ui_screen/medical_insight.dart'; -import 'package:discover_module/ui_screen/new_contacts.dart'; +import 'package:discover_module/contacts_module/provider_class/affiliationsprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/award_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/certificate_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/educationprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/email_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/engagement_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/events_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/hcp%20_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_aff_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_awards_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_certificate_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_education_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_email_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_event_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_list_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_locationprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_pno_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/k2_provider/kol_training_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/location_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/medicalinsightprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/nih_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/patent_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/phoneno_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/procedureprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/publications_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/single_hcpprovider.dart'; +import 'package:discover_module/contacts_module/provider_class/speaker_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/training_provider.dart'; +import 'package:discover_module/contacts_module/provider_class/trials_provider.dart'; +import 'package:discover_module/contacts_module/storage_hive/aff_data/aff_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/awa_data/awa_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/cer_hive/cer_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/edu_data/edu_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/email_data/email_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/events_data/event_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/kol_info/kol_info_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/loc_data/location_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/nih_grant_data/nih_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/patent_data/patent_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/pno_data/pno_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/procedure_data/pro_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/pub_data/pub_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/speaker_data/speaker_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/traning_data/traning_model_hive.dart'; +import 'package:discover_module/contacts_module/storage_hive/trials_data/trial_model_hive.dart'; +import 'package:discover_module/contacts_module/ui_screen/filters_menu.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/interactionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_config_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/interaction_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/json_form_data.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/model/save_interaction.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/repository/hive_repository.dart'; +import 'package:discover_module/contacts_module/ui_screen/interactionform/viewinteractionprovider.dart'; +import 'package:discover_module/contacts_module/ui_screen/new_contacts.dart'; + import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -39,14 +61,7 @@ import 'package:provider/provider.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); - // SystemChrome.setPreferredOrientations([ - // DeviceOrientation.portraitUp, - // ]); - // WidgetsFlutterBinding.ensureInitialized(); - // SystemChrome.setPreferredOrientations([ - // DeviceOrientation.landscapeLeft, - // ]); await Hive.initFlutter(); Hive.registerAdapter(SaveInteractionAdapter()); @@ -75,6 +90,27 @@ Future main() async { await Hive.openBox('hcpdata'); + await Hive.openBox('notehive'); + + Hive.registerAdapter(AffiliationAdapter()); + // await Hive.openBox('affiliationshive'); + + Hive.registerAdapter(KolInfoAdapter()); + Hive.registerAdapter(PublicationAdapter()); + Hive.registerAdapter(EventsAdapter()); + Hive.registerAdapter(TrialsAdapter()); + Hive.registerAdapter(LocationAdapter()); + Hive.registerAdapter(PhoneNoAdapter()); + Hive.registerAdapter(EmailAdapter()); + Hive.registerAdapter(EduAdapter()); + Hive.registerAdapter(AwaAdapter()); + Hive.registerAdapter(CerAdapter()); + Hive.registerAdapter(PatentAdapter()); + Hive.registerAdapter(NihAdapter()); + Hive.registerAdapter(ProAdapter()); + Hive.registerAdapter(Training1Adapter()); + Hive.registerAdapter(SpeAdapter()); + runApp(MultiProvider( providers: [ ChangeNotifierProvider(create: (_) => InteractionProvider()), @@ -99,6 +135,19 @@ Future main() async { ChangeNotifierProvider(create: (_) => NIHGrantsProvider()), ChangeNotifierProvider(create: (_) => ProcedureProvider()), + //K2 Provider + + ChangeNotifierProvider(create: (_) => KolListProvider()), + ChangeNotifierProvider(create: (_) => LocationKolProvider()), + ChangeNotifierProvider(create: (_) => PhonenoProviderK2()), + ChangeNotifierProvider(create: (_) => EmailProviderK2()), + ChangeNotifierProvider(create: (_) => EducationProviderK2()), + ChangeNotifierProvider(create: (_) => TrainigProviderK2()), + ChangeNotifierProvider(create: (_) => AwardProviderK2()), + ChangeNotifierProvider(create: (_) => CertificateProviderK2()), + ChangeNotifierProvider(create: (_) => AffiliationsProviderk2()), + ChangeNotifierProvider(create: (_) => EventProviderK2()), + //ChangeNotifierProvider(create: (_) => ConfigDataProvider()), ChangeNotifierProvider( create: (_) => HiveDataRepository( @@ -142,7 +191,9 @@ class _MyAppState extends State { foregroundColor: Colors.white, //here you can give the text color ), ), + // home: Contactsk2(), home: Contacts1(), + // home: const MyHomePage(title: 'Discover Module'), // home: const MedicalInsight(), ); @@ -223,9 +274,9 @@ class _MyHomePageState extends State { child: Filters(), ), - body: TabBarView( + body: const TabBarView( children: [ - Center(child: const Contacts1()), + Center(child: Contacts1()), // Center(child: Discover(outerTabValue)), // Center(child: DataTableDemo()), ], @@ -236,187 +287,3 @@ class _MyHomePageState extends State { ); } } - - -// import 'package:flutter/material.dart'; - -// void main() { -// runApp(MyApp()); -// } - -// class MyApp extends StatelessWidget { -// @override -// Widget build(BuildContext context) { -// return MaterialApp( -// home: Scaffold( -// appBar: AppBar(title: Text('GridView Example')), -// body: Padding( -// padding: EdgeInsets.all(8.0), -// child: GridView.count( -// crossAxisCount: 2, -// crossAxisSpacing: 8.0, -// mainAxisSpacing: 8.0, -// shrinkWrap: true, // Make GridView as small as possible -// children: List.generate(10, (index) { -// return SizedBox( -// // height: 200, // Fixed height for each card -// child: Card( -// child: Center( -// child: Column( -// mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// Text('Item $index'), -// Text('Item $index'), -// Text('Item $index'), -// Text('Item $index'), -// Text('Item $index'), -// Text('Item $index'), -// Text('Item $index'), -// ], -// ), -// ), -// ), -// ); -// }), -// ), -// ), -// ), -// ); -// } -// } - - - - - - - - -// import 'package:flutter/material.dart'; - -// void main() { -// runApp(MyApp()); -// } - -// class MyApp extends StatelessWidget { -// @override -// Widget build(BuildContext context) { -// return MaterialApp( -// title: 'Dynamic App Bar', -// theme: ThemeData( -// primarySwatch: Colors.blue, -// ), -// home: DynamicAppBar(), -// ); -// } -// } - -// class DynamicAppBar extends StatefulWidget { -// @override -// _DynamicAppBarState createState() => _DynamicAppBarState(); -// } - -// class _DynamicAppBarState extends State { -// final ScrollController _scrollController = ScrollController(); -// double _listHeight = 0.0; // Variable to store list height - -// @override -// void initState() { -// super.initState(); - -// _scrollController.addListener(() { -// // Check if the list has changed and update the height if necessary -// if (_scrollController.hasClients) { -// // Trigger rebuild to recalculate height -// WidgetsBinding.instance?.addPostFrameCallback((_) { -// final double newHeight = _scrollController.position.maxScrollExtent; -// if (newHeight != _listHeight) { -// setState(() { -// _listHeight = newHeight; -// }); -// } -// }); -// } -// }); -// } - -// @override -// Widget build(BuildContext context) { -// final double appBarHeight = 250.0; // Default height for the app bar -// final double adjustedHeight = _listHeight > 500.0 -// ? appBarHeight -// : appBarHeight - 50.0; // Adjust height based on list size - -// return Scaffold( -// body: CustomScrollView( -// controller: _scrollController, -// slivers: [ -// SliverAppBar( -// expandedHeight: adjustedHeight, -// flexibleSpace: FlexibleSpaceBar( -// centerTitle: true, -// collapseMode: CollapseMode.parallax, -// title: Text( -// 'Dynamic App Bar', -// style: TextStyle( -// color: Colors.white, -// fontSize: -// MediaQuery.of(context).size.width < 600 ? 16.0 : 22.0, -// ), -// ), -// background: ColoredBox( -// color: const Color.fromARGB(255, 246, 248, 252), -// child: Column( -// mainAxisAlignment: MainAxisAlignment.center, -// children: [ -// Padding( -// padding: EdgeInsets.all(8.0), -// child: Icon( -// Icons.person, -// size: MediaQuery.of(context).size.width < 600 ? 48 : 72, -// color: Colors.grey, -// ), -// ), -// Text( -// 'Dr. John Doe', -// style: TextStyle( -// fontSize: MediaQuery.of(context).size.width < 600 -// ? 20.0 -// : 28.0, -// fontWeight: FontWeight.bold, -// color: Colors.black, -// ), -// ), -// SizedBox(height: 8.0), -// Text( -// 'Specialist', -// style: TextStyle( -// fontSize: MediaQuery.of(context).size.width < 600 -// ? 14.0 -// : 18.0, -// color: Colors.black, -// ), -// ), -// ], -// ), -// ), -// ), -// floating: false, -// pinned: true, -// snap: false, -// ), -// SliverList( -// delegate: SliverChildBuilderDelegate( -// (BuildContext context, int index) { -// return ListTile( -// title: Text('Item #$index'), -// ); -// }, -// //childCount: 50, // Number of items in the list -// ), -// ), -// ], -// ), -// ); -// } -// } diff --git a/lib/provider_class/speaker_provider.dart b/lib/provider_class/speaker_provider.dart deleted file mode 100644 index b9ae7a8..0000000 --- a/lib/provider_class/speaker_provider.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:discover_module/service.dart/service.dart'; -import 'package:flutter/cupertino.dart'; - -class SpekerEvalutionProvider extends ChangeNotifier { - final callapi = Callapi(); - - List speaker_data = []; - - List get speaker => speaker_data; - - getspeakerdata() async { - final data = await callapi.getSpeakerdata(); - - speaker_data = data; - notifyListeners(); - } -} diff --git a/lib/service.dart/service.dart b/lib/service.dart/service.dart deleted file mode 100644 index cb5be7c..0000000 --- a/lib/service.dart/service.dart +++ /dev/null @@ -1,450 +0,0 @@ -import 'dart:convert'; - -import 'package:dio/dio.dart'; -import 'package:discover_module/constants.dart'; -import 'package:discover_module/hive_fun.dart'; -import 'package:flutter/services.dart'; -import 'package:hive_flutter/hive_flutter.dart'; - -const String curl = Constants.url; - -class Callapi { - getallhcpdata() async { - const url = '$curl/users'; - - // final response = await Dio().get(url); - - // 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 Json = json.decode(responsehcp.data); - - print("Singlejsondata : ${jsonresponse1}"); - return jsonresponse1; - } - - getaffiliationsdata(id) async { - print("Affiliation_iddd: ${id}"); - // const url = '$curl/affiliations'; - - // final affiliationres = await Dio().get(url); - // final jsonresponse2 = affiliationres.data.take(2).toList(); - - // return jsonresponse2; - // final String response = await rootBundle.loadString('assets/section.json'); - // final String response = await rootBundle.loadString('assets/section.json'); - final String response = await Constants.response; - - final Affiliation = await json.decode(response); -///////////////////////////////////////////////////// - final List> filteredData = Affiliation['Affiliations'] - .where((item) => item['user_id'] == id) - .cast>() - .toList(); - print("filteredDatafilteredDatafilteredData: ${filteredData}"); - - // Print filtered data - - final List affiliations = Affiliation['Affiliations']; - - print("Data_isss: $affiliations"); - return filteredData; - } - - 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; - - final String response = await Constants.response; - - final Publications = await json.decode(response); - final List publication = Publications['Publications']; - - ///////////////////////////////////////////////////// - final List> filteredData = Publications['Publications'] - .where((item) => item['user_id'] == id) - .cast>() - .toList(); - print("filteredDatafilteredDatafilteredData111: ${filteredData}"); - - // Print filtered data - - print("publicationData_isss: $publication"); - return filteredData; - } - - geteventsdata(id) async { - // const url = '$curl/events'; - - // 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 String response = await Constants.response; - - final Events = await json.decode(response); - final List event = Events['Events']; - - ///////////////////////////////////////////////////// - final List> filteredData = Events['Events'] - .where((item) => item['user_id'] == id) - .cast>() - .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; - - final String response = await Constants.response; - - final Trials = await json.decode(response); - final List trials = Trials['Trials']; - ///////////////////////////////////////////////////// - final List> filteredData = Trials['Trials'] - .where((item) => item['user_id'] == id) - .cast>() - .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 speaker = Speaker['Speaker']; - - print("speakerData_isss: $speaker"); - return speaker; - } - - 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 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 event = Location['Location']; - - ///////////////////////////////////////////////////// - final List> filteredData = Location['Location'] - .where((item) => item['user_id'] == id) - .cast>() - .toList(); - print("LocationfilteredDatafilteredData111: ${filteredData}"); - - // Print filtered data - print("LocationeventData_isss: $event"); - return filteredData; - } - - getphonedata(id) async { - final String response = await Constants.response; - - final PhoneNo = await json.decode(response); - final List event = PhoneNo['Location']; - - ///////////////////////////////////////////////////// - final List> filteredData = PhoneNo['PhoneNo'] - .where((item) => item['user_id'] == id) - .cast>() - .toList(); - print("PhoneNofilteredDatafilteredData111: ${filteredData}"); - - // Print filtered data - print("PhoneNoeventData_isss: $event"); - return filteredData; - } - - getemaildata(id) async { - final String response = await Constants.response; - - final Email = await json.decode(response); - final List event = Email['Email']; - - ///////////////////////////////////////////////////// - final List> filteredData = Email['Email'] - .where((item) => item['user_id'] == id) - .cast>() - .toList(); - print("EmaililteredDatafilteredData111: ${filteredData}"); - - // Print filtered data - print("EmaileventData_isss: $event"); - return filteredData; - } - - getpatentdata(id) async { - final String response = await Constants.response; - - final Patent = await json.decode(response); - final List event = Patent['Patent']; - - ///////////////////////////////////////////////////// - final List> filteredData = Patent['Patent'] - .where((item) => item['user_id'] == id) - .cast>() - .toList(); - print("PatenteredDatafilteredData111: ${filteredData}"); - - // Print filtered data - print("PatenttData_isss: $event"); - return filteredData; - } - - getcerlistdata(id) async { - final String response = await Constants.response; - - final Certificate = await json.decode(response); - final List event = Certificate['Certificate']; - - ///////////////////////////////////////////////////// - final List> filteredData = Certificate['Certificate'] - .where((item) => item['user_id'] == id) - .cast>() - .toList(); - print("PatenteredDatafilteredData111: ${filteredData}"); - - // Print filtered data - print("PatenttData_isss: $event"); - return filteredData; - } - - getedulistdata(id) async { - final String response = await Constants.response; - - final Education = await json.decode(response); - final List event = Education['Education']; - - ///////////////////////////////////////////////////// - final List> filteredData = Education['Education'] - .where((item) => item['user_id'] == id) - .cast>() - .toList(); - print("PatenteredDatafilteredData111: ${filteredData}"); - - // Print filtered data - print("PatenttData_isss: $event"); - return filteredData; - } - - getawarddata(id) async { - final String response = await Constants.response; - - final Awards = await json.decode(response); - final List event = Awards['Awards']; - - ///////////////////////////////////////////////////// - final List> filteredData = Awards['Awards'] - .where((item) => item['user_id'] == id) - .cast>() - .toList(); - print("PatenteredDatafilteredData111: ${filteredData}"); - - // Print filtered data - print("PatenttData_isss: $event"); - return filteredData; - } - - gettrainingdata(id) async { - final String response = await Constants.response; - - final Training = await json.decode(response); - final List event = Training['Training']; - - ///////////////////////////////////////////////////// - final List> filteredData = Training['Training'] - .where((item) => item['user_id'] == id) - .cast>() - .toList(); - print("PatenteredDatafilteredData111: ${filteredData}"); - - // Print filtered data - print("PatenttData_isss: $event"); - return filteredData; - } - - getnihdata(id) async { - final String response = await Constants.response; - - final Nih = await json.decode(response); - final List event = Nih['NIHGrants']; - - ///////////////////////////////////////////////////// - final List> filteredData = Nih['NIHGrants'] - .where((item) => item['user_id'] == id) - .cast>() - .toList(); - print("PatenteredDatafilteredData111: ${filteredData}"); - - // Print filtered data - print("PatenttData_isss: $event"); - return filteredData; - } - - getprodata(id) async { - final String response = await Constants.response; - - final Pro = await json.decode(response); - final List event = Pro['Procedure']; - - ///////////////////////////////////////////////////// - final List> filteredData = Pro['Procedure'] - .where((item) => item['user_id'] == id) - .cast>() - .toList(); - print("PatenteredDatafilteredData111: ${filteredData}"); - - // Print filtered data - print("PatenttData_isss: $event"); - return filteredData; - } -} diff --git a/lib/ui_screen/medical_insight.dart b/lib/ui_screen/medical_insight.dart deleted file mode 100644 index 594f93e..0000000 --- a/lib/ui_screen/medical_insight.dart +++ /dev/null @@ -1,968 +0,0 @@ -// import 'package:discover_module/constants.dart'; -// import 'package:discover_module/provider_class/medicalinsightprovider.dart'; -// import 'package:discover_module/ui_screen/view_insight.dart'; -// import 'package:flutter/cupertino.dart'; -// import 'package:flutter/material.dart'; -// import 'package:flutter/widgets.dart'; -// import 'package:provider/provider.dart'; - -// class MedicalInsight extends StatefulWidget { -// const MedicalInsight({super.key}); - -// @override -// State createState() => _MedicalInsightState(); -// } - -// class _MedicalInsightState extends State { -// final List> cardData = [ -// {'id': 'ID ', 'number': 'MI1688128025', 'id1': "jjj", 'number1': '265'}, -// {'id': 'ID ', 'number': 20}, -// {'id': 'ID ', 'number': 30}, -// // Add more data entries as needed -// ]; - -// String selectedOption = 'None'; -// late GlobalKey actionKey; - -// var item; - -// @override -// void initState() { -// actionKey = GlobalKey(); -// super.initState(); -// getapicall(); -// } - -// void getapicall() async { -// await Provider.of(context, listen: false) -// .medicalinsightdata(); -// } - -// // GlobalKey actionKey; -// // final List> data = [ -// // {'id': 'Data ID 1', 'number': 10}, -// // {'id': 'Data ID 2', 'number': 20}, -// // {'id': 'Data ID 3', 'number': 30}, -// // // Add more data entries as needed -// // ]; -// @override -// Widget build(BuildContext context) { -// return Directionality( -// textDirection: TextDirection.ltr, -// child: SafeArea( -// child: Scaffold( -// backgroundColor: const Color.fromARGB(255, 222, 237, 247), -// appBar: AppBar( -// title: const Text('Medical Insight'), -// ), -// body: Consumer( -// builder: (context, value, child) { -// return Column( -// children: [ -// Padding( -// padding: const EdgeInsets.all(15.0), -// child: TextField( -// //controller: _searchController, -// onChanged: (value) { -// setState(() {}); -// }, -// decoration: InputDecoration( -// fillColor: Constants.k2color, -// contentPadding: const EdgeInsets.symmetric(vertical: 9.0), -// border: const OutlineInputBorder( -// borderRadius: BorderRadius.only( -// bottomRight: Radius.circular(0))), -// labelText: ' Search', -// prefixIcon: const Icon( -// Icons.search, -// ), -// ), -// ), -// ), -// Row( -// mainAxisAlignment: MainAxisAlignment.end, -// children: [ -// OutlinedButton( -// style: OutlinedButton.styleFrom( -// backgroundColor: Constants.k2color, -// foregroundColor: Colors.white), -// onPressed: () {}, -// child: Text("Create Medical Insight")) -// ], -// ), -// Expanded( -// child: ListView.builder( -// physics: const ScrollPhysics(), -// // scrollDirection: Axis.vertical, -// shrinkWrap: true, -// itemCount: value.med.length, -// itemBuilder: (context, index) { -// item = value.med[index]; - -// print( -// "Item_Medical_insight ${item['Therapeutic Area']}"); -// return GestureDetector( -// onTap: () { -// _showAlertDialog(context); -// }, -// child: Padding( -// padding: const EdgeInsets.all(8.0), -// child: Card( -// surfaceTintColor: Colors.white, -// // shape: RoundedRectangleBorder( -// // side: BorderSide(color: Colors.black, width: 1), -// // borderRadius: BorderRadius.only( -// // bottomRight: Radius.circular(30)), -// // ), -// child: SizedBox( -// width: MediaQuery.sizeOf(context).width, -// child: ListTile( -// title: Column( -// // crossAxisAlignment: CrossAxisAlignment.center, -// children: [ -// Align( -// alignment: Alignment.centerLeft, -// child: Text( -// "ID", -// style: TextStyle( -// fontSize: 16, -// fontWeight: FontWeight.bold), -// ), -// ), -// Align( -// alignment: Alignment.centerLeft, -// child: Text( -// item['id'].toString(), -// textAlign: TextAlign.left, -// style: const TextStyle(fontSize: 16), -// ), -// ), -// // Row( -// // mainAxisAlignment: -// // MainAxisAlignment.spaceBetween, -// // children: [ -// // Text( -// // "Interaction Id", -// // style: TextStyle( -// // fontSize: 16, -// // fontWeight: FontWeight.bold), -// // ), -// // Text( -// // "pokn".toString(), -// // style: TextStyle(fontSize: 16), -// // ), -// // ], -// // ), - -// Row( -// mainAxisAlignment: -// MainAxisAlignment.spaceBetween, -// children: [ -// const Expanded( -// flex: 1, -// child: Align( -// alignment: Alignment.centerLeft, -// child: Text( -// "Therapeutic Area", -// style: TextStyle( -// fontSize: 16, -// fontWeight: -// FontWeight.bold), -// ), -// ), -// ), -// Expanded( -// flex: 1, -// child: Align( -// alignment: Alignment.centerLeft, -// child: Text( -// item['Therapeutic Area'] -// .toString(), -// style: const TextStyle( -// fontSize: 16), -// ), -// ), -// ) -// ], -// ), -// Row( -// mainAxisAlignment: -// MainAxisAlignment.spaceBetween, -// children: [ -// const Expanded( -// flex: 1, -// child: Align( -// alignment: Alignment.centerLeft, -// child: Text( -// "Product", -// style: TextStyle( -// fontSize: 16, -// fontWeight: -// FontWeight.bold), -// ), -// ), -// ), -// Expanded( -// flex: 1, -// child: Align( -// alignment: Alignment.centerLeft, -// child: Text( -// item['Product'].toString(), -// style: const TextStyle( -// fontSize: 16), -// ), -// ), -// ), -// ], -// ), -// Row( -// mainAxisAlignment: -// MainAxisAlignment.spaceBetween, -// children: [ -// const Expanded( -// flex: 1, -// child: Align( -// alignment: Alignment.centerLeft, -// child: Text( -// "Source Type", -// style: TextStyle( -// fontSize: 16, -// fontWeight: -// FontWeight.bold), -// ), -// )), -// Expanded( -// flex: 1, -// child: Align( -// alignment: Alignment.centerLeft, -// child: Text( -// item['Source Type'].toString(), -// style: const TextStyle( -// fontSize: 16), -// ), -// ), -// ) -// ], -// ), -// Row( -// mainAxisAlignment: -// MainAxisAlignment.spaceBetween, -// children: [ -// const Expanded( -// flex: 1, -// child: Align( -// alignment: Alignment.centerLeft, -// child: Text( -// "Topics", -// style: TextStyle( -// fontSize: 16, -// fontWeight: -// FontWeight.bold), -// ), -// ), -// ), -// Expanded( -// flex: 1, -// child: Align( -// alignment: Alignment.centerLeft, -// child: Text( -// item['Topics'].toString(), -// style: const TextStyle( -// fontSize: 16), -// ), -// ), -// ) -// ], -// ), -// Row( -// children: [ -// Expanded( -// flex: 1, -// child: Column( -// children: [ -// Row( -// children: [ -// Icon( -// Icons.person, -// size: 20, -// ), -// Text( -// "pooja", -// style: TextStyle( -// fontSize: 14.0), -// ) -// ], -// ), -// Row( -// children: [ -// Icon( -// Icons.calendar_today, -// size: 20, -// ), -// Text( -// "11/11/2022 ", -// style: TextStyle( -// fontSize: 14.0), -// ) -// ], -// ) -// ], -// ), -// ), -// Expanded( -// flex: 1, -// child: Align( -// alignment: -// Alignment.centerRight, -// child: OutlinedButton( -// style: -// OutlinedButton.styleFrom( -// shape: -// CircleBorder()), -// onPressed: () { -// // final RenderBox renderBox = -// // actionKey.currentContext! -// // .findRenderObject(); -// // final position = renderBox -// // .localToGlobal(Offset.zero); -// final RenderBox renderBox = -// actionKey -// .currentContext! -// .findRenderObject() -// as RenderBox; -// final position = -// renderBox.localToGlobal( -// Offset.zero); - -// showMenu( -// context: context, -// position: -// RelativeRect.fromLTRB( -// position.dx, -// position.dy + -// renderBox -// .size.height, -// position.dx + -// renderBox -// .size.width, -// position.dy + -// renderBox -// .size.height + -// 10, -// ), -// items: >[ -// PopupMenuItem( -// value: 'Option 1', -// child: -// Text('Option 1'), -// ), -// PopupMenuItem( -// value: 'Option 2', -// child: -// Text('Option 2'), -// ), -// PopupMenuItem( -// value: 'Option 3', -// child: -// Text('Option 3'), -// ), -// ], -// ).then((value) { -// if (value != null) { -// setState(() { -// selectedOption = -// value; -// }); -// } -// }); -// }, -// child: Icon( -// Icons.more_horiz_rounded, -// // color: Constants.k2color, -// ), -// )), -// ) -// ], -// ), -// ], -// ), -// ), -// ), -// // shape: BorderRadius.only(bottomRight: Radius.circular(50)), -// ), -// ), -// ); -// }), -// ) -// ], -// ); -// }), -// ), -// ), -// ); -// } - -// void _showAlertDialog(BuildContext context) { -// showDialog( -// context: context, -// builder: (BuildContext context) { -// return AlertDialog( -// // title: Text('Alert'), -// content: const MyWidget22(), -// actions: [ -// TextButton( -// child: const Text('Close'), -// onPressed: () { -// Navigator.of(context).pop(); -// }, -// ), -// ], -// ); -// }, -// ); -// } -// } - -import 'package:discover_module/constants.dart'; -import 'package:discover_module/provider_class/medicalinsightprovider.dart'; -import 'package:discover_module/ui_screen/view_insight.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; -import 'package:provider/provider.dart'; -import 'package:adoptive_calendar/adoptive_calendar.dart'; - -class MedicalInsight1 extends StatefulWidget { - const MedicalInsight1({super.key}); - - @override - State createState() => _MedicalInsightState(); -} - -class _MedicalInsightState extends State { - final List> cardData = [ - {'id': 'ID ', 'number': 'MI1688128025', 'id1': "jjj", 'number1': '265'}, - {'id': 'ID ', 'number': 20}, - {'id': 'ID ', 'number': 30}, - // Add more data entries as needed - ]; - - String selectedOption = 'None'; - late GlobalKey actionKey; - // DateTime? pickedDate; - - var item; - final TextEditingController textController = TextEditingController(); - - DateTime? selectedDate; - - bool calview = false; - String? start, end; - - final TextEditingController startController = TextEditingController(); - final TextEditingController endController = TextEditingController(); - - @override - void initState() { - actionKey = GlobalKey(); - super.initState(); - getapicall(); - } - - void getapicall() async { - await Provider.of(context, listen: false) - .medicalinsightdata(); - } - - // GlobalKey actionKey; - // final List> data = [ - // {'id': 'Data ID 1', 'number': 10}, - // {'id': 'Data ID 2', 'number': 20}, - // {'id': 'Data ID 3', 'number': 30}, - // // Add more data entries as needed - // ]; - @override - Widget build(BuildContext context) { - return Directionality( - textDirection: TextDirection.ltr, - child: SafeArea( - child: Scaffold( - // backgroundColor: const Color.fromARGB(255, 222, 237, 247), - backgroundColor: const Color.fromARGB(255, 246, 248, 252), - - appBar: AppBar( - title: const Text('Medical Insight'), - actions: [ - GestureDetector( - onTap: () { - setState(() { - calview = true; - }); - }, - child: Icon(Icons.calendar_month)) - ], - ), - body: Consumer( - builder: (context, value, child) { - return Column( - children: [ - // GestureDetector( - // onTap: () => _selectDate(context), - // child: AbsorbPointer( - // child: TextField( - // controller: textController, - // decoration: InputDecoration( - // focusedBorder: InputBorder.none, - // enabledBorder: InputBorder.none, - // contentPadding: EdgeInsets.all(10.0), - // labelText: "date", - // labelStyle: - // TextStyle(color: Colors.black, fontSize: 16), - // // pass the hint text parameter here - // hintStyle: TextStyle(color: Colors.black, fontSize: 16), - // suffixIcon: Icon(Icons.calendar_today), - // ), - // style: TextStyle(color: Colors.black, fontSize: 18), - // ), - // ), - // ), - Visibility( - visible: calview, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - // OutlinedButton( - // onPressed: () { - // _selectDate(context); - // }, - // child: - // start == null ? Text('Start Date') : Text(start!), - // ), - Expanded( - flex: 1, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: TextFormField( - controller: startController, - decoration: InputDecoration( - isDense: true, - border: OutlineInputBorder(), - hintText: "ff", - labelText: - startController.text ?? 'Start Date'), - // focusNode: AlwaysDisabledFocusNode(), - onTap: () { - _selectDate(context); - }, - ), - ), - ), - Expanded( - flex: 1, - child: OutlinedButton( - onPressed: () { - _selectDate1(context); - }, - child: end == null ? Text('Start Date') : Text(end!), - ), - ), - ], - ), - ), - - Padding( - padding: const EdgeInsets.all(8.0), - child: TextField( - //controller: _searchController, - onChanged: (value) { - setState(() {}); - }, - decoration: InputDecoration( - fillColor: Constants.k2color, - contentPadding: const EdgeInsets.symmetric(vertical: 9.0), - border: const OutlineInputBorder( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(0))), - labelText: ' Search', - prefixIcon: const Icon( - Icons.search, - ), - ), - ), - ), - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - // OutlinedButton( - // style: OutlinedButton.styleFrom( - // backgroundColor: Constants.k2color, - // foregroundColor: Colors.white), - // onPressed: () {}, - // child: Text("Create Medical Insight")) - ], - ), - Expanded( - child: ListView.builder( - physics: const ScrollPhysics(), - // scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: value.med.length, - itemBuilder: (context, index) { - item = value.med[index]; - - print( - "Item_Medical_insight ${item['Therapeutic Area']}"); - return GestureDetector( - onTap: () { - _showAlertDialog(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Card( - margin: EdgeInsets.zero, - - elevation: 4, - surfaceTintColor: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.zero, - ), - - // shape: RoundedRectangleBorder( - // side: BorderSide(color: Colors.black, width: 1), - // borderRadius: BorderRadius.only( - // bottomRight: Radius.circular(30)), - // ), - child: SizedBox( - width: MediaQuery.sizeOf(context).width, - child: ListTile( - dense: true, - title: Column( - // crossAxisAlignment: CrossAxisAlignment.center, - children: [ - // Text( - // "Acute neurology is the therapeutic area of the medical insight for Product A. The age of treatment is the topic of interest for this source type publication."), - - RichText( - text: TextSpan( - text: '', - style: DefaultTextStyle.of(context) - .style, - children: const [ - TextSpan( - text: 'Acute neurology ', - style: TextStyle( - fontWeight: - FontWeight.bold)), - // TextSpan( - // text: ' therapeutic area ', - // style: TextStyle( - // fontWeight: - // FontWeight.bold)), - TextSpan( - text: - 'is the therapeutic area of the medical insight for '), - TextSpan( - text: - 'Product A. The age of treatment', - style: TextStyle( - fontWeight: - FontWeight.bold)), - TextSpan( - text: - ' is the topic of interest for this source type'), - TextSpan( - text: ' publication.', - style: TextStyle( - fontWeight: - FontWeight.bold)), - ], - ), - ), - - const Padding( - padding: EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Icon( - Icons.person, - size: 20, - ), - Text( - "pooja", - style: - TextStyle(fontSize: 14.0), - ) - ], - ), - Row( - children: [ - Icon( - Icons.calendar_today, - size: 20, - ), - Text( - "11/11/2022 ", - style: - TextStyle(fontSize: 14.0), - ) - ], - ) - ], - ), - ), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // "Therapeutic Area", - // style: TextStyle( - // fontSize: 12, - // fontWeight: FontWeight.normal), - // ), - // ), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // item['Therapeutic Area'].toString(), - // style: const TextStyle(fontSize: 14), - // ), - // ), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // "Product", - // style: TextStyle( - // fontSize: 12, - // fontWeight: FontWeight.normal), - // ), - // ), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // item['Product'].toString(), - // style: const TextStyle(fontSize: 14), - // ), - // ), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // "Source Type", - // style: TextStyle( - // fontSize: 12, - // fontWeight: FontWeight.normal), - // ), - // ), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // item['Source Type'].toString(), - // style: const TextStyle(fontSize: 14), - // ), - // ), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // "Topics", - // style: TextStyle( - // fontSize: 12, - // fontWeight: FontWeight.normal), - // ), - // ), - // Align( - // alignment: Alignment.centerLeft, - // child: Text( - // item['Topics'].toString(), - // style: const TextStyle(fontSize: 14), - // ), - // ), - // Row( - // children: [ - // Expanded( - // flex: 1, - // child: Column( - // children: [ - // Row( - // children: [ - // Icon( - // Icons.person, - // size: 20, - // ), - // Text( - // "pooja", - // style: TextStyle( - // fontSize: 14.0), - // ) - // ], - // ), - // Row( - // children: [ - // Icon( - // Icons.calendar_today, - // size: 20, - // ), - // Text( - // "11/11/2022 ", - // style: TextStyle( - // fontSize: 14.0), - // ) - // ], - // ) - // ], - // ), - // ), - // Expanded( - // flex: 1, - // child: Align( - // alignment: - // Alignment.centerRight, - // child: OutlinedButton( - // style: - // OutlinedButton.styleFrom( - // shape: - // CircleBorder()), - // onPressed: () { - // // final RenderBox renderBox = - // // actionKey.currentContext! - // // .findRenderObject(); - // // final position = renderBox - // // .localToGlobal(Offset.zero); - // final RenderBox renderBox = - // actionKey - // .currentContext! - // .findRenderObject() - // as RenderBox; - // final position = - // renderBox.localToGlobal( - // Offset.zero); - - // showMenu( - // context: context, - // position: - // RelativeRect.fromLTRB( - // position.dx, - // position.dy + - // renderBox - // .size.height, - // position.dx + - // renderBox - // .size.width, - // position.dy + - // renderBox - // .size.height + - // 10, - // ), - // items: >[ - // PopupMenuItem( - // value: 'Option 1', - // child: - // Text('Option 1'), - // ), - // PopupMenuItem( - // value: 'Option 2', - // child: - // Text('Option 2'), - // ), - // PopupMenuItem( - // value: 'Option 3', - // child: - // Text('Option 3'), - // ), - // ], - // ).then((value) { - // if (value != null) { - // setState(() { - // selectedOption = - // value; - // }); - // } - // }); - // }, - // child: Icon( - // Icons.more_horiz_rounded, - // // color: Constants.k2color, - // ), - // )), - // ) - // ], - // ), - ], - ), - ), - ), - // shape: BorderRadius.only(bottomRight: Radius.circular(50)), - ), - ), - ); - }), - ) - ], - ); - }), - ), - ), - ); - } - - void _showAlertDialog(BuildContext context) { - showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - // title: Text('Alert'), - content: const MyWidget22(), - actions: [ - TextButton( - child: const Text('Close'), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], - ); - }, - ); - } - - Future _selectDate(BuildContext context) async { - final DateTime? picked = await showDatePicker( - context: context, - initialDate: selectedDate, - firstDate: DateTime(1901, 1), - lastDate: DateTime(2100)); - if (picked != null && picked != selectedDate) - setState(() { - selectedDate = picked; - String convertedDateTime = - "${picked.year.toString()}-${picked.month.toString().padLeft(2, '0')}-${picked.day.toString().padLeft(2, '0')}"; - // widget.textController.value = TextEditingValue(text: picked.toString()); - startController.value = TextEditingValue(text: convertedDateTime); - - start = convertedDateTime; - ; - }); - } - - Future _selectDate1(BuildContext context) async { - final DateTime? picked = await showDatePicker( - context: context, - initialDate: selectedDate, - firstDate: DateTime(1901, 1), - lastDate: DateTime(2100)); - if (picked != null && picked != selectedDate) - setState(() { - selectedDate = picked; - String convertedDateTime = - "${picked.year.toString()}-${picked.month.toString().padLeft(2, '0')}-${picked.day.toString().padLeft(2, '0')}"; - // widget.textController.value = TextEditingValue(text: picked.toString()); - textController.value = TextEditingValue(text: convertedDateTime); - - end = convertedDateTime; - ; - }); - } -} diff --git a/lib/ui_screen/new_new_profile.dart b/lib/ui_screen/new_new_profile.dart deleted file mode 100644 index 42d2810..0000000 --- a/lib/ui_screen/new_new_profile.dart +++ /dev/null @@ -1,5348 +0,0 @@ -import 'package:discover_module/check.dart'; -import 'package:discover_module/constants.dart'; -import 'package:discover_module/custom_widget/text.dart'; -import 'package:discover_module/provider_class/affiliationsprovider.dart'; -import 'package:discover_module/provider_class/engagement_provider.dart'; -import 'package:discover_module/provider_class/events_provider.dart'; -import 'package:discover_module/provider_class/medicalinsightprovider.dart'; -import 'package:discover_module/provider_class/publications_provider.dart'; -import 'package:discover_module/provider_class/speaker_provider.dart'; -import 'package:discover_module/provider_class/trials_provider.dart'; -import 'package:discover_module/ui_screen/activity_tab.dart'; -import 'package:discover_module/ui_screen/affiliation_data.dart'; -import 'package:discover_module/ui_screen/bottom_sheet.dart'; -import 'package:discover_module/ui_screen/engagementlist.dart'; -import 'package:discover_module/ui_screen/engagementtab.dart'; -import 'package:discover_module/ui_screen/events_data.dart'; -import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart'; -import 'package:discover_module/ui_screen/interactionform/configprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/edit_interaction_screen.dart'; -import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart'; -import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart'; -import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart'; -import 'package:discover_module/ui_screen/interactionform/view_interaction_screen.dart'; -import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart'; -import 'package:discover_module/ui_screen/location_tab.dart'; -import 'package:discover_module/ui_screen/medical_insight.dart'; -import 'package:discover_module/ui_screen/new_editinteraction.dart'; -import 'package:discover_module/ui_screen/new_viewinteraction.dart'; -import 'package:discover_module/ui_screen/newformlist.dart'; -import 'package:discover_module/ui_screen/publication_data.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/painting.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_carousel_widget/flutter_carousel_widget.dart'; -import 'package:flutter_profile_picture/flutter_profile_picture.dart'; -import 'package:provider/provider.dart'; -import 'package:cached_network_image/cached_network_image.dart'; -import 'package:url_launcher/url_launcher.dart'; - -class NewProfile1 extends StatefulWidget { - const NewProfile1({Key? key, required this.text}) : super(key: key); - final Map text; - - @override - State createState() => _NewProfileState(); -} - -class _NewProfileState extends State - with TickerProviderStateMixin { - //bool isonline = false; - List affiliation_data = []; - List publication_data = []; - List event_data = []; - List trial_data = []; - List medinsightData = []; - List speaker = []; - List eng = []; - - // final PageController _controller = PageController(viewportFraction: 0.8); - - List viewformData = []; - - bool _isExpanded = false; - - var item; - - TextEditingController firstNameController = TextEditingController(); - - // final List gradients = [ - // LinearGradient(colors: [ - // Colors.red, - // Colors.orange, - // ]), - // LinearGradient(colors: [Colors.green, Colors.yellow]), - // LinearGradient(colors: [Colors.blue, Colors.purple]), - // LinearGradient(colors: [Colors.pink, Colors.redAccent]), - // LinearGradient(colors: [Colors.teal, Colors.blueAccent]), - // ]; - - final List gradients = [ - const Color.fromARGB(255, 23, 162, 184), - const Color.fromARGB(255, 40, 167, 69), - Color.fromARGB(255, 187, 163, 7), - const Color.fromARGB(255, 220, 53, 69), - const Color.fromARGB(255, 23, 162, 184), - ]; - final ScrollController _scrollController = ScrollController(); - late final TabController _tabController; - - static const _tabs = [ - Tab(text: "Details"), - Tab(text: "Speakers"), - Tab(text: "Speakers"), - ]; - - @override - void initState() { - // TODO: implement initState - super.initState(); - print("pooja123"); - _tabController = TabController(length: 3, vsync: this); - - //init(); - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - //getaffiliations(); - - // getuserdetails(); - - // print("e_isssIndex_iss ${widget.text}"); - // print( - // "Widget_isssIndex_iss ${widget.text!["id"]},${widget.text!["name"]},${widget.text!["img_path"]}"); - }); - } - - init() async { - await Provider.of(context, listen: false) - .initConfigData(); - final data = - await Provider.of(context, listen: false); - - // if(data.g) - data.getRecords("form-3 demo"); - // setState(() {}); - } - - // getaffiliations() async { - // var affiliations = - // Provider.of(context, listen: false); - - // await affiliations.getAffiliationsdata(widget.text["id"]); - // final affilist = affiliations.adddta; - - // print("CheckingAfflist: $affilist"); - - // var publication = Provider.of(context, listen: false); - - // await publication.publicatininfo(widget.text["id"]); - // final publist = publication.publicationlist; - - // var events = Provider.of(context, listen: false); - // await events.geteventdata(widget.text["id"]); - // final eventlist = events.EventsList; - - // //var form = Provider.of(context, listen: false); - // // form.savedList; - - // var trials = Provider.of(context, listen: false); - // await trials.trialsdata(widget.text["id"]); - - // final trialslist = trials.trialsinfo; - - // // var med = Provider.of(context, listen: false); - // // await med.medicalinsightdata(); - // // final medlist = med.trialsinfo; - - // // var speaker11 = - // // Provider.of(context, listen: false); - - // // await speaker11.getspeakerdata(); - - // // final speakerlist = speaker11.speaker; - - // // var engtype = Provider.of(context, listen: false); - // // await engtype.getengagementdata(); - // // final engtypelist = engtype.engagementdata; - - // setState(() { - // affiliation_data = affilist; - // publication_data = publist; - // event_data = eventlist; - // // viewformData = form.savedList; - // trial_data = trialslist; - // // medinsightData = medlist; - // // speaker = speakerlist; - // // eng = engtypelist; - // }); - - // print("Affiliations_data_isNewOff: $affiliation_data"); - // print("Publication_data_isNewOff: $publication_data"); - - // // print("trialslist_data_is: $trialslist"); - // //final affiliationsss = affiliation_data['Affiliations'] as List>; - // } - - @override - void dispose() { - _tabController.dispose(); - super.dispose(); - } - - @override - Widget build(BuildContext context) { - // return Consumer( - // builder: (BuildContext context, provider, Widget? child) { - return DefaultTabController( - length: 3, - child: SafeArea( - child: headerview(context), - ), - ); - // }); - } - - Widget headerview(BuildContext context) { - return SafeArea( - child: Scaffold( - backgroundColor: Constants.bgcolor, - // appBar: AppBar(), - body: Stack( - children: [ - Container( - // color: Colors.blue, - child: Column( - children: [ - getAppBarUI(), - Expanded( - child: NestedScrollView( - controller: _scrollController, - headerSliverBuilder: - (BuildContext context, bool innerBoxIsScrolled) { - return [ - SliverList( - delegate: SliverChildBuilderDelegate( - (BuildContext context, int index) { - return Container( - //color: Constants.blueColor, - child: Column( - children: [ - buildCardView( - context, - ) - - // getTimeDateUI(), - ], - ), - ); - }, childCount: 1), - ), - SliverPersistentHeader( - pinned: true, - floating: true, - delegate: ContestTabHeader( - Container( - //color: Constants.bgcolor2, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.bottomCenter, - end: Alignment.topCenter, - colors: [ - // Constants.blueColor, - Constants.tabbgColor, - Constants.k2color, - // Constants.tabbgColor, - // const Color.fromARGB(255, 222, 237, 247), - // const Color.fromARGB(255, 222, 237, 247), - // Color(0xff006df1) - ]), - ), - child: const TabBar( - indicatorColor: Colors.white, - labelColor: Colors - .white, // Color of the selected tab text - - unselectedLabelColor: Colors.black, - // unselectedLabelColor: - // Color.fromARGB(255, 163, 159, 159), - tabs: [ - // Tab(text: "Sentiment"), - Tab( - // text: "Related " - child: Text( - 'Details', - style: TextStyle( - fontWeight: FontWeight.normal, - fontSize: 15.0), - ), - ), - Tab( - // text: "Activities " - child: Text( - 'Activities', - style: TextStyle( - fontWeight: FontWeight.normal, - fontSize: 15.0), - ), - ), - Tab( - //text: "Engagement " - - child: Text( - 'Engagements', - style: TextStyle( - fontWeight: FontWeight.normal, - fontSize: 15.0), - ), - ), - - // Tab(icon: Icon(Icons.email)), - ], - ), - ), - // const TabBar( - // indicatorSize: TabBarIndicatorSize.label, - // labelColor: Colors.black, - // unselectedLabelColor: Colors.grey, - // tabs: _tabs, - // ), - ), - ) - ]; - }, - body: TabBarView( - //controller: _tabController, - children: [ - LocationTab(text: widget.text["id"]), - - // ListView(children: [ - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // onExpansionChanged: - // (bool expanded) async { - // print("HeyyyPooja"); - - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Affiliations", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(4)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // ], - // ), - // children: [ - // Scrollbar( - // child: SingleChildScrollView( - // scrollDirection: Axis.horizontal, - // child: Container( - // // width: - // // MediaQuery.of(context) - // // .size - // // .width, - // constraints: BoxConstraints( - // minWidth: - // MediaQuery.of(context) - // .size - // .width), - // color: Colors.white, - // child: DataTable( - // showCheckboxColumn: false, - // columns: const [ - // DataColumn( - // label: Expanded( - // child: Text( - // 'Organization Name', - // style: TextStyle( - // fontWeight: - // FontWeight.w600), - // ), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Time Frame', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // affiliation_data - // .take(2) - // .length, - // (index) => DataRow( - // onSelectChanged: (value) { - // // =======> Use onSelectChanged for tab - // print( - // "message11 ${affiliation_data[index]}"); - - // bottomshet( - // affiliation_data[ - // index]); - // }, - // color: MaterialStateProperty - // .resolveWith( - // (Set - // states) { - // if (index.isEven) { - // return Colors.grey - // .withOpacity(0.1); - // } - // return null; - // }), - // cells: [ - // DataCell(Text( - // affiliation_data[ - // index] - // ['org_name'] - // .toString(), - // softWrap: true)), - - // DataCell(Text( - // affiliation_data[ - // index] - // ['time_frame'] - // .toString(), - // softWrap: true)), - - // // Add more DataCells as needed - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // print( - // "Passing_Id_isss: ${widget.text["id"]}"); - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (_) => - // AffiliationsData( - // text: widget - // .text[ - // "id"]))); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: Constants.k2color), - // ), - // style: OutlinedButton.styleFrom( - // shape: RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Publications", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // ], - // ), - // children: [ - // Scrollbar( - // //isAlwaysShown: true, - // child: SingleChildScrollView( - // scrollDirection: Axis.horizontal, - // child: Container( - // constraints: BoxConstraints( - // minWidth: - // MediaQuery.of(context) - // .size - // .width), - // color: Colors.white, - // child: DataTable( - // showCheckboxColumn: false, - // columns: const [ - // DataColumn( - // label: Expanded( - // child: Text('Artical Title', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - - // DataColumn( - // label: Expanded( - // child: Text('Authors', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - - // // Add more columns as needed - // ], - // rows: List.generate( - // publication_data - // .take(2) - // .length, - // (index) => DataRow( - // onSelectChanged: (value) { - // // =======> Use onSelectChanged for tab - // print( - // "message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: - // Radius.circular( - // 0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // publication_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index][ - // 'artical_title'] - // .toString(), - // softWrap: true)), - - // DataCell(Text( - // publication_data[ - // index] - // ['author'] - // .toString(), - // softWrap: true)), - - // // Add more DataCells as needed - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (_) => - // PublicationsData( - // text: widget - // .text[ - // "id"]))); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: Constants.k2color), - // ), - // style: OutlinedButton.styleFrom( - // shape: RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Events", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(4)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.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: const [ - // DataColumn( - // label: Expanded( - // child: Text('Event Name', - // softWrap: true, - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)), - // )), - - // DataColumn( - // label: Expanded( - // child: Text('Role', - // softWrap: true, - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - - // // Add more columns as needed - // ], - // rows: List.generate( - // event_data.take(2).length, - // (index) => DataRow( - // onSelectChanged: (value) { - // // =======> Use onSelectChanged for tab - // print( - // "message ${event_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: - // Radius.circular( - // 0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // event_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // event_data[index] - // ['event_name'] - // .toString(), - // softWrap: true)), - - // DataCell(Text( - // event_data[index] - // ['role'] - // .toString(), - // softWrap: true)), - - // // Add more DataCells as needed - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (_) => - // EventsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: Constants.k2color), - // ), - // style: OutlinedButton.styleFrom( - // shape: RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // //elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Trials", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(4)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.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: const [ - // DataColumn( - // label: Expanded( - // child: Text('Trial Name', - // softWrap: true, - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)), - // )), - // DataColumn( - // label: Expanded( - // child: Text('Status', - // softWrap: true, - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // trial_data.take(2).length, - // (index) => DataRow( - // onSelectChanged: (value) { - // // =======> Use onSelectChanged for tab - // print( - // "message ${trial_data[index]}"); - - // // bsheet( - // // publication_data[ - // // index]); - // showModalBottomSheet( - // useRootNavigator: true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: - // Radius.circular( - // 0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // trial_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // trial_data[index] - // ['trial_name'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // trial_data[index] - // ['status'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (_) => - // EventsData())); - // }, - // style: OutlinedButton.styleFrom( - // shape: RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // child: Text( - // 'Show More', - // style: TextStyle( - // color: Constants.k2color), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), // adds spacing between the text and image - // ]), -////////////////////////////////////////////////////////////////////////////////////// - - Activities(text: widget.text["id"]), - - // ListView(children: [ - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Container( - // child: Card( - // margin: EdgeInsets.all(1.0), - // //elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // backgroundColor: Constants.k2color11, - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // 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, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Locations", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 16.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // 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: const [ - // DataColumn( - // label: Expanded( - // child: Text('Name', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text('Type', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: (value) { - // print( - // "message ${publication_data[index]}"); - - // // showModalBottomSheet( - // // useRootNavigator: - // // true, - // // isScrollControlled: - // // false, - // // enableDrag: true, - // // useSafeArea: true, - // // constraints: - // // const BoxConstraints( - // // maxWidth: - // // double.infinity, - // // ), - // // shape: - // // const RoundedRectangleBorder( - // // borderRadius: - // // BorderRadius - // // .vertical( - // // top: Radius - // // .circular(0), - // // ), - // // ), - // // clipBehavior: Clip - // // .antiAliasWithSaveLayer, - // // context: context, - // // builder: (context) { - // // return bsheet( - // // publication_data[ - // // index]); - // // }, - // // ); - - // showModalBottomSheet< - // dynamic>( - // isScrollControlled: - // true, - // // context and builder are - // // required properties in this widget - // context: context, - // builder: (BuildContext - // context) { - // // we set up a container inside which - // // we create center column and display text - - // // Returning SizedBox instead of a Container - // return Container( - // width: double - // .infinity, - // child: Wrap( - // // mainAxisSize: MainAxisSize.max, - // children: [ - // Expanded( - // child: - // SingleChildScrollView( - // child: - // Column( - // //mainAxisAlignment: MainAxisAlignment.center, - // children: [ - // // Text( - // // 'GeeksforGeeks'), - // // Text( - // // 'GeeksforGeeks'), - - // // ListView( - // // children: [ - // ...List - // .generate( - // 15, - // (index) => - // Padding( - // padding: const EdgeInsets.all(8.0), - // child: Column( - // children: [ - // Text('Heart Failure'), - // ], - // ), - // ), - // ) - // ], - // // ) - // // ], - // ), - // ), - // ), - // ], - // ), - // ); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index][ - // 'Institution'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[ - // index] - // ['Address'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Container( - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // backgroundColor: Constants.k2color11, - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // 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, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Phone Numbers", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 16.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // 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: const [ - // DataColumn( - // label: Expanded( - // child: Text('phone Type', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Location', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: (value) { - // print( - // "message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular(0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // publication_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index][ - // 'Institution'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[ - // index] - // ['Address'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Container( - // child: Card( - // margin: EdgeInsets.all(1.0), - // //elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // backgroundColor: Constants.k2color11, - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // 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, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Emails", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 16.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // 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: const [ - // DataColumn( - // label: Expanded( - // child: Text('Email Type', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text('Email', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: (value) { - // print( - // "message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular(0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // publication_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index][ - // 'Institution'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[ - // index] - // ['Address'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Container( - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // backgroundColor: Constants.k2color11, - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // 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, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Staff/Assistant", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 16.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // 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: const [ - // DataColumn( - // label: Expanded( - // child: Text('Title', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Location', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: (value) { - // print( - // "message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular(0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // publication_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index][ - // 'Institution'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[ - // index] - // ['Address'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Container( - // child: Card( - // margin: EdgeInsets.all(1.0), - - // ///elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // backgroundColor: Constants.k2color11, - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // 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, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "State License", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 16.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // 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: const [ - // DataColumn( - // label: Expanded( - // child: Text('License No', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text('State', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: (value) { - // print( - // "message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular(0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // publication_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index][ - // 'Institution'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[ - // index] - // ['Address'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - // ), // ], - // ]), - // // -////////////////////////////////////////////////////////////////////////////////////// - - EngagementTab(text: widget.text["id"]), - - // ListView( - // children: [ - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // //elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // // initiallyExpanded: true, - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Medical Insights", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // ], - // ), - // children: [ - // Container( - // width: MediaQuery.of(context) - // .size - // .width, - - // /// 5, - // color: Colors.white, - // child: Consumer< - // MediacalInsightProvider>( - // builder: (BuildContext context, - // value, Widget? child) { - // print( - // "med1 : ${value.med.length}"); - - // if (value.med.length != 0) { - // return ListView.builder( - // physics: - // const ScrollPhysics(), - // // scrollDirection: Axis.vertical, - // shrinkWrap: true, - // itemCount: value.med - // .take(2) - // .length, - // itemBuilder: - // (context, index) { - // item = value.med[index]; - - // print( - // "Item_Medical_insight ${item['Therapeutic Area']}"); - // return Padding( - // padding: - // const EdgeInsets - // .all(8.0), - // child: Card( - // margin: - // EdgeInsets.zero, - - // elevation: 4, - // surfaceTintColor: - // Colors.white, - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .zero, - // ), - - // child: SizedBox( - // width: MediaQuery - // .sizeOf( - // context) - // .width, - // child: ListTile( - // dense: true, - // title: Column( - // // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // // Text( - // // "Acute neurology is the therapeutic area of the medical insight for Product A. The age of treatment is the topic of interest for this source type publication."), - - // RichText( - // text: - // TextSpan( - // text: '', - // style: DefaultTextStyle.of( - // context) - // .style, - // children: const [ - // TextSpan( - // text: - // 'Acute neurology ', - // style: - // TextStyle(fontWeight: FontWeight.bold)), - // // TextSpan( - // // text: ' therapeutic area ', - // // style: TextStyle( - // // fontWeight: - // // FontWeight.bold)), - // TextSpan( - // text: - // 'is the therapeutic area of the medical insight for '), - // TextSpan( - // text: - // 'Product A. The age of treatment', - // style: - // TextStyle(fontWeight: FontWeight.bold)), - // TextSpan( - // text: - // ' is the topic of interest for this source type'), - // TextSpan( - // text: - // ' publication.', - // style: - // TextStyle(fontWeight: FontWeight.bold)), - // ], - // ), - // ), - - // const Padding( - // padding: - // EdgeInsets.all( - // 8.0), - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment - // .spaceBetween, - // children: [ - // Row( - // children: [ - // Icon( - // Icons.person, - // size: 20, - // ), - // Text( - // "pooja", - // style: TextStyle(fontSize: 14.0), - // ) - // ], - // ), - // Row( - // children: [ - // Icon( - // Icons.calendar_today, - // size: 20, - // ), - // Text( - // "11/11/2022 ", - // style: TextStyle(fontSize: 14.0), - // ) - // ], - // ) - // ], - // ), - // ), - // ], - // ), - // ), - // ), - // // shape: BorderRadius.only(bottomRight: Radius.circular(50)), - // ), - // ); - // }); - // } else { - // return Container( - // color: Colors.white, - // width: MediaQuery.of(context) - // .size - // .width, - // child: Column( - // children: [ - // Text("No records"), - // ], - // ), - // ); - // } - // }), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (_) => - // const MedicalInsight1())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // title: Row( - // //mainAxisSize: MainAxisSize.min, - // children: [ - // GestureDetector( - // onTap: () async { - // final provider = Provider.of< - // InteractionProvider>( - // context, - // listen: false); - // if (getCount( - // provider - // .intConfigDataList[ - // 0] - // .name, - // provider) != - // 0) { - // provider.savedList - // .where((element) => - // element.form == - // provider - // .intConfigDataList[ - // 0] - // .name) - // .toList(); - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (BuildContext - // context) => - // SavedFormListScreen( - // formname: provider - // .intConfigDataList[ - // 0] - // .name, - // ))); - // } - // }, - // child: Text1( - // title: "Interactions", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // ), - // const SizedBox( - // width: 8.0, - // ), - // ], - // ), - // children: [ - // Container( - // height: MediaQuery.of(context) - // .size - // .height / - // 5, - // color: Colors.white, - // child: Consumer< - // ViewInteractionProvider>( - // builder: (BuildContext context, - // provider, Widget? child) { - // print( - // "P_leangth : ${provider.savedList.length}"); - - // if (provider.savedList.length != - // 0) { - // return ListView.builder( - // shrinkWrap: true, - // physics: - // NeverScrollableScrollPhysics(), - // itemCount: provider - // .savedList - // .take(2) - // .length, - // itemBuilder: - // (context, index) { - // print( - // "Indexxxxxx $index"); - // return Column( - // children: [ - // ListTile( - // subtitle: Text( - // 'Updated on ${provider.savedList[index].updatedTime}', - // //style: TextStyle(fontStyle: FontStyle.italic), - // ), - // title: Text( - // provider - // .savedList[ - // index] - // .id, - // ), - // trailing: SizedBox( - // width: 150, - // child: Row( - // children: [ - // IconButton( - // onPressed: - // () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (BuildContext context) => ViewInteractionScreen1( - // saveInteraction: provider.savedList[index], - // ))); - // }, - // icon: - // const Icon( - // Icons - // .info_outline, - // size: - // 24, - // color: Color.fromARGB( - // 255, - // 8, - // 39, - // 92), - // ), - // ), - // IconButton( - // onPressed: - // () async { - // await provider - // .initConfigData() - // .then({ - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (BuildContext context) => EditInteractionScreen1( - // saveInteraction: provider.savedList[index], - // ))) - // }); - // }, - // icon: - // const Icon( - // Icons - // .edit, - // size: - // 24, - // color: Color.fromARGB( - // 255, - // 8, - // 39, - // 92), - // ), - // ), - // IconButton( - // onPressed: - // () { - // showDeleteRecordAlertDialog( - // context, - // provider.savedList[index].id, - // provider.savedList[index]); - // }, - // icon: - // const Icon( - // Icons - // .delete, - // size: - // 24, - // color: Color.fromARGB( - // 255, - // 8, - // 39, - // 92), - // ), - // ), - // ]), - // ), - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (BuildContext - // context) => - // ViewInteractionScreen1( - // saveInteraction: - // provider.savedList[index], - // ))); - // }, - // ), - // const Divider(), - // ], - // ); - // }); - // } else { - // return Container( - // color: Colors.white, - // width: MediaQuery.of(context) - // .size - // .width, - // child: Column( - // children: [ - // Text("No records"), - // ], - // ), - // ); - // } - // }), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // final provider = Provider - // .of( - // context, - // listen: false); - // if (getCount( - // provider - // .intConfigDataList[ - // 0] - // .name, - // provider) != - // 0) { - // provider.savedList - // .where((element) => - // element.form == - // provider - // .intConfigDataList[ - // 0] - // .name) - // .toList(); - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (BuildContext - // context) => - // SavedFormListScreen( - // formname: provider - // .intConfigDataList[ - // 0] - // .name, - // ))); - // } - // }, - // child: Text('Show More'), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Speaker Evalution", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(4)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.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: const [ - // DataColumn( - // label: Expanded( - // child: Text( - // 'Program Topic', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // ), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Speaker Name', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // speaker.take(2).length, - // (index) => DataRow( - // onSelectChanged: (value) { - // // =======> Use onSelectChanged for tab - // print( - // "message ${speaker[index]}"); - - // // bsheet( - // // publication_data[ - // // index]); - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular(0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // speaker[index]); - // }, - // ); - // }, - // color: MaterialStateProperty - // .resolveWith< - // Color?>((Set< - // MaterialState> - // states) { - // if (index.isEven) { - // return Colors.grey - // .withOpacity(0.1); - // } - // return null; - // }), - // cells: [ - // DataCell(Text( - // speaker[index][ - // 'programtopic'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // speaker[index][ - // 'speakername'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // AffiliationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Engagements", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.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: const [ - // DataColumn( - // label: Expanded( - // child: Text( - // 'Main Therapeutic Area', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // ), - // )), - // DataColumn( - // label: Expanded( - // child: Text('Date', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // eng.take(2).length, - // (index) => DataRow( - // onSelectChanged: (value) { - // // =======> Use onSelectChanged for tab - // print( - // "message ${eng[index]}"); - - // // bsheet( - // // publication_data[ - // // index]); - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular(0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // eng[index]); - // }, - // ); - // }, - // color: MaterialStateProperty - // .resolveWith< - // Color?>((Set< - // MaterialState> - // states) { - // if (index.isEven) { - // return Colors.grey - // .withOpacity(0.1); - // } - // return null; - // }), - // cells: [ - // DataCell(Text( - // eng[index][ - // 'main thereutic area'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // eng[index]['date'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (_) => - // EngagementList())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // //elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "NIH Grants", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.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: const [ - // DataColumn( - // label: Expanded( - // child: Text('NIH Center', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Organization Name', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: (value) { - // print( - // "message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular(0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // publication_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index][ - // 'artical_title'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[ - // index] - // ['author'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Procedures", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.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: const [ - // DataColumn( - // label: Expanded( - // child: Text( - // 'Program Year', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Procedure', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: (value) { - // print( - // "message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular(0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // publication_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index][ - // 'artical_title'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[ - // index] - // ['author'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Patents", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.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: const [ - // DataColumn( - // label: Expanded( - // child: Text( - // 'Patent Title', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Status', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: (value) { - // print( - // "message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular(0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // publication_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index][ - // 'artical_title'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[ - // index] - // ['author'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Container( - // child: Card( - // margin: EdgeInsets.all(1.0), - // //elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Patient Referrals", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 16.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 17.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: const [ - // DataColumn( - // label: Expanded( - // child: Text( - // 'Referred By', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Type of Referrals', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: - // (value) { - // print( - // "message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: double - // .infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular( - // 0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // publication_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index] - // [ - // 'artical_title'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[ - // index] - // ['author'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: Constants - // .k2color), - // ), - // style: OutlinedButton - // .styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .circular(12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: Constants.k2color11, - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black), - // title: Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Training", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 16.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // 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: const [ - // DataColumn( - // label: Expanded( - // child: Text( - // 'Institute Name', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Degree', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: (value) { - // print( - // "message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: - // double.infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular(0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // publication_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index][ - // 'artical_title'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[ - // index] - // ['author'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: - // Constants.k2color), - // ), - // style: - // OutlinedButton.styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular( - // 12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), // adds spacing between the text and image - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.only( - // left: 8.0, right: 8.0), - // child: Container( - // child: Card( - // margin: EdgeInsets.all(1.0), - // // elevation: 5, - // shape: RoundedRectangleBorder( - // borderRadius: - // BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, - // child: ExpansionTile( - // backgroundColor: Constants.k2color11, - // initiallyExpanded: false, - // maintainState: true, - // // backgroundColor: Colors.white, - // // collapsedBackgroundColor: Color(0xFF2b9af3), - // 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, - // // mainAxisSize: MainAxisSize.min, - // children: [ - // Text1( - // title: "Case", - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 16.0), - // const SizedBox( - // width: 8.0, - // ), - // Text1( - // title: "(3)", - // 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: const [ - // DataColumn( - // label: Expanded( - // child: Text('Name', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600), - // softWrap: true), - // )), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Type', - // style: TextStyle( - // fontWeight: - // FontWeight - // .w600)))), - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: - // (value) { - // print( - // "message ${publication_data[index]}"); - - // showModalBottomSheet( - // useRootNavigator: - // true, - // isScrollControlled: - // false, - // enableDrag: true, - // useSafeArea: true, - // constraints: - // const BoxConstraints( - // maxWidth: double - // .infinity, - // ), - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .vertical( - // top: Radius - // .circular( - // 0), - // ), - // ), - // clipBehavior: Clip - // .antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet( - // publication_data[ - // index]); - // }, - // ); - // }, - // cells: [ - // DataCell(Text( - // publication_data[ - // index] - // [ - // 'artical_title'] - // .toString(), - // softWrap: true)), - // DataCell(Text( - // publication_data[ - // index] - // ['author'] - // .toString(), - // softWrap: true)), - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: - // const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => - // // PublicationsData())); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: Constants - // .k2color), - // ), - // style: OutlinedButton - // .styleFrom( - // shape: - // RoundedRectangleBorder( - // borderRadius: - // BorderRadius - // .circular(12), - // ), - // ), - // ), - // ), - // ), - // ) - // ]), - // ), - // ), - // ), - // ), // adds spacing between the text and image - // ], - // ), - - // // /expandableDetails(), - // speakersList(provider), - ], - ), - ), - ) - ], - ), - ), - ], - ), - floatingActionButton: Visibility( - visible: true, - child: FloatingActionButton( - onPressed: () async { - // final ConfigDataProvider configDataProvider = - // ConfigDataProvider(); - - // await configDataProvider.initConfigUIData(); - Navigator.push( - context, MaterialPageRoute(builder: (context) => FormList())); - }, - foregroundColor: Colors.white, - backgroundColor: const Color.fromARGB(255, 0, 71, 132), - child: new Icon(Icons.add), - ), - ), - ), - ); - } - - buildCardView(BuildContext context) { - MediaQuery.of(context).size.height * 0.35; - - return Container( - //color: Colors.yellowAccent, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - //mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Stack( - clipBehavior: Clip.none, - alignment: Alignment.center, - children: [ - Container( - width: - MediaQuery.of(context).size.width, // Adjust width as needed - height: 110, // Adjust height as needed - decoration: BoxDecoration(color: Constants.k2color), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text1( - title: widget.text!["name"], - txtcolor: Colors.white, - fontweight: FontWeight.normal, - txtfont: 20.0), - Text1( - title: widget.text!["speciality"], - txtcolor: Colors.white, - fontweight: FontWeight.normal, - txtfont: 14.0), - ], - ), - ), - // Column( - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Text1( - // title: "Dr " + widget.text!["name"], - // txtcolor: Colors.white, - // fontweight: FontWeight.normal, - // txtfont: 22.0), - // Text1( - // title: widget.text!["speciality"], - // txtcolor: Colors.white, - // fontweight: FontWeight.normal, - // txtfont: 15.0), - // ], - // ), - Positioned( - bottom: -45, - child: Container( - child: widget.text["img_path"] == "" - ? ProfilePicture( - name: widget.text!["name"], - radius: 48, - fontsize: 21, - ) - : ClipOval( - child: SizedBox.fromSize( - size: Size.fromRadius(48), - child: CachedNetworkImage( - imageUrl: widget.text!["img_path"], - imageBuilder: (context, imageProvider) => - Container( - decoration: BoxDecoration( - image: DecorationImage( - image: imageProvider, - fit: BoxFit.fill, - ), - ), - ), - // placeholder: (context, url) => - // CircularProgressIndicator(), - // errorWidget: (context, url, error) => - // Icon(Icons.error), - ), - ), - ), - - // ClipOval( - // child: SizedBox.fromSize( - // size: Size.fromRadius(48), // Image radius - // child: Image.network(widget.text!["img_path"], - // fit: BoxFit.fill), - // ), - // ), - ), - ) - ], - ), - SizedBox( - height: 55.0, - ), - - _ProfileInfoRow(text: widget.text["id"]), - - // Profile photo - Column( - children: [ - // Text1( - // title: "Dr " + widget.text!["name"], - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 22.0), - // Text1( - // title: widget.text!["speciality"], - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 15.0), - SizedBox( - height: 8.0, - ), - Padding( - padding: const EdgeInsets.only(left: 8.0), - child: - Row(mainAxisAlignment: MainAxisAlignment.center, children: [ - const Icon( - Icons.location_city_sharp, - color: Color.fromARGB(255, 0, 71, 132), - ), - const SizedBox( - width: 3.0, - ), - Expanded( - child: Text1( - title: widget.text!["OrgName"] ?? - "Florida Hospital Medical Group Inc", - txtcolor: Colors.black, - txtfont: 14.0, - fontweight: FontWeight.normal, - ), - // child: RichText( - // text: TextSpan( - // text: widget.text!["addr"] ?? - // "Azienda Ospedaliera di Padova", - // style: TextStyle( - // fontSize: 16.0, color: Colors.black), - // ), - // ), - ), - ]), - ), - const SizedBox( - height: 8.0, - ), - Padding( - padding: const EdgeInsets.only(left: 8.0), - child: InkWell( - onTap: () { - _openMapsByAddress(); - }, - child: Row(children: [ - const Icon( - Icons.location_pin, - color: Color.fromARGB(255, 0, 71, 132), - ), - const SizedBox( - width: 3.0, - ), - Expanded( - // child: Text( - // "Via Giustiniani, 2, Padova, Veneto 35128, Italy", - // style: TextStyle( - // fontWeight: FontWeight.bold, fontSize: 14.0), - // ), - child: Text1( - title: widget.text!["Country"] ?? - "Via Giustiniani, 2, Padova, Veneto 35128, Italy", - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 14.0), - - // child: RichText( - // text: TextSpan( - // text: widget.text!["adrr"] ?? - // "Via Giustiniani, 2, Padova, Veneto 35128, Italy", - // style: TextStyle( - // fontSize: 16.0, color: Colors.black), - // ), - // ), - ), - ]), - ), - ), - const SizedBox( - height: 8.0, - ), - Padding( - padding: const EdgeInsets.only(left: 8.0), - child: InkWell( - onTap: () async { - print("Emailll"); - String? encodeQueryParameters(Map params) { - return params.entries - .map((MapEntry entry) => - Uri.encodeComponent(entry.key) + - '=' + - Uri.encodeComponent(entry.value)) - .join('&'); - } - - final Uri emailLaunchUri = Uri( - scheme: 'mailto', - path: 'example@example.com', - query: encodeQueryParameters({ - 'subject': 'Example Subject', - 'body': 'Hello, this is a sample body text.', - }), - ); - - if (await launchUrl(emailLaunchUri)) { - launchUrl(emailLaunchUri); - } else { - throw 'Could not launch $emailLaunchUri'; - } - }, - child: Row(children: [ - const Icon( - Icons.email, - color: Color.fromARGB(255, 0, 71, 132), - ), - const SizedBox( - width: 3.0, - ), - Expanded( - child: Text1( - title: widget.text!["email"], - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 14.0), - ), - ]), - ), - ), - SizedBox( - height: 8.0, - ), - Padding( - padding: const EdgeInsets.only(left: 8.0), - child: InkWell( - onTap: () async { - final call = Uri.parse('tel:${widget.text!["phone_no"]}'); - if (await canLaunchUrl(call)) { - launchUrl(call); - } else { - throw 'Could not launch $call'; - } - }, - child: Row(children: [ - const Icon( - Icons.phone, - color: Color.fromARGB(255, 0, 71, 132), - ), - const SizedBox( - width: 3.0, - ), - // Text( - // "+390498212410 X 12", - // style: TextStyle( - // fontWeight: FontWeight.bold, fontSize: 14.0), - // ), - Text1( - title: widget.text!["phone_no"].toString(), - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 14.0), - ]), - ), - ), - // const SizedBox( - // height: 8.0, - // ), - // Padding( - // padding: const EdgeInsets.only(left: 8.0), - // child: Row(children: [ - // const Icon( - // Icons.call, - // color: Color.fromARGB(255, 0, 71, 132), - // ), - // const SizedBox( - // width: 3.0, - // ), - // Expanded( - // child: Text1( - // title: widget.text!["phone_no"].toString(), - // txtcolor: Colors.black, - // fontweight: FontWeight.normal, - // txtfont: 15.0), - // ), - // ]), - // ), - ], - ), - - const SizedBox( - height: 5.0, - ), - - ExpandableCarousel( - options: CarouselOptions( - showIndicator: false, - slideIndicator: CircularWaveSlideIndicator( - alignment: Alignment.bottomCenter, - currentIndicatorColor: Constants.k2color1, - indicatorBackgroundColor: Colors.grey, - // padding: EdgeInsets.only(: 10), - ), - autoPlay: true, - autoPlayInterval: const Duration(seconds: 2), - ), - // items: [1, 2, 3, 4, 5].map((i) { - // items: [1, 2, 3, 4, 5].asMap().entries.map((entry) { - // items: - // [widget.text!["topdata"]["items"]].asMap().entries.map((entry) { - // // items: widget.text!["topdata"]["items"].map((entry) { - // int index = entry.key; - items: List.generate(widget.text!["topdata"].length, (index) { - print("CheckingTitle: ${widget.text!["topdata"][index]}"); - - var data = widget.text!["topdata"][index]; - print("CheckingTitle111: ${data['title']}"); - // print("CheckingTitle111:222 ${data['items']["name"]}"); - - return Builder( - builder: (BuildContext context) { - return Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Card( - margin: EdgeInsets.all(1.0), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - child: Container( - decoration: BoxDecoration( - color: gradients[ - index % gradients.length], // Apply gradient - borderRadius: BorderRadius.circular(10), - ), - child: Padding( - padding: EdgeInsets.all(10.0), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - data['title'], - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.bold, - color: Colors.white), - ), - // Text( - // index == 0 - // ? "Top Event Topics" - // : index == 1 - // ? "Top Publication Topics" - // : index == 2 - // ? "Top Products Discussed" - // : index == 3 - // ? "Drugs Prescribed" - // : "Condition Treated", - // style: TextStyle( - // fontSize: 16.0, - // fontWeight: FontWeight.bold, - // color: Colors.white), - // ), - const SizedBox( - height: 10.0, - ), - Row( - children: [ - Container( - decoration: BoxDecoration( - color: Constants.cardtext, - borderRadius: BorderRadius.circular(10), - ), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Row( - children: [ - Icon( - Icons.circle, - color: Colors.white, - size: 13.0, - ), - SizedBox( - width: 5.0, - ), - Text( - data['name1'], - style: TextStyle( - fontSize: 14.0, - color: Colors.white), - ), - ], - ), - ), - ), - ], - ), - // SizedBox(height: 1), - Row( - children: [ - Container( - decoration: BoxDecoration( - color: Constants.cardtext, - borderRadius: BorderRadius.circular(5), - ), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Row( - children: [ - Icon( - Icons.circle, - color: Colors.white, - size: 13.0, - ), - SizedBox( - width: 5.0, - ), - Text(data['name2'], - maxLines: 2, - style: TextStyle( - fontSize: 14.0, - color: Colors.white), - softWrap: true), - ], - ), - ), - ), - ], - ), - // SizedBox(height: 5), - Row( - children: [ - Container( - decoration: BoxDecoration( - color: Constants.cardtext, - borderRadius: BorderRadius.circular(5), - ), - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Row( - children: [ - Icon( - Icons.circle, - color: Colors.white, - size: 13.0, - ), - SizedBox( - width: 5.0, - ), - Text( - data['name3'], - style: TextStyle( - fontSize: 14.0, - color: Colors.white), - ), - ], - ), - ), - ), - ], - ), - ], - ), - ), - ), - ), - ), - ); - }, - ); - }).toList(), - ), - - Align( - alignment: Alignment.centerLeft, - child: Padding( - padding: const EdgeInsets.only(left: 8.0), - child: Text1( - title: "Profile Summary", - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 18.0), - ), - ), - const SizedBox( - height: 5.0, - ), - Align( - alignment: Alignment.centerLeft, - child: Padding( - padding: const EdgeInsets.only(left: 15.0), - child: Text1( - title: widget.text!["summarry"], - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 14.0), - ), - ), - - // ListTileTheme( - // dense: true, - // child: Padding( - // padding: const EdgeInsets.symmetric(horizontal: 8.0), - // child: Card( - // margin: EdgeInsets.all(1.0), - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(0.0), - // ), - // color: Constants.k2color11, // Replace with Constants.k2color11 - // child: ExpansionTile( - // onExpansionChanged: (bool expanded) { - // setState(() { - // _isExpanded = expanded; - // }); - // }, - // backgroundColor: - // Constants.k2color11, // Replace with Constants.k2color11 - // trailing: Icon( - // _isExpanded - // ? Icons.keyboard_arrow_up - // : Icons.keyboard_arrow_down, - // color: Colors.black, - // ), - // title: Row( - // children: [ - // Text( - // "Sentiment Score", - // style: TextStyle( - // color: Colors.black, - // fontWeight: FontWeight.normal, - // fontSize: 17.0, - // ), - // ), - // const SizedBox(width: 8.0), - // Text( - // "(3)", - // style: TextStyle( - // color: Colors.black, - // fontWeight: FontWeight.normal, - // fontSize: 17.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: const [ - // DataColumn( - // label: Expanded( - // child: Text( - // 'Product', - // style: - // TextStyle(fontWeight: FontWeight.w600), - // ), - // ), - // ), - // DataColumn( - // label: Expanded( - // child: Text( - // 'Aissel Engagement', - // style: - // TextStyle(fontWeight: FontWeight.w600), - // ), - // ), - // ), - // // Add more columns as needed - // ], - // rows: List.generate( - // publication_data.length, - // (index) => DataRow( - // onSelectChanged: (value) { - // showModalBottomSheet( - // useRootNavigator: true, - // isScrollControlled: false, - // enableDrag: true, - // useSafeArea: true, - // constraints: const BoxConstraints( - // maxWidth: double.infinity, - // ), - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.vertical( - // top: Radius.circular(0), - // ), - // ), - // clipBehavior: Clip.antiAliasWithSaveLayer, - // context: context, - // builder: (context) { - // return bsheet(publication_data[index]); - // }, - // ); - // }, - // cells: [ - // DataCell( - // Text( - // publication_data[index] - // ['artical_title'] ?? - // '', - // softWrap: true, - // ), - // ), - // DataCell( - // Text( - // publication_data[index]['author'] ?? '', - // softWrap: true, - // ), - // ), - // // Add more DataCells as needed - // ], - // ), - // ), - // ), - // ), - // ), - // ), - // Container( - // color: Colors.white, - // child: Align( - // alignment: Alignment.center, - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: OutlinedButton( - // onPressed: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (_) => PublicationsData(), - // // ), - // // ); - // }, - // child: Text( - // 'Show More', - // style: TextStyle( - // color: Colors - // .blue), // Replace with Constants.k2color - // ), - // style: OutlinedButton.styleFrom( - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(12), - // ), - // ), - // ), - // ), - // ), - // ), - // ], - // ), - // ), - // ), - // ), - - SizedBox( - height: 10.0, - ), - - ListTileTheme( - dense: true, - child: Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Card( - margin: EdgeInsets.all(1.0), - // elevation: 5, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(0.0), - ), - color: Constants.k2color11, - child: ExpansionTile( - // collapsedBackgroundColor: Color(0xFF2b9af3), - onExpansionChanged: (bool expanded) { - setState(() { - _isExpanded = expanded; - }); - }, - backgroundColor: Constants.k2color11, - trailing: Icon( - _isExpanded - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.black), - title: Row( - mainAxisAlignment: MainAxisAlignment.start, - // mainAxisSize: MainAxisSize.min, - children: [ - Text1( - title: "Notes", - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 17.0), - const SizedBox( - width: 8.0, - ), - Text1( - title: "(0)", - txtcolor: Colors.black, - fontweight: FontWeight.normal, - txtfont: 17.0), - ], - ), - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: TextField( - decoration: InputDecoration( - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8.0), - ), - hintText: 'Write your note here', - contentPadding: EdgeInsets.all(16.0), - ), - maxLines: - null, // Allows the TextField to expand vertically - ), - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: OutlinedButton( - onPressed: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (_) => PublicationsData())); - }, - child: Text( - 'Save', - style: TextStyle(color: Constants.k2color), - ), - style: OutlinedButton.styleFrom( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - ), - ), - ), - ), - ]), - ), - ), - ), // adds spacing between the text and image - - SizedBox( - height: 10.0, - ), - ], - // ), - ), - ); - } - - Widget listViewTopicCard(String title, String content, bool visible) { - return Visibility( - visible: visible, - child: Card( - child: Container( - padding: EdgeInsets.all(8.0), - width: double.maxFinite, - decoration: BoxDecoration( - // color: Color.fromARGB(179, 248, 238, 238), - // color: Colors.white, - ), - child: Padding( - padding: const EdgeInsets.only(left: 8.0, right: 14.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - title, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.bold, - ), - ), - Text( - content, - style: TextStyle( - fontSize: 14, - color: Colors.grey[700], - ), - ), - ], - ), - ), - ), - ), - ); - } - - Future getCount(String form, InteractionProvider provider) async { - await provider.getRecords(); - - return provider.savedList.where((element) => element.form == form).length; - } - - buidCard() { - Text("Hiii"); - } - - showDeleteRecordAlertDialog( - BuildContext context, String record, SaveInteraction saveInteraction) { - // set up the buttons - ViewInteractionProvider provider = - Provider.of(context, listen: false); - Widget cancelButton = TextButton( - child: const Text("YES"), - onPressed: () async { - await provider.deleteRecord(saveInteraction).then((value) { - _displaySnackBar("Deleted sucessfully!"); - Navigator.of(context).pop(); - }); - }, - ); - Widget continueButton = TextButton( - child: const Text("NO"), - onPressed: () { - Navigator.of(context).pop(); - }, - ); - - // set up the AlertDialog - AlertDialog alert = AlertDialog( - title: const Text(""), - content: Text("Are you sure you want to delete the record $record ?"), - actions: [ - cancelButton, - continueButton, - ], - ); - - // show the dialog - showDialog( - context: context, - builder: (BuildContext context) { - return alert; - }, - ); - } - - _displaySnackBar(String msg) { - final snackBar = SnackBar( - content: Text( - msg, - style: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), - )); - ScaffoldMessenger.of(context).showSnackBar(snackBar); - //scaffoldKeyLogin.currentState!.showSnackBar(snackBar); - } - - Widget makeDismissible({required DraggableScrollableSheet child}) { - return GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () => Navigator.of(context).pop(), - child: GestureDetector( - onTap: () {}, - child: child, - ), - ); - } - - void bottomshet(affiliation_data) { - // print("Aff_index_data: ${affiliation_data}"); - showModalBottomSheet( - // isScrollControlled: - // true, - - context: context, - - useRootNavigator: true, - isScrollControlled: false, - enableDrag: true, - useSafeArea: true, - constraints: const BoxConstraints( - maxWidth: double.infinity, - ), - - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.vertical( - top: Radius.circular(0), - ), - ), - clipBehavior: Clip.antiAliasWithSaveLayer, - // sheetAnimationStyle: _animationStyle, - builder: (BuildContext context) { - return - // makeDismissible( - // child: - DraggableScrollableSheet( - expand: false, - builder: (BuildContext context, ScrollController scrollController) { - return Container( - width: MediaQuery.of(context).size.width, - //color: Colors.white, - color: Color.fromARGB(255, 246, 248, 252), - - // decoration: - // BoxDecoration(borderRadius: BorderRadius.circular(10)), - // child: ListView( - // children: [ - - // ], - // ), - - child: Column( - children: [ - Expanded( - child: ListView.builder( - controller: scrollController, - itemCount: 1, - itemBuilder: (BuildContext context, int index) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - // Row( - // children: [ - // Text( - // "Affiliation", - // style: TextStyle(fontSize: 20.0), - // ) - // ], - // ), - SizedBox( - height: 18.0, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.all(18.0), - child: Text( - affiliation_data['org_name'], - softWrap: true, - maxLines: 4, - style: TextStyle( - fontSize: 18.0, - color: Colors.grey[700]), - ), - ), - ), - // Padding( - // padding: const EdgeInsets.only(left: 18.0), - // child: - // GestureDetector( - // onTap: () async { - // final ConfigDataProvider - // configDataProvider = - // ConfigDataProvider(); - // await configDataProvider - // .initConfigUIDataEng(); - - // final provider = - // Provider.of( - // context, - // listen: false); - - // if (getCount( - // provider.intConfigDataList[index] - // .name, - // provider) != - // 0) { - // provider.savedList - // .where((element) => - // element.form == - // provider - // .intConfigDataList[index] - // .name) - // .toList(); - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: - // (BuildContext context) => - // SavedFormListScreen( - // formname: provider - // .intConfigDataList[ - // index] - // .name, - // ))); - // } - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (context) => - // // const InteractionListScreen())); - // }, - // child: Text( - // affiliation_data['org_name'], - // softWrap: true, - // maxLines: 4, - // style: TextStyle( - // fontSize: 18.0, - // color: Colors.grey[700]), - // ), - // ), - // ) - ], - ), - SizedBox( - height: 18.0, - ), - Divider(), - SizedBox( - height: 8.0, - ), - - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(left: 18.0), - child: Text( - "Department", - style: TextStyle(fontSize: 13.0), - ), - ), - Padding( - padding: const EdgeInsets.only(left: 18.0), - child: Text( - affiliation_data['dept'], - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700]), - ), - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only( - left: 18.0, top: 18.0), - child: Text( - "Role", - style: TextStyle(fontSize: 13.0), - ), - ), - Padding( - padding: const EdgeInsets.only(left: 18.0), - child: Text( - affiliation_data['role'], - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700]), - ), - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only( - left: 18.0, top: 18.0), - child: Text( - "Time Frame".toString(), - style: TextStyle(fontSize: 13.0), - ), - ), - Padding( - padding: const EdgeInsets.only(left: 18.0), - child: Text( - affiliation_data['time_frame'], - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700]), - ), - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only( - left: 18.0, top: 18.0), - child: Text( - "Oraganization Type", - style: TextStyle(fontSize: 13.0), - ), - ), - Padding( - padding: const EdgeInsets.only(left: 18.0), - child: Text( - affiliation_data['org_type'], - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700]), - ), - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only( - left: 18.0, top: 18.0), - child: Text( - "Eng Type", - style: TextStyle(fontSize: 13.0), - ), - ), - Padding( - padding: const EdgeInsets.only(left: 18.0), - child: Text( - affiliation_data['emg_type'], - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700]), - ), - ) - ], - ), - ], - ); - }, - ), - ), - ], - ), - ); - }, - ); - //); - }, - ); - } - - Widget _buildPaginationDots() { - return Container( - padding: EdgeInsets.symmetric(vertical: 8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: List.generate(10, (index) { - return Container( - margin: EdgeInsets.symmetric(horizontal: 4.0), - width: 8.0, - height: 8.0, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: 1 == index ? Colors.blue : Colors.grey, - ), - ); - }), - ), - ); - } - - Widget getAppBarUI() { - return Container( - decoration: BoxDecoration( - color: Constants.k2color, - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.2), - offset: const Offset(0, 2), - blurRadius: 8.0), - ], - ), - child: Padding( - padding: EdgeInsets.only(top: 2, left: 8, right: 8), - child: Row( - children: [ - Container( - alignment: Alignment.topLeft, - // width: AppBar().preferredSize.height, - // height: AppBar().preferredSize.height, - child: Material( - color: Colors.transparent, - child: InkWell( - borderRadius: const BorderRadius.all( - Radius.circular(32.0), - ), - onTap: () { - Navigator.pop(context); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - children: [ - Icon( - Icons.arrow_back_ios_new, - size: 18, - color: Colors.white, - ), - SizedBox( - width: 8, - ), - Text( - "Contacts", - style: TextStyle(fontSize: 14.0, color: Colors.white), - ) - ], - ), - ), - ), - ), - ), - Expanded( - child: Text( - "", - maxLines: 1, - softWrap: true, - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 14, - overflow: TextOverflow.ellipsis, - ), - ), - ), - ], - ), - ), - ); - } - - Future _openMapsByAddress() async { - final address = 'Italy'; - final Uri mapsUri = Uri( - scheme: 'https', - host: 'www.google.com', - path: 'maps/search/', - query: address, - ); - - if (!await launchUrl(mapsUri)) { - throw 'Could not launch $mapsUri'; - } - } -} - -class _ProfileInfoRow extends StatelessWidget { -// _ProfileInfoRow({Key? key}) : super(key: key); - final int text; - - _ProfileInfoRow({required this.text, Key? key}) : super(key: key); - - final List _items = const [ - ProfileInfoItem("Publication(s)", 688), - ProfileInfoItem("Event(s)", 111), - ProfileInfoItem("Trial(s)", 10), - ]; - - @override - Widget build(BuildContext context) { - return Container( - height: 80, - constraints: const BoxConstraints(maxWidth: 400), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: _items - .map((item) => Expanded( - child: Row( - children: [ - if (_items.indexOf(item) != 0) const VerticalDivider(), - Expanded(child: _singleItem(context, item)), - ], - ))) - .toList(), - ), - ); - } - - Widget _singleItem(BuildContext context, item) => Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - item.value.toString(), - style: const TextStyle( - fontWeight: FontWeight.bold, - fontSize: 14, - ), - ), - ), - Text( - item.title, - // style: const TextStyle( - // fontWeight: FontWeight.normal, - // fontSize: 18, - // ), - // style: Theme.of(context).textTheme.caption, - ) - ], - ); -} - -class ProfileInfoItem { - final String title; - final int value; - const ProfileInfoItem(this.title, this.value); -} - -class ContestTabHeader extends SliverPersistentHeaderDelegate { - ContestTabHeader( - this.searchUI, - ); - final Widget searchUI; - - @override - Widget build( - BuildContext context, double shrinkOffset, bool overlapsContent) { - return Container(color: Colors.white, child: searchUI); - } - - @override - double get maxExtent => 52.0; - - @override - double get minExtent => 52.0; - - @override - bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) { - return true; - } -}