From 23b7d859114247041e0dc7fa5efea742035b44ff Mon Sep 17 00:00:00 2001 From: devamirsaleemahmad Date: Sun, 5 Nov 2023 12:19:57 +0300 Subject: [PATCH] changes --- .../model/privilege/HMCProjectListModel.dart | 2 +- lib/core/service/medical/labs_service.dart | 18 +- .../viewModels/medical/labs_view_model.dart | 31 +- .../ancillaryOrdersDetails.dart | 38 +- lib/pages/BookAppointment/QRCode.dart | 19 +- .../covid-payment-summary.dart | 4 +- lib/pages/MyAppointments/MyAppointments.dart | 2 +- .../widgets/AppointmentActions.dart | 10 +- lib/pages/ToDoList/ToDo.dart | 8 +- lib/pages/feedback/send_feedback_page.dart | 17 +- .../fragments/home_page_fragment2.dart | 25 +- lib/pages/landing/home_page_2.dart | 2 +- lib/pages/landing/landing_page.dart | 12 +- lib/pages/landing/widgets/slider_view.dart | 12 +- lib/pages/login/login.dart | 13 +- .../medical/ask_doctor/doctor_response.dart | 1 + .../medical/labs/laboratory_result_page.dart | 2 +- .../my_trackers/Weight/WeightYeaPage.dart | 6 +- .../blood_suger/blood_sugar_weekly_page.dart | 8 +- .../radiology/radiology_home_page.dart | 2 +- lib/pages/paymentService/payment_service.dart | 27 +- .../family_files/family_files_provider.dart | 2 +- lib/uitl/utils.dart | 556 +++++++----------- .../medical/LabResult/FlowChartPage.dart | 5 +- .../data_display/medical/doctor_card.dart | 4 +- lib/widgets/others/app_scaffold_widget.dart | 10 +- lib/widgets/others/arrow_back.dart | 17 +- pubspec.yaml | 72 +-- 28 files changed, 396 insertions(+), 529 deletions(-) diff --git a/lib/core/model/privilege/HMCProjectListModel.dart b/lib/core/model/privilege/HMCProjectListModel.dart index 6b69c1c5..6af7bfbb 100644 --- a/lib/core/model/privilege/HMCProjectListModel.dart +++ b/lib/core/model/privilege/HMCProjectListModel.dart @@ -1,5 +1,5 @@ class HMCProjectListModel { - int projectID; + int? projectID; HMCProjectListModel({this.projectID}); diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 8754e124..9830d84e 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -9,7 +9,7 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; class LabsService extends BaseService { - List patientLabOrdersList =[]; + List patientLabOrdersList = []; String labReportPDF = ""; @@ -30,9 +30,9 @@ class LabsService extends BaseService { RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult(); - List patientLabSpecialResult =[]; - List labResultList =[]; - List labOrdersResultsList =[]; + List patientLabSpecialResult = []; + List labResultList = []; + List labOrdersResultsList = []; Future getLaboratoryResult({String? projectID, int? clinicID, String? invoiceNo, String? orderNo, String? setupID, bool? isVidaPlus}) async { hasError = false; @@ -177,14 +177,14 @@ class LabsService extends BaseService { return Future.value(localRes); } - Future getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, String? procedure}) async { + Future getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, String? procedure, bool isVidaPlus = false}) async { hasError = false; Map body = Map(); - body['InvoiceNo'] = "0"; - body['InvoiceNo_VP'] = patientLabOrder!.invoiceNo; - body['OrderNo'] = patientLabOrder.orderNo; + body['InvoiceNo_VP'] = isVidaPlus ? patientLabOrder!.invoiceNo : "0"; + body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder!.invoiceNo; + body['OrderNo'] = patientLabOrder!.orderNo; body['isDentalAllowedBackend'] = false; - body['SetupID'] = patientLabOrder.setupID; + body['SetupID'] = patientLabOrder!.setupID; body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID; body['Procedure'] = procedure; diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 4ca210f1..993ef7de 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -22,8 +22,8 @@ class LabsViewModel extends BaseViewModel { String get labReportPDF => _labsService.labReportPDF; - List _patientLabOrdersListClinic =[]; - List _patientLabOrdersListHospital =[]; + List _patientLabOrdersListClinic = []; + List _patientLabOrdersListHospital = []; List get patientLabOrdersList => filterType == FilterType.Clinic ? _patientLabOrdersListClinic : _patientLabOrdersListHospital; @@ -48,7 +48,7 @@ class LabsViewModel extends BaseViewModel { List patientLabOrdersHospital = _patientLabOrdersListHospital .where( (elementClinic) => elementClinic.filterName == element.projectName, - ) + ) .toList(); if (patientLabOrdersHospital.length != 0) { @@ -72,17 +72,11 @@ class LabsViewModel extends BaseViewModel { List get labResultList => _labsService.labResultList; - List labResultLists =[]; + 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, - projectID: projectID, - clinicID: clinicID, - setupID: setupID, - isVidaPlus: isVidaPlus); + await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, setupID: setupID, isVidaPlus: isVidaPlus); if (_labsService.hasError) { error = _labsService.error!; setState(ViewState.Error); @@ -115,9 +109,13 @@ class LabsViewModel extends BaseViewModel { } } - getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, bool isVidaPlus}) async { + getPatientLabOrdersResults({PatientLabOrders? patientLabOrder, String? procedure, bool? isVidaPlus}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, isVidaPlus: isVidaPlus); + await _labsService.getPatientLabOrdersResults( + patientLabOrder: patientLabOrder, + procedure: procedure, + isVidaPlus: isVidaPlus!, + ); if (_labsService.hasError) { error = _labsService.error!; setState(ViewState.Error); @@ -136,19 +134,20 @@ 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!; } else { - if (isDownload) {} else { + if (isDownload) { + } else { AppToast.showSuccessToast(message: mes!); } } diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 573a8c24..8858889d 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -22,6 +22,7 @@ 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; @@ -209,7 +210,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, @@ -368,9 +369,28 @@ class _AnicllaryOrdersState extends State with SingleTic ); } + // Widget getAncillaryDetails(AnciallryOrdersViewModel model) { + // Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList!, (obj) => obj.procedureCategoryName); + // return Padding(padding: EdgeInsets.only(top: 0, bottom: 200), child: getHeaderDetails(newMap)); + // } +// Changed By Aamir Widget getAncillaryDetails(AnciallryOrdersViewModel model) { - Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList!, (obj) => obj.procedureCategoryName); - return Padding(padding: EdgeInsets.only(top: 0, bottom: 200), child: getHeaderDetails(newMap)); + Map> newMap = {}; + + // Grouping the list manually by the 'procedureCategoryName' key + model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList!.forEach((obj) { + String key = obj.procedureCategoryName!; + if (newMap.containsKey(key)) { + newMap[key]!.add(obj); + } else { + newMap[key] = [obj]; + } + }); + + return Padding( + padding: EdgeInsets.only(top: 0, bottom: 200), + child: getHeaderDetails(newMap), + ); } Widget getHeaderDetails(newMap) { @@ -639,15 +659,9 @@ 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, - 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, + projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, projectViewModel.user.patientID, localContext, isAncillaryOrder: true) .then((res) { addAdvancedNumberRequest( @@ -725,7 +739,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/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 322945ed..62764185 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -31,11 +31,11 @@ import 'package:flutter_svg/flutter_svg.dart'; class QRCode extends StatefulWidget { late PatientShareResponse? patientShareResponse; late AppoitmentAllHistoryResultList? appointment; - late String? appoQR; + late String? appoQR; AuthenticatedUser? authUser; AppSharedPreferences sharedPref = AppSharedPreferences(); - QRCode({required this.patientShareResponse, required this.appoQR, this.appointment}); + QRCode({required this.patientShareResponse, required this.appoQR, this.appointment}); @override _QRCodeState createState() => _QRCodeState(); @@ -79,10 +79,10 @@ class _QRCodeState extends State { } startQRCodeScan() async { - String onlineCheckInQRCode = (await BarcodeScanner.scan())?.rawContent; + String onlineCheckInQRCode = (await BarcodeScanner.scan().then((value) => value.rawContent)); if (onlineCheckInQRCode != "") { sendNfcCheckInRequest(onlineCheckInQRCode); - locator().todoList.to_do_list_nfc(widget.appointment); + locator().todoList.to_do_list_nfc(widget.appointment!); } else {} } @@ -268,9 +268,16 @@ class _QRCodeState extends State { okFunction: () { GifLoaderDialogUtils.showMyDialog(context); service - .sendAppointmentQREmail(widget.authUser!.emailAddress!, widget.patientShareResponse!.appointmentDate!, widget.patientShareResponse!.appointmentNo!.toString(), + .sendAppointmentQREmail( + widget.authUser!.emailAddress!, + widget.patientShareResponse!.appointmentDate!, + widget.patientShareResponse!.appointmentNo!.toString(), //Changed By Aamir - widget.patientShareResponse!.doctorNameObj, widget.patientShareResponse!.projectName, widget.appoQR!, getDoctorSpeciality(widget.patientShareResponse!.doctorSpeciality as List), context) + widget.patientShareResponse!.doctorNameObj, + widget.patientShareResponse!.projectName, + widget.appoQR!, + getDoctorSpeciality(widget.patientShareResponse!.doctorSpeciality as List), + context) .then((res) { GifLoaderDialogUtils.hideDialog(context); ConfirmDialog.closeAlertDialog(context); diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index 7fcbe52a..a88c56da 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 4d780b17..144d732c 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -371,7 +371,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid }), isInOutPatient: _appointmentResult.isInOutPatient, name: _appointmentResult.doctorTitle! + " " + _appointmentResult.doctorNameObj!, - projectID: _appointmentResult.projectID, + 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 678d9bec..769b6761 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -73,11 +73,9 @@ class _AppointmentActionsState extends State { padding: EdgeInsets.all(21), shrinkWrap: true, 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.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( @@ -158,12 +156,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; diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 821e24cb..edafef9b 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -56,9 +56,9 @@ class ToDo extends StatefulWidget { bool isShowAppBar = true; Function()? onBackClick; bool isFromMyAppointments; - AppoitmentAllHistoryResultList appointment; + AppoitmentAllHistoryResultList? appointment; - ToDo({@required this.isShowAppBar, this.onBackClick, this.isFromMyAppointments = false, this.appointment}); + ToDo({required this.isShowAppBar, this.onBackClick, this.isFromMyAppointments = false, this.appointment}); @override _ToDoState createState() => _ToDoState(); @@ -804,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)); @@ -857,7 +857,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } dataLoaded = true; if(widget.isFromMyAppointments) { - getPatientShare(context, widget.appointment); + getPatientShare(context, widget.appointment!); } }); } else { diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 38c34fb7..d6c5039c 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -496,7 +496,7 @@ class _SendFeedbackPageState extends State { appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); }); setState(() { - appointHistory = null; + appointHistory = AppoitmentAllHistoryResultList(); isShowListAppointHistory = true; }); } else {} @@ -519,6 +519,21 @@ 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; diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 4528897c..f42119cf 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -25,7 +25,7 @@ import 'package:provider/provider.dart'; class HomePageFragment2 extends StatefulWidget { DashboardViewModel model; - Function? onPharmacyClick, onLoginClick, onMedicalFileClick; + VoidCallback? onPharmacyClick, onLoginClick, onMedicalFileClick; HomePageFragment2(this.model, {this.onLoginClick, this.onPharmacyClick, this.onMedicalFileClick}); @@ -51,15 +51,15 @@ class _HomePageFragment2State extends State { initialiseHmgServices(bool isLogin) { hmgServices.clear(); - hmgServices.add(new HmgServices(0, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); - hmgServices.add(new HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); - hmgServices.add(new HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); - hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); - hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); - hmgServices.add(new HmgServices(5, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); - hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); - hmgServices.add(new HmgServices(7, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); - hmgServices.add(new HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); + hmgServices.add(HmgServices(0, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); + hmgServices.add(HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); + hmgServices.add(HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); + hmgServices.add(HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); + hmgServices.add(HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); + hmgServices.add(HmgServices(5, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); + hmgServices.add(HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); + hmgServices.add(HmgServices(7, TranslationBase.of(context).covidTest, TranslationBase.of(context).driveThru, "assets/images/new/CoronaIcon.svg", isLogin)); + hmgServices.add(HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); } @override @@ -85,7 +85,7 @@ class _HomePageFragment2State extends State { child: LoggedSliderView( projectViewModel, new SliderData( - TranslationBase.of(context).fileno + ": " + (projectViewModel.user.patientID.toString()?? ""), + TranslationBase.of(context).fileno + ": " + (projectViewModel.user.patientID.toString() ?? ""), projectViewModel.user.firstName! + ' ' + (projectViewModel.user.lastName ?? ""), "", bannerColor[0].darkColor, @@ -102,7 +102,8 @@ class _HomePageFragment2State extends State { margin: EdgeInsets.only(left: 20, right: 20, top: 8, bottom: 6), child: SliderView( onLoginClick: () { - widget.onLoginClick; + print("-----------"); + widget.onLoginClick!(); projectViewModel.analytics.loginRegistration.login_register_initiate(); }, ), diff --git a/lib/pages/landing/home_page_2.dart b/lib/pages/landing/home_page_2.dart index ae8183aa..fcff1f30 100644 --- a/lib/pages/landing/home_page_2.dart +++ b/lib/pages/landing/home_page_2.dart @@ -17,7 +17,7 @@ import 'landing_page_pharmcy.dart'; class HomePage2 extends StatefulWidget { final Function? goToMyProfile; - Function? onLoginClick, onMedicalFileClick; + VoidCallback? onLoginClick, onMedicalFileClick; HomePage2({Key? key, this.goToMyProfile, this.onLoginClick, this.onMedicalFileClick}); diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 58344c5e..d4208b5a 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -497,12 +497,11 @@ class _LandingPageState extends State with WidgetsBindingObserver { setState(() { currentTab = 0; }); - pageController.jumpToPage(0); }, ), projectViewModel.isLogin && model.notificationsCount != null && !projectViewModel.isLoginChild - ? new Positioned( + ? Positioned( right: projectViewModel.isArabic ? 35 : 0, top: 5, child: new Container( @@ -515,9 +514,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { minWidth: 20, minHeight: 20, ), - child: new Text( + child: Text( model.notificationsCount.toString(), - style: new TextStyle( + style: TextStyle( color: Colors.white, fontSize: projectViewModel.isArabic ? 8 : 9, ), @@ -566,6 +565,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { changeCurrentTab(1); }, onLoginClick: () { + print("here i am"); login(); }, onMedicalFileClick: () { @@ -645,7 +645,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { authService.getDashboard().then((value) => { setState(() { if (value != null) { - notificationCount = value['List_PatientDashboard'].isNotEmpty?? value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + notificationCount = value['List_PatientDashboard'].isNotEmpty ?? value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 + ? '99+' + : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); model.setState(model.count, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); FlutterAppIconBadge.updateBadge(int.parse(notificationCount)); diff --git a/lib/pages/landing/widgets/slider_view.dart b/lib/pages/landing/widgets/slider_view.dart index 93058b0e..286706aa 100644 --- a/lib/pages/landing/widgets/slider_view.dart +++ b/lib/pages/landing/widgets/slider_view.dart @@ -8,11 +8,16 @@ import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -class SliderView extends StatelessWidget { - Function onLoginClick; +class SliderView extends StatefulWidget { + VoidCallback onLoginClick; SliderView({required this.onLoginClick}); + @override + State createState() => _SliderViewState(); +} + +class _SliderViewState extends State { late ProjectViewModel projectViewModel; @override @@ -96,7 +101,8 @@ class SliderView extends StatelessWidget { backgroundColor: Color(0xFFFBF2E31), elevation: 0, onPressed: () { - onLoginClick(); + + widget.onLoginClick(); }, child: Center( child: AutoSizeText( diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index f795ff84..21812f33 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -138,8 +138,8 @@ class _Login extends State { DefaultButton( TranslationBase.of(context).login, () { - // if (!isButtonDisabled) - this.startLogin(); + if (!isButtonDisabled) + this.startLogin(); }, disabledColor: Color(0xff575757), ), @@ -231,9 +231,9 @@ class _Login extends State { } startLogin() { - //if (isButtonDisabled == false) { - checkUserAuthentication(); - // } + if (isButtonDisabled == false) { + checkUserAuthentication(); + } } void validateForm() { @@ -276,7 +276,8 @@ class _Login extends State { if (value['IsAuthenticated']) { this.checkActivationCode(); } - // } else { + } + // else { // ConfirmDialog activationDialog = new ConfirmDialog( // context: context, // confirmMessage: TranslationBase.of(context).accountDeactivatedMsg, diff --git a/lib/pages/medical/ask_doctor/doctor_response.dart b/lib/pages/medical/ask_doctor/doctor_response.dart index 0476c46c..0f7c1a09 100644 --- a/lib/pages/medical/ask_doctor/doctor_response.dart +++ b/lib/pages/medical/ask_doctor/doctor_response.dart @@ -2,6 +2,7 @@ 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 c03652f8..0656424d 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -96,7 +96,7 @@ class _LaboratoryResultPageState extends State { 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); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, int.parse(widget.patientLabOrders!.projectID!)), isDownload: true); GifLoaderDialogUtils.hideDialog(context); try { String path = await _createFileFromString(model.labReportPDF, "pdf"); diff --git a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart index 9ba4f470..a79eb958 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart @@ -103,9 +103,9 @@ class WeightYearPage extends StatelessWidget { TableRow( children: [ Utils.tableColumnValue('${DateUtil.getDayMonthYearDateFormatted(diabtec.weightDate)} ', - isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false, mProjectViewModel: projectViewModel), + isCapitable: false, mProjectViewModel: projectViewModel!), + Utils.tableColumnValue('${diabtec.weightDate.hour}:${diabtec.weightDate.minute}', isCapitable: false, mProjectViewModel: projectViewModel!), + Utils.tableColumnValue('${diabtec.weightMeasured}', isCapitable: false, mProjectViewModel: projectViewModel!), ], ), ); diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart index 08e2a78e..2b74395d 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart @@ -95,10 +95,10 @@ class BloodSugarWeeklyPage extends StatelessWidget { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(diabtec.dateChart!), isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(diabtec.dateChart!.hour.toString() + ':' + diabtec.dateChart!.minute.toString(), isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(diabtec.measuredDesc!, isCapitable: false, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(DateUtil.getDayMonthYearDateFormatted(diabtec.dateChart!), isCapitable: false, mProjectViewModel: projectViewModel!), + Utils.tableColumnValue(diabtec.dateChart!.hour.toString() + ':' + diabtec.dateChart!.minute.toString(), isCapitable: false, mProjectViewModel: projectViewModel!), + Utils.tableColumnValue(diabtec.measuredDesc!, isCapitable: false, mProjectViewModel: projectViewModel!), + Utils.tableColumnValue(diabtec.resultValue.toString(), isCapitable: false, mProjectViewModel: projectViewModel!), Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ SizedBox(height: 12), Container( diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 845c3e90..09e443e5 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 dee29701..bef8c3c2 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -12,6 +12,7 @@ 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; @@ -55,7 +56,7 @@ class PaymentService extends StatelessWidget { } List getPaymentServiceList(BuildContext context) { - List medical =[]; + List medical = []; medical.add( InkWell( @@ -95,12 +96,13 @@ class PaymentService extends StatelessWidget { left: 8, top: 4, child: badge_import.Badge( - toAnimate: false, - elevation: 0, + badgeStyle: badge_import.BadgeStyle( + shape: badge_import.BadgeShape.circle, + elevation: 0, + badgeColor: secondaryColor!.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + ), position: badge_import.BadgePosition.topEnd(), - 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)), @@ -111,12 +113,13 @@ class PaymentService extends StatelessWidget { right: 8, top: 4, child: badge_import.Badge( - toAnimate: false, - elevation: 0, position: badge_import.BadgePosition.topEnd(), - shape: badge_import.BadgeShape.circle, - badgeColor: secondaryColor.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), + badgeStyle: badge_import.BadgeStyle( + shape: badge_import.BadgeShape.circle, + elevation: 0, + 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)), @@ -150,7 +153,7 @@ class PaymentService extends StatelessWidget { navigateToToDoPage(BuildContext context) { if (projectViewModel!.isLogin) { // if (model.count != 0) { - Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); + Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); // } else { // AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); // } diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index eb001bdc..87d030c2 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -34,7 +34,7 @@ class FamilyFilesProvider with ChangeNotifier { bool isLogin = false; bool isLoading = true; dynamic authenticatedUser; - GetAllSharedRecordsByStatusResponse? allSharedRecordsByStatusResponse; + GetAllSharedRecordsByStatusResponse allSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse(); Future getSharedRecordByStatus() async { dynamic localRes; diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index d80a422a..b0b821bf 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -101,14 +101,9 @@ class Utils { static showPermissionConsentDialog(BuildContext context, String message, VoidCallback? onTap) { showDialog( context: context, - builder: (cxt) => - CovidConsentDialog( - okTitle: TranslationBase - .of(context) - .acceptLbl, - title: TranslationBase - .of(context) - .covidConsentHeader, + builder: (cxt) => CovidConsentDialog( + okTitle: TranslationBase.of(context).acceptLbl, + title: TranslationBase.of(context).covidConsentHeader, message: message, onTap: onTap!, )); @@ -161,10 +156,7 @@ class Utils { } static String getAdvancePaymentTransID(int projectID, int fileNumber) { - return projectID.toString() + '-' + fileNumber.toString() + '-' + DateTime - .now() - .millisecondsSinceEpoch - .toString(); + return projectID.toString() + '-' + fileNumber.toString() + '-' + DateTime.now().millisecondsSinceEpoch.toString(); } bool validateIDBox(String value, int type) { @@ -233,86 +225,74 @@ class Utils { onTap: () => projectViewModel!.havePrivilege(5) ? Navigator.push(context!, FadePage(page: MyAppointments())) : null, child: isLogin! ? Stack(children: [ - Container( - width: double.infinity, - height: double.infinity, - child: MedicalProfileItem( - title: TranslationBase - .of(context!) - .myAppointments, + Container( + width: double.infinity, + height: double.infinity, + child: MedicalProfileItem( + title: TranslationBase.of(context!).myAppointments, + imagePath: 'appointment_list.svg', + subTitle: TranslationBase.of(context!).myAppointmentsList, + hasBadge: true, + isEnable: projectViewModel!.havePrivilege(5)), + ), + projectViewModel.isArabic + ? !projectViewModel.user!.isFamily + ? Positioned( + left: 8, + top: 4, + child: badge_import.Badge( + badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), + badgeStyle: badge_import.BadgeStyle( + elevation: 0, + shape: badge_import.BadgeShape.circle, + badgeColor: secondaryColor!.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + ), + position: badge_import.BadgePosition.topEnd(), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + : Container() + : !projectViewModel.user!.isFamily + ? Positioned( + right: 8, + top: 4, + child: badge_import.Badge( + position: badge_import.BadgePosition.topEnd(), + badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), + badgeStyle: badge_import.BadgeStyle( + elevation: 0, + shape: badge_import.BadgeShape.circle, + badgeColor: secondaryColor!.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + ), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + : Container(), + ]) + : MedicalProfileItem( + title: TranslationBase.of(context!).myAppointments, imagePath: 'appointment_list.svg', - subTitle: TranslationBase - .of(context!) - .myAppointmentsList, + subTitle: TranslationBase.of(context!).myAppointmentsList, hasBadge: true, - isEnable: projectViewModel!.havePrivilege(5)), - ), - projectViewModel.isArabic - ? !projectViewModel.user!.isFamily - ? Positioned( - left: 8, - top: 4, - child: badge_import.Badge( - badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), - badgeStyle: badge_import.BadgeStyle( - elevation: 0, - shape: badge_import.BadgeShape.circle, - badgeColor: secondaryColor!.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - ), - position: badge_import.BadgePosition.topEnd(), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + isEnable: projectViewModel!.havePrivilege(5), ), - ), - ) - : Container() - : !projectViewModel.user!.isFamily - ? Positioned( - right: 8, - top: 4, - child: badge_import.Badge( - position: badge_import.BadgePosition.topEnd(), - badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), - badgeStyle: badge_import.BadgeStyle( - elevation: 0, - shape: badge_import.BadgeShape.circle, - badgeColor: secondaryColor!.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - ), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), - ), - ), - ) - : Container(), - ]) - : MedicalProfileItem( - title: TranslationBase - .of(context!) - .myAppointments, - imagePath: 'appointment_list.svg', - subTitle: TranslationBase - .of(context!) - .myAppointmentsList, - hasBadge: true, - isEnable: projectViewModel!.havePrivilege(5), - ), )); if (projectViewModel.havePrivilege(10)) { medical.add(InkWell( onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), child: MedicalProfileItem( - title: TranslationBase - .of(context) - .lab, + title: TranslationBase.of(context).lab, imagePath: 'lab_result.svg', - subTitle: TranslationBase - .of(context) - .labSubtitle, + subTitle: TranslationBase.of(context).labSubtitle, ), )); } @@ -320,47 +300,34 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .radiology, + title: TranslationBase.of(context).radiology, imagePath: 'radiology.svg', - subTitle: TranslationBase - .of(context) - .radiologySubtitle, + subTitle: TranslationBase.of(context).radiologySubtitle, isEnable: projectViewModel.havePrivilege(7), ), - ); + )); medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .medicines, + title: TranslationBase.of(context).medicines, imagePath: 'medicine_prescription.svg', - subTitle: TranslationBase - .of(context) - .medicinesSubtitle, + subTitle: TranslationBase.of(context).medicinesSubtitle, isEnable: projectViewModel.havePrivilege(12), ), )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(25) + onTap: () => projectViewModel.havePrivilege(25) ? Navigator.push( - context, - FadePage(page: VitalSignDetailsScreen()), - ) + context, + FadePage(page: VitalSignDetailsScreen()), + ) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .vitalSigns, + title: TranslationBase.of(context).vitalSigns, imagePath: 'vital_signs.svg', - subTitle: TranslationBase - .of(context) - .vitalSignsSubtitle, + subTitle: TranslationBase.of(context).vitalSignsSubtitle, isEnable: projectViewModel.havePrivilege(25), ), )); @@ -370,45 +337,32 @@ class Utils { if (projectViewModel.havePrivilege(48)) Navigator.push(context, FadePage(page: ActiveMedicationsPage())); }, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .myMedical, + title: TranslationBase.of(context).myMedical, imagePath: 'active_medication.svg', - subTitle: TranslationBase - .of(context) - .myMedicalSubtitle, + subTitle: TranslationBase.of(context).myMedicalSubtitle, isEnable: projectViewModel.havePrivilege(48), ), )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(6) + onTap: () => projectViewModel.havePrivilege(6) ? Navigator.push( - context, - FadePage( - page: DoctorHomePage(), - ), - ) + context, + FadePage( + page: DoctorHomePage(), + ), + ) : null, child: - MedicalProfileItem(title: TranslationBase - .of(context) - .myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase - .of(context) - .myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), + MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), )); medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: MyInvoices())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .invoicesList, + title: TranslationBase.of(context).invoicesList, imagePath: 'invoice_list.svg', - subTitle: TranslationBase - .of(context) - .myInvoice, + subTitle: TranslationBase.of(context).myInvoice, isEnable: projectViewModel.havePrivilege(14), ), )); @@ -417,14 +371,10 @@ class Utils { onTap: () => projectViewModel.havePrivilege(85) ? Navigator.push(context, FadePage(page: AnicllaryOrders())) : null, // onTap: () => Navigator.push(context, FadePage(page: AnicllaryOrders())), child: MedicalProfileItem( - title: TranslationBase - .of(context) - .anicllaryOrders, + title: TranslationBase.of(context).anicllaryOrders, imagePath: 'ancillary.svg', isPngImage: false, - subTitle: TranslationBase - .of(context) - .myInvoice, + subTitle: TranslationBase.of(context).myInvoice, isEnable: projectViewModel.havePrivilege(85), ), )); @@ -432,35 +382,26 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .eye, + title: TranslationBase.of(context).eye, imagePath: 'eye_measurement.svg', - subTitle: TranslationBase - .of(context) - .eyeSubtitle, + subTitle: TranslationBase.of(context).eyeSubtitle, isEnable: projectViewModel.havePrivilege(14), ), )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(22) + onTap: () => projectViewModel.havePrivilege(22) ? Navigator.push( - context, - FadePage( - page: InsuranceCard( + context, + FadePage( + page: InsuranceCard( appointmentNo: 0, ))) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .insurance, + title: TranslationBase.of(context).insurance, imagePath: 'insurance_card.svg', - subTitle: TranslationBase - .of(context) - .insuranceSubtitle, + subTitle: TranslationBase.of(context).insuranceSubtitle, isEnable: projectViewModel.havePrivilege(22), ), )); @@ -470,34 +411,25 @@ class Utils { Navigator.push(context, FadePage(page: InsuranceUpdate())); }, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .updateInsurance, + title: TranslationBase.of(context).updateInsurance, imagePath: 'insurance_card.svg', - subTitle: TranslationBase - .of(context) - .updateInsuranceSubtitle, + subTitle: TranslationBase.of(context).updateInsuranceSubtitle, ), )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(18) + onTap: () => projectViewModel.havePrivilege(18) ? Navigator.push( - context, - FadePage( - page: InsuranceApproval( + context, + FadePage( + page: InsuranceApproval( appointmentNo: 0, ))) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .insuranceApproval, + title: TranslationBase.of(context).insuranceApproval, imagePath: 'insurance_approval.svg', - subTitle: TranslationBase - .of(context) - .insuranceApprovalSubtitle, + subTitle: TranslationBase.of(context).insuranceApprovalSubtitle, isEnable: projectViewModel.havePrivilege(18), ), )); @@ -505,13 +437,9 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(23) ? Navigator.push(context, FadePage(page: AllergiesPage())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .allergies, + title: TranslationBase.of(context).allergies, imagePath: 'allergies_diagnosed.svg', - subTitle: TranslationBase - .of(context) - .allergiesSubtitle, + subTitle: TranslationBase.of(context).allergiesSubtitle, isEnable: projectViewModel.havePrivilege(23), ), )); @@ -519,13 +447,9 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(26) ? Navigator.push(context, FadePage(page: MyVaccines())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .myVaccines, + title: TranslationBase.of(context).myVaccines, imagePath: 'vaccine_list.svg', - subTitle: TranslationBase - .of(context) - .myVaccinesSubtitle, + subTitle: TranslationBase.of(context).myVaccinesSubtitle, isEnable: projectViewModel.havePrivilege(26), ), )); @@ -533,13 +457,9 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .medical, + title: TranslationBase.of(context).medical, imagePath: 'medical_report.svg', - subTitle: TranslationBase - .of(context) - .medicalSubtitle, + subTitle: TranslationBase.of(context).medicalSubtitle, isEnable: projectViewModel.havePrivilege(20), ), )); @@ -547,13 +467,9 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .monthly, + title: TranslationBase.of(context).monthly, imagePath: 'monthly_report.svg', - subTitle: TranslationBase - .of(context) - .monthlySubtitle, + subTitle: TranslationBase.of(context).monthlySubtitle, isEnable: projectViewModel.havePrivilege(19), ), )); @@ -561,13 +477,9 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .sick, + title: TranslationBase.of(context).sick, imagePath: 'sick_leave.svg', - subTitle: TranslationBase - .of(context) - .sickSubtitle, + subTitle: TranslationBase.of(context).sickSubtitle, isEnable: projectViewModel.havePrivilege(16), ), )); @@ -575,13 +487,9 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(47) ? Navigator.push(context, FadePage(page: MyBalancePage())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .myBalance, + title: TranslationBase.of(context).myBalance, imagePath: 'balance_credit.svg', - subTitle: TranslationBase - .of(context) - .myBalanceSubtitle, + subTitle: TranslationBase.of(context).myBalanceSubtitle, isEnable: projectViewModel.havePrivilege(47), ), )); @@ -596,13 +504,9 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .myTrackers, + title: TranslationBase.of(context).myTrackers, imagePath: 'tracker.svg', - subTitle: TranslationBase - .of(context) - .myTrackersSubtitle, + subTitle: TranslationBase.of(context).myTrackersSubtitle, isEnable: projectViewModel.havePrivilege(24), ), )); @@ -610,13 +514,9 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(30) ? Navigator.push(context, FadePage(page: SmartWatchInstructions())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .smartWatchesSubtitle, + title: TranslationBase.of(context).smartWatchesSubtitle, imagePath: 'smart_watch.svg', - subTitle: TranslationBase - .of(context) - .smartWatches, + subTitle: TranslationBase.of(context).smartWatches, isEnable: projectViewModel.havePrivilege(30), ), )); @@ -624,20 +524,14 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(28) ? Navigator.push(context, FadePage(page: AskDoctorHomPage())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .askYourSubtitle, imagePath: 'ask_doctor.svg', subTitle: TranslationBase - .of(context) - .askYour, isEnable: projectViewModel.havePrivilege(28)), + title: TranslationBase.of(context).askYourSubtitle, imagePath: 'ask_doctor.svg', subTitle: TranslationBase.of(context).askYour, isEnable: projectViewModel.havePrivilege(28)), )); if (projectViewModel.havePrivilege(32) || true) { medical.add(InkWell( onTap: () { if (Platform.isAndroid) { - showPermissionConsentDialog(context, TranslationBase - .of(context) - .wifiPermission, () { + showPermissionConsentDialog(context, TranslationBase.of(context).wifiPermission, () { connectWifi(projectViewModel, context); }); } else { @@ -645,13 +539,9 @@ class Utils { } }, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .internet, + title: TranslationBase.of(context).internet, imagePath: 'internet_connection.svg', - subTitle: TranslationBase - .of(context) - .internetSubtitle, + subTitle: TranslationBase.of(context).internetSubtitle, ), )); } @@ -659,13 +549,9 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(40) ? launch('whatsapp://send?phone=18885521858&text=') : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .chatbot, + title: TranslationBase.of(context).chatbot, imagePath: 'chatbot.svg', - subTitle: TranslationBase - .of(context) - .chatbotSubtitle, + subTitle: TranslationBase.of(context).chatbotSubtitle, isEnable: projectViewModel.havePrivilege(40), ), )); @@ -734,81 +620,69 @@ class Utils { onTap: () => projectViewModel!.havePrivilege(5) ? Navigator.push(context!, FadePage(page: MyAppointments())) : null, child: isLogin! ? Stack(children: [ - MedicalProfileItem( - title: TranslationBase - .of(context!) - .myAppointments, - imagePath: 'appointment_list.svg', - subTitle: TranslationBase - .of(context!) - .myAppointmentsList, - hasBadge: true, - isEnable: projectViewModel!.havePrivilege(5)), - projectViewModel.isArabic! - ? !projectViewModel.isLoginChild - ? Positioned( - left: 8, - top: 4, - child: badge_import.Badge( - position: badge_import.BadgePosition.topEnd(), - badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), - badgeStyle: badge_import.BadgeStyle( - elevation: 0, - shape: badge_import.BadgeShape.circle, - badgeColor: secondaryColor!.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - ), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), - ), - ), - ) - : Container() - : !projectViewModel.isLoginChild - ? Positioned( - right: 8, - top: 4, - child: badge_import.Badge( - badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), - badgeStyle: badge_import.BadgeStyle( - elevation: 0, - shape: badge_import.BadgeShape.circle, - badgeColor: secondaryColor!.withOpacity(1.0), - borderRadius: BorderRadius.circular(8), - ), - position: badge_import.BadgePosition.topEnd(), - badgeContent: Container( - padding: EdgeInsets.all(2.0), - child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), - ), - ), - ) - : Container(), - ]) + MedicalProfileItem( + title: TranslationBase.of(context!).myAppointments, + imagePath: 'appointment_list.svg', + subTitle: TranslationBase.of(context!).myAppointmentsList, + hasBadge: true, + isEnable: projectViewModel!.havePrivilege(5)), + projectViewModel.isArabic! + ? !projectViewModel.isLoginChild + ? Positioned( + left: 8, + top: 4, + child: badge_import.Badge( + position: badge_import.BadgePosition.topEnd(), + badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), + badgeStyle: badge_import.BadgeStyle( + elevation: 0, + shape: badge_import.BadgeShape.circle, + badgeColor: secondaryColor!.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + ), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + : Container() + : !projectViewModel.isLoginChild + ? Positioned( + right: 8, + top: 4, + child: badge_import.Badge( + badgeAnimation: badge_import.BadgeAnimation.fade(toAnimate: false), + badgeStyle: badge_import.BadgeStyle( + elevation: 0, + shape: badge_import.BadgeShape.circle, + badgeColor: secondaryColor!.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + ), + position: badge_import.BadgePosition.topEnd(), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + : Container(), + ]) : MedicalProfileItem( - title: TranslationBase - .of(context!) - .myAppointments, - imagePath: 'appointment_list.svg', - subTitle: TranslationBase - .of(context!) - .myAppointmentsList, - hasBadge: true, - isEnable: projectViewModel!.havePrivilege(5), - ), + title: TranslationBase.of(context!).myAppointments, + imagePath: 'appointment_list.svg', + subTitle: TranslationBase.of(context!).myAppointmentsList, + hasBadge: true, + isEnable: projectViewModel!.havePrivilege(5), + ), )); medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(10) ? Navigator.push(context, FadePage(page: LabsHomePage())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .lab, + title: TranslationBase.of(context).lab, imagePath: 'lab_result.svg', - subTitle: TranslationBase - .of(context) - .labSubtitle, + subTitle: TranslationBase.of(context).labSubtitle, isEnable: projectViewModel.havePrivilege(10), ), )); @@ -816,13 +690,9 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .radiology, + title: TranslationBase.of(context).radiology, imagePath: 'radiology.svg', - subTitle: TranslationBase - .of(context) - .radiologySubtitle, + subTitle: TranslationBase.of(context).radiologySubtitle, isEnable: projectViewModel.havePrivilege(7), ), )); @@ -830,33 +700,24 @@ class Utils { medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, child: MedicalProfileItem( - title: TranslationBase - .of(context) - .medicines, + title: TranslationBase.of(context).medicines, imagePath: 'medicine_prescription.svg', - subTitle: TranslationBase - .of(context) - .medicinesSubtitle, + subTitle: TranslationBase.of(context).medicinesSubtitle, isEnable: projectViewModel.havePrivilege(12), ), )); medical.add(InkWell( - onTap: () => - projectViewModel.havePrivilege(6) + onTap: () => projectViewModel.havePrivilege(6) ? Navigator.push( - context, - FadePage( - page: DoctorHomePage(), - ), - ) + context, + FadePage( + page: DoctorHomePage(), + ), + ) : null, child: - MedicalProfileItem(title: TranslationBase - .of(context) - .myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase - .of(context) - .myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), + MedicalProfileItem(title: TranslationBase.of(context).myDoctor, imagePath: 'my_doc.svg', subTitle: TranslationBase.of(context).myDoctorSubtitle, isEnable: projectViewModel.havePrivilege(6)), )); return medical; @@ -896,11 +757,7 @@ class Utils { SizedBox(height: 6), Text( text, - style: TextStyle(fontSize: 12, - fontWeight: FontWeight.w600, - color: Color(0xff2E303A), - letterSpacing: -0.48, - height: 18 / 12), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), ), SizedBox(height: 5), if (showDivider) @@ -913,7 +770,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, @@ -974,13 +831,32 @@ class Utils { return crypto.md5.convert(utf8.encode(input)).toString(); } - static String generateSignature() { + static bool isVidaPlusProject(ProjectViewModel projectViewModel, int projectID) { + bool isVidaPlus = false; + projectViewModel.vidaPlusProjectList.forEach((element) { + if (element.projectID == projectID) { + isVidaPlus = true; + } + }); + return isVidaPlus; + } + static bool isHMCProject(ProjectViewModel projectViewModel, int projectID) { + bool isHMCProject = false; + projectViewModel.hMCProjectListModel.forEach((element) { + if (element.projectID == projectID) { + isHMCProject = true; + } + }); + return isHMCProject; } +// 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: [ @@ -1009,7 +885,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) { @@ -1023,7 +899,7 @@ openAppStore({String androidPackageName, String iOSAppID, bool isHuawei = false} } } -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 06a361b6..6595ce50 100644 --- a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart +++ b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart @@ -21,15 +21,14 @@ class FlowChartPage extends StatelessWidget { FlowChartPage({this.patientLabOrder, this.filterName}); - ProjectViewModel projectViewModel; + 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))), + model.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: filterName, isVidaPlus: Utils.isVidaPlusProject(projectViewModel!, int.parse(patientLabOrder!.projectID!))), builder: (context, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: filterName!, diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index a84268d8..39025efd 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -93,9 +93,9 @@ class DoctorCard extends StatelessWidget { color: Utils.isHMCProject(projectViewModel, projectID) ? Color(0xff3FACC8) - : isLiveCareAppointment + : isLiveCareAppointment! ? Color(0xff2E303A) - : !isInOutPatient + : !isInOutPatient! ? Color(0xffD02127) : Color(0xffa9a089), borderRadius: BorderRadius.only( diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index e5ac52bf..21dea4fd 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -70,7 +70,7 @@ class AppScaffold extends StatefulWidget { final List? imagesInfo; final bool isHelp; final bool isLocalLoader; - final VoidCallbackAction? backButtonTab; + final VoidCallback? backButtonTab; final String? icon; final bool showDropDown; final int? dropdownIndexValue; @@ -343,7 +343,7 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget { final void Function(int?)? dropDownIndexChange; final List? appBarIcons; - Function? onTap; + VoidCallback? onTap; NewAppBarWidget({Key? key, this.showTitle = false, this.showDropDown = false, this.title = "", this.dropDownList, this.appBarIcons, this.dropdownIndexValue, this.dropDownIndexChange, this.onTap}) : super(key: key); @@ -358,9 +358,7 @@ class NewAppBarWidget extends StatelessWidget implements PreferredSizeWidget { // backgroundColor: Colors.red, // automaticallyImplyLeading: false, leading: ArrowBack( - onTap: () { - onTap; - }, + onTap: onTap, ), titleSpacing: -8, // centerTitle: false, @@ -449,7 +447,7 @@ class AppBarWidget extends StatefulWidget implements PreferredSizeWidget { final bool showOfferPackagesCart; final bool isShowDecPage; - final Function()? backButtonTab; + final VoidCallback? backButtonTab; Function(String)? badgeUpdater; AppBarWidget( diff --git a/lib/widgets/others/arrow_back.dart b/lib/widgets/others/arrow_back.dart index adf1bda3..57ca3f1d 100644 --- a/lib/widgets/others/arrow_back.dart +++ b/lib/widgets/others/arrow_back.dart @@ -2,18 +2,27 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -class ArrowBack extends StatelessWidget { - final Function? onTap; +class ArrowBack extends StatefulWidget { + final VoidCallback? onTap; - ArrowBack({Key? key, this.onTap,}) : super(key: key); + ArrowBack({ + Key? key, + this.onTap, + }) : super(key: key); + @override + State createState() => _ArrowBackState(); +} + +class _ArrowBackState extends State { @override Widget build(BuildContext context) { // ProjectViewModel projectViewModel = Provider.of(context); return GestureDetector( behavior: HitTestBehavior.opaque, onTap: Feedback.wrapForTap(() { - onTap != null ? onTap! : Navigator.maybePop(context); + /// widget.onTap != null ? widget.onTap : + Navigator.maybePop(context); }, context), child: Icon( Icons.arrow_back_ios, diff --git a/pubspec.yaml b/pubspec.yaml index fdc1054f..9e268698 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -37,7 +37,7 @@ dependencies: #chart fl_chart: ^0.64.0 - + #Camera Preview camera: ^0.10.1 @@ -60,8 +60,6 @@ dependencies: fluttertoast: ^8.0.8 firebase_messaging: ^14.1.0 firebase_analytics: ^10.0.5 - - # Progress bar flutter_progress_hud: ^2.0.2 percent_indicator: ^4.2.3 @@ -74,7 +72,7 @@ dependencies: image_picker: ^1.0.4 #GIF image -# flutter_gifimage: ^1.0.1 + # flutter_gifimage: ^1.0.1 flutter_gif: ^0.0.4 photo_view: any # flutter_webrtc: any @@ -82,11 +80,6 @@ dependencies: # UI Reqs expandable: ^5.0.1 - # Notification Banner - # dropdown_banner: ^1.4.0 - # flutter_xlider: ^3.4.0 - # flutter_local_notifications: - # charts flutter_charts: ^0.5.2 google_maps_flutter: ^2.1.1 @@ -96,11 +89,7 @@ dependencies: huawei_push: ^6.5.0+300 # Qr code Scanner TODO fix it - # barcode_scanner: ^1.0.1 - # flutter_polyline_points: ^1.0.0 location: ^5.0.3 - # Qr code Scanner - # barcode_scan_fix: ^1.0.2 barcode_scan2: ^4.2.2 # Rating Stars @@ -128,119 +117,68 @@ dependencies: hijri: ^3.0.0 #datetime_picker - #flutter_datetime_picker: ^1.5.1 flutter_datetime_picker_plus: ^2.1.0 - # Carousel -# carousel_pro: ^1.0.0 //8/oct carousel_pro_nullsafety: ^2.0.0 - #local_notifications flutter_local_notifications: any - - #device_calendar device_calendar: ^4.2.0 - - #Handle Geolocation geolocator: ^9.0.2 - - #Handle lat long to address geocoding: ^2.0.1 - jiffy: ^6.2.1 #Flutter WebRTC flutter_webrtc: ^0.9.7 - screen_brightness: ^0.2.2+1 - - #google maps places - google_maps_place_picker_mb: ^3.0.0 - # google_maps_place_picker: ^2.1.0-nullsafety.3 map_launcher: ^3.0.1 - #countdown timer for Upcoming List flutter_countdown_timer: ^4.1.0 - #Dependencies for video call implementation native_device_orientation: ^1.0.0 wakelock: ^0.6.2 after_layout: ^1.1.0 - # twilio_programmable_video: ^0.11.0+1 cached_network_image: ^3.1.0+1 - # flutter_tts: - # path: flutter_tts-voice_enhancement flutter_tts: ^3.6.1 - -# wifi: ^0.1.5 //18/oct vibration: ^1.7.3 - flutter_nfc_kit: ^3.3.1 - -# geofencing: ^0.1.0 //18/oct - speech_to_text: ^6.1.1 - # path: speech_to_text - + #in_app_update: ^4.2.2 in_app_review: ^2.0.3 badges: ^3.1.2 flutter_app_icon_badge: ^2.0.0 - # syncfusion_flutter_sliders: ^19.3.55 -# searchable_dropdown: ^1.1.3 dropdown_search: 5.0.6 youtube_player_flutter: ^8.0.0 - # Dep by Zohaib shimmer: ^3.0.0 carousel_slider: ^4.0.0 - # flutter_material_pickers: ^3.1.2 flutter_staggered_grid_view: ^0.7.0 - # flutter_hms_gms_availability: ^2.0.0 huawei_hmsavailability: ^6.6.0+300 huawei_location: ^6.11.0+301 # Marker Animation - # flutter_animarker: ^3.2.0 auto_size_text: ^3.0.0 equatable: ^2.0.3 - # signalr_core: ^1.1.1 wave: ^0.2.0 - # sms_retriever: ^1.0.0 sms_otp_auto_verify: ^2.1.0 flutter_ios_voip_kit: ^0.1.0 google_api_availability: ^5.0.0 - # open_file: ^3.2.1 open_filex: ^4.3.2 path_provider: ^2.0.8 - + logger: ^2.0.2+1 - - # flutter_callkit_incoming: ^1.0.3+3 - # firebase_core: 1.12.0 -# flutter_amazonpaymentservices: 0.0.6 -# crypto: dependency_overrides: - #provider: ^5.0.0 - # permission_handler : ^10.2.0 - #flutter_svg: ^1.1.6 -# firebase_messaging_platform_interface: any -# flutter_inappwebview: 5.7.2+3 -# git: -# url: https://github.com/CodeEagle/flutter_inappwebview - dev_dependencies: flutter_test: sdk: flutter build_runner: ^2.1.5 - + flutter: uses-material-design: true - # assets: assets: - assets/ - assets/images/