From dfa1952f4dddbb48e776da2e6a292a9ae879323e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 6 Dec 2020 17:44:39 +0300 Subject: [PATCH 01/12] Implemented countdown timer in ToDo list & removed Smart progress bar from the whole app --- lib/config/localized_values.dart | 32 +- lib/core/viewModels/dashboard_view_model.dart | 26 +- lib/pages/Blood/blood_donation.dart | 1 - lib/pages/Blood/confirm_payment_page.dart | 30 +- lib/pages/Blood/dialogs/ConfirmSMSDialog.dart | 46 +-- lib/pages/BookAppointment/BookConfirm.dart | 27 +- lib/pages/BookAppointment/BookSuccess.dart | 50 +-- lib/pages/BookAppointment/BookingOptions.dart | 9 +- .../BookAppointment/DentalComplaints.dart | 19 +- lib/pages/BookAppointment/DoctorProfile.dart | 386 +++++++++--------- lib/pages/BookAppointment/QRCode.dart | 9 +- lib/pages/BookAppointment/Search.dart | 6 +- lib/pages/BookAppointment/SearchResults.dart | 1 + .../components/SearchByClinic.dart | 4 +- .../components/SearchByDoctor.dart | 4 +- .../BookAppointment/widgets/CardCommon.dart | 15 +- .../widgets/DentalComplaintCard.dart | 21 +- .../BookAppointment/widgets/DoctorView.dart | 1 - .../Covid-DriveThru/Covid-TimeSlots.dart | 43 +- .../covid-drivethru-location.dart | 35 +- lib/pages/MyAppointments/MyAppointments.dart | 34 +- lib/pages/MyAppointments/VisitTicket.dart | 16 +- .../widgets/AppointmentActions.dart | 125 ++++-- .../widgets/PrescriptionReport.dart | 17 +- lib/pages/ToDoList/ToDo.dart | 19 + lib/pages/landing/home_page.dart | 2 +- lib/pages/livecare/livecare_home.dart | 66 ++- .../livecare/widgets/LiveCareHistoryCard.dart | 8 +- .../widgets/LiveCarePendingRequest.dart | 12 +- lib/pages/livecare/widgets/clinic_card.dart | 9 +- lib/pages/livecare/widgets/clinic_list.dart | 137 ++++--- lib/pages/login/login.dart | 51 ++- .../medical/ask_doctor/ask_doctor_page.dart | 3 - .../medical/balance/advance_payment_page.dart | 32 +- .../medical/balance/confirm_payment_page.dart | 7 +- .../smart_watch_instructions.dart | 8 +- lib/uitl/location_util.dart | 4 +- lib/uitl/translations_delegate_base.dart | 8 + .../bottom_navigation/bottom_nav_bar.dart | 50 +-- lib/widgets/drawer/app_drawer_widget.dart | 1 - lib/widgets/others/bottom_bar.dart | 32 +- .../others/floating_button_search.dart | 9 +- pubspec.yaml | 7 +- 43 files changed, 803 insertions(+), 619 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e6be280b..ce921a7d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1044,5 +1044,35 @@ const Map localizedValues = { "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", "ar": "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." - } + }, + "dental-complains": { + "en": "Symptoms", + "ar": "الأعراض" + }, + "empty-result": { + "en": "There is no search results found", + "ar": "لايوجد نتائج" + }, + + "no-booked-appointment": { + "en": "No booked appointments", + "ar": "لا يوجد مواعيد محجوزة" + }, + "no-confirmed-appointment": { + "en": "No confirmed appointments", + "ar": "لا توجد مواعيد مؤكدة" + }, + "no-arrived-appointment": { + "en": "No arrived appointments", + "ar": "لا يوجد مواعيد" + }, + "upcoming-empty": { + "en": "You do not have any Todo actions yet.", + "ar": "ليس لديك أي إجراءات الآن." + }, + "upcoming-timeLeft": { + "en": "time left for appointment", + "ar": "الوقت المتبقي للموعد" + }, + }; diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart index 4cf22b23..e98ca341 100644 --- a/lib/core/viewModels/dashboard_view_model.dart +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -1,14 +1,20 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + import '../../locator.dart'; class DashboardViewModel extends BaseViewModel { VitalSignService _vitalSignService = locator(); - String get weightKg => _vitalSignService.weightKg; - String get heightCm => _vitalSignService.heightCm; + + String get weightKg => _vitalSignService.weightKg; + + String get heightCm => _vitalSignService.heightCm; String bloadType = ""; + // ToDoCountProviderModel toDoProvider = + // Provider.of(AppGlobal.context); + getPatientRadOrders() async { if (isLogin && _vitalSignService.weightKg.isEmpty) { setState(ViewState.Busy); @@ -17,7 +23,21 @@ class DashboardViewModel extends BaseViewModel { error = _vitalSignService.error; setState(ViewState.Error); } else - setState(ViewState.Idle); + setState(ViewState.Idle); + // getToDoCount(); } } + +// getToDoCount() { +// toDoProvider.setState(0); +// ClinicListService service = new ClinicListService(); +// service.getActiveAppointmentNo(AppGlobal.context).then((res) { +// print(res['AppointmentActiveNumber']); +// if (res['MessageStatus'] == 1) { +// toDoProvider.setState(res['AppointmentActiveNumber']); +// } else {} +// }).catchError((err) { +// print(err); +// }); +// } } diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index 99e5242e..ad1d8785 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -27,7 +27,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:giffy_dialog/giffy_dialog.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; //import '../../../core/model/my_balance/AdvanceModel.dart'; import 'confirm_payment_page.dart'; diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index 9ad6d68f..75282190 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; @@ -18,7 +20,6 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'dialogs/ConfirmSMSDialog.dart'; import 'new_text_Field.dart'; @@ -159,16 +160,16 @@ class ConfirmPaymentPage extends StatelessWidget { label: TranslationBase.of(context).confirm.toUpperCase(), disabled: model.state == ViewState.Busy, onTap: () { + GifLoaderDialogUtils.showMyDialog(context); model .sendActivationCodeForAdvancePayment( patientID: int.parse(advanceModel.fileNumber), projectID: advanceModel.hospitalsModel.iD) .then((value) { + GifLoaderDialogUtils.hideDialog(context); if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(); - }).showProgressBar( - text: "Loading", - backgroundColor: Colors.blue.withOpacity(0.6)); + }); }, ), ), @@ -248,12 +249,14 @@ class ConfirmPaymentPage extends StatelessWidget { checkPaymentStatus(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); service .checkPaymentStatus( Utils.getAppointmentTransID( appo.projectID, appo.clinicID, appo.appointmentNo), AppGlobal.context) .then((res) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); print("Printing Payment Status Reponse!!!!"); print(res); String paymentInfo = res['Response_Message']; @@ -263,18 +266,21 @@ class ConfirmPaymentPage extends StatelessWidget { AppToast.showErrorToast(message: res['Response_Message']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); service .createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context) .then((res) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); addAdvancedNumberRequest( res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), @@ -282,24 +288,28 @@ class ConfirmPaymentPage extends StatelessWidget { appo.appointmentNo.toString(), appo); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } addAdvancedNumberRequest(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(AppGlobal.context); service .addAdvancedNumberRequest( advanceNumber, paymentReference, appointmentID, AppGlobal.context) .then((res) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); print(res); navigateToHome(AppGlobal.context); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Future navigateToHome(context) async { diff --git a/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart index d165a895..e08d2f28 100644 --- a/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart +++ b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart @@ -8,13 +8,13 @@ import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobi import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class ConfirmSMSDialog extends StatefulWidget { final String phoneNumber; @@ -112,32 +112,31 @@ class _ConfirmSMSDialogState extends State { height: 40, color: Theme.of(context).primaryColor, child: Stack( - children: [ Center( - child: Texts( - 'SMS', - color: Colors.white, - textAlign: TextAlign.center, - ), - ), - Positioned(child: Container( - child: InkWell( - onTap: () => Navigator.pop(context), - child: Container( - decoration: BoxDecoration( - shape: BoxShape.circle, color: Colors.white), - child: Icon( - Icons.clear, - color: Colors.grey[900], - )), + child: Texts( + 'SMS', + color: Colors.white, + textAlign: TextAlign.center, ), ), - left: projectViewModel.isArabic? 2:0, - right: projectViewModel.isArabic? 0:2, + Positioned( + child: Container( + child: InkWell( + onTap: () => Navigator.pop(context), + child: Container( + decoration: BoxDecoration( + shape: BoxShape.circle, color: Colors.white), + child: Icon( + Icons.clear, + color: Colors.grey[900], + )), + ), + ), + left: projectViewModel.isArabic ? 2 : 0, + right: projectViewModel.isArabic ? 0 : 2, ) ], - ), ), Image.asset( @@ -334,15 +333,14 @@ class _ConfirmSMSDialogState extends State { } void submit(MyBalanceViewModel model) { + GifLoaderDialogUtils.showMyDialog(context); if (verifyAccountForm.currentState.validate()) { final activationCode = digit1.text + digit2.text + digit3.text + digit4.text; model .checkActivationCodeForAdvancePayment(activationCode: activationCode) - .then((value) {}) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) .then((value) { + GifLoaderDialogUtils.hideDialog(context); Navigator.pop(context, true); }); } diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index fa69d913..ed0f5bf1 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -2,9 +2,11 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -15,7 +17,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:rating_bar/rating_bar.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'BookSuccess.dart'; @@ -38,11 +39,15 @@ class BookConfirm extends StatefulWidget { PatientShareResponse patientShareResponse; AuthenticatedUser authUser; + @override _BookConfirmState createState() => _BookConfirmState(); } class _BookConfirmState extends State { + + ToDoCountProviderModel toDoProvider; + @override void initState() { widget.authUser = new AuthenticatedUser(); @@ -471,9 +476,10 @@ class _BookConfirmState extends State { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); print(res['AppointmentNo']); - Future.delayed(new Duration(milliseconds: 1800), () { + Future.delayed(new Duration(milliseconds: 500), () { getLiveCareAppointmentPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); + getToDoCount(); }); } else { GifLoaderDialogUtils.hideDialog(context); @@ -499,10 +505,23 @@ class _BookConfirmState extends State { dialog.showAlertDialog(context); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); + } + + getToDoCount() { + toDoProvider.setState(0); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber']); + } else {} + }).catchError((err) { + print(err); + }); } getPatientShare(context, String appointmentNo, int clinicID, int projectID, diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 92e6bc9e..70a5b1fb 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:flutter/material.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'QRCode.dart'; @@ -349,36 +348,37 @@ class _BookSuccessState extends State { confirmAppointment(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); service .confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context) .then((res) { - if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }) - .catchError((err) { - print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - if (appo.isLiveCareAppointment) { - insertLiveCareVIDARequest(appo); - } else { - navigateToHome(context); - } - }); + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + if (appo.isLiveCareAppointment) { + insertLiveCareVIDARequest(appo); + } else { + navigateToHome(context); + } + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); } insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); service .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); navigateToHome(context); @@ -386,9 +386,10 @@ class _BookSuccessState extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Widget _getPayNowAppo() { @@ -633,6 +634,7 @@ class _BookSuccessState extends State { } getApplePayAPQ(AppoitmentAllHistoryResultList appo) { + GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service .checkPaymentStatus( @@ -640,6 +642,7 @@ class _BookSuccessState extends State { appo.projectID, appo.clinicID, appo.appointmentNo), context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); print("Printing Payment Status Reponse!!!!"); print(res); String paymentInfo = res['Response_Message']; @@ -649,9 +652,10 @@ class _BookSuccessState extends State { AppToast.showErrorToast(message: res['Response_Message']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { diff --git a/lib/pages/BookAppointment/BookingOptions.dart b/lib/pages/BookAppointment/BookingOptions.dart index 83af454f..b90c3b34 100644 --- a/lib/pages/BookAppointment/BookingOptions.dart +++ b/lib/pages/BookAppointment/BookingOptions.dart @@ -52,11 +52,10 @@ class _BookingOptionsState extends State { children: [ Expanded( child: CardCommon( - image: 'assets/images/new-design/search_by_clinic.png', - text: TranslationBase.of(context).clinic, - subText: TranslationBase.of(context).name, - type: 0, - ), + image: 'assets/images/new-design/search_by_clinic.png', + text: TranslationBase.of(context).clinic, + subText: TranslationBase.of(context).name, + type: 0), ), Expanded( child: CardCommon( diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 34a7e1e1..043eaff1 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -2,12 +2,13 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart'; -import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class DentalComplaints extends StatefulWidget { SearchInfo searchInfo; @@ -35,7 +36,8 @@ class _DentalComplaintsState extends State { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: "Symptoms", + appBarTitle: TranslationBase.of(context).dentalComplaints, + isShowDecPage: false, body: Container( margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), child: ListView.builder( @@ -59,12 +61,14 @@ class _DentalComplaintsState extends State { } getChiefComplaintsList() { + GifLoaderDialogUtils.showMyDialog(context); getLanguageID(); ClinicListService service = new ClinicListService(); service .getChiefComplaintsList( widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { print(res['List_DentalChiefComplain']); setState(() { @@ -73,10 +77,13 @@ class _DentalComplaintsState extends State { }); print(complaintsList.length); }); - } else {} + } else { + + } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } } diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 94386465..20e4ae09 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -275,209 +275,214 @@ class _DoctorProfileState extends State child: Opacity( opacity: a1.value, child: Dialog( - child: Container( - height: 400.0, - width: MediaQuery.of(context).size.width * 0.8, - color: Colors.white, - child: Column( - children: [ - Container( - alignment: Alignment.center, - width: MediaQuery.of(context).size.width, - color: Theme.of(context).primaryColor, - margin: EdgeInsets.only(bottom: 5.0), - padding: EdgeInsets.all(10.0), - child: Text(TranslationBase.of(context).doctorRating, - style: TextStyle( - fontSize: 22.0, color: Colors.white))), - Container( - margin: EdgeInsets.only(top: 0.0), - child: Text( - this - .widget - .doctor - .actualDoctorRate - .ceilToDouble() - .toString(), - style: TextStyle( - fontSize: 32.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 5.0), - alignment: Alignment.center, - child: RatingBar.readOnly( - initialRating: - this.widget.doctor.actualDoctorRate.toDouble(), - size: 35.0, - filledColor: Colors.yellow[700], - emptyColor: Colors.grey[500], - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star, - ), - ), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text( - this.widget.doctor.noOfPatientsRate.toString() + - " " + - TranslationBase.of(context).reviews, - style: TextStyle( - fontSize: 14.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Row( - children: [ - Container( - width: 100.0, - margin: EdgeInsets.only( - top: 10.0, left: 15.0, right: 15.0), - child: Text( - TranslationBase.of(context).excellent, - style: TextStyle( - fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth( - doctorDetailsList[0].patientNumber), - height: 6.0, - child: Container( - color: Colors.green[700], - ), - ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + // height: 400.0, + width: MediaQuery.of(context).size.width * 0.8, + color: Colors.white, + child: Column( + children: [ + Container( + alignment: Alignment.center, + width: MediaQuery.of(context).size.width, + color: Theme.of(context).primaryColor, + margin: EdgeInsets.only(bottom: 5.0), + padding: EdgeInsets.all(10.0), + child: Text(TranslationBase.of(context).doctorRating, + style: TextStyle( + fontSize: 22.0, color: Colors.white))), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Text( + this + .widget + .doctor + .actualDoctorRate + .ceilToDouble() + .toString(), + style: TextStyle( + fontSize: 32.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: + this.widget.doctor.actualDoctorRate.toDouble(), + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, ), - ], - ), - ), - Container( - child: Row( - children: [ - Container( - width: 100.0, - margin: EdgeInsets.only( - top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).v_good, - style: TextStyle( - fontSize: 13.0, color: Colors.black))), - Container( + ), + Container( margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth( - doctorDetailsList[1].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffB7B723), + child: Text( + this.widget.doctor.noOfPatientsRate.toString() + + " " + + TranslationBase.of(context).reviews, + style: TextStyle( + fontSize: 14.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).excellent, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[0].patientNumber), + height: 6.0, + child: Container( + color: Colors.green[700], + ), + ), ), - ), + ], ), - ], - ), - ), - Container( - child: Row( - children: [ - Container( - width: 100.0, - margin: EdgeInsets.only( - top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).good, - style: TextStyle( - fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth( - doctorDetailsList[2].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffEBA727), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).v_good, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[1].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffB7B723), + ), + ), ), - ), + ], ), - ], - ), - ), - Container( - child: Row( - children: [ - Container( - width: 100.0, - margin: EdgeInsets.only( - top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).average, - style: TextStyle( - fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth( - doctorDetailsList[3].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffEB7227), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).good, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[2].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEBA727), + ), + ), ), - ), + ], ), - ], - ), - ), - Container( - child: Row( - children: [ - Container( - width: 100.0, - margin: EdgeInsets.only( - top: 10.0, left: 15.0, right: 15.0), - child: Text( - TranslationBase.of(context).below_average, - style: TextStyle( - fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth( - doctorDetailsList[4].patientNumber), - height: 6.0, - child: Container( - color: Color(0xffE20C0C), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).average, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[3].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEB7227), + ), + ), ), - ), + ], ), - ], - ), - ), - Container( - margin: EdgeInsets.only(top: 40.0), child: Divider()), - Container( - margin: EdgeInsets.only(top: 0.0), - child: Align( - alignment: FractionalOffset.bottomCenter, - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).below_average, + style: TextStyle( + fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[4].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffE20C0C), + ), + ), + ), + ], ), - minWidth: MediaQuery.of(context).size.width, - height: 40.0, - child: RaisedButton( - elevation: 0.0, - color: Colors.white, - textColor: Colors.red, - hoverColor: Colors.transparent, - focusColor: Colors.transparent, - highlightColor: Colors.transparent, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - Navigator.of(context).pop(); - }, - child: Text(TranslationBase.of(context).cancel, - style: TextStyle(fontSize: 18.0)), + ), + Container( + margin: EdgeInsets.only(top: 40.0), child: Divider()), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Align( + alignment: FractionalOffset.bottomCenter, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 40.0, + child: RaisedButton( + elevation: 0.0, + color: Colors.white, + textColor: Colors.red, + hoverColor: Colors.transparent, + focusColor: Colors.transparent, + highlightColor: Colors.transparent, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(TranslationBase.of(context).cancel, + style: TextStyle(fontSize: 18.0)), + ), + ), ), ), - ), + ], ), - ], - ), + ), + ], ), ), ), @@ -491,10 +496,7 @@ class _DoctorProfileState extends State } double getRatingWidth(int patientNumber) { - print(patientNumber); - print(this.widget.doctor.noOfPatientsRate); var width = (patientNumber / this.widget.doctor.noOfPatientsRate) * 100; - print(width); return width; } diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index e92c2348..487d1be7 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -10,11 +10,11 @@ import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsLis import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class QRCode extends StatefulWidget { PatientShareResponse patientShareResponse; @@ -235,6 +235,7 @@ class _QRCodeState extends State { okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () { + GifLoaderDialogUtils.showMyDialog(context); service .sendAppointmentQREmail( widget.authUser.emailAddress, @@ -247,15 +248,15 @@ class _QRCodeState extends State { widget.patientShareResponse.doctorSpeciality), context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res); ConfirmDialog.closeAlertDialog(context); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); ConfirmDialog.closeAlertDialog(context); AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", - backgroundColor: Colors.blue.withOpacity(0.6)); + }); }, cancelFunction: () => {}); dialog.showAlertDialog(context); diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index 095d72a6..44cf46c3 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -1,18 +1,16 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart'; -import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart'; -import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:flutter/material.dart'; -import 'package:geolocator/geolocator.dart'; class Search extends StatefulWidget { final int type; final List clnicIds; + Search({this.type = 0, this.clnicIds}); + @override _SearchState createState() => _SearchState(); } diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 055b0c41..72226c2e 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -27,6 +27,7 @@ class _SearchResultsState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).bookAppo, isShowAppBar: true, + isShowDecPage: false, body: Container( margin: EdgeInsets.all(10.0), child: SingleChildScrollView( diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 7943e423..355bb52b 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -13,7 +13,6 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class SearchByClinic extends StatefulWidget { final List clnicIds; @@ -137,7 +136,8 @@ class _SearchByClinicState extends State { margin: EdgeInsets.only(top: 15.0), child: DropdownButtonHideUnderline( child: DropdownButton( - hint: new Text("Select Project"), + hint: + new Text(TranslationBase.of(context).selectHospital), value: projectDropdownValue, items: projectsList.map((item) { return new DropdownMenuItem( diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 1e1945b5..8d2b9387 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -4,7 +4,6 @@ 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:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../SearchResults.dart'; @@ -129,9 +128,12 @@ class _SearchByDoctorState extends State { navigateToSearchResults( context, doctorsList, _patientDoctorAppointmentListHospital); } else { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); }); } diff --git a/lib/pages/BookAppointment/widgets/CardCommon.dart b/lib/pages/BookAppointment/widgets/CardCommon.dart index e56ba965..6a7e2bdd 100644 --- a/lib/pages/BookAppointment/widgets/CardCommon.dart +++ b/lib/pages/BookAppointment/widgets/CardCommon.dart @@ -1,12 +1,16 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class CardCommon extends StatelessWidget { + var languageID; final image; final text; final subText; final type; - const CardCommon( + + CardCommon( {@required this.image, @required this.text, @required this.subText, @@ -14,6 +18,7 @@ class CardCommon extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return GestureDetector( onTap: () { navigateToSearch(context, this.type); @@ -43,8 +48,12 @@ class CardCommon extends StatelessWidget { color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), ), Container( - alignment: Alignment.bottomRight, - margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), + alignment: projectViewModel.isArabic + ? Alignment.bottomLeft + : Alignment.bottomRight, + margin: projectViewModel.isArabic + ? EdgeInsets.fromLTRB(10.0, 0.0, 00.0, 8.0) + : EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0), child: Image.asset(this.image, width: 60.0, height: 60.0), ), ], diff --git a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart index 27f37d0a..eb434cad 100644 --- a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart +++ b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart @@ -3,8 +3,9 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; // ignore: must_be_immutable class DentalComplaintCard extends StatefulWidget { @@ -69,14 +70,15 @@ class _DentalComplaintCardState extends State { List doctorsList = []; List _patientDoctorAppointmentListHospital = List(); - + GifLoaderDialogUtils.showMyDialog(context); ClinicListService service = new ClinicListService(); service .getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD, widget.listDentalChiefComplain.projectID, context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { - print(res['List_DentalDoctorChiefComplaintMapping']); + print(res['ErrorEndUserMessage']); setState(() { doctorsList.clear(); res['List_DentalDoctorChiefComplaintMapping'].forEach((v) { @@ -107,16 +109,21 @@ class _DentalComplaintCardState extends State { patientDoctorAppointment: element)); } }); - navigateToSearchResults( - context, doctorsList, _patientDoctorAppointmentListHospital); + if (doctorsList.length != 0) { + navigateToSearchResults( + context, doctorsList, _patientDoctorAppointmentListHospital); + } else { + AppToast.showErrorToast(message: TranslationBase.of(context).emptyResult); + } }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Future navigateToSearchResults( diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index d419e4af..bd4fb429 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -6,7 +6,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:rating_bar/rating_bar.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../DoctorProfile.dart'; diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart index 3e58b657..8375e337 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -9,13 +9,13 @@ import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.da import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:intl/intl.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:table_calendar/table_calendar.dart'; class CovidTimeSlots extends StatefulWidget { @@ -481,6 +481,7 @@ class _CovidTimeSlotsState extends State insertAppointmentCovidTest(context, DoctorList docObject) { DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); AppoitmentAllHistoryResultList appo; service .insertAppointment( @@ -491,7 +492,7 @@ class _CovidTimeSlotsState extends State CovidTimeSlots.selectedDate, context) .then((res) { - print(res); + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); Future.delayed(new Duration(milliseconds: 1800), () { @@ -521,17 +522,19 @@ class _CovidTimeSlotsState extends State dialog.showAlertDialog(context); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) { ConfirmDialog.closeAlertDialog(context); + GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service.cancelAppointment(appo, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { Future.delayed(new Duration(milliseconds: 1500), () { insertAppointmentCovidTest(context, docObject); @@ -540,28 +543,27 @@ class _CovidTimeSlotsState extends State AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { + GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service .getPatientShare(appointmentNo, clinicID, projectID, context) .then((res) { - print(res); - widget.patientShareResponse = new PatientShareResponse.fromJson(res); - }) - .catchError((err) { - print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - navigateToPaymentAlert(); - }); + GifLoaderDialogUtils.hideDialog(context); + widget.patientShareResponse = new PatientShareResponse.fromJson(res); + navigateToPaymentAlert(); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); } navigateToPaymentAlert() { @@ -573,8 +575,10 @@ class _CovidTimeSlotsState extends State } getCovidFreeSlots(BuildContext context, int projectID) { + GifLoaderDialogUtils.showMyDialog(context); CovidDriveThruService service = new CovidDriveThruService(); service.getCovidFreeSlots(context, projectID).then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res['COVID19_FreeTimeSlots']); if (res['MessageStatus'] == 1) { if (res['COVID19_FreeTimeSlots'].length != 0) { @@ -595,8 +599,9 @@ class _CovidTimeSlotsState extends State AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } } diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 0563c4bd..245bcbaf 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -3,11 +3,12 @@ import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCe import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class CovidDrivethruLocation extends StatefulWidget { @override @@ -258,37 +259,38 @@ class _CovidDrivethruLocationState extends State { CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse(); + GifLoaderDialogUtils.showMyDialog(context); + service .getCovidPaymentInformation(context, int.parse(projectID)) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson( res['COVID19_PatientShare']); - print(covidPaymentInfoResponse.procedureNameField); }); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => CovidPaymentDetails( + covidPaymentInfoResponse: covidPaymentInfoResponse, + projectID: int.parse(projectID), + ))); } else {} }) .catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => CovidPaymentDetails( - covidPaymentInfoResponse: covidPaymentInfoResponse, - projectID: int.parse(projectID), - ))); }); } getProjectsList(BuildContext context) { CovidDriveThruService service = new CovidDriveThruService(); + GifLoaderDialogUtils.showMyDialog(context); service.getCovidProjectsList(context).then((res) { - print(res); + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { print(res); setState(() { @@ -298,8 +300,9 @@ class _CovidDrivethruLocationState extends State { }); } else {} }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } } diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 7b7dc1da..aa3b72ae 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -47,10 +47,19 @@ class _MyAppointmentsState extends State void initState() { _tabController = new TabController(length: 3, vsync: this); WidgetsBinding.instance.addPostFrameCallback((_) { - if (Provider.of(context, listen: false).isLogin) getPatientAppointmentHistory(); + if (Provider.of(context, listen: false).isLogin) + getPatientAppointmentHistory(); }); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/0.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/1.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/1.png')); super.initState(); } @@ -108,14 +117,14 @@ class _MyAppointmentsState extends State if (res['MessageStatus'] == 1) { GifLoaderDialogUtils.hideDialog(context); setState(() { + isDataLoaded = true; if (res['AppoimentAllHistoryResultList'].length != 0) { + isDataLoaded = true; res['AppoimentAllHistoryResultList'].forEach((v) { widget.appoList .add(new AppoitmentAllHistoryResultList.fromJson(v)); }); sortAppointmentList(); - openAppointmentsTab(); - isDataLoaded = true; } else {} }); } else { @@ -224,6 +233,7 @@ class _MyAppointmentsState extends State filterName: element.clinicName, patientDoctorAppointment: element)); } + openAppointmentsTab(); }); } @@ -290,7 +300,7 @@ class _MyAppointmentsState extends State "assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text("No Booked Appointments", + child: Text(TranslationBase.of(context).noBookedAppo, style: TextStyle( fontSize: 16.0, )), @@ -345,8 +355,7 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: Text( - TranslationBase.of(context).noConfirmedAppointments, + child: Text(TranslationBase.of(context).noConfirmedAppo, style: TextStyle( fontSize: 16.0, )), @@ -400,11 +409,10 @@ class _MyAppointmentsState extends State Image.asset("assets/images/new-design/noAppointmentIcon.png"), Container( margin: EdgeInsets.only(top: 10.0), - child: - Text(TranslationBase.of(context).noArrivedAppointments, - style: TextStyle( - fontSize: 16.0, - )), + child: Text(TranslationBase.of(context).noArrivedAppo, + style: TextStyle( + fontSize: 16.0, + )), ), ], ), diff --git a/lib/pages/MyAppointments/VisitTicket.dart b/lib/pages/MyAppointments/VisitTicket.dart index 54dcf13f..6f1dbdf8 100644 --- a/lib/pages/MyAppointments/VisitTicket.dart +++ b/lib/pages/MyAppointments/VisitTicket.dart @@ -2,11 +2,11 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class VisitTicket extends StatefulWidget { List appoList = []; @@ -48,9 +48,10 @@ class _VisitTicketState extends State { } getPatientAppointmentCurfewHistory(BuildContext context) { - loading(true); DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); service.getPatientAppointmentHistory(true, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res['AppoimentAllHistoryResultList']); if (res['MessageStatus'] == 1) { setState(() { @@ -61,20 +62,13 @@ class _VisitTicketState extends State { }); } else {} }); - loading(false); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - loading(false); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - loading(false); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); - } - - loading(bool flag) { - setState(() { - isLoading = flag; }); } } diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 93069f1e..ce312a8d 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -1,7 +1,9 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart'; @@ -17,6 +19,7 @@ import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.d import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -24,6 +27,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class AppointmentActions extends StatefulWidget { @@ -44,16 +48,22 @@ class AppointmentActions extends StatefulWidget { class _AppointmentActionsState extends State { List appoButtonsList = []; + ToDoCountProviderModel toDoProvider; + @override void initState() { + toDoProvider = Provider.of(context); _getAppointmentActionButtons(); super.initState(); } @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); var size = MediaQuery.of(context).size; - final double itemHeight = ((size.height - kToolbarHeight - 24) * 0.455) / 2; + final double itemHeight = projectViewModel.isArabic + ? ((size.height - kToolbarHeight - 24) * 0.47) / 2 + : ((size.height - kToolbarHeight - 24) * 0.4) / 2; final double itemWidth = size.width / 2; return Container( @@ -72,51 +82,62 @@ class _AppointmentActionsState extends State { onTap: () { _handleButtonClicks(e); }, - child: Container( - // height: 100.0, - margin: EdgeInsets.all(7.0), - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.grey[400], - blurRadius: 2.0, - spreadRadius: 0.0) - ], - borderRadius: BorderRadius.circular(10), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Container( - margin: - EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0), - child: Text(e.title, - overflow: TextOverflow.clip, - style: TextStyle( - color: new Color(0xFF40ACC9), - letterSpacing: 1.0, - fontSize: 18.0)), - ), - Container( - margin: - EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0), - child: Text(e.subtitle, - overflow: TextOverflow.clip, - style: TextStyle( - color: Colors.black, - letterSpacing: 1.0, - fontSize: 15.0)), - ), - Container( - alignment: Alignment.bottomRight, - margin: - EdgeInsets.fromLTRB(0.0, 10.0, 10.0, 7.0), - child: Image.asset(e.icon, - width: 40.0, height: 40.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + // height: 100.0, + margin: EdgeInsets.all(7.0), + padding: EdgeInsets.only(bottom: 15.0), + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Colors.grey[400], + blurRadius: 2.0, + spreadRadius: 0.0) + ], + borderRadius: BorderRadius.circular(10), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Container( + margin: + EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0), + child: Text(e.title, + overflow: TextOverflow.clip, + style: TextStyle( + color: new Color(0xFF40ACC9), + letterSpacing: 1.0, + fontSize: 18.0)), + ), + Container( + margin: + EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0), + child: Text(e.subtitle, + overflow: TextOverflow.clip, + style: TextStyle( + color: Colors.black, + letterSpacing: 1.0, + fontSize: 15.0)), + ), + Container( + alignment: projectViewModel.isArabic + ? Alignment.bottomLeft + : Alignment.bottomRight, + margin: projectViewModel.isArabic + ? EdgeInsets.fromLTRB( + 10.0, 7.0, 0.0, 8.0) + : EdgeInsets.fromLTRB( + 0.0, 7.0, 10.0, 8.0), + child: Image.asset(e.icon, + width: 45.0, height: 45.0), + ), + ], ), - ], - ), + ), + ], ), )) .toList(), @@ -357,6 +378,7 @@ class _AppointmentActionsState extends State { GifLoaderDialogUtils.hideDialog(context); print(res); if (res['MessageStatus'] == 1) { + getToDoCount(); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); Navigator.of(context).pop(); } else { @@ -368,6 +390,19 @@ class _AppointmentActionsState extends State { }); } + getToDoCount() { + toDoProvider.setState(0); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + print(res['AppointmentActiveNumber']); + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber']); + } else {} + }).catchError((err) { + print(err); + }); + } + openAppointmentRadiology() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); diff --git a/lib/pages/MyAppointments/widgets/PrescriptionReport.dart b/lib/pages/MyAppointments/widgets/PrescriptionReport.dart index 932211ba..213e28e1 100644 --- a/lib/pages/MyAppointments/widgets/PrescriptionReport.dart +++ b/lib/pages/MyAppointments/widgets/PrescriptionReport.dart @@ -4,7 +4,7 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -16,7 +16,10 @@ class PrescriptionReportPage extends StatefulWidget { dynamic listPres; AppoitmentAllHistoryResultList appo; - PrescriptionReportPage({@required this.prescriptionReportEnhList, @required this.listPres, @required this.appo}); + PrescriptionReportPage( + {@required this.prescriptionReportEnhList, + @required this.listPres, + @required this.appo}); @override _PrescriptionReportState createState() => _PrescriptionReportState(); @@ -113,12 +116,18 @@ class _PrescriptionReportState extends State { sendPrescriptionReportEmail() { DoctorsListService service = new DoctorsListService(); - service.sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, widget.listPres, context).then((res) { + GifLoaderDialogUtils.showMyDialog(context); + service + .sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, + widget.listPres, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail'); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); AppToast.showErrorToast(message: err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } navigateToPrescriptionDetails(PrescriptionReportEnh prescriptionReportEnh) { diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 18da37e8..fb8990b2 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -19,6 +19,8 @@ import 'package:diplomaticquarterapp/uitl/utils.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:flutter_countdown_timer/current_remaining_time.dart'; +import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -208,6 +210,22 @@ class _ToDoState extends State { ), ], ), + Container( + child: CountdownTimer( + endTime: DateTime.now().millisecondsSinceEpoch + + (widget.appoList[index] + .remaniningHoursTocanPay * + 1000) * + 60, + widgetBuilder: (_, CurrentRemainingTime time) { + return Text( + '${time.days}:${time.hours}:${time.min}:${time.sec} ' + TranslationBase.of(context).upcomingTimeLeft, + style: TextStyle( + fontSize: 12.0, + color: Color(0xff40ACC9))); + }, + ), + ), ], ), ), @@ -503,6 +521,7 @@ class _ToDoState extends State { widget.appoList.forEach((element) { print(element.isLiveCareAppointment); print(element.nextAction); + print(element.remaniningHoursTocanPay); }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index fbdaf906..008887ca 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -191,7 +191,7 @@ class _HomePageState extends State { ) : Container( width: double.infinity, - height: projectViewModel.isArabic ? 180 : 150, + height: projectViewModel.isArabic ? 180 : 160, decoration: BoxDecoration( color: Theme.of(context).primaryColor, shape: BoxShape.rectangle, diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index fc5c4eab..3243b269 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -3,12 +3,11 @@ import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePendingReque import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_list.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/livecare_logs.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; - -import 'livecare_type_select.dart'; class LiveCareHome extends StatefulWidget { static bool showFooterButton = true; @@ -93,40 +92,37 @@ class _LiveCareHomeState extends State hasLiveCareRequest = false; }); LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); PatientERVirtualHistoryResponse patientERVirtualHistoryResponse = new PatientERVirtualHistoryResponse(); - service - .getLivecareHistory(context) - .then((res) { - setState(() { - print(res['ErRequestHistoryList'].length); - if (res['ErRequestHistoryList'].length != 0) { - patientERVirtualHistoryResponse = - PatientERVirtualHistoryResponse.fromJson(res); - erRequestHistoryList = - patientERVirtualHistoryResponse.erRequestHistoryList; + service.getLivecareHistory(context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + setState(() { + print(res['ErRequestHistoryList'].length); + if (res['ErRequestHistoryList'].length != 0) { + patientERVirtualHistoryResponse = + PatientERVirtualHistoryResponse.fromJson(res); + erRequestHistoryList = + patientERVirtualHistoryResponse.erRequestHistoryList; - if (patientERVirtualHistoryResponse - .erRequestHistoryList[0].callStatus < - 4) { - pendingERRequestHistoryList = - patientERVirtualHistoryResponse.erRequestHistoryList[0]; - hasLiveCareRequest = true; - } else { - hasLiveCareRequest = false; - } - } - }); - }) - .catchError((err) { - print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - setState(() { - isDataLoaded = true; - }); - }); + if (patientERVirtualHistoryResponse + .erRequestHistoryList[0].callStatus < + 4) { + pendingERRequestHistoryList = + patientERVirtualHistoryResponse.erRequestHistoryList[0]; + hasLiveCareRequest = true; + } else { + hasLiveCareRequest = false; + } + } + }); + setState(() { + isDataLoaded = true; + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); } } diff --git a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart index 25ec8514..e80f79ee 100644 --- a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart +++ b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart @@ -5,11 +5,11 @@ import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class LiveCareHistoryCard extends StatefulWidget { ErRequestHistoryList erRequestHistoryList; @@ -177,6 +177,7 @@ class _LiveCareHistoryCardState extends State { sendInvoiceEmail(context) { ConfirmDialog.closeAlertDialog(context); LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service .sendLiveCareInvoiceEmail( widget.erRequestHistoryList.appointmentNo.toString(), @@ -184,12 +185,13 @@ class _LiveCareHistoryCardState extends State { authUser.emailAddress, context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: "LiveCare invoice sent successfully"); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } getAuthenticatedUser() async { diff --git a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart index bfd42e62..7ce39804 100644 --- a/lib/pages/livecare/widgets/LiveCarePendingRequest.dart +++ b/lib/pages/livecare/widgets/LiveCarePendingRequest.dart @@ -3,9 +3,9 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/PatientERVirtualHistoryR import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.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:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class LiveCarePendingRequest extends StatefulWidget { ErRequestHistoryList pendingERRequestHistoryList; @@ -149,19 +149,19 @@ class _LiveCarePendingRequestState extends State { cancelLiveCareRequest() { LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service .cancelLiveCareRequest(widget.pendingERRequestHistoryList.vCID, context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast( message: "LiveCare request cancelled successfully"); + widget.getLiveCareHistory(); }) .catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - widget.getLiveCareHistory(); }); } } diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index 56613034..410b7170 100644 --- a/lib/pages/livecare/widgets/clinic_card.dart +++ b/lib/pages/livecare/widgets/clinic_card.dart @@ -2,8 +2,8 @@ import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsRespon import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'ClinicTimingsDialog.dart'; @@ -90,9 +90,11 @@ class _State extends State { getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) { LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service .getLivecareClinicTiming(patientERGetClinicsList.serviceID, context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { clinicsServiceTimingsResponse = @@ -129,8 +131,9 @@ class _State extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } } diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 8ce3b7b0..fc27d92b 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -17,13 +17,13 @@ import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart' import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class ClinicList extends StatefulWidget { final Function getLiveCareHistory; @@ -79,31 +79,27 @@ class _clinic_listState extends State { void startLiveCare() { bool isError = false; LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); ERAppointmentFeesResponse erAppointmentFeesResponse = new ERAppointmentFeesResponse(); - service - .getERAppointmentFees(selectedClinicID, context) - .then((res) { - if (res['HasAppointment'] == true) { - isError = true; - showLiveCareCancelDialog(res['ErrorEndUserMessage'], res); - } else { - erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res); - isError = false; - } - }) - .catchError((err) { - print(err); - isError = true; - AppToast.showErrorToast(message: err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - if (!isError) - getERAppointmentTime( - erAppointmentFeesResponse.getERAppointmentFeesList); - }); + service.getERAppointmentFees(selectedClinicID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['HasAppointment'] == true) { + isError = true; + showLiveCareCancelDialog(res['ErrorEndUserMessage'], res); + } else { + erAppointmentFeesResponse = ERAppointmentFeesResponse.fromJson(res); + isError = false; + } + if (!isError) + getERAppointmentTime( + erAppointmentFeesResponse.getERAppointmentFeesList); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + isError = true; + AppToast.showErrorToast(message: err); + }); } showLiveCareCancelDialog(String msg, res) { @@ -112,8 +108,7 @@ class _clinic_listState extends State { confirmMessage: msg, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => - {cancelAppointment(res)}, + okFunction: () => {cancelAppointment(res)}, cancelFunction: () => {}); dialog.showAlertDialog(context); } @@ -132,38 +127,37 @@ class _clinic_listState extends State { appo.appointmentDate = res['AppointmentDate']; ConfirmDialog.closeAlertDialog(context); + GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service - .cancelAppointment(appo, context) - .then((res) { - print(res); - if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); - } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); - } - }) - .catchError((err) { - print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - startLiveCare(); - }); + service.cancelAppointment(appo, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + print(res); + if (res['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); + startLiveCare(); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); } getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) { LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service.getERAppointmentTime(selectedClinicID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res); showLiveCarePaymentDialog( getERAppointmentFeesList, res['WatingtimeInteger']); }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); AppToast.showErrorToast(message: err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } showLiveCarePaymentDialog( @@ -320,12 +314,14 @@ class _clinic_listState extends State { checkPaymentStatus(AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); service .checkPaymentStatus( Utils.getAppointmentTransID( appo.projectID, appo.clinicID, appo.appointmentNo), context) .then((res) { + GifLoaderDialogUtils.hideDialog(context); print("Printing Payment Status Reponse!!!!"); print(res); String paymentInfo = res['Response_Message']; @@ -336,27 +332,27 @@ class _clinic_listState extends State { AppToast.showErrorToast(message: res['Response_Message']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } addNewCallForPatientER(String clientRequestID) { LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service .addNewCallForPatientER(selectedClinicID, clientRequestID, context) .then((res) { - AppToast.showSuccessToast( - message: "New Call has been added successfully"); - }) - .catchError((err) { - print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - widget.getLiveCareHistory(); - }); + GifLoaderDialogUtils.hideDialog(context); + AppToast.showSuccessToast( + message: "New Call has been added successfully"); + widget.getLiveCareHistory(); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); } getLanguageID() async { @@ -366,7 +362,9 @@ class _clinic_listState extends State { getLiveCareClinicsList() { isDataLoaded = false; LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service.getLivecareClinics(context).then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res['PatientER_GetClinicsList'].length); if (res['MessageStatus'] == 1) { setState(() { @@ -384,15 +382,18 @@ class _clinic_listState extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } getLiveCareScheduleClinicsList() { isDataLoaded = false; LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service.getLiveCareScheduledClinics(context).then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res['ClinicsHaveScheduleList'].length); if (res['MessageStatus'] == 1) { setState(() { @@ -411,9 +412,10 @@ class _clinic_listState extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } openLiveCareSelectionDialog() { @@ -605,13 +607,13 @@ class _clinic_listState extends State { void startScheduleLiveCare() { List doctorsList = []; LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); List _patientDoctorAppointmentListHospital = List(); service .getLiveCareScheduledDoctorList(context, selectedClinicID) .then((res) { - print(res['DoctorByClinicIDList']); - print(res['DoctorByClinicIDList'].length); + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { if (res['DoctorByClinicIDList'].length != 0) { @@ -650,9 +652,10 @@ class _clinic_listState extends State { context, doctorsList, _patientDoctorAppointmentListHospital); } else {} }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Future navigateToSearchResults( diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index a1540ef7..db4ba713 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -20,13 +20,11 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_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'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class Login extends StatefulWidget { @override @@ -93,23 +91,24 @@ class _Login extends State { onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), - Directionality( - textDirection:TextDirection.ltr,child:Container( - child: TextFields( - fontWeight: FontWeight.normal, - controller: nationalIDorFile, - onChanged: (value) => {validateForm()}, - prefixIcon: Icon( - loginType == 1 - ? Icons.chrome_reader_mode - : Icons.receipt, - color: Color(0xFF40ACC9)), - padding: EdgeInsets.only( - top: 20, bottom: 20, left: 10, right: 10), - hintText: loginType == 1 - ? TranslationBase.of(context).nationalID - : TranslationBase.of(context).fileNo, - ))) + Directionality( + textDirection: TextDirection.ltr, + child: Container( + child: TextFields( + fontWeight: FontWeight.normal, + controller: nationalIDorFile, + onChanged: (value) => {validateForm()}, + prefixIcon: Icon( + loginType == 1 + ? Icons.chrome_reader_mode + : Icons.receipt, + color: Color(0xFF40ACC9)), + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + hintText: loginType == 1 + ? TranslationBase.of(context).nationalID + : TranslationBase.of(context).fileNo, + ))) ], ), ), @@ -122,7 +121,9 @@ class _Login extends State { color: Colors.grey, height: 2, ), - SizedBox(height: 10,), + SizedBox( + height: 10, + ), Row( children: [ Expanded( @@ -209,15 +210,13 @@ class _Login extends State { okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => { - ConfirmDialog.closeAlertDialog(context), + ConfirmDialog.closeAlertDialog(context), Navigator.of(context).pushNamed( REGISTER, ), - }, cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); dialog.showAlertDialog(context); - }); // SMSOTP.showLoadingDialog(context, false), } @@ -244,9 +243,9 @@ class _Login extends State { this.authService.checkActivationCode(request, code).then((result) => { sharedPref.remove(FAMILY_FILE), result = CheckActivationCode.fromJson(result), - result.list.isFamily =false, - this.sharedPref.setObject(USER_PROFILE, result.list), - this.sharedPref.setObject(MAIN_USER, result.list), + result.list.isFamily = false, + this.sharedPref.setObject(USER_PROFILE, result.list), + this.sharedPref.setObject(MAIN_USER, result.list), this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), this.sharedPref.setString(TOKEN, result.authenticationTokenID), authenticatedUserObject.getUser(), diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index 6beed0dc..e6172b7a 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -1,7 +1,5 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; -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/uitl/app_toast.dart'; @@ -12,7 +10,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:rating_bar/rating_bar.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; class AskDoctorPage extends StatelessWidget { @override diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 9f3cda72..85a0cc8f 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; @@ -19,7 +20,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../../../core/model/my_balance/AdvanceModel.dart'; import 'confirm_payment_page.dart'; @@ -56,7 +56,11 @@ class _AdvancePaymentPageState extends State { void initState() { super.initState(); getAuthUser(); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/images-info-home/advance-payment/ar/0.png')); } @override @@ -107,13 +111,13 @@ class _AdvancePaymentPageState extends State { if (beneficiaryType == BeneficiaryType.MyFamilyFiles) InkWell( onTap: () { + GifLoaderDialogUtils.showMyDialog(context); model.getFamilyFiles().then((value) { + GifLoaderDialogUtils.hideDialog(context); confirmSelectFamilyDialog(model .getAllSharedRecordsByStatusResponse .getAllSharedRecordsByStatusList); - }).showProgressBar( - text: "Loading", - backgroundColor: Colors.blue.withOpacity(0.6)); + }); }, child: Container( padding: EdgeInsets.all(12), @@ -145,17 +149,16 @@ class _AdvancePaymentPageState extends State { if (beneficiaryType == BeneficiaryType.OtherAccount) InkWell( onTap: () { - if (_fileTextController.text.isNotEmpty) + if (_fileTextController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); model .getPatientInfoByPatientID( id: _fileTextController.text) .then((value) { + GifLoaderDialogUtils.hideDialog(context); confirmSelectPatientDialog(model.patientInfoList); - }).showProgressBar( - text: "Loading", - backgroundColor: - Colors.blue.withOpacity(0.6)); - else + }); + } else AppToast.showErrorToast( message: 'Please Enter The File Number'); }, @@ -268,10 +271,11 @@ class _AdvancePaymentPageState extends State { advanceModel.amount = amount; advanceModel.mobileNumber = mobileNum; advanceModel.patientName = patientName; - + GifLoaderDialogUtils.showMyDialog(context); model .getPatientInfoByPatientIDAndMobileNumber(advanceModel) .then((value) { + GifLoaderDialogUtils.hideDialog(context); if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) { Utils.hideKeyboard(context); @@ -295,9 +299,7 @@ class _AdvancePaymentPageState extends State { }, ); } - }).showProgressBar( - text: "Loading", - backgroundColor: Colors.blue.withOpacity(0.6)); + }); }, ), )), diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 4954653d..679a16db 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -19,7 +19,6 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'dialogs/ConfirmSMSDialog.dart'; import 'new_text_Field.dart'; @@ -165,16 +164,16 @@ class ConfirmPaymentPage extends StatelessWidget { label: TranslationBase.of(context).confirm.toUpperCase(), disabled: model.state == ViewState.Busy, onTap: () { + GifLoaderDialogUtils.showMyDialog(context); model .sendActivationCodeForAdvancePayment( patientID: int.parse(advanceModel.fileNumber), projectID: advanceModel.hospitalsModel.iD) .then((value) { + GifLoaderDialogUtils.hideDialog(context); if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(); - }).showProgressBar( - text: "Loading", - backgroundColor: Colors.blue.withOpacity(0.6)); + }); }, ), ), diff --git a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart index eb0c1675..20217ca9 100644 --- a/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart +++ b/lib/pages/medical/smart_watch_health_data/smart_watch_instructions.dart @@ -3,9 +3,9 @@ import 'dart:io'; import 'package:carousel_slider/carousel_slider.dart'; import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/health_data_list.dart'; import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:url_launcher/url_launcher.dart'; class SmartWatchInstructions extends StatefulWidget { @@ -796,7 +796,9 @@ class _SmartWatchInstructionsState extends State { getLastPatientRecord(BuildContext context) { SmartWatchIntegrationService service = new SmartWatchIntegrationService(); + GifLoaderDialogUtils.showMyDialog(context); service.getLastPatientRecord(context).then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { print(res['Med_GetPatientLastRecordList']); setState(() { @@ -807,9 +809,9 @@ class _SmartWatchInstructionsState extends State { }); } else {} }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } _openHealthDataList() { diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index 1c85d898..5c2d3a3c 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -58,8 +58,8 @@ class LocationUtils { void setLocation(Position position) { print(position); - this.sharedPref.setDouble(USER_LAT, position.latitude); - this.sharedPref.setDouble(USER_LONG, position.longitude); + this.sharedPref.setDouble(USER_LAT, position.latitude ?? 0.0); + this.sharedPref.setDouble(USER_LONG, position.longitude ?? 0.0); } void setZeroLocation() { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 2cb521d9..d8db692d 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -911,6 +911,14 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get infoMyAppointments => localizedValues['info-my-appointments'][locale.languageCode]; String get infoTodo => localizedValues['info-todo'][locale.languageCode]; String get familyInfo => localizedValues['family-info'][locale.languageCode]; + String get dentalComplaints => localizedValues['dental-complains'][locale.languageCode]; + String get emptyResult => localizedValues['empty-result'][locale.languageCode]; + + String get noBookedAppo => localizedValues['no-booked-appointment'][locale.languageCode]; + String get noConfirmedAppo => localizedValues['no-confirmed-appointment'][locale.languageCode]; + String get noArrivedAppo => localizedValues['no-arrived-appointment'][locale.languageCode]; + String get upcomingEmpty => localizedValues['upcoming-empty'][locale.languageCode]; + String get upcomingTimeLeft => localizedValues['upcoming-timeLeft'][locale.languageCode]; } diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 21cbebba..1ae7b684 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -10,8 +10,9 @@ import 'bottom_navigation_item.dart'; class BottomNavBar extends StatefulWidget { final ValueChanged changeIndex; - final int index ; - BottomNavBar({Key key, this.changeIndex,this.index}) : super(key: key); + final int index; + + BottomNavBar({Key key, this.changeIndex, this.index}) : super(key: key); @override _BottomNavBarState createState() => _BottomNavBarState(); @@ -52,29 +53,28 @@ class _BottomNavBarState extends State { currentIndex: 1, name: TranslationBase.of(context).medicalProfile, ), - if(widget.index == 0) - Expanded( - child: SizedBox( - height: 50, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox(height: 22), - ], - ), - ), - ), - if(widget.index != 0) - BottomNavigationItem( - icon: EvaIcons.calendar, - activeIcon: EvaIcons.calendar, - changeIndex: _changeIndex, - index: _index, - currentIndex: 2, - name: TranslationBase.of(context).bookAppo, - ), - + if (widget.index == 0) + Expanded( + child: SizedBox( + height: 50, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox(height: 22), + ], + ), + ), + ), + if (widget.index != 0) + BottomNavigationItem( + icon: EvaIcons.calendar, + activeIcon: EvaIcons.calendar, + changeIndex: _changeIndex, + index: _index, + currentIndex: 2, + name: TranslationBase.of(context).bookAppo, + ), BottomNavigationItem( icon: DQIcons.family, activeIcon: DQIcons.family, diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index a45cba96..cc77d17d 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -17,7 +17,6 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:url_launcher/url_launcher.dart'; import '../../config/size_config.dart'; diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 4de9efdf..71381a18 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -1,53 +1,41 @@ import 'dart:collection'; -import 'dart:convert'; +import 'dart:math'; import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/pages/ErService/NearestEr.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; +import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; -import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/medical/doctor/doctor_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/labs_home_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/pages/vaccine/my_vaccines_screen.dart'; +import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; -import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_result.dart'; import 'package:speech_to_text/speech_to_text.dart'; -import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart'; -import 'dart:math'; -import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; -import 'package:diplomaticquarterapp/routes.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; -import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; -import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; class BottomBarSearch extends StatefulWidget { @override @@ -76,6 +64,7 @@ class _SearchBot extends State { bool _isInit = true; TextEditingController searchController = TextEditingController(); + @override void initState() { requestPermissions(); @@ -432,10 +421,12 @@ class _SearchBot extends State { List arr = []; List arrDistance = []; DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); service .getDoctorsList(clinicId, projectId, false, context, doctorId: doctorId, doctorName: doctorName) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && @@ -483,9 +474,10 @@ class _SearchBot extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Future navigateToDoctorProfile(context, docObject, docProfile, diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 2bfacaea..2d1f9109 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -40,6 +40,7 @@ import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -55,7 +56,6 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:flutter/cupertino.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:url_launcher/url_launcher.dart'; class FloatingSearchButton extends StatefulWidget { @@ -734,10 +734,12 @@ class _FloatingSearchButton extends State List arr = []; List arrDistance = []; DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); service .getDoctorsList(clinicId, projectId, isNearest, context, doctorId: doctorId, doctorName: doctorName) .then((res) { + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && @@ -785,9 +787,10 @@ class _FloatingSearchButton extends State AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } Future navigateToDoctorProfile(context, docObject, docProfile, diff --git a/pubspec.yaml b/pubspec.yaml index 5bd52d75..7941c492 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -106,8 +106,6 @@ dependencies: #Circular progress bar for reverse timer circular_countdown_timer: ^0.0.5 - smart_progress_bar: ^0.1.6 - #Just Audio to play ringing for incoming video call just_audio: ^0.3.4 @@ -138,11 +136,14 @@ dependencies: device_calendar: ^3.1.0 #Handle Geolocation - geolocator: ^6.0.0+1 + geolocator: ^6.1.10 screen: ^0.0.5 #google maps places google_maps_place_picker: ^1.0.0 + + #countdown timer for Upcoming List + flutter_countdown_timer: ^1.4.0 #Dependencies for video call implementation native_device_orientation: ^0.3.0 From 4e2c955b09da41b93c4b15fc2f32350c4f69cd50 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 6 Dec 2020 17:42:44 +0200 Subject: [PATCH 02/12] add missing translation --- ios/Flutter/.last_build_id | 2 +- lib/config/localized_values.dart | 99 ++++++++++++++++++- .../all_habib_medical_service_page.dart | 22 +++-- lib/pages/ContactUs/findus/findus_page.dart | 7 +- .../insurance/insurance_approval_screen.dart | 62 ++++++------ .../medical/balance/my_balance_page.dart | 9 +- .../medical/reports/report_home_page.dart | 12 +-- lib/pages/paymentService/payment_service.dart | 4 +- lib/uitl/translations_delegate_base.dart | 24 +++++ 9 files changed, 179 insertions(+), 62 deletions(-) diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index b5ed87ba..6bca0336 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1 @@ -a30437b5671472a3d6a8672edcfc504b \ No newline at end of file +f4a819c27119d0f472892c1088ad1ca3 \ No newline at end of file diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e6be280b..044f5573 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -522,11 +522,11 @@ const Map localizedValues = { "PaymentOnline": {"en": "Service", "ar": "الالكتروني"}, "OnlineCheckIn": {"en": "Online Check-In", "ar": "مدفوعات معلقة"}, "MyBalances": {"en": "My Balances", "ar": "رصيدي"}, - "BalanceAmount": {"en": "Balance Amount", "ar": "رصيدالحساب"}, - "TotalBalance": {"en": "Total Balance", "ar": "الرصيد الكلي"}, + "BalanceAmount": { "en": "Wallet Amount", "ar": "مبلغ المحفظة"}, + "TotalBalance": { "en": "Total Amount", "ar": "المبلغ الإجمالي"}, "CreateAdvancedPayment": { - "en": "Create Advanced Payment", - "ar": "إنشاء دفعة مقدمة" + "en": "Recharge Wallet", + "ar": "إعادة شحن المحفظة" }, "AdvancePayment": {"en": "Advance Payment", "ar": "الدفع مقدما"}, "AdvancePaymentLabel": { @@ -1044,5 +1044,96 @@ const Map localizedValues = { "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", "ar": "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." + }, + "covid-test-all-services": { + "en": "Covid-19 Drive-Thru Test", + "ar": "فحص كورونا من داخل السيارة" + }, + "pharmacy": { + "en": "Pharmacy", + "ar": "الصيدلية" + }, + "ereferral": { + "en": "E-Referral", + "ar": "طلب التحويل" + }, + "child-vaccine": { + "en": "Child Vaccines", + "ar": "تطعيمات الأطفال" + }, + "calculators": { + "en": "Health Calculators", + "ar": "الحاسبات الصحية" + }, + "converters": { + "en": "Health Converter", + "ar": "تحويل القياسات" + }, + "h2o": { + "en": "Water Tracker", + "ar": "حساب كمية الماء" + }, + "v-tour": { + "en": "Virtual Tour", + "ar": "جولة إفتراضية" + }, + "hmg-news": { + "en": "HMG News", + "ar": "أخبار المجموعة" + }, + "blood-d": { + "en": "Blood Donation", + "ar": "تبرع بالدم" + }, + "symptomCheckerTitle": { + "en": "Symptom Checker", + "ar": "مدقق الأعراض" + }, + "latest-news": { + "en": "Latest News", + "ar": "أحدث الأخبار" + }, + "our-location": { + "en": "Our Locations", + "ar": "موقعنا" + }, + "pharmacies": { + "en": "Pharmacies", + "ar": "الصيدليات" + }, + "hospitals": { + "en": "Hospitals", + "ar": "المستشفيات" + }, + "wallet": { + "en": "Wallet", + "ar": "محفظة نقود" + }, + "hmg": { + "en": "Al Habib", + "ar": "الحبيب" + }, + + "requested": { + "en": "Requested", + "ar": "مطلوب" + }, + "ready": { + "en": "Ready", + "ar": "جاهز" + }, + "completed": { + "en": "Completed", + "ar": "مكتمل" + }, + "cancelled": { + "en": "Cancelled", + "ar": "ملغى" + }, + + "request-medical-report": { + "en": "Request medical report", + "ar": "طلب تقرير طبي" } + }; diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 6c03f6ba..316a2437 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -48,6 +48,7 @@ class _AllHabibMedicalServiceState extends State { AuthenticatedUser authUser = new AuthenticatedUser(); LocationUtils locationUtils; var weather = '--'; + @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { @@ -201,7 +202,7 @@ class _AllHabibMedicalServiceState extends State { ), imageLocation: 'assets/images/new-design/family_menu_icon_red.png', - title: 'My Family', + title: TranslationBase.of(context).family, ), ServicesContainer( onTap: () => Navigator.push( @@ -230,20 +231,23 @@ class _AllHabibMedicalServiceState extends State { "https://hmgwebservices.com/vt_mobile/html/index.html"), imageLocation: 'assets/images/new-design/virtual_tour_icon.png', - title: 'Virtual Tour', + title: TranslationBase.of(context).vTour, ), ServicesContainer( onTap: () { - Navigator.of(context).push(MaterialPageRoute( + Navigator.of(context).push( + MaterialPageRoute( builder: (BuildContext context) => MyWebView( - title: "HMG News", - selectedUrl: - "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", - ))); + title: TranslationBase.of(context).hmgNews, + selectedUrl: + "https://twitter.com/hashtag/مجموعة_د_سليمان_الحبيب_الطبية?src=hashtag_click&f=live", + ), + ), + ); }, imageLocation: 'assets/images/new-design/twitter_dashboard_icon.png', - title: 'Latest News', + title: TranslationBase.of(context).latestNews, ), ServicesContainer( onTap: () => Navigator.push( @@ -253,7 +257,7 @@ class _AllHabibMedicalServiceState extends State { ), ), imageLocation: 'assets/images/new-design/find_us_icon.png', - title: 'Find Us', + title: TranslationBase.of(context).findUs, ), ], ), diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index 807ac1c7..f920de9f 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model import 'package:diplomaticquarterapp/pages/ContactUs/findus/hospitrals_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/pharmacies_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -39,7 +40,7 @@ class _FindUsPageState extends State builder: (_, model, w) => AppScaffold( isShowAppBar: true, isShowDecPage: false, - appBarTitle: 'Locations', + appBarTitle: TranslationBase.of(context).ourLocation, baseViewModel: model, body: Scaffold( extendBodyBehindAppBar: true, @@ -90,13 +91,13 @@ class _FindUsPageState extends State Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts(' Hospitals '), + child: Texts(TranslationBase.of(context).hospitals), ), ), Container( width: MediaQuery.of(context).size.width * 0.30, child: Center( - child: Texts(' Pharmacies '), + child: Texts(TranslationBase.of(context).pharmacies), ), ), ], diff --git a/lib/pages/insurance/insurance_approval_screen.dart b/lib/pages/insurance/insurance_approval_screen.dart index b62c2b43..d21e06a5 100644 --- a/lib/pages/insurance/insurance_approval_screen.dart +++ b/lib/pages/insurance/insurance_approval_screen.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; import 'package:flutter/cupertino.dart'; @@ -20,10 +21,19 @@ class InsuranceApproval extends StatefulWidget { class _InsuranceApprovalState extends State { List imagesInfo = List(); + @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png')); - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png')); return BaseView( onModelReady: widget.appointmentNo != null ? (model) => @@ -63,10 +73,10 @@ class _InsuranceApprovalState extends State { ), if (model.insuranceApproval.length > 0) Container( - width: SizeConfig.widthMultiplier * 18.0, - height: SizeConfig.heightMultiplier * 2.8, + width: 60, + height: 35, decoration: BoxDecoration( - color: Color(0xffC5272D), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(19.0)), child: Center( child: Text( @@ -92,29 +102,21 @@ class _InsuranceApprovalState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - model.insuranceApproval[index] - .patientDescription == - "In Patient" + model.insuranceApproval[index].patientDescription == "In Patient" ? Container( decoration: BoxDecoration( - color: Color(0xffB8372C), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular( 16.0)), - width: 95.0, + width: 115.0, padding: EdgeInsets.only(left: 11.5), - child: Text( - model.insuranceApproval[index] - .patientDescription == - null - ? '' - : model - .insuranceApproval[ - index] - .patientDescription, - style: TextStyle( - color: Colors.white), + child: Center( + child: Texts( + TranslationBase.of(context).inPatient, + color: Colors.white, + ), ), ) : Container( @@ -123,20 +125,14 @@ class _InsuranceApprovalState extends State { borderRadius: BorderRadius.circular( 16.0)), - width: 95.0, + width: 115.0, padding: EdgeInsets.only(left: 11.5), - child: Text( - model.insuranceApproval[index] - .patientDescription == - null - ? '' - : model - .insuranceApproval[ - index] - .patientDescription, - style: TextStyle( - color: Colors.white), + child: Center( + child: Texts( + TranslationBase.of(context).outpatient, + color: Colors.white, + ), ), ), Padding( diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index e6bc6352..2fb8c51c 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -57,7 +57,7 @@ class MyBalancePage extends StatelessWidget { color: Colors.white, ), Texts( - '${model.totalAdvanceBalanceAmount ?? 0} SAR', + '${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar, color: Colors.white, bold: true, ), @@ -81,12 +81,13 @@ class MyBalancePage extends StatelessWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(model.patientAdvanceBalanceAmountList[index] - .projectDescription), + Texts( - '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} SAR', + '${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} '+TranslationBase.of(context).sar, bold: true, ), + Texts(model.patientAdvanceBalanceAmountList[index] + .projectDescription), ], ), ), diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 2bf6d1b8..636d4e00 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -86,32 +86,32 @@ class _HomeReportPageState extends State controller: _tabController, indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.label, - indicatorColor: Colors.red[800], + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, unselectedLabelColor: Colors.grey[800], tabs: [ Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts('Requested'), + child: Texts(TranslationBase.of(context).requested), ), ), Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts('Ready'), + child: Texts(TranslationBase.of(context).ready), ), ), Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts('Completed'), + child: Texts(TranslationBase.of(context).completed), ), ), Container( width: MediaQuery.of(context).size.width * 0.22, child: Center( - child: Texts('Cancelled'), + child: Texts(TranslationBase.of(context).cancelled), ), ), ], @@ -152,7 +152,7 @@ class _HomeReportPageState extends State height: 90, margin: EdgeInsets.all(8.0), child: Button( - label: 'Resend order & deliver', + label: TranslationBase.of(context).requestMedicalReport, backgroundColor: Colors.grey[800], onTap: () => Navigator.push( context, diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index c31981f7..cc2fd7ca 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -115,12 +115,12 @@ class PaymentService extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - 'My Balances', + TranslationBase.of(context).hmg, color: HexColor('#B61422'), bold: true, ), Texts( - TranslationBase.of(context).payment, + TranslationBase.of(context).wallet, fontSize: 14, fontWeight: FontWeight.normal, ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 2cb521d9..f14c456d 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -912,6 +912,30 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get infoTodo => localizedValues['info-todo'][locale.languageCode]; String get familyInfo => localizedValues['family-info'][locale.languageCode]; + String get covidTestAllServices => localizedValues['covid-test-all-services'][locale.languageCode]; + String get pharmacy => localizedValues['pharmacy'][locale.languageCode]; + String get ereferral => localizedValues['ereferral'][locale.languageCode]; + String get childVaccine => localizedValues['child-vaccine'][locale.languageCode]; + String get calculators => localizedValues['calculators'][locale.languageCode]; + String get converters => localizedValues['converters'][locale.languageCode]; + String get h2o => localizedValues['h2o'][locale.languageCode]; + String get vTour => localizedValues['v-tour'][locale.languageCode]; + String get hmgNews => localizedValues['hmg-news'][locale.languageCode]; + String get bloodD => localizedValues['blood-d'][locale.languageCode]; + String get symptomCheckerTitle => localizedValues['symptomCheckerTitle'][locale.languageCode]; + String get latestNews => localizedValues['latest-news'][locale.languageCode]; + String get ourLocation => localizedValues['our-location'][locale.languageCode]; + String get pharmacies => localizedValues['pharmacies'][locale.languageCode]; + String get hospitals => localizedValues['hospitals'][locale.languageCode]; + String get wallet => localizedValues['wallet'][locale.languageCode]; + String get hmg => localizedValues['hmg'][locale.languageCode]; + String get requested => localizedValues['requested'][locale.languageCode]; + String get ready => localizedValues['ready'][locale.languageCode]; + String get completed => localizedValues['completed'][locale.languageCode]; + String get cancelled => localizedValues['cancelled'][locale.languageCode]; + String get requestMedicalReport => localizedValues['request-medical-report'][locale.languageCode]; + + } class TranslationBaseDelegate extends LocalizationsDelegate { From 47e4b99f11362d16fa6e6c3bc096f6739e92236b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 6 Dec 2020 17:54:17 +0200 Subject: [PATCH 03/12] fix issues --- lib/config/localized_values.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 5ca00362..2498a679 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1074,8 +1074,6 @@ const Map localizedValues = { "en": "time left for appointment", "ar": "الوقت المتبقي للموعد" }, - - }, "covid-test-all-services": { "en": "Covid-19 Drive-Thru Test", "ar": "فحص كورونا من داخل السيارة" @@ -1165,6 +1163,6 @@ const Map localizedValues = { "request-medical-report": { "en": "Request medical report", "ar": "طلب تقرير طبي" - } + }, }; From a1f91d99b3987b090ccffd4c780750c964f4df8f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 7 Dec 2020 10:32:21 +0300 Subject: [PATCH 04/12] added countdown timer in my appointments --- lib/pages/BookAppointment/BookConfirm.dart | 7 ++++--- .../widgets/AppointmentActions.dart | 2 +- .../widgets/AppointmentCardView.dart | 21 +++++++++++++++++++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index ed0f5bf1..7a247b78 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; import 'BookSuccess.dart'; @@ -39,13 +40,11 @@ class BookConfirm extends StatefulWidget { PatientShareResponse patientShareResponse; AuthenticatedUser authUser; - @override _BookConfirmState createState() => _BookConfirmState(); } class _BookConfirmState extends State { - ToDoCountProviderModel toDoProvider; @override @@ -59,6 +58,7 @@ class _BookConfirmState extends State { @override Widget build(BuildContext context) { + toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).bookAppo, isShowAppBar: true, @@ -426,9 +426,10 @@ class _BookConfirmState extends State { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); print(res['AppointmentNo']); - Future.delayed(new Duration(milliseconds: 1800), () { + Future.delayed(new Duration(milliseconds: 500), () { getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); + getToDoCount(); }); } else { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index ce312a8d..c0399b8a 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -52,7 +52,6 @@ class _AppointmentActionsState extends State { @override void initState() { - toDoProvider = Provider.of(context); _getAppointmentActionButtons(); super.initState(); } @@ -60,6 +59,7 @@ class _AppointmentActionsState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); + toDoProvider = Provider.of(context); var size = MediaQuery.of(context).size; final double itemHeight = projectViewModel.isArabic ? ((size.height - kToolbarHeight - 24) * 0.47) / 2 diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index 71bde484..1bbe471a 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -1,6 +1,10 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_countdown_timer/current_remaining_time.dart'; +import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:rating_bar/rating_bar.dart'; import '../AppointmentDetails.dart'; @@ -104,6 +108,23 @@ class _ApointmentCardState extends State { ), ], ), + widget.appo.patientStatusType == AppointmentType.BOOKED ? + Container( + child: CountdownTimer( + endTime: DateTime.now().millisecondsSinceEpoch + + (widget.appo.remaniningHoursTocanPay * 1000) * + 60, + widgetBuilder: (_, CurrentRemainingTime time) { + return Text( + '${time.days}:${time.hours}:${time.min}:${time.sec} ' + + TranslationBase.of(context) + .upcomingTimeLeft, + style: TextStyle( + fontSize: 12.0, + color: Color(0xff40ACC9))); + }, + ), + ) : Container(), ], ), ), From 9fecf8e89f186320ed21510fe46357738d5b294b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Dec 2020 10:34:02 +0200 Subject: [PATCH 05/12] fix insurance update --- .../FamilyFiles/GetAllSharedRecordByStatusResponse.dart | 4 ++-- lib/pages/insurance/insurance_update_screen.dart | 6 ++++-- lib/splashPage.dart | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart index b21d940f..750cf0be 100644 --- a/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart +++ b/lib/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart @@ -25,7 +25,7 @@ class GetAllSharedRecordsByStatusResponse { dynamic successMsgN; dynamic doctorInformationList; List getAllPendingRecordsList; - List getAllSharedRecordsByStatusList; + List getAllSharedRecordsByStatusList = List(); List getResponseFileList; bool isHMGPatient; bool isLoginSuccessfully; @@ -92,7 +92,7 @@ class GetAllSharedRecordsByStatusResponse { this.successMsgN, this.doctorInformationList, this.getAllPendingRecordsList, - this.getAllSharedRecordsByStatusList, + this.getAllSharedRecordsByStatusList , this.getResponseFileList, this.isHMGPatient, this.isLoginSuccessfully, diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 1e616108..f2f66031 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -97,7 +97,9 @@ class _InsuranceUpdateState extends State controller: _tabController, children: [ Container( - child: ListView.builder( + child: + model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList!=null? + ListView.builder( itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, itemBuilder: (BuildContext context, int index) { return Container( @@ -173,7 +175,7 @@ class _InsuranceUpdateState extends State ), ), ); - }), + }):Container(), ), Container( child: ListView.builder( diff --git a/lib/splashPage.dart b/lib/splashPage.dart index d367d3ec..2c12d6fd 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -42,9 +42,9 @@ class _SplashScreenState extends State { var data = await sharedPref.getObject(USER_PROFILE); if (data != null) { AuthenticatedUser userData = AuthenticatedUser.fromJson(data); - Provider.of(context, listen: false).isLogin = true; - authenticatedUserObject.isLogin = true; - authenticatedUserObject.user = userData; + // Provider.of(context, listen: false).isLogin = true; + //authenticatedUserObject.isLogin = true; + //authenticatedUserObject.user = userData; } } From 554ed1b50a4f4e020421d7807c427c4c0eba87ed Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Dec 2020 10:55:27 +0200 Subject: [PATCH 06/12] fix insurance update --- lib/config/localized_values.dart | 7 +- .../insurance/insurance_update_screen.dart | 236 +++++++++--------- lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/others/app_scaffold_widget.dart | 28 ++- 4 files changed, 148 insertions(+), 124 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2498a679..2b596bfb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -483,7 +483,7 @@ const Map localizedValues = { "LabOrders": {"en": "Lab Orders", "ar": "تحاليل المختبر"}, "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, "Prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, - "History": {"en": "History", "ar": "السجل"}, + "History": {"en": "History", "ar": "السجلات"}, "OrderNo": {"en": "Order No", "ar": "رقم الطلب"}, "OrderDetails": {"en": "Order Details", "ar": "تفاصيل الطلب"}, "VitalSign": {"en": "Vital Sign", "ar": "العلامة حيوية"}, @@ -1164,5 +1164,8 @@ const Map localizedValues = { "en": "Request medical report", "ar": "طلب تقرير طبي" }, - + "insur-cards": { + "en": "Insurance Cards", + "ar": "بطاقات التأمين" + }, }; diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index f2f66031..b088d477 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; @@ -35,7 +36,7 @@ class _InsuranceUpdateState extends State onModelReady: (model) => model.getInsuranceUpdated(), builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold( - appBarTitle: 'Insurance Cards', + appBarTitle: TranslationBase.of(context).insurCards, isShowAppBar: true, baseViewModel: model, body: Scaffold( @@ -63,7 +64,7 @@ class _InsuranceUpdateState extends State controller: _tabController, isScrollable: true, indicatorWeight: 4.0, - indicatorColor: Colors.red, + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.symmetric( horizontal: 13.0, vertical: 2.0), @@ -72,13 +73,14 @@ class _InsuranceUpdateState extends State Container( width: MediaQuery.of(context).size.width * 0.35, child: Center( - child: Texts('Card'), + child: Texts(TranslationBase.of(context) + .updateInsuranceSubtitle), ), ), Container( width: MediaQuery.of(context).size.width * 0.35, child: Center( - child: Texts('History'), + child: Texts(TranslationBase.of(context).history), ), ), ], @@ -97,85 +99,99 @@ class _InsuranceUpdateState extends State controller: _tabController, children: [ Container( - child: - model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList!=null? - ListView.builder( - itemCount: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, - itemBuilder: (BuildContext context, int index) { - return Container( - margin: EdgeInsets.all(10.0), - child: Card( - margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - color: Colors.white, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - ), - child: Container( - width: MediaQuery.of(context).size.width, - padding: EdgeInsets.all(10.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - flex: 3, - child: Container( - margin: EdgeInsets.only( - top: 2.0, left: 10.0, right: 20.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Text( - model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index].patientName, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: FontWeight.w500, - letterSpacing: 1.0)), - Text( - 'File No.' + - model.getAllSharedRecordsByStatusResponse - .getAllSharedRecordsByStatusList[ - index].patientID.toString(), - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: FontWeight.w500, - letterSpacing: 1.0)), - ], - ), - ), - ), - Expanded( - flex: 2, - child: Container( - // height: MediaQuery.of(context).size.height * 0.12, - margin: EdgeInsets.only(top: 2.0), - child: Column( - children: [ - Container( - child: SecondaryButton( - label: 'Update', - small: true, - textColor: Colors.white, - // color: Colors.grey, - ), - //height: 45, - // width:90 + child: model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList != + null + ? ListView.builder( + itemCount: model.getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList.length, + itemBuilder: (BuildContext context, int index) { + return Container( + margin: EdgeInsets.all(10.0), + child: Card( + margin: + EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.all(10.0), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + flex: 3, + child: Container( + margin: EdgeInsets.only( + top: 2.0, + left: 10.0, + right: 20.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Texts( + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientName, + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ), + Texts( + TranslationBase.of(context) + .fileno + + ": " + + model + .getAllSharedRecordsByStatusResponse + .getAllSharedRecordsByStatusList[ + index] + .patientID + .toString(), + fontSize: 14, + color: Colors.black, + fontWeight: FontWeight.w500, + ) + ], ), - ], + ), ), - ), - ) - ], + Expanded( + flex: 2, + child: Container( + // height: MediaQuery.of(context).size.height * 0.12, + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase.of( + context) + .updateInsurance, + small: true, + textColor: Colors.white, + // color: Colors.grey, + ), + //height: 45, + // width:90 + ), + ], + ), + ), + ) + ], + ), + ), ), - ), - ), - ); - }):Container(), + ); + }) + : Container(), ), Container( child: ListView.builder( @@ -212,35 +228,34 @@ class _InsuranceUpdateState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("TAMER FANASHEH ", - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), - Text( - 'File No.' + - model - .insuranceUpdate[ - index] - .patientID - .toString(), - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), Text( - model.insuranceUpdate[index] - .createdOn, + model.user.firstName + + " " + + model.user.lastName, style: TextStyle( fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.w500, letterSpacing: 1.0)), + Texts( + TranslationBase.of(context) + .fileno + + ": " + + model + .insuranceUpdate[ + index] + .patientID + .toString(), + fontSize: 14, + color: Colors.black, + ), + Texts( + model.insuranceUpdate[index] + .createdOn, + fontSize: 14, + color: Colors.black, + ), ], ), ), @@ -248,7 +263,6 @@ class _InsuranceUpdateState extends State Expanded( flex: 1, child: Container( -// height: MediaQuery.of(context).size.height * 0.12, margin: EdgeInsets.only(top: 20.0), child: Column( children: [ @@ -259,15 +273,13 @@ class _InsuranceUpdateState extends State Container( margin: EdgeInsets.only( top: 13.5, left: 2.0), - child: Text( - model - .insuranceUpdate[ - index] - .statusDescription, - textAlign: - TextAlign.center, - style: TextStyle( - fontSize: 12.0)), + child: Texts( + model.insuranceUpdate[index] + .statusDescription, + textAlign: TextAlign.center, + fontSize: 12, + color: Colors.black, + ), ), ], ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 39048bca..5a055973 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -942,6 +942,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get completed => localizedValues['completed'][locale.languageCode]; String get cancelled => localizedValues['cancelled'][locale.languageCode]; String get requestMedicalReport => localizedValues['request-medical-report'][locale.languageCode]; + String get insurCards => localizedValues['insur-cards'][locale.languageCode]; } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 99a7ee2d..cdc6025a 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -59,11 +59,13 @@ class AppScaffold extends StatelessWidget { this.isShowDecPage = true, this.isBottomBar, this.image, - this.infoList, this.imagesInfo}); + this.infoList, + this.imagesInfo}); @override Widget build(BuildContext context) { AppGlobal.context = context; + ProjectViewModel projectViewModel = Provider.of(context); return Scaffold( backgroundColor: Theme.of(context).scaffoldBackgroundColor, @@ -75,13 +77,15 @@ class AppScaffold extends StatelessWidget { headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), - title: Texts( - authenticatedUserObject.isLogin || !isShowDecPage - ? appBarTitle.toUpperCase() - : TranslationBase.of(context).serviceInformationTitle, - color: Colors.white, - bold: true, - ), + title: Text( + authenticatedUserObject.isLogin || !isShowDecPage + ? appBarTitle.toUpperCase() + : TranslationBase.of(context).serviceInformationTitle, + style: TextStyle( + fontWeight: FontWeight.bold, + color: Colors.white, + fontFamily: + projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), leading: Builder( builder: (BuildContext context) { return ArrowBack(); @@ -129,13 +133,17 @@ class AppScaffold extends StatelessWidget { infoList: infoList, imagesInfo: imagesInfo, ) - : baseViewModel != null + : baseViewModel != null ? NetworkBaseView( child: buildBodyWidget(), baseViewModel: baseViewModel, ) : buildBodyWidget(), - bottomSheet: (Provider.of(context, listen: false).isLogin || !isShowDecPage)?bottomSheet:null, + bottomSheet: + (Provider.of(context, listen: false).isLogin || + !isShowDecPage) + ? bottomSheet + : null, //floatingActionButton: floatingActionButton ?? floatingActionButton, // bottomNavigationBar: // this.isBottomBar == true ? BottomBarSearch() : SizedBox() From 14f92f6c582bb7e7167f1959117117f2eb5782a3 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Dec 2020 11:02:33 +0200 Subject: [PATCH 07/12] remove updated button --- .../insurance/insurance_update_screen.dart | 77 ++++++++++--------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index b088d477..a7e7c32b 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -1,15 +1,11 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; import '../base/base_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart'; -import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; -import 'package:rating_bar/rating_bar.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; class InsuranceUpdate extends StatefulWidget { @override @@ -31,6 +27,7 @@ class _InsuranceUpdateState extends State _tabController.dispose(); } + //TODO implement update card Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getInsuranceUpdated(), @@ -144,6 +141,9 @@ class _InsuranceUpdateState extends State color: Colors.black, fontWeight: FontWeight.w500, ), + SizedBox( + height: 8, + ), Texts( TranslationBase.of(context) .fileno + @@ -162,29 +162,30 @@ class _InsuranceUpdateState extends State ), ), ), - Expanded( - flex: 2, - child: Container( - // height: MediaQuery.of(context).size.height * 0.12, - margin: EdgeInsets.only(top: 2.0), - child: Column( - children: [ - Container( - child: SecondaryButton( - label: TranslationBase.of( - context) - .updateInsurance, - small: true, - textColor: Colors.white, - // color: Colors.grey, + if (false) + Expanded( + flex: 2, + child: Container( + // height: MediaQuery.of(context).size.height * 0.12, + margin: EdgeInsets.only(top: 2.0), + child: Column( + children: [ + Container( + child: SecondaryButton( + label: TranslationBase.of( + context) + .updateInsurance, + small: true, + textColor: Colors.white, + // color: Colors.grey, + ), + //height: 45, + // width:90 ), - //height: 45, - // width:90 - ), - ], + ], + ), ), - ), - ) + ) ], ), ), @@ -228,16 +229,17 @@ class _InsuranceUpdateState extends State crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - model.user.firstName + - " " + - model.user.lastName, - style: TextStyle( - fontSize: 14.0, - color: Colors.black, - fontWeight: - FontWeight.w500, - letterSpacing: 1.0)), + Texts( + model.user.firstName + + " " + + model.user.lastName, + fontSize: 14, + fontWeight: FontWeight.w500, + color: Colors.black, + ), + SizedBox( + height: 8, + ), Texts( TranslationBase.of(context) .fileno + @@ -248,12 +250,17 @@ class _InsuranceUpdateState extends State .patientID .toString(), fontSize: 14, + fontWeight: FontWeight.w500, color: Colors.black, ), + SizedBox( + height: 8, + ), Texts( model.insuranceUpdate[index] .createdOn, fontSize: 14, + fontWeight: FontWeight.w500, color: Colors.black, ), ], From 468bb0356c15a803eb4f08e7130b66e1a3fc0f31 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 9 Dec 2020 12:38:56 +0300 Subject: [PATCH 08/12] updates & fixes --- lib/pages/ToDoList/ToDo.dart | 22 +++-- lib/pages/medical/medical_profile_page.dart | 93 +++++++++++++------ .../radiology/radiology_details_page.dart | 6 +- 3 files changed, 83 insertions(+), 38 deletions(-) diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index fb8990b2..95e10879 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -62,7 +62,7 @@ class _ToDoState extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).todoList, imagesInfo: imagesInfo, - isShowAppBar: true, + isShowAppBar: false, description: TranslationBase.of(context).infoTodo, body: SingleChildScrollView( child: Column( @@ -212,17 +212,23 @@ class _ToDoState extends State { ), Container( child: CountdownTimer( - endTime: DateTime.now().millisecondsSinceEpoch + + endTime: DateTime.now() + .millisecondsSinceEpoch + (widget.appoList[index] - .remaniningHoursTocanPay * - 1000) * + .remaniningHoursTocanPay * + 1000) * 60, - widgetBuilder: (_, CurrentRemainingTime time) { + widgetBuilder: + (_, CurrentRemainingTime time) { return Text( - '${time.days}:${time.hours}:${time.min}:${time.sec} ' + TranslationBase.of(context).upcomingTimeLeft, + '${time.days}:${time.hours}:${time.min}:${time.sec} ' + + TranslationBase.of( + context) + .upcomingTimeLeft, style: TextStyle( fontSize: 12.0, - color: Color(0xff40ACC9))); + color: + Color(0xff40ACC9))); }, ), ), @@ -529,7 +535,7 @@ class _ToDoState extends State { }).catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: err); + err != null ?? AppToast.showErrorToast(message: err); }); } diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 41746f3c..37592733 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -81,11 +81,11 @@ class _MedicalProfilePageState extends State { padding: EdgeInsets.symmetric(vertical: 5.0), child: Column( children: [ - if(model.isLogin) - Container( - width: double.infinity, - height: 55, - ), + if (model.isLogin) + Container( + width: double.infinity, + height: 55, + ), Row( children: [ Expanded( @@ -112,29 +112,63 @@ class _MedicalProfilePageState extends State { .myAppointmentsList, hasBadge: true, ), - Positioned( - right: 0.0, - child: Badge( - toAnimate: false, - position: - BadgePosition.topEnd(), - shape: BadgeShape.circle, - badgeColor: Color(0xFF40ACC9) - .withOpacity(1.0), - borderRadius: - BorderRadius.circular(8), - badgeContent: Container( - padding: - EdgeInsets.all(2.0), - child: Text( - appoCountProvider.count - .toString(), - style: TextStyle( - color: Colors.white, - fontSize: 16.0)), - ), - ), - ), + projectViewModel.isArabic + ? Positioned( + left: 0.0, + child: Badge( + toAnimate: false, + shape: + BadgeShape.circle, + badgeColor: Color( + 0xFF40ACC9) + .withOpacity(1.0), + borderRadius: + BorderRadius + .circular(8), + badgeContent: Container( + padding: + EdgeInsets.all( + 2.0), + child: Text( + appoCountProvider + .count + .toString(), + style: TextStyle( + color: Colors + .white, + fontSize: + 16.0)), + ), + ), + ) + : Positioned( + right: 0.0, + child: Badge( + toAnimate: false, + shape: + BadgeShape.circle, + badgeColor: Color( + 0xFF40ACC9) + .withOpacity(1.0), + borderRadius: + BorderRadius + .circular(8), + badgeContent: Container( + padding: + EdgeInsets.all( + 2.0), + child: Text( + appoCountProvider + .count + .toString(), + style: TextStyle( + color: Colors + .white, + fontSize: + 16.0)), + ), + ), + ), ]) : MedicalProfileItem( title: TranslationBase.of(context) @@ -156,7 +190,8 @@ class _MedicalProfilePageState extends State { child: MedicalProfileItem( title: TranslationBase.of(context).lab, imagePath: 'lab_result_icon.png', - subTitle: TranslationBase.of(context).labSubtitle, + subTitle: TranslationBase.of(context) + .labSubtitle, ), ), ), diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 9f8a0640..ce4a4e3a 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -27,17 +27,21 @@ class RadiologyDetailsPage extends StatelessWidget { baseViewModel: model, body: SingleChildScrollView( child: Column( + mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ Text('${finalRadiology.reportData}',textAlign: TextAlign.center,), + SizedBox( + height: 160.0, + ) ], ), ), bottomSheet: Container( width: double.infinity, - height: MediaQuery.of(context).size.height * 0.2, color: Colors.grey[100], child: Column( + mainAxisSize: MainAxisSize.min, children: [ Divider(), Container( From 4d203c8a5b2ef1740c80055b401812555c8a823c Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Dec 2020 13:43:07 +0200 Subject: [PATCH 09/12] fix LabResult --- lib/config/localized_values.dart | 8 ++ lib/core/model/labs/lab_result.dart | 8 +- lib/core/service/client/base_app_client.dart | 2 +- lib/core/service/medical/labs_service.dart | 23 ++++ .../viewModels/medical/labs_view_model.dart | 32 +++-- .../medical/labs/laboratory_result_page.dart | 2 +- lib/uitl/date_uitl.dart | 15 +++ lib/uitl/translations_delegate_base.dart | 2 + lib/widgets/charts/app_time_series_chart.dart | 7 ++ .../medical/LabResult/FlowChartPage.dart | 42 +++++++ .../{ => LabResult}/LabResultWidget.dart | 19 ++- .../LabResult/Lab_Result_details_wideget.dart | 112 ++++++++++++++++++ .../lab_result_chart_and_detials.dart | 74 ++++++++++++ .../laboratory_result_widget.dart | 3 +- .../others/app_expandable_notifier.dart | 3 +- 15 files changed, 330 insertions(+), 22 deletions(-) create mode 100644 lib/widgets/data_display/medical/LabResult/FlowChartPage.dart rename lib/widgets/data_display/medical/{ => LabResult}/LabResultWidget.dart (88%) create mode 100644 lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart create mode 100644 lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart rename lib/widgets/data_display/medical/{ => LabResult}/laboratory_result_widget.dart (99%) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2b596bfb..f7b5f234 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1168,4 +1168,12 @@ const Map localizedValues = { "en": "Insurance Cards", "ar": "بطاقات التأمين" }, + 'labResult': { + "en": "Lab results", + "ar": "نتائج التحاليل المخبرية" + }, + 'details':{ + 'en':'Details', + 'ar':'التفاصيل' + } }; diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart index c9acd809..adc2e5ff 100644 --- a/lib/core/model/labs/lab_result.dart +++ b/lib/core/model/labs/lab_result.dart @@ -1,9 +1,9 @@ class LabResult { String description; - Null femaleInterpretativeData; + dynamic femaleInterpretativeData; int gender; int lineItemNo; - Null maleInterpretativeData; + dynamic maleInterpretativeData; String notes; String packageID; int patientID; @@ -13,11 +13,11 @@ class LabResult { String sampleCollectedOn; String sampleReceivedOn; String setupID; - Null superVerifiedOn; + dynamic superVerifiedOn; String testCode; String uOM; String verifiedOn; - Null verifiedOnDateTime; + dynamic verifiedOnDateTime; LabResult( {this.description, diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 0e940a53..408f8a6e 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -139,7 +139,7 @@ class BaseAppClient { parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); } else if (!parsed['IsAuthenticated']) { - // await logout(); + await logout(); //helpers.showErrorToast('Your session expired Please login agian'); } else { diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index b9b9a16c..737b7b1b 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -32,6 +32,7 @@ class LabsService extends BaseService { List patientLabSpecialResult = List(); List labResultList = List(); + List labOrdersResultsList = List(); Future getLaboratoryResult( {String projectID, @@ -77,6 +78,28 @@ class LabsService extends BaseService { }, body: body); } + Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder,String procedure}) async { + hasError = false; + Map body = Map(); + body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['OrderNo'] = patientLabOrder.orderNo; + body['isDentalAllowedBackend'] = false; + body['SetupID'] = patientLabOrder.setupID; + body['ProjectID'] = patientLabOrder.projectID; + body['ClinicID'] = patientLabOrder.clinicID; + body['Procedure'] = procedure; + await baseAppClient.post(GET_Patient_LAB_RESULT, + onSuccess: (dynamic response, int statusCode) { + labOrdersResultsList.clear(); + response['ListPLR'].forEach((lab) { + labOrdersResultsList.add(LabResult.fromJson(lab)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 582ee745..95be11db 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -12,6 +12,9 @@ class LabsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; LabsService _labsService = locator(); + List get labOrdersResultsList => _labsService.labOrdersResultsList; + + List _patientLabOrdersListClinic = List(); List _patientLabOrdersListHospital = List(); @@ -105,18 +108,15 @@ class LabsViewModel extends BaseViewModel { getPatientLabResult({PatientLabOrders patientLabOrder}) async { setState(ViewState.Busy); - await _labsService.getPatientLabResult( - patientLabOrder: patientLabOrder - ); + await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); } else { _labsService.labResultList.forEach((element) { - List patientLabOrdersClinic = - labResultLists - .where((elementClinic) => - elementClinic.filterName == element.testCode) + List patientLabOrdersClinic = labResultLists + .where( + (elementClinic) => elementClinic.filterName == element.testCode) .toList(); if (patientLabOrdersClinic.length != 0) { @@ -124,16 +124,26 @@ class LabsViewModel extends BaseViewModel { .patientLabResultList .add(element); } else { - labResultLists.add(LabResultList( - filterName: element.testCode, - lab: element)); + labResultLists + .add(LabResultList(filterName: element.testCode, lab: element)); } - }); setState(ViewState.Idle); } } + + getPatientLabOrdersResults({PatientLabOrders patientLabOrder,String procedure}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder,procedure: procedure); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + sendLabReportEmail({PatientLabOrders patientLabOrder}) async { setState(ViewState.Busy); await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 9b1f5a26..dc3d10cc 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/medical/laboratory_result_widget.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/LabResult/laboratory_result_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index c5ef6b34..95086f10 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -19,6 +19,21 @@ class DateUtil { return DateTime.now(); } + static DateTime convertStringToDateTime(String date) { + if (date != null) { + try { + var dateT = date.split('/'); + var year = dateT[2].substring(0,4); + return DateTime(int.parse(year),int.parse(dateT[1]),int.parse(dateT[0])); + } catch (e) { + print(e); + } + + return DateTime.now(); + } else + return DateTime.now(); + } + static String convertDateToString(DateTime date) { const start = "/Date("; const end = "+0300)"; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 5a055973..86e98b07 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -943,6 +943,8 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get cancelled => localizedValues['cancelled'][locale.languageCode]; String get requestMedicalReport => localizedValues['request-medical-report'][locale.languageCode]; String get insurCards => localizedValues['insur-cards'][locale.languageCode]; + String get labResult => localizedValues['labResult'][locale.languageCode]; + String get details => localizedValues['details'][locale.languageCode]; } diff --git a/lib/widgets/charts/app_time_series_chart.dart b/lib/widgets/charts/app_time_series_chart.dart index 857a7620..d34bc591 100644 --- a/lib/widgets/charts/app_time_series_chart.dart +++ b/lib/widgets/charts/app_time_series_chart.dart @@ -62,3 +62,10 @@ class TimeSeriesSales { TimeSeriesSales(this.time, this.sales); } + +class TimeSeriesSales2 { + final DateTime time; + final double sales; + + TimeSeriesSales2(this.time, this.sales); +} diff --git a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart new file mode 100644 index 00000000..fde78169 --- /dev/null +++ b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart @@ -0,0 +1,42 @@ +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; + +import 'lab_result_chart_and_detials.dart'; + +class FlowChartPage extends StatelessWidget { + final PatientLabOrders patientLabOrder; + final String filterName; + + FlowChartPage({this.patientLabOrder, this.filterName}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPatientLabOrdersResults( + patientLabOrder: patientLabOrder, procedure: filterName), + builder: (context, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: filterName, + baseViewModel: model, + body: SingleChildScrollView( + child: model.labOrdersResultsList.isNotEmpty + ? Container( + child: LabResultChartAndDetails( + name: filterName, + labResult: model.labOrdersResultsList, + ), + ) + : Container( + child: Center( + child: Texts('no Data'), + ), + ), + ), + ), + ); + } +} diff --git a/lib/widgets/data_display/medical/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart similarity index 88% rename from lib/widgets/data_display/medical/LabResultWidget.dart rename to lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index 6ad51c36..eb8771b7 100644 --- a/lib/widgets/data_display/medical/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -1,18 +1,23 @@ import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../text.dart'; +import '../../text.dart'; +import 'FlowChartPage.dart'; + class LabResultWidget extends StatelessWidget { final String filterName ; final List patientLabResultList; + final PatientLabOrders patientLabOrder; - LabResultWidget({Key key, this.filterName, this.patientLabResultList}) : super(key: key); + LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder}) : super(key: key); ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -30,7 +35,15 @@ class LabResultWidget extends StatelessWidget { Texts(filterName), InkWell( onTap: () { - //TODO model.getPatientLabResult(patientLabOrder: widget.patientLabOrder); + Navigator.push( + context, + FadePage( + page: FlowChartPage( + filterName: filterName, + patientLabOrder: patientLabOrder, + ), + ), + ); }, child: Texts( TranslationBase.of(context).showMoreBtn, diff --git a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart new file mode 100644 index 00000000..1f09dcf7 --- /dev/null +++ b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart @@ -0,0 +1,112 @@ +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class LabResultDetailsWidget extends StatefulWidget { + final List labResult; + + LabResultDetailsWidget({ + this.labResult, + }); + + @override + _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); +} + +class _VitalSignDetailsWidgetState extends State { + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), + border: Border.all(color: Colors.grey, width: 1), + ), + margin: EdgeInsets.all(20), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(), + ), + ], + ), + ), + ); + } + + List fullData() { + List tableRow = []; + tableRow.add(TableRow(children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).date, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts(TranslationBase.of(context).labResult, color: Colors.white), + ), + height: 60), + ) + ])); + widget.labResult.forEach((vital) { + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + // '${DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + '${vital.sampleCollectedOn}', + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${vital.resultValue}', + textAlign: TextAlign.center, + ), + ), + ), + ), + ])); + }); + return tableRow; + } +} diff --git a/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart new file mode 100644 index 00000000..19a95bac --- /dev/null +++ b/lib/widgets/data_display/medical/LabResult/lab_result_chart_and_detials.dart @@ -0,0 +1,74 @@ +import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:flutter/material.dart'; + +import 'package:charts_flutter/flutter.dart' as charts; + +import 'Lab_Result_details_wideget.dart'; + +class LabResultChartAndDetails extends StatelessWidget { + LabResultChartAndDetails({ + Key key, + @required this.labResult, + @required this.name, + }) : super(key: key); + + final List labResult; + final String name; + + List _timeSeriesData = []; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + AppExpandableNotifier( + headerWidget: AppTimeSeriesChart( + seriesList: generateData(), + chartName: name, + startDate: DateUtil.convertStringToDateTime(labResult[0].sampleCollectedOn), + endDate: DateTime.now(), + ), + bodyWidget: LabResultDetailsWidget( + labResult: labResult, + ), + ), + ], + ); + } + + generateData() { + if (labResult.length > 0) { + int x =0; + labResult.forEach( + (element) { + try { + var resultValueDouble =double.parse(element.resultValue); + var resultValueInt = resultValueDouble.toInt(); + _timeSeriesData.add( + TimeSeriesSales( + DateUtil.convertStringToDateTime(element.sampleCollectedOn), + resultValueInt, + ), + ); + + } catch (e) { + print(e); + } + + }, + ); + } + return [ + new charts.Series( + id: 'Sales', + colorFn: (_, __) => charts.MaterialPalette.red.shadeDefault, + domainFn: (TimeSeriesSales sales, _) => sales.time, + measureFn: (TimeSeriesSales sales, _) => sales.sales, + data: _timeSeriesData, + ) + ]; + } +} diff --git a/lib/widgets/data_display/medical/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart similarity index 99% rename from lib/widgets/data_display/medical/laboratory_result_widget.dart rename to lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index d16019b6..79cf632b 100644 --- a/lib/widgets/data_display/medical/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -12,7 +12,7 @@ import 'package:flutter_html/flutter_html.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -import '../text.dart'; +import '../../text.dart'; import 'LabResultWidget.dart'; class LaboratoryResultWidget extends StatefulWidget { @@ -232,6 +232,7 @@ class _LaboratoryResultWidgetState extends State { ...List.generate( model.labResultLists.length, (index) => LabResultWidget( + patientLabOrder: widget.patientLabOrder, filterName: model .labResultLists[index].filterName, patientLabResultList: model diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index b68ae1da..23a3a59f 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; @@ -59,7 +60,7 @@ class _AppExpandableNotifier extends State { Padding( padding: EdgeInsets.all(10), child: Text( - widget.title ?? 'Details', + widget.title ?? TranslationBase.of(context).details, style: TextStyle( fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2, From c4bb75eab4492cb47748657784c80fbb4e42131b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 9 Dec 2020 18:40:32 +0300 Subject: [PATCH 10/12] Doctor rating fixed --- lib/pages/BookAppointment/DoctorProfile.dart | 15 +- .../MyAppointments/AppointmentDetails.dart | 355 ++++++++++++++++-- .../widgets/AppointmentActions.dart | 2 +- .../widgets/AppointmentCardView.dart | 12 +- 4 files changed, 331 insertions(+), 53 deletions(-) diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 20e4ae09..392eb24c 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -53,17 +53,6 @@ class _DoctorProfileState extends State length: 2, vsync: this, initialIndex: widget.isOpenAppt == true ? 1 : 0); - - // event.controller.stream.listen((p) { - // if (p['clinic_id'] != null && - // p['doctor_id'] != null && - // p['project_id'] != null) { - // setState(() { - // // need to take the data from here - // // dropdownValue = p['clinic_id']; - // }); - // } - // }); _tabController = new TabController(length: 2, vsync: this); widget.authUser = new AuthenticatedUser(); widget.doctor.speciality = widget.docProfileList.specialty; @@ -164,7 +153,7 @@ class _DoctorProfileState extends State alignment: Alignment.center, child: Text( "(" + - widget.doctor.noOfPatientsRate.toString() + + widget.docProfileList.noOfPatientsRate.toString() + " " + TranslationBase.of(context).reviews + ")", @@ -496,7 +485,7 @@ class _DoctorProfileState extends State } double getRatingWidth(int patientNumber) { - var width = (patientNumber / this.widget.doctor.noOfPatientsRate) * 100; + var width = (patientNumber / this.widget.docProfileList.noOfPatientsRate) * 100; return width; } diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 109af9d1..4143d090 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -1,8 +1,11 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -26,6 +29,8 @@ class _AppointmentDetailsState extends State with SingleTickerProviderStateMixin { static TabController _tabController; + List doctorDetailsList = List(); + @override void initState() { _tabController = new TabController(length: 2, vsync: this); @@ -46,26 +51,26 @@ class _AppointmentDetailsState extends State isShowAppBar: true, bottomSheet: AppointmentDetails.showFooterButton ? Container( - width: MediaQuery.of(context).size.width, - height: 50.0, - margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF60686b), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: goToBookConfirm, - child: Text(TranslationBase.of(context).bookNow, - style: TextStyle(fontSize: 18.0)), - ), - ), - ) + width: MediaQuery.of(context).size.width, + height: 50.0, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF60686b), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: goToBookConfirm, + child: Text(TranslationBase.of(context).bookNow, + style: TextStyle(fontSize: 18.0)), + ), + ), + ) : null, body: Container( color: new Color(0xFFf6f6f6), @@ -88,7 +93,8 @@ class _AppointmentDetailsState extends State ), ), Container( - margin: EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), + margin: + EdgeInsets.only(top: 10.0, left: 10.0, right: 10.0), alignment: Alignment.center, child: Text( widget.appo.doctorTitle + @@ -123,19 +129,24 @@ class _AppointmentDetailsState extends State emptyIcon: Icons.star, ), ), - Container( - margin: EdgeInsets.only(top: 5.0), - alignment: Alignment.center, - child: Text( - "(" + - widget.appo.noOfPatientsRate.toString() + - " Reviews)", - style: TextStyle( - fontSize: 14.0, - color: Colors.blue[800], - letterSpacing: 1.0, - decoration: TextDecoration.underline, - )), + InkWell( + onTap: () { + getDoctorRatingsDetails(); + }, + child: Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: Text( + "(" + + widget.appo.noOfPatientsRate.toString() + + " Reviews)", + style: TextStyle( + fontSize: 14.0, + color: Colors.blue[800], + letterSpacing: 1.0, + decoration: TextDecoration.underline, + )), + ), ), Container( margin: EdgeInsets.only(top: 10.0), @@ -171,8 +182,14 @@ class _AppointmentDetailsState extends State child: TabBarView( physics: NeverScrollableScrollPhysics(), children: [ - AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton), - DocAvailableAppointments(doctor: getDoctorObject(), isLiveCareAppointment: widget.appo.isLiveCareAppointment) + AppointmentActions( + appo: widget.appo, + tabController: _tabController, + enableFooterButton: enableFooterButton), + DocAvailableAppointments( + doctor: getDoctorObject(), + isLiveCareAppointment: + widget.appo.isLiveCareAppointment) ], controller: _tabController, ), @@ -208,7 +225,273 @@ class _AppointmentDetailsState extends State selectedTime: DocAvailableAppointments.selectedTime))); } + getDoctorRatingsDetails() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.getDoctorsRatingDetails(widget.appo.doctorID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + doctorDetailsList.clear(); + res['DoctorRatingDetailsList'].forEach((v) { + doctorDetailsList.add(new DoctorRateDetails.fromJson(v)); + }); + showRatingDialog(doctorDetailsList); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + void showRatingDialog(List doctorDetailsList) { + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: Dialog( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + // height: 400.0, + width: MediaQuery.of(context).size.width * 0.8, + color: Colors.white, + child: Column( + children: [ + Container( + alignment: Alignment.center, + width: MediaQuery.of(context).size.width, + color: Theme.of(context).primaryColor, + margin: EdgeInsets.only(bottom: 5.0), + padding: EdgeInsets.all(10.0), + child: Text( + TranslationBase.of(context).doctorRating, + style: TextStyle( + fontSize: 22.0, color: Colors.white))), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Text( + this + .widget + .appo + .actualDoctorRate + .ceilToDouble() + .toString(), + style: TextStyle( + fontSize: 32.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: + this.widget.appo.actualDoctorRate.toDouble(), + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text( + this.widget.appo.noOfPatientsRate.toString() + + " " + + TranslationBase.of(context).reviews, + style: TextStyle( + fontSize: 14.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).excellent, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[0].patientNumber), + height: 6.0, + child: Container( + color: Colors.green[700], + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).v_good, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[1].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffB7B723), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).good, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[2].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEBA727), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context).average, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[3].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEB7227), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only( + top: 10.0, left: 15.0, right: 15.0), + child: Text( + TranslationBase.of(context) + .below_average, + style: TextStyle( + fontSize: 13.0, + color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth( + doctorDetailsList[4].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffE20C0C), + ), + ), + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 40.0), + child: Divider()), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Align( + alignment: FractionalOffset.bottomCenter, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 40.0, + child: RaisedButton( + elevation: 0.0, + color: Colors.white, + textColor: Colors.red, + hoverColor: Colors.transparent, + focusColor: Colors.transparent, + highlightColor: Colors.transparent, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text( + TranslationBase.of(context).cancel, + style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}); + } + + double getRatingWidth(int patientNumber) { + var width = (patientNumber / this.widget.appo.noOfPatientsRate) * 100; + return width; + } DoctorList getDoctorObject() { DoctorList docObj = new DoctorList(); diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index c0399b8a..76c0633c 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -88,7 +88,7 @@ class _AppointmentActionsState extends State { Container( // height: 100.0, margin: EdgeInsets.all(7.0), - padding: EdgeInsets.only(bottom: 15.0), + padding: EdgeInsets.only(bottom: 4.0), decoration: BoxDecoration( boxShadow: [ BoxShadow( diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index 1bbe471a..25d5e931 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -5,6 +6,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; import '../AppointmentDetails.dart'; @@ -23,6 +25,7 @@ class AppointmentCard extends StatefulWidget { class _ApointmentCardState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return InkWell( onTap: () { navigateToAppointmentDetails(context, widget.appo); @@ -46,7 +49,7 @@ class _ApointmentCardState extends State { fit: BoxFit.fill, height: 60.0, width: 60.0), ), Container( - width: MediaQuery.of(context).size.width * 0.57, + width: MediaQuery.of(context).size.width * 0.61, margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -101,8 +104,11 @@ class _ApointmentCardState extends State { Container( transform: Matrix4.translationValues(15.0, -40.0, 0.0), - child: Image.asset( - "assets/images/new-design/arrow.png", + child: projectViewModel.isArabic ? Image.asset( + "assets/images/new-design/arrow_menu_black-ar.png", + width: 25.0, + height: 25.0) : Image.asset( + "assets/images/new-design/arrow_menu_black-en.png", width: 25.0, height: 25.0), ), From eca2266f7b03d67e28d22f9d4a81dc3d92aa312a Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 9 Dec 2020 23:23:14 +0200 Subject: [PATCH 11/12] hot fixing --- lib/config/localized_values.dart | 18 +++- .../insurance/insurance_card_screen.dart | 87 +++++++++++-------- lib/pages/insurance/insurance_details.dart | 26 +++--- .../prescription_details_page.dart | 20 +++-- .../prescriptions_home_page.dart | 2 +- .../prescriptions/prescriptions_page.dart | 4 +- .../radiology/radiology_details_page.dart | 7 +- lib/uitl/translations_delegate_base.dart | 4 + .../LabResult/Lab_Result_details_wideget.dart | 3 +- .../data_display/medical/doctor_card.dart | 4 +- 10 files changed, 107 insertions(+), 68 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f7b5f234..313cbbb2 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1175,5 +1175,21 @@ const Map localizedValues = { 'details':{ 'en':'Details', 'ar':'التفاصيل' - } + }, + "active-insurence": { + "en": "Active", + "ar": "نشطة" + }, + "not-active": { + "en": "Not Active", + "ar": "غير نشط" + }, + "card-detail": { + "en": "Insurance Details", + "ar": "منافعك التامينية" + }, + "Dr": { + "en": "Dr. ", + "ar": "الدكتور." + }, }; diff --git a/lib/pages/insurance/insurance_card_screen.dart b/lib/pages/insurance/insurance_card_screen.dart index 5f8c6777..42357eea 100644 --- a/lib/pages/insurance/insurance_card_screen.dart +++ b/lib/pages/insurance/insurance_card_screen.dart @@ -20,18 +20,23 @@ import '../base/base_view.dart'; class InsuranceCard extends StatefulWidget { int appointmentNo; - InsuranceCard({this.appointmentNo}); @override _InsuranceCardState createState() => _InsuranceCardState(); } + class _InsuranceCardState extends State { InsuranceCardService _insuranceCardService = locator(); List imagesInfo = List(); + @override Widget build(BuildContext context) { - imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png', + imageAr: + 'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png')); return BaseView( onModelReady: (model) => model.getInsurance(), @@ -79,16 +84,16 @@ class _InsuranceCardState extends State { padding: EdgeInsets.all(14), width: double.infinity, decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.grey,width: 0.2), - borderRadius: BorderRadius.all(Radius.circular(2)), - boxShadow: [ - BoxShadow( - color: Colors.white70, - ), - - ] - ), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.grey, width: 0.2), + borderRadius: + BorderRadius.all(Radius.circular(2)), + boxShadow: [ + BoxShadow( + color: Colors.white70, + ), + ]), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -103,28 +108,34 @@ class _InsuranceCardState extends State { thickness: 0.5, ), Column( - crossAxisAlignment: CrossAxisAlignment.stretch, + crossAxisAlignment: + CrossAxisAlignment.stretch, children: [ Text( TranslationBase.of(context).category + - model.insurance[index].subCategoryDesc, + model.insurance[index] + .subCategoryDesc, style: TextStyle(fontSize: 18.5), ), Text( - TranslationBase.of(context).expirationDate + - convertDateFormat( - model.insurance[index].cardValidTo), + TranslationBase.of(context) + .expirationDate + + convertDateFormat(model + .insurance[index].cardValidTo), style: TextStyle(fontSize: 18.5), ), Text( - TranslationBase.of(context).patientCard + - model.insurance[index].patientCardID, + TranslationBase.of(context) + .patientCard + + model + .insurance[index].patientCardID, style: TextStyle(fontSize: 18.5), ), Text( - TranslationBase.of(context).policyNumber + - model - .insurance[index].insurancePolicyNumber, + TranslationBase.of(context) + .policyNumber + + model.insurance[index] + .insurancePolicyNumber, style: TextStyle(fontSize: 18.5), ), ], @@ -132,16 +143,18 @@ class _InsuranceCardState extends State { Column( children: [ model.insurance[index].isActive == true - ? Text('Active', - style: TextStyle( + ? Texts( + TranslationBase.of(context) + .activeInsurence, color: Colors.green, fontWeight: FontWeight.w900, - fontSize: 17.9)) - : Text('Not Active', - style: TextStyle( + fontSize: 17.9) + : Texts( + TranslationBase.of(context) + .notActive, color: Colors.red, fontWeight: FontWeight.w900, - fontSize: 17.9)) + fontSize: 17.9) ], ), SizedBox( @@ -151,7 +164,9 @@ class _InsuranceCardState extends State { Container( color: Colors.transparent, child: SecondaryButton( - onTap:()=>{ getDetails(model.insurance[index])}, + onTap: () => { + getDetails(model.insurance[index]) + }, label: TranslationBase.of(context).seeDetails, textColor: Colors.white, ), @@ -160,8 +175,6 @@ class _InsuranceCardState extends State { ], ), ), - - ], ), ], @@ -191,13 +204,13 @@ class _InsuranceCardState extends State { return newDate.toString(); } - getDetails(data){ + + getDetails(data) { GifLoaderDialogUtils.showMyDialog(context); _insuranceCardService.getInsuranceDetails(data).then((value) => { - GifLoaderDialogUtils.hideDialog(context), - Navigator.push(context, - FadePage(page: InsuranceCardDetails(data:value[0]['CheckList']))) - - }); + GifLoaderDialogUtils.hideDialog(context), + Navigator.push(context, + FadePage(page: InsuranceCardDetails(data: value[0]['CheckList']))) + }); } } diff --git a/lib/pages/insurance/insurance_details.dart b/lib/pages/insurance/insurance_details.dart index d0a829be..16745e9e 100644 --- a/lib/pages/insurance/insurance_details.dart +++ b/lib/pages/insurance/insurance_details.dart @@ -1,35 +1,29 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:html/dom.dart' as dom; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class InsuranceCardDetails extends StatefulWidget { +class InsuranceCardDetails extends StatelessWidget { final String data; InsuranceCardDetails({this.data}); - @override - _InsuranceCardInsuranceCardDetailsState createState() => _InsuranceCardInsuranceCardDetailsState(); -} -//TODO fix it -class _InsuranceCardInsuranceCardDetailsState extends State { @override Widget build(BuildContext context) { - return - AppScaffold( - isShowAppBar: true, - - body: Center( - child: SingleChildScrollView( + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).cardDetail, + body: Center( + child: SingleChildScrollView( child: Html( - data:widget.data, - ) - ) + data: data, + ), + ), ), ); } - } diff --git a/lib/pages/medical/prescriptions/prescription_details_page.dart b/lib/pages/medical/prescriptions/prescription_details_page.dart index 024de17c..d59bc06d 100644 --- a/lib/pages/medical/prescriptions/prescription_details_page.dart +++ b/lib/pages/medical/prescriptions/prescription_details_page.dart @@ -105,22 +105,29 @@ class PrescriptionDetailsPage extends StatelessWidget { color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts(TranslationBase.of(context).way))), + child: Center( + child: Texts(TranslationBase.of(context).way))), Container( color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts(TranslationBase.of(context).average))), + child: Center( + child: + Texts(TranslationBase.of(context).average))), Container( color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts(TranslationBase.of(context).dailyDoses))), + child: Center( + child: Texts( + TranslationBase.of(context).dailyDoses))), Container( color: Colors.white, height: 30, width: double.infinity, - child: Center(child: Texts(TranslationBase.of(context).period))), + child: Center( + child: + Texts(TranslationBase.of(context).period))), ], ), TableRow( @@ -136,7 +143,8 @@ class PrescriptionDetailsPage extends StatelessWidget { height: 50, width: double.infinity, child: Center( - child: Text(prescriptionReport.frequencyN?? ''))), + child: + Text(prescriptionReport.frequencyN ?? ''))), Container( color: Colors.white, height: 50, @@ -174,7 +182,7 @@ class PrescriptionDetailsPage extends StatelessWidget { SizedBox( height: 5, ), - Texts(prescriptionReport.remarks), + Texts(prescriptionReport.remarks ?? ''), ], ), ), diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index 94484340..b13933c6 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -83,7 +83,7 @@ class _HomePrescriptionsPageState extends State controller: _tabController, indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.label, - indicatorColor: Colors.red[800], + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), diff --git a/lib/pages/medical/prescriptions/prescriptions_page.dart b/lib/pages/medical/prescriptions/prescriptions_page.dart index 6b852db9..dc842bdc 100644 --- a/lib/pages/medical/prescriptions/prescriptions_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_page.dart @@ -37,7 +37,7 @@ class PrescriptionsPage extends StatelessWidget { leading: Radio( value: FilterType.Clinic, groupValue: prescriptionsViewModel.filterType, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (FilterType value) { prescriptionsViewModel.setFilterType(value); }, @@ -55,7 +55,7 @@ class PrescriptionsPage extends StatelessWidget { leading: Radio( value: FilterType.Hospital, groupValue: prescriptionsViewModel.filterType, - activeColor: Colors.red[800], + activeColor: Theme.of(context).primaryColor, onChanged: (FilterType value) { prescriptionsViewModel.setFilterType(value); }, diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 9f8a0640..53057953 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_mode import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -29,7 +30,11 @@ class RadiologyDetailsPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text('${finalRadiology.reportData}',textAlign: TextAlign.center,), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts('${finalRadiology.reportData}',textAlign: TextAlign.start,fontSize: 17,), + ), + SizedBox(height: MediaQuery.of(context).size.height * 0.2,) ], ), ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 86e98b07..53ae86d4 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -945,6 +945,10 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get insurCards => localizedValues['insur-cards'][locale.languageCode]; String get labResult => localizedValues['labResult'][locale.languageCode]; String get details => localizedValues['details'][locale.languageCode]; + String get activeInsurence => localizedValues['active-insurence'][locale.languageCode]; + String get notActive => localizedValues['not-active'][locale.languageCode]; + String get cardDetail => localizedValues['card-detail'][locale.languageCode]; + String get dr => localizedValues['Dr'][locale.languageCode]; } diff --git a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart index 1f09dcf7..753f3deb 100644 --- a/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart +++ b/lib/widgets/data_display/medical/LabResult/Lab_Result_details_wideget.dart @@ -86,8 +86,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: Texts( - // '${DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', - '${vital.sampleCollectedOn}', + '${vital.verifiedOn}', textAlign: TextAlign.center, ), ), diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 732a8934..2e70f2ab 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -96,7 +96,7 @@ class DoctorCard extends StatelessWidget { Expanded( flex: 1, child: LargeAvatar( - name: name, + name:name, url: profileUrl, ), ), @@ -108,7 +108,7 @@ class DoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - name, + TranslationBase.of(context).dr+" "+ name, bold: true, ), Texts( From 9d3c64200e835f20237aef1b4e5aa8392677e6ac Mon Sep 17 00:00:00 2001 From: Haroon Amjad Date: Thu, 10 Dec 2020 01:24:51 +0300 Subject: [PATCH 12/12] fixes --- lib/config/localized_values.dart | 4 ++ lib/pages/BookAppointment/BookConfirm.dart | 4 +- .../components/DocAvailableAppointments.dart | 1 + .../BookAppointment/components/DocInfo.dart | 7 ++- .../MyAppointments/AppointmentDetails.dart | 41 ++++++++++++- lib/pages/MyAppointments/MyAppointments.dart | 2 + .../MyAppointments/models/ArrivedButtons.dart | 4 +- .../widgets/AppointmentActions.dart | 5 +- .../widgets/AppointmentCardView.dart | 60 +++++++++++-------- lib/uitl/translations_delegate_base.dart | 3 +- 10 files changed, 91 insertions(+), 40 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f7b5f234..1466f977 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1175,5 +1175,9 @@ const Map localizedValues = { 'details':{ 'en':'Details', 'ar':'التفاصيل' + }, + "age": { + "en": "Age", + "ar": "العمر" } }; diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 7a247b78..73975c58 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -325,7 +325,7 @@ class _BookConfirmState extends State { Container( margin: EdgeInsets.only(top: 5.0), child: Text( - "Gender: " + + TranslationBase.of(context).gender + ": " + widget.authUser.genderDescription, style: TextStyle( fontSize: 12.0, @@ -335,7 +335,7 @@ class _BookConfirmState extends State { Container( margin: EdgeInsets.only(top: 5.0, bottom: 3.0), child: Text( - "Age: " + widget.authUser.age.toString(), + TranslationBase.of(context).age + ": " + widget.authUser.age.toString(), style: TextStyle( fontSize: 12.0, color: Colors.grey[600], diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 70b6aaa0..8ac1d197 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -380,6 +380,7 @@ class _DocAvailableAppointmentsState extends State AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); }); } diff --git a/lib/pages/BookAppointment/components/DocInfo.dart b/lib/pages/BookAppointment/components/DocInfo.dart index aa6e3b9f..02c1eb90 100644 --- a/lib/pages/BookAppointment/components/DocInfo.dart +++ b/lib/pages/BookAppointment/components/DocInfo.dart @@ -13,6 +13,7 @@ class DoctorInformation extends StatelessWidget { return Container( margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), child: Column( + mainAxisSize: MainAxisSize.min, children: [ Card( shape: RoundedRectangleBorder( @@ -106,6 +107,7 @@ class DoctorInformation extends StatelessWidget { Container( margin: EdgeInsets.fromLTRB(20.0, 0.0, 10.0, 5.0), child: Column( + mainAxisSize: MainAxisSize.min, children: [ _getNormalText(docProfileList.doctorProfileInfo) ], @@ -123,7 +125,6 @@ class DoctorInformation extends StatelessWidget { return Text(text, style: TextStyle( fontSize: 13, - fontFamily: 'Open-Sans', fontWeight: FontWeight.bold, letterSpacing: 0.5, color: Colors.grey[800])); @@ -133,9 +134,9 @@ class DoctorInformation extends StatelessWidget { return Container( margin: EdgeInsets.only(top: 5.0), child: Text(text, + maxLines: 16, style: TextStyle( fontSize: 13, - fontFamily: 'Open-Sans', letterSpacing: 0.5, color: Colors.grey[700])), ); @@ -151,7 +152,7 @@ class DoctorInformation extends StatelessWidget { Text(text.trim(), style: TextStyle( fontSize: 13, - fontFamily: 'Open-Sans', + letterSpacing: 0.5, color: Colors.grey[700])), Container( diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 4143d090..4fc038a6 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; @@ -5,10 +6,12 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; import 'widgets/AppointmentActions.dart'; @@ -39,13 +42,13 @@ class _AppointmentDetailsState extends State @override void dispose() { - // TODO: implement dispose super.dispose(); _tabController.dispose(); } @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: widget.appo.doctorNameObj, isShowAppBar: true, @@ -109,7 +112,7 @@ class _AppointmentDetailsState extends State Container( margin: EdgeInsets.only(top: 10.0), alignment: Alignment.center, - child: Text(widget.appo.clinicName, + child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality), style: TextStyle( fontSize: 12.0, color: Colors.grey[900], @@ -139,7 +142,9 @@ class _AppointmentDetailsState extends State child: Text( "(" + widget.appo.noOfPatientsRate.toString() + - " Reviews)", + " " + + TranslationBase.of(context).reviews + + ")", style: TextStyle( fontSize: 14.0, color: Colors.blue[800], @@ -148,6 +153,17 @@ class _AppointmentDetailsState extends State )), ), ), + Container( + alignment: Alignment.center, + child: Text(DateUtil.getWeekDayMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + widget.appo.appointmentDate), + projectViewModel.isArabic ? "ar" : "en")), + ), + Container( + alignment: Alignment.center, + child: Text(widget.appo.startTime), + ), Container( margin: EdgeInsets.only(top: 10.0), child: Divider( @@ -493,6 +509,25 @@ class _AppointmentDetailsState extends State return width; } + String getDate(String date) { + DateTime dateObj = DateUtil.convertStringToDate(date); + return DateUtil.getWeekDay(dateObj.weekday) + + ", " + + dateObj.day.toString() + + " " + + DateUtil.getMonth(dateObj.month) + + " " + + dateObj.year.toString(); + } + + String getDoctorSpeciality(List docSpecial) { + String docSpeciality = ""; + docSpecial.forEach((v) { + docSpeciality = docSpeciality + v + " "; + }); + return docSpeciality; + } + DoctorList getDoctorObject() { DoctorList docObj = new DoctorList(); docObj.doctorID = widget.appo.doctorID; diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index aa3b72ae..47e539a0 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -419,4 +419,6 @@ class _MyAppointmentsState extends State ), ); } + + } diff --git a/lib/pages/MyAppointments/models/ArrivedButtons.dart b/lib/pages/MyAppointments/models/ArrivedButtons.dart index a30349ba..a5132883 100644 --- a/lib/pages/MyAppointments/models/ArrivedButtons.dart +++ b/lib/pages/MyAppointments/models/ArrivedButtons.dart @@ -40,7 +40,7 @@ class ArrivedButtons { "caller": "insertComplaint" }, { - "title": TranslationBase.of(AppGlobal.context).insurance, + "title": TranslationBase.of(AppGlobal.context).insuranceApproval, "subtitle": TranslationBase.of(AppGlobal.context).insuranceSubtitle, "icon": "assets/images/new-design/insurance_approvals_icon.png", "caller": "Insurance" @@ -58,4 +58,4 @@ class ArrivedButtons { "caller": "Survey" } ]; -} +} \ No newline at end of file diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 76c0633c..d8c5fd47 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -437,12 +437,11 @@ class _AppointmentActionsState extends State { navigateToMedicinePrescriptionReport( prescriptionReportEnhList, res['ListPRM']); } else { - AppToast.showErrorToast(message: "Sorry there is no data"); + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); - print(err); - AppToast.showErrorToast(message: err); + // AppToast.showErrorToast(message: err); }); } diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index 25d5e931..a1e5c0e7 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -80,7 +80,12 @@ class _ApointmentCardState extends State { ), Container( margin: EdgeInsets.only(top: 3.0, bottom: 3.0), - child: Text(getDate(widget.appo.appointmentDate).trim(), + child: Text( + DateUtil.getWeekDayMonthDayYearDateFormatted( + DateUtil.convertStringToDate( + widget.appo.appointmentDate), + projectViewModel.isArabic ? "ar" : "en") + .trim(), style: TextStyle( fontSize: 12.0, color: Colors.grey[600], @@ -104,33 +109,38 @@ class _ApointmentCardState extends State { Container( transform: Matrix4.translationValues(15.0, -40.0, 0.0), - child: projectViewModel.isArabic ? Image.asset( - "assets/images/new-design/arrow_menu_black-ar.png", - width: 25.0, - height: 25.0) : Image.asset( - "assets/images/new-design/arrow_menu_black-en.png", - width: 25.0, - height: 25.0), + child: projectViewModel.isArabic + ? Image.asset( + "assets/images/new-design/arrow_menu_black-ar.png", + width: 25.0, + height: 25.0) + : Image.asset( + "assets/images/new-design/arrow_menu_black-en.png", + width: 25.0, + height: 25.0), ), ], ), - widget.appo.patientStatusType == AppointmentType.BOOKED ? - Container( - child: CountdownTimer( - endTime: DateTime.now().millisecondsSinceEpoch + - (widget.appo.remaniningHoursTocanPay * 1000) * - 60, - widgetBuilder: (_, CurrentRemainingTime time) { - return Text( - '${time.days}:${time.hours}:${time.min}:${time.sec} ' + - TranslationBase.of(context) - .upcomingTimeLeft, - style: TextStyle( - fontSize: 12.0, - color: Color(0xff40ACC9))); - }, - ), - ) : Container(), + (widget.appo.patientStatusType == AppointmentType.BOOKED || + widget.appo.patientStatusType == + AppointmentType.CONFIRMED) + ? Container( + child: CountdownTimer( + endTime: DateTime.now().millisecondsSinceEpoch + + (widget.appo.remaniningHoursTocanPay * 1000) * + 60, + widgetBuilder: (_, CurrentRemainingTime time) { + return Text( + '${time.days}:${time.hours}:${time.min}:${time.sec} ' + + TranslationBase.of(context) + .upcomingTimeLeft, + style: TextStyle( + fontSize: 12.0, + color: Color(0xff40ACC9))); + }, + ), + ) + : Container(), ], ), ), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 86e98b07..61107e30 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -945,8 +945,7 @@ String get fileno => localizedValues['fileno'][locale.languageCode]; String get insurCards => localizedValues['insur-cards'][locale.languageCode]; String get labResult => localizedValues['labResult'][locale.languageCode]; String get details => localizedValues['details'][locale.languageCode]; - - + String get age => localizedValues['age'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate {