From ca43849d9d431efe26a2a09b1835e913d9490c04 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 27 Jul 2022 14:24:23 +0300 Subject: [PATCH] CMC Updates --- lib/config/localized_values.dart | 1 + .../cmc_insert_pres_order_request_model.dart | 4 + .../AlHabibMedicalService/cmc_service.dart | 2 + lib/core/service/client/base_app_client.dart | 6 +- .../NewCMC/new_cmc_page.dart | 2 +- .../NewCMC/new_cmc_step_one_page.dart | 28 +- .../NewCMC/new_cmc_step_three_page.dart | 286 ++++++++++++++---- .../orders_log_details_page.dart | 2 +- lib/pages/BookAppointment/BookSuccess.dart | 4 +- .../components/SearchByClinic.dart | 47 +-- .../covid-dirvethru-questions.dart | 1 + lib/pages/ErService/ErOptions.dart | 1 + lib/pages/ToDoList/ToDo.dart | 2 +- lib/pages/landing/landing_page.dart | 7 +- lib/pages/settings/profile_setting.dart | 23 +- .../appointment_services/GetDoctorsList.dart | 3 +- lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/in_app_browser/InAppBrowser.dart | 8 +- 18 files changed, 310 insertions(+), 118 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 14d8a6cb..7c8831eb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1847,4 +1847,5 @@ const Map localizedValues = { "lakumUnhold": { "en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل" }, "lakumDiscontinue": { "en": "The account is closed", "ar": "الحساب مغلق" }, "lakumSuccess": { "en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح" }, + "deleteAccount": { "en": "Delete my account", "ar": "الحساب احذف" }, }; diff --git a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart index 7c621f35..9de08856 100644 --- a/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart +++ b/lib/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart @@ -16,6 +16,7 @@ class CMCInsertPresOrderRequestModel { double longitude; int createdBy; int orderServiceID; + int projectID; List patientERCMCInsertServicesList; CMCInsertPresOrderRequestModel( @@ -36,6 +37,7 @@ class CMCInsertPresOrderRequestModel { this.longitude, this.createdBy, this.orderServiceID, + this.projectID, this.patientERCMCInsertServicesList}); CMCInsertPresOrderRequestModel.fromJson(Map json) { @@ -56,6 +58,7 @@ class CMCInsertPresOrderRequestModel { longitude = json['Longitude']; createdBy = json['CreatedBy']; orderServiceID = json['OrderServiceID']; + projectID = json['ProjectId']; if (json['PatientER_CMC_InsertServicesList'] != null) { patientERCMCInsertServicesList = new List(); @@ -84,6 +87,7 @@ class CMCInsertPresOrderRequestModel { data['longitude'] = this.longitude; // data['CreatedBy'] = this.createdBy; data['OrderServiceID'] = this.orderServiceID; + data['ProjectID'] = this.projectID; if (this.patientERCMCInsertServicesList != null) { data['procedures'] = this.patientERCMCInsertServicesList.map((v) => v.toJson()).toList(); diff --git a/lib/core/service/AlHabibMedicalService/cmc_service.dart b/lib/core/service/AlHabibMedicalService/cmc_service.dart index c6c2d82f..e1bb4154 100644 --- a/lib/core/service/AlHabibMedicalService/cmc_service.dart +++ b/lib/core/service/AlHabibMedicalService/cmc_service.dart @@ -133,6 +133,8 @@ class CMCService extends BaseService { Future insertCMCOrderRC({CMCInsertPresOrderRequestModel order}) async { hasError = false; String reqId = ""; + order.latitude = 0.0; + order.longitude = 0.0; await baseAppClient.post(ADD_CMC_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) { isOrderUpdated = true; reqId = response['response'].toString(); diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index d4ca669a..e9f4904f 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -129,9 +129,9 @@ class BaseAppClient { } } - // body['IdentificationNo'] = 2076117163; - // body['MobileNo'] = "966503109207"; - // body['PatientID'] = 1018977; //3844083 + // body['IdentificationNo'] = 1098574195; + // body['MobileNo'] = "966565001080"; + // body['PatientID'] = 1454600; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart index b6dfde7a..9efe2342 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -181,7 +181,7 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { Expanded( child: Text( // !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(), - widget.model.pendingOrder.projectName.trim().toString(), + widget.model.pendingOrder.projectName != null ? widget.model.pendingOrder.projectName.trim().toString() : "", style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), ), ), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart index e6eefefe..0b6f49dd 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; @@ -161,19 +162,26 @@ class _NewCMCStepOnePageState extends State { widget.cMCInsertPresOrderRequestModel.patientOutSA = projectViewModel.user.outSA; widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList = [patientERCMCInsertServicesList]; - await widget.model.getCustomerInfo(); + navigateTo( + context, + NewCMCStepThreePage( + cmcInsertPresOrderRequestModel: widget.cMCInsertPresOrderRequestModel, + model: widget.model, + ), + ); + // await widget.model.getCustomerInfo(); if (widget.model.state == ViewState.ErrorLocal) { Utils.showErrorToast(); } else { - navigateTo( - context, - NewCMCStepTowPage( - longitude: widget.longitude, - latitude: widget.latitude, - cmcInsertPresOrderRequestModel: widget.cMCInsertPresOrderRequestModel, - model: widget.model, - ), - ); + // navigateTo( + // context, + // NewCMCStepTowPage( + // longitude: widget.longitude, + // latitude: widget.latitude, + // cmcInsertPresOrderRequestModel: widget.cMCInsertPresOrderRequestModel, + // model: widget.model, + // ), + // ); } } }, diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart index cc83abdb..ec020f49 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart @@ -3,19 +3,24 @@ import 'dart:async'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; class NewCMCStepThreePage extends StatefulWidget { @@ -31,6 +36,12 @@ class NewCMCStepThreePage extends StatefulWidget { class _NewCMCStepThreePageState extends State { Completer _controller = Completer(); + String projectDropdownValue; + List projectsList = []; + HospitalsModel selectedHospital; + final GlobalKey projectDropdownKey = GlobalKey(); + bool isLocationSelected = false; + static CameraPosition _kGooglePlex = CameraPosition( target: LatLng(37.42796133580664, -122.085749655962), zoom: 14.4746, @@ -53,6 +64,11 @@ class _NewCMCStepThreePageState extends State { zoom: 14.4746, ); } + WidgetsBinding.instance.addPostFrameCallback((_) { + // if (projectViewModel.isLogin) { + getProjectsList(); + // } + }); super.initState(); } @@ -100,53 +116,136 @@ class _NewCMCStepThreePageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - TranslationBase.of(context).orderDetails + " : ", - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - letterSpacing: -0.46, - color: CustomColors.grey, + Container( + width: double.infinity, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.only(top: 12), + padding: EdgeInsets.only(left: 0, right: 0, top: 0, bottom: 12), + child: Row( + children: [ + Flexible( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).selectLocation, + style: TextStyle( + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ), + Container( + height: 18, + child: DropdownButtonHideUnderline( + child: DropdownButton( + key: projectDropdownKey, + hint: new Text(TranslationBase.of(context).selectHospital), + value: selectedHospital, + iconSize: 0, + isExpanded: true, + style: TextStyle(fontSize: 14, letterSpacing: -0.56, color: Colors.black), + items: projectsList.map((item) { + return new DropdownMenuItem( + value: item, + child: new Text(item.name), + ); + }).toList(), + onChanged: (newValue) async { + setState(() { + selectedHospital = newValue; + projectDropdownValue = newValue.mainProjectID.toString(); + isLocationSelected = true; + widget.cmcInsertPresOrderRequestModel.projectID = newValue.mainProjectID; + // getDoctorsList(context); + }); + }, + ), + ), + ), + ], + ), + ), + Icon(Icons.keyboard_arrow_down), + ], ), ), SizedBox( height: 6, ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - height: 200, - decoration: containerColorRadiusBorder(Colors.white, 12, Colors.grey), - clipBehavior: Clip.antiAlias, - child: Container( - decoration: cardRadius(12), - clipBehavior: Clip.antiAlias, - margin: const EdgeInsets.all(0), - // child: GoogleMap( - // mapType: MapType.normal, - // markers: markers, - // initialCameraPosition: _kGooglePlex, - // onMapCreated: (GoogleMapController controller) { - // _controller.complete(controller); - // }, - // ), - child: Image.network( - "https://maps.googleapis.com/maps/api/staticmap?center=" + - widget.cmcInsertPresOrderRequestModel.latitude.toString() + - "," + - widget.cmcInsertPresOrderRequestModel.longitude.toString() + - "&zoom=16&size=600x300&maptype=roadmap&markers=color:red%7C" + - widget.cmcInsertPresOrderRequestModel.latitude.toString() + - "," + - widget.cmcInsertPresOrderRequestModel.longitude.toString() + - "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8", - width: double.infinity, - height: double.infinity, - fit: BoxFit.cover, - ), - ), - ), - ), + isLocationSelected + ? Padding( + padding: const EdgeInsets.all(8.0), + child: Stack( + children: [ + Container( + height: 200, + decoration: containerColorRadiusBorder(Colors.white, 12, Colors.grey), + clipBehavior: Clip.antiAlias, + child: Container( + decoration: cardRadius(12), + clipBehavior: Clip.antiAlias, + margin: const EdgeInsets.all(0), + child: Image.network( + "https://maps.googleapis.com/maps/api/staticmap?center=" + + selectedHospital.latitude.toString() + + "," + + selectedHospital.longitude.toString() + + "&zoom=16&size=600x300&maptype=roadmap&markers=color:red%7C" + + selectedHospital.latitude.toString() + + "," + + selectedHospital.longitude.toString() + + "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8", + width: double.infinity, + height: double.infinity, + fit: BoxFit.cover, + ), + ), + ), + Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + InkWell( + onTap: () { + getDirections(); + }, + child: Container( + decoration: cardRadius(1000), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.only(left: 12, right: 12, top: 6, bottom: 6), + child: Row( + children: [ + Padding( + padding: const EdgeInsets.all(3.0), + child: SvgPicture.asset( + "assets/images/new/direction.svg", + width: 13, + height: 13, + ), + ), + mWidth(6), + Text( + TranslationBase.of(context).getDirections, + style: TextStyle( + color: Colors.black, + fontSize: 11, + letterSpacing: -0.44, + fontWeight: FontWeight.w600, + ), + ) + ], + ), + ), + ), + ), + ], + ), + ], + ), + ) + : Container(), SizedBox( height: 12, ), @@ -196,32 +295,89 @@ class _NewCMCStepThreePageState extends State { children: [ Container( width: MediaQuery.of(context).size.width * 0.9, - child: SecondaryButton( - label: TranslationBase.of(context).confirm, - color: CustomColors.green, - onTap: () async { - GifLoaderDialogUtils.showMyDialog(context); - String requestId = await widget.model.insertCMCOrderRC(order: widget.cmcInsertPresOrderRequestModel); - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state != ViewState.ErrorLocal) { - //show scuccess dialog - showCMCConfirmDialog( - context, - requestId, - onClick: () { - Navigator.pop(context); - Navigator.pop(context); - }, - ); - } else { - AppToast.showErrorToast(message: widget.model.error); - } - }, - textColor: Theme.of(context).backgroundColor), + child: DefaultButton( + TranslationBase.of(context).confirm, + !isLocationSelected + ? null + : () async { + GifLoaderDialogUtils.showMyDialog(context); + String requestId = await widget.model.insertCMCOrderRC(order: widget.cmcInsertPresOrderRequestModel); + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state != ViewState.ErrorLocal) { + showCMCConfirmDialog( + context, + requestId, + onClick: () { + Navigator.pop(context); + Navigator.pop(context); + }, + ); + } else { + AppToast.showErrorToast(message: widget.model.error); + } + }, + color: CustomColors.green, + disabledColor: CustomColors.grey, + ), + // SecondaryButton( + // label: TranslationBase.of(context).confirm, + // color: CustomColors.green, + // onTap: () async { + // if(isLocationSelected) { + // GifLoaderDialogUtils.showMyDialog(context); + // String requestId = await widget.model.insertCMCOrderRC(order: widget.cmcInsertPresOrderRequestModel); + // GifLoaderDialogUtils.hideDialog(context); + // if (widget.model.state != ViewState.ErrorLocal) { + // showCMCConfirmDialog( + // context, + // requestId, + // onClick: () { + // Navigator.pop(context); + // Navigator.pop(context); + // }, + // ); + // } else { + // AppToast.showErrorToast(message: widget.model.error); + // } + // } else { + // Utils.showErrorToast("Please select hospital from the dropdown menu to continue"); + // } + // }, + // textColor: Theme.of(context).backgroundColor), ), ], ), ), ); } + + getDirections() { + if (isLocationSelected) { + MapsLauncher.launchCoordinates(double.parse(selectedHospital.latitude), double.parse(selectedHospital.longitude), selectedHospital.name); + } else { + Utils.showErrorToast("Please select address from the dropdown menu to get directions"); + } + } + + getProjectsList() { + ClinicListService service = new ClinicListService(); + GifLoaderDialogUtils.showMyDialog(context); + List projectsListLocal = []; + service.getProjectsList(context).then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + res['ListProject'].forEach((v) { + projectsListLocal.add(new HospitalsModel.fromJson(v)); + }); + projectsList = projectsListLocal; + }); + } + GifLoaderDialogUtils.hideDialog(context); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } } diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart index 78c1d140..39de5bf7 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart @@ -134,7 +134,7 @@ class OrdersLogDetailsPage extends StatelessWidget { Expanded( child: Text( // !projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(), - order.projectName.trim().toString(), + order.projectName != null ? order.projectName.trim().toString() : "", style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), ), ), diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 04bda097..de9b9c70 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -265,6 +265,7 @@ class _BookSuccessState extends State { appo.serviceID = widget.patientShareResponse.serviceID; appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; appo.doctorID = widget.patientShareResponse.doctorID; + appo.appointmentDate = widget.patientShareResponse.appointmentDate; if (appo.isLiveCareAppointment) insertLiveCareVIDARequest(appo); else @@ -425,6 +426,7 @@ class _BookSuccessState extends State { appo.serviceID = widget.patientShareResponse.serviceID; appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment; appo.doctorID = widget.patientShareResponse.doctorID; + appo.appointmentDate = widget.patientShareResponse.appointmentDate; insertLiveCareVIDARequest(appo, isMoveHome: false); }).catchError((err) { // GifLoaderDialogUtils.hideDialog(context); @@ -458,7 +460,7 @@ class _BookSuccessState extends State { insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo, {bool isMoveHome = true}) { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, context).then((res) { + service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (isMoveHome) navigateToHome(context); diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 8c11386a..0c7a9546 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -23,7 +23,6 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import 'LaserClinic.dart'; @@ -219,6 +218,7 @@ class _SearchByClinicState extends State { dropdownValue = result.clinicID.toString(); setState(() { if (!isDentalSelectedAndSupported()) { + dropdownValue = ""; projectDropdownValue = ""; getDoctorsList(context); } else {} @@ -237,11 +237,10 @@ class _SearchByClinicState extends State { clincs.clinicID.toString() + "-" + clincs.isLiveCareClinicAndOnline.toString() + "-" + clincs.liveCareClinicID.toString() + "-" + clincs.liveCareServiceID.toString(); if (dropdownValue == "253-false-0-0") { Navigator.push(context, FadePage(page: LaserClinic())); - } else if (!isDentalSelectedAndSupported() && !nearestAppo) { + } else if (!isDentalSelectedAndSupported()) { projectDropdownValue = ""; getDoctorsList(context); - } else { - } + } else {} }); projectViewModel.analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription); }); @@ -325,7 +324,7 @@ class _SearchByClinicState extends State { child: new Text(item.name), ); }).toList(), - onChanged: (newValue) async{ + onChanged: (newValue) async { setState(() { selectedHospital = newValue; projectDropdownValue = newValue.mainProjectID.toString(); @@ -494,29 +493,32 @@ class _SearchByClinicState extends State { getProjectsList() { ClinicListService service = new ClinicListService(); List projectsListLocal = []; - service.getProjectsList(context).then((res) { - if (res['MessageStatus'] == 1) { - setState(() { - res['ListProject'].forEach((v) { - projectsListLocal.add(new HospitalsModel.fromJson(v)); - }); - projectsList = projectsListLocal; + service + .getProjectsList(context) + .then((res) { + if (res['MessageStatus'] == 1) { + setState(() { + res['ListProject'].forEach((v) { + projectsListLocal.add(new HospitalsModel.fromJson(v)); + }); + projectsList = projectsListLocal; + }); + filterClinic(); + isProjectLoaded = true; + } else { + isProjectLoaded = false; + } + }) + .catchError((err) {}) + .catchError((err) { + print(err); }); - filterClinic(); - isProjectLoaded = true; - } else { - isProjectLoaded = false; - } - }).catchError((err) { - }).catchError((err) { - print(err); - }); } // TODO Mosa_REMARk to come back later getDoctorsList(BuildContext context) { SearchInfo searchInfo = new SearchInfo(); - if (dropdownValue.split("-")[0] == "17") { + if (dropdownValue != null) if (dropdownValue.split("-")[0] == "17") { searchInfo.ProjectID = int.parse(projectDropdownValue); searchInfo.ClinicID = int.parse(dropdownValue.split("-")[0]); searchInfo.hospital = selectedHospital; @@ -633,6 +635,7 @@ class _SearchByClinicState extends State { .then((value) { setState(() { dropdownValue = null; + dropdownTitle = ""; }); getProjectsList(); }); diff --git a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart index 0dc23227..ef4bf39a 100644 --- a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart +++ b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart @@ -273,6 +273,7 @@ class CovidDirveThruQuestionsState extends State { all = all && (element["ans"] == 1 || element["ans"] == 0); }); if (all) if (qa[0]["ans"] == 1) { + sharedPref.setObject(COVID_QA_LIST, qa); openPassportUpdatePage(); } else { sharedPref.setObject(COVID_QA_LIST, qa); diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 40bcc1af..e733ca89 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -88,6 +88,7 @@ class _ErOptionsState extends State { InkWell( onTap: () { if (projectViewModel.havePrivilege(81)) Navigator.push(context, FadePage(page: DdServicesPage())); + // Navigator.push(context, FadePage(page: DdServicesPage())); }, child: MedicalProfileItem( title: "ED", diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 421948b6..96da5d1f 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1008,7 +1008,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, context).then((res) { + service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 64685b1b..834bf465 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; @@ -699,8 +700,10 @@ class _LandingPageState extends State with WidgetsBindingObserver { } else { projectViewModel.analytics.setUser(null); } - String voipToken = await sharedPref.getString(APNS_TOKEN); - getOneSignalVOIPToken(voipToken); + if (Platform.isIOS) { + String voipToken = await sharedPref.getString(APNS_TOKEN); + getOneSignalVOIPToken(voipToken); + } } getOneSignalVOIPToken(String voipToken) { diff --git a/lib/pages/settings/profile_setting.dart b/lib/pages/settings/profile_setting.dart index 8769b00a..7cfc3acb 100644 --- a/lib/pages/settings/profile_setting.dart +++ b/lib/pages/settings/profile_setting.dart @@ -1,4 +1,3 @@ -import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -31,16 +30,13 @@ class _ProfileSettings extends State with TickerProviderStateMi @override void initState() { - super.initState(); } Widget build(BuildContext context) { projectProvider = Provider.of(context); return BaseView( - onModelReady: (model) => { - getSettings() - }, + onModelReady: (model) => {getSettings()}, builder: (_, model, wi) => Container( child: model.user != null ? Column( @@ -217,6 +213,14 @@ class _ProfileSettings extends State with TickerProviderStateMi inputWidget(TranslationBase.of(context).emergencyName, "", emergencyContactName), mHeight(8), inputWidget(TranslationBase.of(context).emergencyContact, "", emergencyContact), + mHeight(10), + InkWell( + onTap: () {}, + child: Text( + TranslationBase.of(context).deleteAccount, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, letterSpacing: -0.64, color: Color(0xffD02127), decoration: TextDecoration.underline), + ), + ), mHeight(8), ], ), @@ -248,6 +252,10 @@ class _ProfileSettings extends State with TickerProviderStateMi ); } + deactivateAccount() { + + } + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { return Container( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), @@ -333,8 +341,9 @@ class _ProfileSettings extends State with TickerProviderStateMi getSettings() { // GifLoaderDialogUtils.showMyDialog(AppGlobal.context); authService.getSettings().then((result) => { - // GifLoaderDialogUtils.hideDialog(AppGlobal.context), - setValue(result["PateintInfoForUpdateList"][0])}); + // GifLoaderDialogUtils.hideDialog(AppGlobal.context), + setValue(result["PateintInfoForUpdateList"][0]) + }); } setValue(value) { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 8e77019a..e694a148 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -707,7 +707,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future insertVIDARequest(int appoNo, int clinicID, int projectID, int serviceID, int docID, BuildContext context) async { + Future insertVIDARequest(int appoNo, int clinicID, int projectID, int serviceID, int docID, String appoDate, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -727,6 +727,7 @@ class DoctorsListService extends BaseService { request = { "AppointmentNo": appoNo, + "AppointmentDate": appoDate, "ClinicID": clinicID, "ProjectID": projectID, "ServiceID": serviceID, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index d279b564..e7faf572 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2856,6 +2856,7 @@ class TranslationBase { String get lakumUnhold => localizedValues["lakumUnhold"][locale.languageCode]; String get lakumDiscontinue => localizedValues["lakumDiscontinue"][locale.languageCode]; String get lakumSuccess => localizedValues["lakumSuccess"][locale.languageCode]; + String get deleteAccount => localizedValues["deleteAccount"][locale.languageCode]; } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 6e89bb01..7d6b31ab 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -34,13 +34,13 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';