diff --git a/ios/Podfile b/ios/Podfile index c92f7e80..264db98d 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -32,6 +32,7 @@ target 'Runner' do use_modular_headers! pod 'OpenTok', '~> 2.22.0' + pod 'VTO2Lib' flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end @@ -53,9 +54,34 @@ post_install do |installer| ] build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' + xcconfig_path = build_configuration.base_configuration_reference.real_path + xcconfig = File.read(xcconfig_path) + xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR") + File.open(xcconfig_path, "w") { |file| file << xcconfig_mod } + if build_configuration.build_settings['WRAPPER_EXTENSION'] == 'bundle' build_configuration.build_settings['DEVELOPMENT_TEAM'] = '3A359E86ZF' end end end +end + +post_integrate do |installer| + compiler_flags_key = 'COMPILER_FLAGS' + project_path = 'Pods/Pods.xcodeproj' + + project = Xcodeproj::Project.open(project_path) + project.targets.each do |target| + target.build_phases.each do |build_phase| + if build_phase.is_a?(Xcodeproj::Project::Object::PBXSourcesBuildPhase) + build_phase.files.each do |file| + if !file.settings.nil? && file.settings.key?(compiler_flags_key) + compiler_flags = file.settings[compiler_flags_key] + file.settings[compiler_flags_key] = compiler_flags.gsub(/-DOS_OBJECT_USE_OBJC=0\s*/, '') + end + end + end + end + end + project.save() end \ No newline at end of file diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000..ea96fe5f --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/config/config.dart b/lib/config/config.dart index b1dc8323..2dd34047 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -19,8 +19,8 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; - // var BASE_URL = 'http://10.50.100.198:2018/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'http://10.50.100.198:2018/'; +var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; @@ -335,7 +335,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 10.9; +var VERSION_ID = 10.8; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7fd9507b..29671b2d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -182,7 +182,7 @@ const Map localizedValues = { 'passQRAppoAttend': {'en': 'Pass the QR code through the attendance devices available in the Hospital.', 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.'}, 'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'}, 'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'}, - 'scanQRHospital': {'en': 'Approach the Online Check-In board in the hospital & scan via NFC to Check-In', 'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وافحصها عبر NFC لتسجيل الوصول'}, + 'scanQRHospital': {'en': 'Approach the Online Check-In board in the hospital & scan via NFC or QR Code to Check-In', 'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وقم بالمسح الضوئي عبر NFC أو رمز الاستجابة السريعة لتسجيل الوصول'}, 'scanNFC': {'en': 'Scan NFC to Check-In', 'ar': 'مسح NFC لتسجيل الوصول'}, "sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"}, "success": {"en": "Done successfully", "ar": "تم تنفذ الطلب بنجاح"}, diff --git a/lib/core/model/privilege/HMCProjectListModel.dart b/lib/core/model/privilege/HMCProjectListModel.dart new file mode 100644 index 00000000..6b69c1c5 --- /dev/null +++ b/lib/core/model/privilege/HMCProjectListModel.dart @@ -0,0 +1,15 @@ +class HMCProjectListModel { + int projectID; + + HMCProjectListModel({this.projectID}); + + HMCProjectListModel.fromJson(Map json) { + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/service/medical/PatientSickLeaveService.dart b/lib/core/service/medical/PatientSickLeaveService.dart index 656d2d5f..f31e06a2 100644 --- a/lib/core/service/medical/PatientSickLeaveService.dart +++ b/lib/core/service/medical/PatientSickLeaveService.dart @@ -11,9 +11,11 @@ class PatientSickLeaveService extends BaseService { await baseAppClient.post(GET_PATIENT_SICK_LEAVE_STATUS, onSuccess: (response, statusCode) async { sickLeaveList.clear(); - response['List_SickLeave'].forEach((sickLeave) { - sickLeaveList.add(SickLeave.fromJson(sickLeave)); - }); + if(response['List_SickLeave'] != null && response['List_SickLeave'].length != 0) { + response['List_SickLeave'].forEach((sickLeave) { + sickLeaveList.add(SickLeave.fromJson(sickLeave)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/privilege_service.dart b/lib/core/service/privilege_service.dart index a68f071f..560c0628 100644 --- a/lib/core/service/privilege_service.dart +++ b/lib/core/service/privilege_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; @@ -7,30 +8,30 @@ import 'package:diplomaticquarterapp/main.dart'; class PrivilegeService extends BaseService { List privilegeModelList = []; List vidaPlusProjectListModel = []; + List hMCProjectListModel = []; Future getPrivilege() async { Map body = Map(); body['PatientType'] = 4; - await baseAppClient.post( - GET_PRIVILEGE, - onSuccess: (dynamic response, int statusCode) { - response['ServicePrivilegeList'].forEach((item) { - privilegeModelList.add(PrivilegeModel.fromJson(item)); + await baseAppClient.post(GET_PRIVILEGE, onSuccess: (dynamic response, int statusCode) { + response['ServicePrivilegeList'].forEach((item) { + privilegeModelList.add(PrivilegeModel.fromJson(item)); + }); + + if (response['ProjectListVidaPlus'].length != 0) { + response['ProjectListVidaPlus'].forEach((item) { + vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); }); + } - if (response['ProjectListVidaPlus'].length != 0) { - response['ProjectListVidaPlus'].forEach((item) { - vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); - }); - } - }, - onFailure: (String error, int statusCode) { - print(error); - print(statusCode); - hasError = true; - super.error = error; - }, - body: body, - ); + if (response['HMCProjectList'].length != 0) { + response['HMCProjectList'].forEach((item) { + hMCProjectListModel.add(HMCProjectListModel.fromJson(item)); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } } diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index cafb5221..4ca210f1 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -75,6 +75,7 @@ class LabsViewModel extends BaseViewModel { List labResultLists =[]; getLaboratoryResult({required String projectID, required int clinicID, required String invoiceNo, required String orderNo, required String setupID, required bool isVidaPlus}) async { + getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID, bool isVidaPlus}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, @@ -114,9 +115,9 @@ class LabsViewModel extends BaseViewModel { } } - getPatientLabOrdersResults({required PatientLabOrders patientLabOrder, required String procedure}) async { + getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, bool isVidaPlus}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure); + await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, isVidaPlus: isVidaPlus); if (_labsService.hasError) { error = _labsService.error!; setState(ViewState.Error); @@ -135,14 +136,14 @@ class LabsViewModel extends BaseViewModel { _labsService.labOrdersResultsList.forEach((element) { try { - timeSeries.add(new TimeSeriesSales2(DateUtil.convertStringToDate(element.verifiedOnDateTime!), double.parse(element.resultValue!))); + timeSeries.add(new TimeSeriesSales2(DateUtil.convertStringToDate(element.verifiedOnDateTime), double.parse(element.resultValue))); } catch (e) {} }); setState(ViewState.Idle); } } - sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes, AuthenticatedUser? userObj, required bool isVidaPlus, bool isDownload = false}) async { + sendLabReportEmail({PatientLabOrders? patientLabOrder, String? mes, AuthenticatedUser? userObj, required bool isVidaPlus, bool isDownload = false}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isVidaPlus: isVidaPlus, isDownload: isDownload); if (_labsService.hasError) { error = _labsService.error!; diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 47d0ed5e..80e90713 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -3,6 +3,7 @@ import 'dart:async'; import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; @@ -51,12 +52,14 @@ class ProjectViewModel extends BaseViewModel { List privilegeRootUser = []; List privilegeChildUser = []; List _vidaPlusProjectListModel = []; - - List get vidaPlusProjectList => _vidaPlusProjectListModel; - List selectedBodyPartList = []; + List _hMCProjectListModel = []; List get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser; + List get vidaPlusProjectList => _vidaPlusProjectListModel; + List get hMCProjectListModel => _hMCProjectListModel; + List selectedBodyPartList = []; + late StreamSubscription subscription; late double _latitude; @@ -119,6 +122,16 @@ class ProjectViewModel extends BaseViewModel { notifyListeners(); } + setVidaPlusProjectList(List vidaPlusProjectListModelInput) { + _vidaPlusProjectListModel = vidaPlusProjectListModelInput; + notifyListeners(); + } + + setHMCProjectList(List hMCProjectListModel) { + _hMCProjectListModel = hMCProjectListModel; + notifyListeners(); + } + setPrivilege({privilegeList, bool isLoginChild = false}) { List privilege = []; @@ -140,10 +153,7 @@ class ProjectViewModel extends BaseViewModel { notifyListeners(); } - setVidaPlusProjectList(List vidaPlusProjectListModelInput) { - _vidaPlusProjectListModel = vidaPlusProjectListModelInput; - notifyListeners(); - } + bool havePrivilege(int id) { bool isHavePrivilege = false; @@ -173,7 +183,7 @@ class ProjectViewModel extends BaseViewModel { searchvalue = data; notifyListeners(); } - + void setLatitudeLongitude(double lat, double long) { _latitude = lat; _longitude = long; diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index e7b89b42..573a8c24 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -1,6 +1,5 @@ import 'dart:io'; -import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -23,7 +22,6 @@ import 'package:diplomaticquarterapp/widgets/dragable_sheet.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class AnicllaryOrdersDetails extends StatefulWidget { final dynamic appoNo; @@ -134,9 +132,13 @@ class _AnicllaryOrdersState extends State with SingleTic SizedBox(height: 12), DefaultButton( TranslationBase.of(context).payNow.toUpperCase(), - selectedProcList.length > 0 && getTotalValue() != "0.00" + selectedProcList!.length > 0 ? () { - makePayment(model); + if (getTotalValue() != "0.00") { + makePayment(model); + } else { + autoGenerateInvoice(); + } } : null, color: CustomColors.green, @@ -207,7 +209,7 @@ class _AnicllaryOrdersState extends State with SingleTic ), mWidth(3), Text( - projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!, + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, style: TextStyle( fontWeight: FontWeight.w600, fontSize: 12, @@ -499,7 +501,7 @@ class _AnicllaryOrdersState extends State with SingleTic openPayment(selectedPaymentMethod, projectViewModel.user!, double.parse(getTotalValue()), AppoitmentAllHistoryResultList(), model, selectedInstallmentPlan); }, patientShare: double.parse(getTotalValue()), - isFromAdvancePayment: !projectViewModel.havePrivilege(94), + isFromAdvancePayment: !projectViewModel!.havePrivilege(94), )); } @@ -637,8 +639,15 @@ class _AnicllaryOrdersState extends State with SingleTic // selectedProcList.forEach((element) { // ancillaryOrdersProcedureList.add(new AncillaryOrdersProcedureList(procedureID: num.parse(element.procedureID), procedureDescription: element.procedureName)); // }); - service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user!.patientType, - projectViewModel.user!.firstName! + " " + projectViewModel.user!.lastName!, projectViewModel.user!.patientID!, localContext, + service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType, + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext, + isAncillaryOrder: true) + // List ancillaryOrdersProcedureList = []; + // selectedProcList.forEach((element) { + // ancillaryOrdersProcedureList.add(new AncillaryOrdersProcedureList(procedureID: num.parse(element.procedureID), procedureDescription: element.procedureName)); + // }); + service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType, + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext, isAncillaryOrder: true) .then((res) { addAdvancedNumberRequest( @@ -677,6 +686,8 @@ class _AnicllaryOrdersState extends State with SingleTic }); }); + GifLoaderDialogUtils.showMyDialog(localContext); + DoctorsListService service = new DoctorsListService(); service.autoGenerateAncillaryOrdersInvoice(widget.orderNo, widget.projectID, widget.appoNo, selectedProcListAPI, localContext).then((res) { GifLoaderDialogUtils.hideDialog(localContext); @@ -714,7 +725,7 @@ class _AnicllaryOrdersState extends State with SingleTic addToSelectedProcedures(AnciallryOrdersViewModel model) { if (model.ancillaryListsDetails.isNotEmpty) { selectedProcList.clear(); - model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList!.forEach((element) { + model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList.forEach((element) { if (!isProcedureDisabled(element)) { selectedProcList.add(element); } diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 6046d1f4..29408ad1 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -335,11 +335,11 @@ class _BookConfirmState extends State { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); Future.delayed(new Duration(milliseconds: 500), () { + // checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context); getToDoCount(); getPatientShare(context, res['AppointmentNo'], docObject.clinicID!, docObject.projectID!, docObject); }); - widget.service.logDoctorFreeSlots(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, decodedLogs, res['AppointmentNo'], context).then((res) { if (res['MessageStatus'] == 1) { print("Logs Saved"); diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 770c8454..322945ed 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -1,5 +1,6 @@ import 'dart:typed_data'; +import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -16,7 +17,9 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart'; @@ -55,7 +58,7 @@ class _QRCodeState extends State { }); WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - startNFCScan(); + // startNFCScan(); }); super.initState(); @@ -75,9 +78,18 @@ class _QRCodeState extends State { }); } + startQRCodeScan() async { + String onlineCheckInQRCode = (await BarcodeScanner.scan())?.rawContent; + if (onlineCheckInQRCode != "") { + sendNfcCheckInRequest(onlineCheckInQRCode); + locator().todoList.to_do_list_nfc(widget.appointment); + } else {} + } + @override Widget build(BuildContext context) { _context = context; + List checkInOptionsList = getCheckInOptionsList(context); return AppScaffold( appBarTitle: TranslationBase.of(context).onlineCheckIn, isShowAppBar: true, @@ -149,42 +161,95 @@ class _QRCodeState extends State { ), ], ), - ], - ), - ), - bottomSheet: Container( - color: CustomColors.appBackgroudGreyColor, - padding: EdgeInsets.all(21), - // height: 45.0, - child: Row( - children: [ - Expanded( - flex: 1, - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - height: 45.0, - child: CustomTextButton( - backgroundColor: CustomColors.green, - elevation: 0, - onPressed: () { - startNFCScan(); - }, - child: Text(TranslationBase.of(context).scanNFC, - style: TextStyle( - fontSize: 18.0, - color: Colors.white, - )), - ), + mHeight(21), + Padding( + padding: EdgeInsets.only(left: 21, right: 21), + child: GridView.builder( + shrinkWrap: true, + primary: false, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), + padding: EdgeInsets.zero, + itemCount: checkInOptionsList.length, + itemBuilder: (BuildContext context, int index) { + return checkInOptionsList[index]; + }, ), ), ], ), ), + // bottomSheet: Container( + // color: CustomColors.appBackgroudGreyColor, + // padding: EdgeInsets.all(21), + // // height: 45.0, + // child: Row( + // children: [ + // Expanded( + // flex: 1, + // child: ButtonTheme( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10.0), + // ), + // height: 45.0, + // child: CustomTextButton( + // backgroundColor: CustomColors.green, + // elevation: 0, + // onPressed: () { + // startNFCScan(); + // }, + // child: Text(TranslationBase.of(context).scanNFC, + // style: TextStyle( + // fontSize: 18.0, + // color: Colors.white, + // )), + // ), + // ), + // ), + // ], + // ), + // ), ); } + List getCheckInOptionsList(BuildContext context) { + List optionsList = []; + + optionsList.add( + InkWell( + onTap: () { + startNFCScan(); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).scanNFC, + imagePath: 'contactless.svg', + subTitle: "", + isEnable: true, + width: 80.0, + height: 80.0, + ), + ), + ); + + optionsList.add( + InkWell( + onTap: () { + startQRCodeScan(); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).pharmaLiveCareScanQR, + imagePath: 'qr_code.svg', + subTitle: "", + isEnable: true, + width: 80.0, + height: 80.0, + ), + ), + ); + + return optionsList; + } + sendEmail() async { DoctorsListService service = new DoctorsListService(); diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index db19e4c5..7fcbe52a 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -265,7 +265,7 @@ class _CovidPaymentSummaryState extends State { MyInAppBrowser.errorURLS.forEach((element) { if (url.contains(element)) { - if (widget.browser!.isOpened()) widget.browser!.close(); + if (widget.browser.isOpened()) widget.browser.close(); MyInAppBrowser.isPaymentDone = false; return; } @@ -276,7 +276,7 @@ class _CovidPaymentSummaryState extends State { print("onBrowserExit Called!!!!"); try { if (widget.selectedPaymentMethod == "TAMARA") { - checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), appo); + checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo); // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo); // } else { diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 9d4b9428..4d780b17 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -371,6 +371,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid }), isInOutPatient: _appointmentResult.isInOutPatient, name: _appointmentResult.doctorTitle! + " " + _appointmentResult.doctorNameObj!, + projectID: _appointmentResult.projectID, // billNo: _appointmentResult.invoiceNo, profileUrl: _appointmentResult.doctorImageURL, subName: _isSortByClinic ? _appointmentResult.projectName : _appointmentResult.clinicName, diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 2d1bd150..678d9bec 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -29,6 +29,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.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/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -74,6 +75,11 @@ class _AppointmentActionsState extends State { itemBuilder: (context, index) { // bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule"); bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || (widget.appo.isLiveCareAppointment! && appoButtonsList[index].caller == "askDoc")); + bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || + (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || + (Utils.isVidaPlusProject(projectViewModel, widget.appo.projectID) && + widget.appo.clinicID == 10 && + (appoButtonsList[index].caller == "prescriptions" || appoButtonsList[index].caller == "radiology" || appoButtonsList[index].caller == "labResult"))); return InkWell( onTap: shouldEnable ? null @@ -111,7 +117,7 @@ class _AppointmentActionsState extends State { GAnalytics.APPOINTMENT_DETAIL_FLOW_TYPE = 'my appointment'; showReminderDialog( context, - new DateFormat("dd MMM yyyy hh:mm") + DateFormat("dd MMM yyyy hh:mm") .parse(DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate!), widget.projectViewModel!.isArabic) + " " + widget.appo.startTime!), //DateUtil.convertStringToDate(widget.appo.appointmentDate), widget.appo.doctorNameObj!, @@ -152,12 +158,12 @@ class _AppointmentActionsState extends State { locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'survey'); break; case "Insurance": - navigateToInsuranceApprovals(widget.appo.appointmentNo!); + navigateToInsuranceApprovals(widget.appo.appointmentNo); locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'insurance'); break; case "VitalSigns": - navigateToVitalSigns(widget.appo.appointmentNo!, widget.appo.projectID!); + navigateToVitalSigns(widget.appo.appointmentNo, widget.appo.projectID); locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'vital sign'); break; @@ -583,12 +589,26 @@ class _AppointmentActionsState extends State { navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { if (widget.projectViewModel!.isLogin) { if (model.count != 0) { - Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); + Navigator.push( + context, + FadePage( + page: ToDo( + isShowAppBar: true, + isFromMyAppointments: true, + appointment: widget.appo, + ))); } else { AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); } } else { - Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); + Navigator.push( + context, + FadePage( + page: ToDo( + isShowAppBar: true, + isFromMyAppointments: true, + appointment: widget.appo, + ))); } } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index f5de01e6..821e24cb 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -55,8 +55,10 @@ class ToDo extends StatefulWidget { bool isShowAppBar = true; Function()? onBackClick; + bool isFromMyAppointments; + AppoitmentAllHistoryResultList appointment; - ToDo({required this.isShowAppBar, this.onBackClick}); + ToDo({@required this.isShowAppBar, this.onBackClick, this.isFromMyAppointments = false, this.appointment}); @override _ToDoState createState() => _ToDoState(); @@ -802,7 +804,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { List doctorByHospital = _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList(); if (doctorByHospital.length != 0) { - _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element); + _patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); } else { _patientDoctorAppointmentListHospital .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); @@ -854,6 +856,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { }); } dataLoaded = true; + if(widget.isFromMyAppointments) { + getPatientShare(context, widget.appointment); + } }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index d6701285..38c34fb7 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -407,8 +407,8 @@ class _SendFeedbackPageState extends State { color: Color(0xff575757), letterSpacing: -0.56, ), - suffixIconConstraints: BoxConstraints(minWidth: 50), - suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), + // suffixIconConstraints: BoxConstraints(minWidth: 50), + // suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), contentPadding: EdgeInsets.zero, border: InputBorder.none, focusedBorder: InputBorder.none, @@ -493,10 +493,10 @@ class _SendFeedbackPageState extends State { if (res['MessageStatus'] == 1) { if (res['AppoimentAllHistoryResultList'].length != 0) { res['AppoimentAllHistoryResultList'].forEach((v) { - appoList.add(AppoitmentAllHistoryResultList.fromJson(v)); + appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); }); setState(() { - appointHistory = AppoitmentAllHistoryResultList(); + appointHistory = null; isShowListAppointHistory = true; }); } else {} @@ -519,25 +519,25 @@ class _SendFeedbackPageState extends State { return; } - openSpeechReco() async { - new RoboSearch(context: context).showAlertDialog(context); - _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode; - // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); - // if (available) { - // speech.listen( - // onResult: resultListener, - // listenMode: stt.ListenMode.confirmation, - // localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', - // ); - // } else { - // print("The user has denied the use of speech recognition."); - // } - } - + // openSpeechReco() async { + // new RoboSearch(context: context).showAlertDialog(context); + // _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode; + // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); + // if (available) { + // speech.listen( + // onResult: resultListener, + // listenMode: stt.ListenMode.confirmation, + // localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', + // ); + // } else { + // print("The user has denied the use of speech recognition."); + // } + // } + // // void errorListener(SpeechRecognitionError error) { // event.setValue({"searchText": 'null'}); - // SpeechToText.closeAlertDialog(context); - // print(error); + // //SpeechToText.closeAlertDialog(context); + // print(error); // } void statusListener(String status) { @@ -563,9 +563,9 @@ class _SendFeedbackPageState extends State { } } - Future initSpeechState() async { - // bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); - // print(hasSpeech); - // if (!mounted) return; - } + // Future initSpeechState() async { + // bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + // print(hasSpeech); + // if (!mounted) return; + // } } diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index a83097c1..f795ff84 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -1,4 +1,3 @@ -import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; @@ -277,7 +276,6 @@ class _Login extends State { if (value['IsAuthenticated']) { this.checkActivationCode(); } - } // } else { // ConfirmDialog activationDialog = new ConfirmDialog( // context: context, diff --git a/lib/pages/medical/allergies_page.dart b/lib/pages/medical/allergies_page.dart index f101195c..599d91b0 100644 --- a/lib/pages/medical/allergies_page.dart +++ b/lib/pages/medical/allergies_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/AllergiesViewModel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -22,7 +23,7 @@ class AllergiesPage extends StatelessWidget { baseViewModel: model, description: TranslationBase.of(context).infoAllergies, imagesInfo: imagesInfo, - body: ListView.builder( + body: model.allergies.isNotEmpty ? ListView.builder( itemCount: model.allergies.length, itemBuilder: (context, index) => Container( margin: EdgeInsets.all(15), @@ -54,7 +55,7 @@ class AllergiesPage extends StatelessWidget { ], ), ), - ), + ) : getNoDataWidget(context), ), ); } diff --git a/lib/pages/medical/ask_doctor/doctor_response.dart b/lib/pages/medical/ask_doctor/doctor_response.dart index 0f7c1a09..0476c46c 100644 --- a/lib/pages/medical/ask_doctor/doctor_response.dart +++ b/lib/pages/medical/ask_doctor/doctor_response.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_mod import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 24090646..c03652f8 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -83,34 +83,34 @@ class _LaboratoryResultPageState extends State { ], ), ), - // bottomSheet: Container( - // color: Colors.white, - // height: MediaQuery.of(context).size.height * 0.081, - // width: double.infinity, - // padding: EdgeInsets.all(12.0), - // child: Column( - // children: [ - // Container( - // width: MediaQuery.of(context).size.width * 0.9, - // child: DefaultButton( - // TranslationBase.of(context).downloadReport, - // () async { - // GifLoaderDialogUtils.showMyDialog(context); - // await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); - // GifLoaderDialogUtils.hideDialog(context); - // try { - // String path = await _createFileFromString(model.labReportPDF, "pdf"); - // OpenFilex.open(path); - // } catch (ex) { - // AppToast.showErrorToast(message: "Cannot open file."); - // } - // }, - // textColor: Colors.white, - // ), - // ), - // ], - // ), - // ), + bottomSheet: Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.081, + width: double.infinity, + padding: EdgeInsets.all(12.0), + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: DefaultButton( + TranslationBase.of(context).downloadReport, + () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); + GifLoaderDialogUtils.hideDialog(context); + try { + String path = await _createFileFromString(model.labReportPDF, "pdf"); + OpenFilex.open(path); + } catch (ex) { + AppToast.showErrorToast(message: "Cannot open file."); + } + }, + textColor: Colors.white, + ), + ), + ], + ), + ), ), ); } diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 93f3bd05..58d1adfc 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -10,6 +10,7 @@ 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/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; @@ -49,7 +50,7 @@ class _PatientSickLeavePageState extends State { backgroundColor: Color(0xffF7F7F7), imagesInfo: imagesInfo, baseViewModel: model, - body: ListView.separated( + body: model.sickLeaveList.isNotEmpty ? ListView.separated( physics: BouncingScrollPhysics(), itemCount: model.sickLeaveList.length, padding: EdgeInsets.all(21), @@ -69,7 +70,7 @@ class _PatientSickLeavePageState extends State { showConfirmMessage(model, index); }, ), - ), + ) : getNoDataWidget(context), ), ); } diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 782590a8..3b4e643b 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -18,7 +18,7 @@ import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class RadiologyDetailsPage extends StatelessWidget { - final FinalRadiology? finalRadiology; + final FinalRadiology? finalRadiology; bool? isRadiologyVidaPlus; RadiologyDetailsPage({Key? key, this.finalRadiology, this.isRadiologyVidaPlus}); @@ -32,6 +32,7 @@ class RadiologyDetailsPage extends StatelessWidget { lineItem: finalRadiology!.invoiceLineItemNo!, invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!) ? finalRadiology!.invoiceNo_VP : finalRadiology!.invoiceNo, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!)), + builder: (_, model, widget) => AppScaffold( appBarTitle: TranslationBase.of(context).report, isShowAppBar: true, diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 09e443e5..845c3e90 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -71,7 +71,7 @@ class RadiologyHomePage extends StatelessWidget { physics: NeverScrollableScrollPhysics(), padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), itemBuilder: (context, _index) { - FinalRadiology radiology = model.finalRadiologyList[index].finalRadiologyList![_index]; + FinalRadiology radiology = model.finalRadiologyList[index].finalRadiologyList[_index]; bool _isSortByClinic = model.filterType == FilterType.Clinic; return DoctorCard( onTap: () => Navigator.push( diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index 291b29da..dee29701 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -12,7 +12,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class PaymentService extends StatelessWidget { ToDoCountProviderModel? model; @@ -96,12 +95,12 @@ class PaymentService extends StatelessWidget { left: 8, top: 4, child: badge_import.Badge( - // toAnimate: false, - // elevation: 0, + toAnimate: false, + elevation: 0, position: badge_import.BadgePosition.topEnd(), - // shape: badge_import.BadgeShape.circle, - // badgeColor: secondaryColor.withOpacity(1.0), - // borderRadius: BorderRadius.circular(8), + shape: badge_import.BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), badgeContent: Container( padding: EdgeInsets.all(2.0), child: Text(model!.count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), @@ -112,12 +111,12 @@ class PaymentService extends StatelessWidget { right: 8, top: 4, child: badge_import.Badge( - // toAnimate: false, - // elevation: 0, + toAnimate: false, + elevation: 0, position: badge_import.BadgePosition.topEnd(), - // shape: badge_import.BadgeShape.circle, - // badgeColor: secondaryColor.withOpacity(1.0), - // borderRadius: BorderRadius.circular(8), + shape: badge_import.BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), badgeContent: Container( padding: EdgeInsets.all(2.0), child: Text(model!.count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 522486f3..ae8e228f 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1841,4 +1841,6 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + + } diff --git a/lib/splashPage.dart b/lib/splashPage.dart index d75e57e2..e72fc71f 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -57,6 +57,7 @@ class _SplashScreenState extends State { ProjectViewModel projectProvider = Provider.of(context, listen: false); projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); projectProvider.setVidaPlusProjectList(_privilegeService.vidaPlusProjectListModel); + projectProvider.setHMCProjectList(_privilegeService.hMCProjectListModel); AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en"); var themeNotifier = Provider.of(context, listen: false); diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 0e27ff33..d80a422a 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -329,7 +329,7 @@ class Utils { .radiologySubtitle, isEnable: projectViewModel.havePrivilege(7), ), - )); + ); medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, @@ -913,7 +913,7 @@ class Utils { ); } - static Widget tableColumnValue(String text, {bool isLast = false, bool isCapitable = true, ProjectViewModel? mProjectViewModel}) { + static Widget tableColumnValue(String text, {bool isLast = false, bool isCapitable = true, ProjectViewModel mProjectViewModel}) { ProjectViewModel projectViewModel = mProjectViewModel ?? Provider.of(AppGlobal.context); return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -921,16 +921,10 @@ class Utils { children: [ SizedBox(height: 12), Text( - isCapitable && !projectViewModel.isArabic ? text - .toLowerCase() - .capitalizeFirstofEach : text, + isCapitable && !projectViewModel.isArabic ? text.toLowerCase().capitalizeFirstofEach : text, maxLines: 2, overflow: TextOverflow.ellipsis, - style: TextStyle(fontSize: 12, - fontWeight: FontWeight.w600, - color: Color(0xff575757), - letterSpacing: -0.4, - height: 16 / 10), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), if (!isLast) @@ -945,10 +939,7 @@ class Utils { static Future isGoogleServicesAvailable() async { GooglePlayServicesAvailability availability = await GoogleApiAvailability.instance.checkGooglePlayServicesAvailability(); - String status = availability - .toString() - .split('.') - .last; + String status = availability.toString().split('.').last; if (status == "success") { return true; } @@ -963,17 +954,10 @@ class Utils { children: [ SizedBox(height: 14), AutoSizeText( - isCapitable ? text - .toLowerCase() - .capitalizeFirstofEach : text, + isCapitable ? text.toLowerCase().capitalizeFirstofEach : text, maxLines: 1, minFontSize: 6, - style: TextStyle(decoration: TextDecoration.underline, - fontSize: 12, - fontWeight: FontWeight.w600, - color: Color(0xffD02127), - letterSpacing: -0.48, - height: 18 / 12), + style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffD02127), letterSpacing: -0.48, height: 18 / 12), ), SizedBox(height: 10), if (!isLast) @@ -990,22 +974,13 @@ class Utils { return crypto.md5.convert(utf8.encode(input)).toString(); } - static bool isVidaPlusProject(ProjectViewModel projectViewModel, int projectID) { - bool isVidaPlus = false; - projectViewModel.vidaPlusProjectList.forEach((element) { - if (element.projectID == projectID) { - isVidaPlus = true; - } - }); - return isVidaPlus; + static String generateSignature() { + } -// static String generateSignature() { -// -// } } -Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), required Widget child}) { +Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) { return Container( decoration: BoxDecoration( boxShadow: [ @@ -1034,7 +1009,7 @@ extension IndexedIterable on Iterable { } } -openAppStore({String? androidPackageName, String? iOSAppID, bool isHuawei = false}) async { +openAppStore({String androidPackageName, String iOSAppID, bool isHuawei = false}) async { if (Platform.isAndroid) { assert(!(androidPackageName == null), "Should have valid value in androidPackageName parameter"); if (isHuawei) { @@ -1048,7 +1023,7 @@ openAppStore({String? androidPackageName, String? iOSAppID, bool isHuawei = fals } } -String labelFrom({required String className}) { +String labelFrom({@required String className}) { RegExp exp = RegExp(r'(?<=[a-z])[A-Z]'); String result = className.replaceAllMapped(exp, (m) { diff --git a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart index 2167ef7e..06a361b6 100644 --- a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart +++ b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart @@ -1,13 +1,16 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'LineChartCurved.dart'; import 'lab_result_chart_and_detials.dart'; @@ -18,10 +21,15 @@ class FlowChartPage extends StatelessWidget { FlowChartPage({this.patientLabOrder, this.filterName}); + ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getPatientLabOrdersResults(patientLabOrder: patientLabOrder!, procedure: filterName!), + onModelReady: (model) => + model.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: filterName, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(patientLabOrder.projectID))), builder: (context, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: filterName!, @@ -72,7 +80,7 @@ class FlowChartPage extends StatelessWidget { ) : Center( child: Container( - padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.32), + padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.32), child: Center( child: getNoDataWidget(context), ), diff --git a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index 2177bda5..5522cd42 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -151,6 +151,7 @@ class _LaboratoryResultWidgetState extends State { ], ), child: Column( + mainAxisSize: MainAxisSize.min, children: [ Row( children: [ @@ -170,6 +171,7 @@ class _LaboratoryResultWidgetState extends State { if (_isShowMore) Container( width: double.infinity, + // height: 450.0, child: Html( data: widget.details ?? TranslationBase.of(context).noDataAvailable, ), diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index b79e878c..a84268d8 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -32,6 +33,7 @@ class DoctorCard extends StatelessWidget { final String vaccineName; final bool isSickLeave; final int sickLeaveStatus; + final int projectID; DoctorCard( {this.name, @@ -51,9 +53,10 @@ class DoctorCard extends StatelessWidget { this.vaccineName = "", this.isParentAppointment = false, this.isSickLeave = false, - this.sickLeaveStatus = 0}); + this.sickLeaveStatus = 0, + this.projectID = 0}); - ProjectViewModel? projectViewModel; + late ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -87,11 +90,14 @@ class DoctorCard extends StatelessWidget { decoration: isShowInOutPatient! ? BoxDecoration( //Colors.red[900] Color(0xff404545) - color: isLiveCareAppointment! - ? Color(0xff2E303A) - : !isInOutPatient! - ? Color(0xffD02127) - : Color(0xffa9a089), + + color: Utils.isHMCProject(projectViewModel, projectID) + ? Color(0xff3FACC8) + : isLiveCareAppointment + ? Color(0xff2E303A) + : !isInOutPatient + ? Color(0xffD02127) + : Color(0xffa9a089), borderRadius: BorderRadius.only( topLeft: projectViewModel!.isArabic ? Radius.circular(0) : Radius.circular(10), bottomLeft: projectViewModel!.isArabic ? Radius.circular(0) : Radius.circular(10),