From 5163c826adeba139cfe72793d90963d0c552483b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 6 Oct 2021 15:29:12 +0300 Subject: [PATCH] Updates & fixes --- lib/config/localized_values.dart | 4 + .../service/feedback/feedback_service.dart | 3 + .../service/medical/BloodSugarService.dart | 19 +- .../parmacyModule/parmacy_module_service.dart | 10 +- .../home_health_care_view_model.dart | 4 +- .../medical/ask_doctor_view_model.dart | 2 +- lib/pages/BookAppointment/DoctorProfile.dart | 2 +- .../rrt-order-list-item.dart | 2 +- .../MyAppointments/AppointmentDetails.dart | 6 +- .../widgets/AppointmentActions.dart | 2 +- lib/pages/ToDoList/payment_method_select.dart | 10 +- lib/pages/feedback/send_feedback_page.dart | 270 +++++++----------- lib/pages/feedback/status_feedback_page.dart | 124 ++++---- .../AttachInsuranceCardImageDialog.dart | 9 +- .../insurance/insurance_approval_screen.dart | 6 +- lib/pages/insurance/insurance_page.dart | 4 +- .../medical/ask_doctor/ask_doctor_page.dart | 17 +- .../medical/balance/advance_payment_page.dart | 15 +- .../my_trackers/Weight/WeightWeeklyPage.dart | 6 +- .../bloodPressureWeeklyPage.dart | 7 +- .../blood_suger/blood_sugar_weekly_page.dart | 6 +- .../vital_sign/vital_sign_details_screen.dart | 14 +- .../rate_appointment_doctor.dart | 1 - lib/uitl/translations_delegate_base.dart | 9 + lib/uitl/utils_new.dart | 19 ++ .../data_display/medical/doctor_card.dart | 2 +- lib/widgets/new_design/doctor_header.dart | 4 +- 27 files changed, 293 insertions(+), 284 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c80c87ac..ec234553 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -797,6 +797,7 @@ const Map localizedValues = { "mass": {"en": "Mass", "ar": "كتلة"}, "temp-c": {"en": "°C", "ar": "°س"}, "bpm": {"en": "bpm", "ar": "نبضة"}, + "respirationBPM": {"en": "bpm", "ar": "نفس"}, "respiration-signs": {"en": "Respiration", "ar": "تنفس"}, "sys-dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"}, "body": {"en": "Body Mass", "ar": "كتلة\nالجسم"}, @@ -1213,6 +1214,7 @@ const Map localizedValues = { "pound": {"en": "Pound", "ar": "رطل"}, "seeListOfDoctor": {"en": "See List Of Doctors", "ar": "انظر قائمة الأطباء"}, "obese": {"en": "Obese", "ar": "سمين"}, + "extremeObese": {"en": "Extreme Obese", "ar": "السمنة المفرطة"}, "overWeight": {"en": "OverWeight", "ar": "وزن زائد"}, "healthy": {"en": "Healthy", "ar": "صحي"}, "underWeight": {"en": "UnderWeight", "ar": "نقص الوزن"}, @@ -1528,4 +1530,6 @@ const Map localizedValues = { "insuredPatient": {"en": "Insured Patient", "ar": "هل لدى المريض تامين؟"}, "rateDoctor": {"en": "Rate Doctor", "ar": "تقييم الطبيب"}, "rateAppointment": {"en": "Rate Appointment", "ar": "سعر التعيين"}, + "noInsuranceCardAttached": {"en": "Please attach your insurance card image to continue", "ar": "يرجى إرفاق صورة بطاقة التأمين الخاصة بك للمتابعة"}, + "bodyMassIndex": {"en": "Body Mass Index is: ", "ar": "مؤشر كتلة الجسم هو:"}, }; diff --git a/lib/core/service/feedback/feedback_service.dart b/lib/core/service/feedback/feedback_service.dart index b36ebee3..d6da1ee3 100644 --- a/lib/core/service/feedback/feedback_service.dart +++ b/lib/core/service/feedback/feedback_service.dart @@ -41,10 +41,13 @@ class FeedbackService extends BaseService { _requestInsertCOCItem.deviceInfo = Platform.localHostname; _requestInsertCOCItem.resolution = "400x847"; _requestInsertCOCItem.projectID = 0; + _requestInsertCOCItem.tokenID = "C0c@@dm!n?T&A&A@Barcha202029582948"; _requestInsertCOCItem.identificationNo = int.parse(user.patientIdentificationNo); if (BASE_URL.contains('uat')) { _requestInsertCOCItem.forDemo = true; + } else { + _requestInsertCOCItem.forDemo = false; } final Map body = _requestInsertCOCItem.toJson(); diff --git a/lib/core/service/medical/BloodSugarService.dart b/lib/core/service/medical/BloodSugarService.dart index 84b932e8..9c8e9cd9 100644 --- a/lib/core/service/medical/BloodSugarService.dart +++ b/lib/core/service/medical/BloodSugarService.dart @@ -18,15 +18,14 @@ class BloodSugarService extends BaseService { Future getBloodSugar() async { hasError = false; Map body = Map(); + monthDiabtectResultAverageList.clear(); + weekDiabtectResultAverageList.clear(); + yearDiabtecResultAverageList.clear(); + monthDiabtecPatientResult.clear(); + weekDiabtecPatientResult.clear(); + yearDiabtecPatientResult.clear(); body['isDentalAllowedBackend'] = false; await baseAppClient.post(GET_DIABETIC_RESULT_AVERAGE, onSuccess: (dynamic response, int statusCode) { - monthDiabtectResultAverageList.clear(); - weekDiabtectResultAverageList.clear(); - yearDiabtecResultAverageList.clear(); - - monthDiabtecPatientResult.clear(); - weekDiabtecPatientResult.clear(); - yearDiabtecPatientResult.clear(); response['List_MonthDiabtectResultAverage'].forEach((item) { monthDiabtectResultAverageList.add(MonthDiabtectResultAverage.fromJson(item)); @@ -47,10 +46,10 @@ class BloodSugarService extends BaseService { Future getDiabtecResults() async { hasError = false; + monthDiabtecPatientResult.clear(); + weekDiabtecPatientResult.clear(); + yearDiabtecPatientResult.clear(); await baseAppClient.post(GET_DIABTEC_RESULT, onSuccess: (dynamic response, int statusCode) { - monthDiabtecPatientResult.clear(); - weekDiabtecPatientResult.clear(); - yearDiabtecPatientResult.clear(); response['List_MonthDiabtecPatientResult'].forEach((item) { monthDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item)); diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart index 0a87000d..9cca6ac9 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -12,6 +13,7 @@ class PharmacyModuleService extends BaseService { bool isFinished = true; String errorMsg = ''; String url = ""; + CustomerInfo customerInfo; List bannerItems = List(); List manufacturerList = List(); @@ -51,8 +53,12 @@ class PharmacyModuleService extends BaseService { hasError = false; try { await baseAppClient.getPharmacy(PHARMACY_CREATE_CUSTOMER, onSuccess: (dynamic response, int statusCode) async { - if (!response['IsRegistered']) {} - await generatePharmacyToken(); + if (!response['IsRegistered']) { + + } else { + customerInfo = CustomerInfo.fromJson(response); + } + // await generatePharmacyToken(); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart index 47e6815e..d7d9f1c2 100644 --- a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart @@ -113,8 +113,8 @@ class HomeHealthCareViewModel extends BaseViewModel { // await _customerAddressesService.getCustomerInfo(); setState(ViewState.ErrorLocal); } else { - // await _pharmacyModuleService.createUser(); - await _customerAddressesService.getCustomerInfo(); + await _pharmacyModuleService.createUser(); + // await _customerAddressesService.getCustomerInfo(); await getCustomerAddresses(); } } diff --git a/lib/core/viewModels/medical/ask_doctor_view_model.dart b/lib/core/viewModels/medical/ask_doctor_view_model.dart index 7890fb3a..d060db1f 100644 --- a/lib/core/viewModels/medical/ask_doctor_view_model.dart +++ b/lib/core/viewModels/medical/ask_doctor_view_model.dart @@ -39,7 +39,7 @@ class AskDoctorViewModel extends BaseViewModel { }); } else { setState(ViewState.Idle); - AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).askDocEmpty); + // AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).askDocEmpty); } } diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 6d3a3afa..caadb72a 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -145,7 +145,7 @@ class _DoctorProfileState extends State with TickerProviderStateM onTap: (index) { setState(() { if (index == 1) { - if (widget.doctor.clinicID == 17 || widget.doctor.clinicID == 23 || widget.isLiveCareAppointment) { + if (widget.doctor.clinicID == 17 || widget.doctor.clinicID == 23 || widget.doctor.clinicID == 47 || widget.isLiveCareAppointment) { _tabController.index = _tabController.previousIndex; showFooterButton = false; } else { diff --git a/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart index 656d47e0..fd433f66 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart @@ -124,7 +124,7 @@ class RRTLogListItem extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.getDayMonthYearDateFormattedLang(order.createdOn, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(order.createdOn), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 13b86071..0ff38fd5 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -107,7 +107,7 @@ class _AppointmentDetailsState extends State with SingleTick "", //model.user.emailAddress, ), - isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true, + isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true, buttonTitle: TranslationBase.of(context).schedule, buttonIcon: 'assets/images/new/Boo_ Appointment.svg', showConfirmMessageDialog: false, @@ -136,7 +136,7 @@ class _AppointmentDetailsState extends State with SingleTick onTap: (index) { setState(() { if (index == 1) { - if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) { + if (widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) { _tabController.index = _tabController.previousIndex; AppointmentDetails.showFooterButton = false; } else { @@ -147,7 +147,7 @@ class _AppointmentDetailsState extends State with SingleTick }, tabs: [ Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))), - widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment + widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 47 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment ? Tab( child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)), ) diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index fd402a6b..ee94a616 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -67,7 +67,7 @@ class _AppointmentActionsState extends State { padding: EdgeInsets.all(21), shrinkWrap: true, itemBuilder: (context, index) { - bool shouldEnable = (widget.appo.clinicID == 17 && appoButtonsList[index].caller == "openReschedule"); + bool shouldEnable = (widget.appo.clinicID == 17 && widget.appo.clinicID == 47 && appoButtonsList[index].caller == "openReschedule"); return InkWell( onTap: shouldEnable ? null diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index fef55190..f2a96651 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -47,7 +47,7 @@ class _PaymentMethodState extends State { updateSelectedPaymentMethod("MADA"); }, child: Card( - elevation: 3.0, + elevation: 0.0, margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( @@ -83,7 +83,7 @@ class _PaymentMethodState extends State { updateSelectedPaymentMethod("VISA"); }, child: Card( - elevation: 3.0, + elevation: 0.0, margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( @@ -119,7 +119,7 @@ class _PaymentMethodState extends State { updateSelectedPaymentMethod("MASTERCARD"); }, child: Card( - elevation: 3.0, + elevation: 0.0, margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( @@ -155,7 +155,7 @@ class _PaymentMethodState extends State { updateSelectedPaymentMethod("Installment"); }, child: Card( - elevation: 3.0, + elevation: 0.0, margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( @@ -192,7 +192,7 @@ class _PaymentMethodState extends State { updateSelectedPaymentMethod("ApplePay"); }, child: Card( - elevation: 3.0, + elevation: 0.0, margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 7ba5e29c..c3af1577 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -111,7 +112,7 @@ class _SendFeedbackPageState extends State { children: [ Text( TranslationBase.of(context).likeToHear, - textAlign: TextAlign.center, + // textAlign: TextAlign.center, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), ), SizedBox(height: 21), @@ -159,99 +160,23 @@ class _SendFeedbackPageState extends State { isShowListAppointHistory = true; }); }, - child: Container( - // margin: EdgeInsets.all(8.0), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), - child: Row( - children: [ - Container( - width: projectViewModel.isArabic ? 27 : 20, - height: projectViewModel.isArabic ? 105 : 90, - decoration: BoxDecoration( - //Colors.red[900] Color(0xff404545) - color: appointHistory.isLiveCareAppointment - ? Color(0xff404545) - : !appointHistory.isInOutPatient - ? Colors.red[900] - : Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), - bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), - ), - ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - appointHistory.isLiveCareAppointment - ? TranslationBase.of(context).liveCare.toUpperCase() - : !appointHistory.isInOutPatient - ? TranslationBase.of(context).inPatient.toUpperCase() - : TranslationBase.of(context).outpatient.toUpperCase(), - style: TextStyle(color: Colors.white, fontSize: 12), - ), - )), - ), - Expanded( - flex: 4, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - children: [ - Expanded( - flex: 1, - child: LargeAvatar( - name: appointHistory.doctorNameObj, - url: appointHistory.doctorImageURL, - ), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - appointHistory.doctorNameObj, - bold: true, - ), - Texts( - DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointHistory.appointmentDate)), - variant: 'caption3', - ), - StarRating(totalAverage: appointHistory.doctorRate.toDouble(), forceStars: true), - ], - ), - ), - ), - ], - ), - ), - ], - ), - ), - Expanded( - flex: 1, - child: Center( - child: Icon( - Icons.arrow_forward_ios, - size: 15, - ), - ), - ) - ], - ), + child: DoctorCard( + onTap: () {}, + isInOutPatient: appointHistory.isInOutPatient, + name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj, + // billNo: _appointmentResult.invoiceNo, + profileUrl: appointHistory.doctorImageURL, + subName: appointHistory.projectName, + isLiveCareAppointment: appointHistory.isLiveCareAppointment, + date: DateUtil.convertStringToDate(appointHistory.appointmentDate), + rating: appointHistory.actualDoctorRate + 0.0, + appointmentTime: appointHistory.startTime.substring(0, 5), ), ), + SizedBox(height: 12), if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 && isShowListAppointHistory) Container( - height: model.appointHistoryList.length > 2 ? MediaQuery.of(context).size.height * 0.25 : MediaQuery.of(context).size.height * 0.15, + height: model.appointHistoryList.length > 2 ? MediaQuery.of(context).size.height * 0.35 : MediaQuery.of(context).size.height * 0.17, child: ListView.builder( itemCount: model.appointHistoryList.length, itemBuilder: (context, index) => InkWell( @@ -261,76 +186,87 @@ class _SendFeedbackPageState extends State { isShowListAppointHistory = false; }); }, - child: Container( - margin: EdgeInsets.only(left: 8, right: 8), - color: Colors.white, - child: Column( - children: [ - Row( - children: [ - Expanded( - flex: 4, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - children: [ - Expanded( - flex: 1, - child: LargeAvatar( - name: model.appointHistoryList[index].doctorNameObj, - url: model.appointHistoryList[index].doctorImageURL, - ), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - model.appointHistoryList[index].doctorNameObj, - bold: true, - ), - Texts( - DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)), - variant: 'caption3', - ), - StarRating(totalAverage: model.appointHistoryList[index].doctorRate.toDouble(), forceStars: true), - ], - ), - ), - ), - ], - ), - ), - ], - ), - ), - Expanded( - flex: 1, - child: Center( - child: Icon( - Icons.arrow_forward_ios, - size: 15, - ), - ), - ) - ], - ), - SizedBox( - height: 5, - ), - Divider( - height: 0.5, - color: Colors.grey[400], - ) - ], - ), + child: DoctorCard( + onTap: () {}, + isInOutPatient: model.appointHistoryList[index].isInOutPatient, + name: model.appointHistoryList[index].doctorTitle + " " + model.appointHistoryList[index].doctorNameObj, + profileUrl: model.appointHistoryList[index].doctorImageURL, + subName: model.appointHistoryList[index].projectName, + isLiveCareAppointment: model.appointHistoryList[index].isLiveCareAppointment, + date: DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate), + rating: model.appointHistoryList[index].actualDoctorRate + 0.0, + appointmentTime: model.appointHistoryList[index].startTime.substring(0, 5), ), + // Container( + // margin: EdgeInsets.only(left: 8, right: 8), + // color: Colors.white, + // child: Column( + // children: [ + // Row( + // children: [ + // Expanded( + // flex: 4, + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Padding( + // padding: const EdgeInsets.all(10.0), + // child: Row( + // children: [ + // Expanded( + // flex: 1, + // child: LargeAvatar( + // name: model.appointHistoryList[index].doctorNameObj, + // url: model.appointHistoryList[index].doctorImageURL, + // ), + // ), + // Expanded( + // flex: 4, + // child: Container( + // margin: EdgeInsets.all(10), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Texts( + // model.appointHistoryList[index].doctorNameObj, + // bold: true, + // ), + // Texts( + // DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)), + // variant: 'caption3', + // ), + // StarRating(totalAverage: model.appointHistoryList[index].doctorRate.toDouble(), forceStars: true), + // ], + // ), + // ), + // ), + // ], + // ), + // ), + // ], + // ), + // ), + // Expanded( + // flex: 1, + // child: Center( + // child: Icon( + // Icons.arrow_forward_ios, + // size: 15, + // ), + // ), + // ) + // ], + // ), + // SizedBox( + // height: 5, + // ), + // Divider( + // height: 0.5, + // color: Colors.grey[400], + // ) + // ], + // ), + // ), ), ), ), @@ -515,19 +451,6 @@ class _SendFeedbackPageState extends State { ), suffixIconConstraints: BoxConstraints(minWidth: 50), suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), - // prefixIconConstraints: BoxConstraints(minWidth: 50), - // prefixIcon: suffix == null - // ? null - // : Text( - // "+" + suffix, - // style: TextStyle( - // fontSize: 14, - // height: 21 / 14, - // fontWeight: FontWeight.w500, - // color: Color(0xff2E303A), - // letterSpacing: -0.56, - // ), - // ), contentPadding: EdgeInsets.zero, border: InputBorder.none, focusedBorder: InputBorder.none, @@ -581,8 +504,11 @@ class _SendFeedbackPageState extends State { GifLoaderDialogUtils.hideDialog(context); setState(() { appointHistory = null; + isShowListAppointHistory = true; }); }); + } else { + isShowListAppointHistory = false; } setMessageType(value); }, diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index 18993f1d..ae13d81b 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -1,13 +1,16 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; 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 StatusFeedbackPage extends StatefulWidget { @override @@ -17,6 +20,7 @@ class StatusFeedbackPage extends StatefulWidget { class _StatusFeedbackPageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getCOC(), builder: (_, model, widget) => AppScaffold( @@ -28,67 +32,70 @@ class _StatusFeedbackPageState extends State { child: model.cOCItemList.isNotEmpty ? Container( margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0, bottom: 80), - padding: EdgeInsets.all(15.0), child: ListView.builder( itemCount: model.cOCItemList.length, itemBuilder: (context, index) => InkWell( - onTap: () { - gotodetails(model.cOCItemList[index]); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - margin: EdgeInsets.all(4), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts('${model.cOCItemList[index].cOCTitle}'), - Texts( - TranslationBase.of(context).number + ' : ${model.cOCItemList[index].itemID}', - variant: 'overline', - ), - ], - ), - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts('${model.cOCItemList[index].status}'), - Texts( - '${model.cOCItemList[index].date}', - variant: 'overline', - ), - ], - ), - ), - ], - ), - Texts('${model.cOCItemList[index].formType}'), - Divider( - height: 4.5, - color: Colors.grey[500], - ) - ], + onTap: () { + // gotodetails(model.cOCItemList[index]); + }, + child: Card( + shape: cardRadius(12), + margin: EdgeInsets.all(10), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(projectViewModel.isArabic ? model.cOCItemList[index].statusAr : model.cOCItemList[index].status, + style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)), + Container( + margin: EdgeInsets.only(top: 5.0), + child: Text(model.cOCItemList[index].formType, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + color: Color(0xff2B353E), + letterSpacing: -0.48, + height: 18 / 12))), + myRichText(TranslationBase.of(context).number + ": ", model.cOCItemList[index].itemID.toString(), projectViewModel.isArabic), + Text(model.cOCItemList[index].cOCTitle, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + color: Color(0xff2B353E), + letterSpacing: -0.48, + height: 18 / 12)), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text(model.cOCItemList[index].date.split(" ")[0], + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + color: Color(0xff2B353E), + letterSpacing: -0.48)), + Text(model.cOCItemList[index].date.split(" ")[1], + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + color: Color(0xff2B353E), + letterSpacing: -0.48)), + ], + ), + ], + ), ), ), - ))), + )), ) : Center( child: Column( @@ -122,7 +129,8 @@ class _StatusFeedbackPageState extends State { padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: DefaultButton( TranslationBase.of(context).search, - () => {}, + projectViewModel.isLogin ? null : () => {}, + disabledColor: Colors.grey, ), ), ], diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart index 38fd75d5..8272f0c2 100644 --- a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:flutter/cupertino.dart'; @@ -154,8 +155,12 @@ class _AttachInsuranceCardImageDialogState extends State { description: TranslationBase.of(context).infoApprovals, infoList: TranslationBase.of(context).infoApprovalPoints, imagesInfo: imagesInfo, - body: ListView.separated( + body: model.insuranceApproval.length > 0 ? ListView.separated( padding: EdgeInsets.all(21), physics: BouncingScrollPhysics(), itemBuilder: (_, index) { @@ -164,7 +166,7 @@ class _InsuranceApprovalState extends State { ); }, separatorBuilder: (context, index) => SizedBox(height: 12), - itemCount: model.insuranceApproval.length)), + itemCount: model.insuranceApproval.length) : getNoDataWidget(context)), ); } diff --git a/lib/pages/insurance/insurance_page.dart b/lib/pages/insurance/insurance_page.dart index e1f347a0..58a9e64a 100644 --- a/lib/pages/insurance/insurance_page.dart +++ b/lib/pages/insurance/insurance_page.dart @@ -150,7 +150,9 @@ class InsurancePage extends StatelessWidget { patientID: patientID, patientIdentificationID: patientIdentificationID, name: name, - ))); + ))).then((value) { + model.getInsuranceUpdated(); + }); } else { AppToast.showErrorToast(message: _insuranceCardService.error); } diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index ccff9042..389baf24 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/ask_doctor/request_type.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; 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/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -22,7 +24,20 @@ class AskDoctorPage extends StatelessWidget { onModelReady: (model) => model.getMyDoctor(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - body: _appointmentExpandableList(model.patientDoctorAppointmentListHospital, model), + body: model.patientDoctorAppointmentListHospital.length > 0 ? _appointmentExpandableList(model.patientDoctorAppointmentListHospital, model) : noDoctor(context), + ), + ); + } + + Widget noDoctor(BuildContext context) { + return Container( + margin: EdgeInsets.only(left: 50.0, right: 50.0), + child: Center( + child: Text(TranslationBase.of(context).askDocEmpty, textAlign: TextAlign.center, style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w400, + color: CustomColors.accentColor + )), ), ); } diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 9e1e042e..9e587b7f 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -15,6 +15,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/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -258,16 +259,13 @@ class _AdvancePaymentPageState extends State { ), ), bottomSheet: Container( - height: 70, width: double.infinity, + color: Theme.of(context).scaffoldBackgroundColor, padding: EdgeInsets.all(12), - color: Colors.white, - child: SecondaryButton( - textColor: Colors.white, - label: TranslationBase.of(context).submit, - color: CustomColors.accentColor, - disabled: amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null, - onTap: () { + child: DefaultButton( + TranslationBase.of(context).submit, + (amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null) ? null : + () { var mobileNum; var patientName; @@ -320,6 +318,7 @@ class _AdvancePaymentPageState extends State { } }); }, + disabledColor: Colors.grey, ), )), ); diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart index 81d8c150..8d82b13c 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -109,7 +109,11 @@ class WeightWeeklyPage extends StatelessWidget { model: model, ), ), - ); + ).then((value) { + if (model.weekWeightMeasurementResult.isEmpty) { + model.weightWeekTimeSeriesData.clear(); + } + }); }, child: Container( // height: 70, diff --git a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart index 1262897c..b4974159 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart @@ -111,7 +111,12 @@ class BloodPressureWeeklyPage extends StatelessWidget { measureTimeSelectedType: diabtec.measuredArmDesc, ), ), - ); + ).then((value) { + if(model.weekDiabtecPatientResult.isEmpty) { + model.weightWeekTimeSeriesDataTop.clear(); + model.weightWeekTimeSeriesDataLow.clear(); + } + }); }, child: Container( // height: 70, 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 9afcd888..537265ed 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 @@ -116,7 +116,11 @@ class BloodSugarWeeklyPage extends StatelessWidget { bloodSugarViewMode: bloodSugarViewMode, ), ), - ); + ).then((value) { + if(bloodSugarViewMode.weekDiabtecPatientResult.isEmpty) { + timeSeriesData.clear(); + } + }); }, child: Container( // height: 70, diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart index d11e91f5..89f5545f 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -33,7 +33,7 @@ class VitalSignDetailsScreen extends StatelessWidget { // vitalSigns.add(new VitalSign(TranslationBase.of(context).body, mode.bodyMax, TranslationBase.of(context).mass, "assets/images/new/")); vitalSigns.add(new VitalSign(TranslationBase.of(context).temperature, mode.temperatureCelcius, TranslationBase.of(context).tempC, "assets/images/new/temperature.svg")); vitalSigns.add(new VitalSign(TranslationBase.of(context).heart, mode.hartRat, TranslationBase.of(context).bpm, "assets/images/new/heart_rate.svg")); - vitalSigns.add(new VitalSign(TranslationBase.of(context).respirationRate, mode.respirationBeatPerMinute, TranslationBase.of(context).bpm, "assets/images/new/respiration_rate.svg")); + vitalSigns.add(new VitalSign(TranslationBase.of(context).respirationRate, mode.respirationBeatPerMinute, TranslationBase.of(context).respirationBPM, "assets/images/new/respiration_rate.svg")); vitalSigns.add(new VitalSign(TranslationBase.of(context).bloodPressure, mode.bloodPressure, TranslationBase.of(context).sysDias, "assets/images/new/blood_pressure.svg")); } @@ -71,7 +71,7 @@ class VitalSignDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Body Mass Index is: " + mode.bodyMax, + TranslationBase.of(context).bodyMassIndex + mode.bodyMax, style: TextStyle( fontSize: 16, letterSpacing: -0.64, @@ -83,15 +83,15 @@ class VitalSignDetailsScreen extends StatelessWidget { height: MediaQuery.of(context).size.width / 2.8, child: Row( children: [ - showMass(context, "Underweight", "< 18.5", double.parse(mode.bodyMax) <= 18.5 ? Colors.red : Colors.black, 8), + showMass(context, TranslationBase.of(context).underWeight, "< 18.5", double.parse(mode.bodyMax) <= 18.5 ? Colors.red : Colors.black, 8), mWidth(12), - showMass(context, "Normal", "18.5 - 24.9", (double.parse(mode.bodyMax) > 18.5 && double.parse(mode.bodyMax) < 25) ? Colors.red : Colors.black, 6), + showMass(context, TranslationBase.of(context).healthy, "18.5 - 24.9", (double.parse(mode.bodyMax) > 18.5 && double.parse(mode.bodyMax) < 25) ? Colors.red : Colors.black, 6), mWidth(12), - showMass(context, "Overweight", "25 - 29.9", (double.parse(mode.bodyMax) >= 25 && double.parse(mode.bodyMax) < 30) ? Colors.red : Colors.black, 4), + showMass(context, TranslationBase.of(context).overWeight, "25 - 29.9", (double.parse(mode.bodyMax) >= 25 && double.parse(mode.bodyMax) < 30) ? Colors.red : Colors.black, 4), mWidth(12), - showMass(context, "Obese", "30 - 34.9", (double.parse(mode.bodyMax) >= 30 && double.parse(mode.bodyMax) < 35) ? Colors.red : Colors.black, 2), + showMass(context, TranslationBase.of(context).obese, "30 - 34.9", (double.parse(mode.bodyMax) >= 30 && double.parse(mode.bodyMax) < 35) ? Colors.red : Colors.black, 2), mWidth(12), - showMass(context, "Extreme Obese", "> 35", (double.parse(mode.bodyMax) >= 35) ? Colors.red : Colors.black, 0), + showMass(context, TranslationBase.of(context).extremeObese, "> 35", (double.parse(mode.bodyMax) >= 35) ? Colors.red : Colors.black, 0), ], ), ), diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 241412e9..aaf9aa06 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -111,7 +111,6 @@ class _RateAppointmentDoctorState extends State { color: rating >= (index + 1) ? Color.fromRGBO(255, 186, 0, 1.0) : Colors.grey[400], - // Theme.of(context).hintColor, icon: Icon(rating >= (index + 1) ? Icons.star : Icons.star)), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 8b3c72cf..9676871f 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2326,6 +2326,15 @@ class TranslationBase { String get rateAppointment => localizedValues["rateAppointment"][locale.languageCode]; + String get noInsuranceCardAttached => localizedValues["noInsuranceCardAttached"][locale.languageCode]; + + String get bodyMassIndex => localizedValues["bodyMassIndex"][locale.languageCode]; + + String get extremeObese => localizedValues["extremeObese"][locale.languageCode]; + + String get respirationBPM => localizedValues["respirationBPM"][locale.languageCode]; + + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils_new.dart b/lib/uitl/utils_new.dart index 0040a1f2..124b3b45 100644 --- a/lib/uitl/utils_new.dart +++ b/lib/uitl/utils_new.dart @@ -1,6 +1,9 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; Decoration appGradient = BoxDecoration( gradient: LinearGradient( @@ -23,6 +26,22 @@ Color getColorFromHex(String hexColor) { return Color(int.parse(hexColor, radix: 16)); } +Widget getNoDataWidget(BuildContext context) { + return Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgPicture.asset('assets/images/new/not_found.svg', width: 110.0, height: 110.0), + Container( + margin: EdgeInsets.only(top: 15.0), + child: Text(TranslationBase.of(context).noResultFound, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: Color(0xFFBABABA)))), + ], + ), + ), + ); +} + spacerVertical(double v) { return Container( height: v, diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 8ddca1b2..81defe5d 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -133,7 +133,7 @@ class DoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.getDayMonthYearDateFormattedLang(date, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(date), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), Text( diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 06f392bd..79cccab3 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -75,7 +75,7 @@ class DoctorHeader extends StatelessWidget { children: [ if (headerModel.date != null) Text( - DateUtil.getDayMonthYearDateFormattedLang(headerModel.date, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(headerModel.date), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), if (headerModel.time != null) @@ -118,7 +118,7 @@ class DoctorHeader extends StatelessWidget { ), SizedBox(width: 6), Text( - "${headerModel.totalReviews} ${TranslationBase.of(context).reviews}", + "${headerModel.totalReviews == null ? 0 : headerModel.totalReviews} ${TranslationBase.of(context).reviews}", style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600,