diff --git a/lib/config/config.dart b/lib/config/config.dart index bce0cc8c..6686a23c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -189,6 +189,8 @@ const HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvance const ADD_ADVANCE_NUMBER_REQUEST = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; +const ADD_VIDA_REQUEST = 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart'; + const IS_ALLOW_ASK_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_CALL_REQUEST_TYPE = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 9ba405e7..c0aa888f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1184,6 +1184,98 @@ const Map localizedValues = { "en": "To recieve water reminders, please turn on notifications in the system settings", "ar": "الرجاء تفعيل الاشعارات في الاعدادات" }, + "select-location": { + "en": "Select Location", + "ar": "اختر موقعا" + }, + "result-header": { + "en": "Get The Result During 8 Hours", + "ar": "احصل على النتيجة خلال 8 ساعة" + }, + "covid-info": { + "en": "We are using the advance technology to test COVID-19, The sample for examination is taking between the nose and mouth (nasopharyngeal swab), the examination is done by ELITE In Genius of the company ELITECH GROUP MOLECULAR DIAGNOSTICS, Note that the device belongs to an Italian company and is manufactured in Japan with RC- PCR​", + "ar": "يتوفر لدينا أحدث جهاز خاص بفحص مرض الكورونا (COVID-19) طريقة الفحص تؤخذ مسحة من البلعوم الأنفي ( عن طريف الأنف) ويتم الفحص بواسطة جهاز ELITE In Genius التابع لشركة ELITECH GROUP MOLECULAR DIAGNOSTICS علما بأن الجهاز تابع لشركة إيطالية ومصنع في اليابان بتقينة RC-PCR" + }, + "select-appo": { + "en": "Kindly select one of the available appointments from below:", + "ar": "يرجى اختيار أحد المواعيد المتاحة من أدناه:" + }, + "covid-alert-header": { + "en": "Pay With-in 15 mins to confirm the appointment", + "ar": "الرجاء اتمام عملية الدفع خلال 15 دقيقه لتاكيد الموعد" + }, + "covid-alert-info": { + "en": "Payment for Covid-19 Test should Be made with-in 15 mins otherwise The system will Cancel the Scheduled appointment automatically​", + "ar": "سيتم الغاء الموعد عن طريق النظام بشكل الي في حال عدم اتمام عمليه الدفع خلال 15 دقيقة​" + }, + "covid-alert-mins": { + "en": "Pay With-in 15 mins", + "ar": "ادفع خلال 15 دقيقة" + }, + "back": { + "en": "Back", + "ar": "رجوع" + }, + "get-directions": { + "en": "Get Directions", + "ar": "احصل على الاتجاهات" + }, + "selected-location": { + "en": "Selected Location:", + "ar": "الموقع المحدد:" + }, + "test-fee": { + "en": "Test Fee", + "ar": "رسوم الاختبار" + }, + "pay-options": { + "en": "You can pay by the following Options:", + "ar": "يمكنك الدفع عن طريق الخيارات التالية:" + }, + "livecare-service": { + "en": "LiveCare Service", + "ar": "خدمة لايف كير" + }, + "livecare-service-desc": { + "en": "is to obtain medical advice with a specialist doctor Via a video call", + "ar": "هي الحصول على استشارة طبية مع طبيب مختص عن طريق اتصال فيديو" + }, + "why-livecare": { + "en": "WHY LIVECARE", + "ar": "لماذا خدمة اللايف كير" + }, + "livecare-point-1": { + "en": "No need to wait you will get Medical consultation immediately via Video call", + "ar": "لا داعي للانتظار سوف تحصل على الاستشارة الطبية فورا عن طريق مكالمة الفيديو" + }, + "doc-virtual-appo-ins4": { + "en": "The doctor will see your medical file", + "ar": "سوف يتمكن الطبيب من الاطلاع على ملفك الطبي كامل" + }, + "doc-virtual-appo-ins5": { + "en": "Free prescription delivery service", + "ar": "خدمة توصيل الادوية مجانا" + }, + "livecare-summary": { + "en": "** The service is included with some insurance companies according to the terms and conditions With our best wishes for health and wellness", + "ar": "** الخدمة مشمولة لدى بعض شركات التامين على حسب الشروط والاحكام مع تمنياتنا لكم بدوام الصحة والعافية" + }, + "livecare-option-1": { + "en": "Get Medical consultation immediately", + "ar": "الحصول على الاستشارة فورا" + }, + "livecare-option-2": { + "en": "Instant video call", + "ar": "اتصال فيديو فوري" + }, + "livecare-option-3": { + "en": "Book Appointment", + "ar": "حجز موعد" + }, + "livecare-option-4": { + "en": "Schedule video call", + "ar": "اتصال فيديو مجدول" + }, "verification_message_code": {"en": "Please enter verification code", "ar": "الرجاء إدخال رمز التحقق"}, "sms_code": {"en": "Enter SMS Code here", "ar": "أدخل رمز التحقق هنا"}, "code_failure": {"en": "Didn’t received the code", "ar": "لم أستلم رمز التحقق"}, diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index e0fa2aec..6d1e98ea 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -29,7 +29,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:giffy_dialog/giffy_dialog.dart'; import 'package:provider/provider.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/dialogs/ConfirmSMSDialog.dart b/lib/pages/Blood/dialogs/ConfirmSMSDialog.dart index d165a895..5cfb2372 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( @@ -335,14 +334,13 @@ class _ConfirmSMSDialogState extends State { void submit(MyBalanceViewModel model) { if (verifyAccountForm.currentState.validate()) { + GifLoaderDialogUtils.showMyDialog(context); 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 03a28d90..ae968764 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -61,6 +61,7 @@ class _BookConfirmState extends State { toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).bookAppo, + isShowDecPage: false, isShowAppBar: true, body: SingleChildScrollView( child: Container( @@ -461,6 +462,7 @@ class _BookConfirmState extends State { dialog.showAlertDialog(context); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); print(err); }); diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 34a7e1e1..614189e0 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -5,9 +5,9 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplai 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/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'; class DentalComplaints extends StatefulWidget { SearchInfo searchInfo; @@ -59,12 +59,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(() { @@ -75,8 +77,8 @@ class _DentalComplaintsState extends State { }); } else {} }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } } diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index e92c2348..00fb2fc8 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,14 @@ class _QRCodeState extends State { widget.patientShareResponse.doctorSpeciality), context) .then((res) { - print(res); + GifLoaderDialogUtils.hideDialog(context); ConfirmDialog.closeAlertDialog(context); }).catchError((err) { ConfirmDialog.closeAlertDialog(context); + GifLoaderDialogUtils.hideDialog(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/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 0c65a789..e5f219f0 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -26,6 +26,7 @@ class _SearchResultsState extends State { Widget build(BuildContext context) { return AppScaffold( appBarTitle: TranslationBase.of(context).bookAppo, + isShowDecPage: false, isShowAppBar: true, body: Container( margin: EdgeInsets.all(10.0), diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 01c9ee92..e772a418 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; diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 1e1945b5..5e4ea91c 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'; diff --git a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart index 27f37d0a..57377d75 100644 --- a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart +++ b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart @@ -3,8 +3,8 @@ 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:flutter/material.dart'; -import 'package:smart_progress_bar/smart_progress_bar.dart'; // ignore: must_be_immutable class DentalComplaintCard extends StatefulWidget { @@ -70,11 +70,13 @@ class _DentalComplaintCardState extends State { 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']); setState(() { @@ -114,9 +116,9 @@ class _DentalComplaintCardState extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); 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 1562c5f7..2788145f 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 f21a9718..1e6911e2 100644 --- a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart +++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart @@ -16,7 +16,6 @@ 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 { @@ -113,7 +112,7 @@ class _CovidTimeSlotsState extends State @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "COVID-19 TEST", + appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, body: SingleChildScrollView( child: Container( @@ -147,8 +146,8 @@ class _CovidTimeSlotsState extends State children: [ Container( margin: EdgeInsets.only( - left: 20.0, right: 20.0, top: 40.0), - child: Text("COVID-19 TEST", + left: 20.0, right: 20.0, top: 20.0), + child: Text(TranslationBase.of(context).covidTest, style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, @@ -157,7 +156,7 @@ class _CovidTimeSlotsState extends State Container( margin: EdgeInsets.only( left: 20.0, right: 20.0, top: 10.0), - child: Text("Drive-Thru", + child: Text(TranslationBase.of(context).driveThru, style: TextStyle( color: Colors.white, fontSize: 24.0)), ), @@ -179,8 +178,7 @@ class _CovidTimeSlotsState extends State children: [ Container( margin: EdgeInsets.all(10.0), - child: Text( - "Kindly select one of the available appointments from below: ", + child: Text(TranslationBase.of(context).selectAppo, style: TextStyle(color: Colors.black, fontSize: 16.0)), ), @@ -493,10 +491,8 @@ class _CovidTimeSlotsState extends State print(res); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: "Appointment Booked Successfully"); - // Future.delayed(new Duration(milliseconds: 1800), () { getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); - // }); } else { GifLoaderDialogUtils.hideDialog(context); appo = new AppoitmentAllHistoryResultList(); @@ -522,9 +518,9 @@ class _CovidTimeSlotsState extends State } }).catchError((err) { AppToast.showErrorToast(message: err); + GifLoaderDialogUtils.hideDialog(context); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, @@ -543,8 +539,7 @@ class _CovidTimeSlotsState extends State } }).catchError((err) { print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } getPatientShare(context, String appointmentNo, int clinicID, int projectID, @@ -553,17 +548,14 @@ class _CovidTimeSlotsState extends State 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); + print(res); + widget.patientShareResponse = new PatientShareResponse.fromJson(res); + navigateToPaymentAlert(); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); } navigateToPaymentAlert() { @@ -576,12 +568,12 @@ class _CovidTimeSlotsState extends State getCovidFreeSlots(BuildContext context, int projectID) { CovidDriveThruService service = new CovidDriveThruService(); + GifLoaderDialogUtils.showMyDialog(context); service.getCovidFreeSlots(context, projectID).then((res) { - print(res['COVID19_FreeTimeSlots']); + GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['COVID19_FreeTimeSlots'].length != 0) { freeSlotsResponse = res['COVID19_FreeTimeSlots']; - print(res['COVID19_FreeTimeSlots'].length); _getJSONSlots().then((value) => { setState(() => { widget.selectedClinicID = @@ -599,7 +591,6 @@ class _CovidTimeSlotsState extends State } }).catchError((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..c82fd0f1 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -1,13 +1,16 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCenterModel.dart'; 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/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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'; +import 'package:provider/provider.dart'; class CovidDrivethruLocation extends StatefulWidget { @override @@ -23,6 +26,8 @@ class _CovidDrivethruLocationState extends State { String projectName = ""; String projectID = ""; + ProjectViewModel projectViewModel; + @override void initState() { WidgetsBinding.instance @@ -32,8 +37,9 @@ class _CovidDrivethruLocationState extends State { @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return AppScaffold( - appBarTitle: "COVID-19 TEST", + appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, body: SingleChildScrollView( child: Container( @@ -41,8 +47,10 @@ class _CovidDrivethruLocationState extends State { child: Column( children: [ Container( - alignment: Alignment.centerLeft, - child: Text("Get The Result During 8 Hours", + alignment: projectViewModel.isArabic + ? Alignment.centerRight + : Alignment.centerLeft, + child: Text(TranslationBase.of(context).resultHeader, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 22.0, @@ -50,14 +58,15 @@ class _CovidDrivethruLocationState extends State { ), Container( margin: EdgeInsets.only(top: 10.0), - child: Text( - "We are using the advance technology to test COVID-19, The sample for examination is taking between the nose and mouth (nasopharyngeal swab), the examination is done by ELITE In Genius of the company ELITECH GROUP MOLECULAR DIAGNOSTICS, Note that the device belongs to an Italian company and is manufactured in Japan with RC- PCR​", + child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 16.0, color: Colors.black)), ), Container( margin: EdgeInsets.only(top: 20.0), - alignment: Alignment.centerLeft, - child: Text("Select Location", + alignment: projectViewModel.isArabic + ? Alignment.centerRight + : Alignment.centerLeft, + child: Text(TranslationBase.of(context).selectLocation, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 18.0, @@ -79,7 +88,7 @@ class _CovidDrivethruLocationState extends State { margin: EdgeInsets.only(top: 15.0), child: DropdownButtonHideUnderline( child: DropdownButton( - hint: new Text("Select Address"), + hint: new Text(TranslationBase.of(context).selectAddress), value: projectDropdownValue, items: projectsList.map((item) { return new DropdownMenuItem( @@ -98,8 +107,10 @@ class _CovidDrivethruLocationState extends State { isLocationSelected ? Container( margin: EdgeInsets.only(top: 15.0), - alignment: Alignment.centerLeft, - child: Text("Selected Location", + alignment: projectViewModel.isArabic + ? Alignment.centerRight + : Alignment.centerLeft, + child: Text(TranslationBase.of(context).selectLocation, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 18.0, @@ -150,8 +161,8 @@ class _CovidDrivethruLocationState extends State { onPressed: () { getDirections(); }, - child: - Text("GET DIRECTIONS", style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).getDirections, + style: TextStyle(fontSize: 18.0)), ), ), ), @@ -178,7 +189,8 @@ class _CovidDrivethruLocationState extends State { onPressed: () { back(); }, - child: Text("BACK", style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).back, + style: TextStyle(fontSize: 18.0)), ), ), ), @@ -201,7 +213,8 @@ class _CovidDrivethruLocationState extends State { onPressed: () { next(); }, - child: Text("NEXT", style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).next, + style: TextStyle(fontSize: 18.0)), ), ), ), @@ -258,35 +271,35 @@ 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) { 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); if (res['MessageStatus'] == 1) { @@ -296,10 +309,11 @@ class _CovidDrivethruLocationState extends State { projectsList.add(new DriveThroughTestingCenterModel.fromJson(v)); }); }); + GifLoaderDialogUtils.hideDialog(context); } else {} }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); - }).showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }); } } diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index 1254997d..07914c9e 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -23,7 +23,7 @@ class _CovidPaymentDetailsState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "COVID-19 TEST", + appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, body: SingleChildScrollView( child: Container( @@ -57,8 +57,8 @@ class _CovidPaymentDetailsState extends State { children: [ Container( margin: EdgeInsets.only( - left: 20.0, right: 20.0, top: 40.0), - child: Text("COVID-19 TEST", + left: 20.0, right: 20.0, top: 20.0), + child: Text(TranslationBase.of(context).covidTest, style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, @@ -67,7 +67,7 @@ class _CovidPaymentDetailsState extends State { Container( margin: EdgeInsets.only( left: 20.0, right: 20.0, top: 10.0), - child: Text("Drive-Thru", + child: Text(TranslationBase.of(context).driveThru, style: TextStyle( color: Colors.white, fontSize: 24.0)), ), @@ -88,7 +88,7 @@ class _CovidPaymentDetailsState extends State { alignment: Alignment.center, margin: EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0), - child: Text("Test Fees", + child: Text(TranslationBase.of(context).testFee, style: TextStyle( color: Colors.black, fontSize: 22.0, @@ -156,7 +156,7 @@ class _CovidPaymentDetailsState extends State { Container( alignment: Alignment.center, margin: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 5.0), - child: Text("You can pay by following options: ", + child: Text(TranslationBase.of(context).payOptions, textAlign: TextAlign.center, style: TextStyle( fontSize: 16.0, @@ -197,7 +197,7 @@ class _CovidPaymentDetailsState extends State { onPressed: () { cancel(); }, - child: Text("CANCEL", style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)), ), ), ), @@ -218,7 +218,7 @@ class _CovidPaymentDetailsState extends State { disabledTextColor: Colors.white, disabledColor: Colors.grey[500], onPressed: isAgree ? next : null, - child: Text("NEXT", style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)), ), ), ), diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 383bedb3..622f88c8 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -365,7 +365,9 @@ class _ToDoState extends State { color: Color(0xff20bc44), ), height: 30.0, - margin: projectViewModel.isArabic ? EdgeInsets.fromLTRB(160.0, 0.0, 30.0, 0.0) : EdgeInsets.fromLTRB(30.0, 0.0, 160.0, 0.0), + margin: projectViewModel.isArabic + ? EdgeInsets.fromLTRB(160.0, 0.0, 30.0, 0.0) + : EdgeInsets.fromLTRB(30.0, 0.0, 160.0, 0.0), transform: Matrix4.translationValues(0.0, -8.0, 0.0), child: Row( mainAxisAlignment: MainAxisAlignment.start, @@ -385,14 +387,17 @@ class _ToDoState extends State { ), widget.appoList[index].isLiveCareAppointment ? Container( - child: Text(TranslationBase.of(context).videoAppo, + child: Text( + TranslationBase.of(context).videoAppo, style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), ) : Container( - child: Text(TranslationBase.of(context).walkinAppo, + child: Text( + TranslationBase.of(context) + .walkinAppo, style: TextStyle( color: Colors.white, fontWeight: FontWeight.bold, @@ -825,20 +830,25 @@ class _ToDoState extends State { res['Fort_id'], res['PaymentMethod'], context) .then((res) { GifLoaderDialogUtils.hideDialog(context); - print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); + print(res['OnlineCheckInAppointments'][0]); addAdvancedNumberRequest( res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), - appo); + appo, + res['OnlineCheckInAppointments'][0]); }).catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(context); }); } - addAdvancedNumberRequest(String advanceNumber, String paymentReference, - String appointmentID, AppoitmentAllHistoryResultList appo) { + addAdvancedNumberRequest( + String advanceNumber, + String paymentReference, + String appointmentID, + AppoitmentAllHistoryResultList appo, + dynamic apptData) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service @@ -846,8 +856,25 @@ class _ToDoState extends State { advanceNumber, paymentReference, appointmentID, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); + if (appo.isLiveCareAppointment) + addVIDARequestInsert(advanceNumber, paymentReference, apptData); + else + getAppoQR(context, appo); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); + } + + addVIDARequestInsert( + String advanceNumber, String paymentReference, dynamic apptData) { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service + .addVIDARequest(advanceNumber, paymentReference, apptData, context) + .then((res) { + GifLoaderDialogUtils.hideDialog(context); print(res); - getAppoQR(context, appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index 1974753f..bbad8d4c 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -3,12 +3,10 @@ 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/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; @@ -35,7 +33,9 @@ class _LiveCareHomeState extends State pendingERRequestHistoryList = new ErRequestHistoryList(); - WidgetsBinding.instance.addPostFrameCallback((_) => getLiveCareHistory()); + WidgetsBinding.instance.addPostFrameCallback((_) { + if (!isDataLoaded) getLiveCareHistory(); + }); super.initState(); } @@ -89,6 +89,7 @@ class _LiveCareHomeState extends State } void getLiveCareHistory() { + GifLoaderDialogUtils.showMyDialog(context); setState(() { isDataLoaded = false; hasLiveCareRequest = false; @@ -96,38 +97,31 @@ class _LiveCareHomeState extends State LiveCareService service = new LiveCareService(); 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; + } + } + isDataLoaded = true; + }); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); } } diff --git a/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart b/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart index 19144263..72ca4ce9 100644 --- a/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart +++ b/lib/pages/livecare/livecare_scheduling/schedule_clinic_card.dart @@ -36,7 +36,7 @@ class _ScheduleClinicCardState extends State { child: Text( widget.languageID == 'ar' ? widget.clinicsHaveScheduleList.clinicDescN != null ? widget.clinicsHaveScheduleList.clinicDescN: "" - : widget.clinicsHaveScheduleList.clinicDesc != null ? widget.clinicsHaveScheduleList.clinicDesc: "Dermatology", + : widget.clinicsHaveScheduleList.clinicDesc != null ? widget.clinicsHaveScheduleList.clinicDesc: "Test Clinic", style: TextStyle( fontSize: 16.0, color: diff --git a/lib/pages/livecare/livecare_type_select.dart b/lib/pages/livecare/livecare_type_select.dart index 833c9698..00c2b717 100644 --- a/lib/pages/livecare/livecare_type_select.dart +++ b/lib/pages/livecare/livecare_type_select.dart @@ -51,20 +51,19 @@ class _LiveCareTypeSelectState extends State { ), Container( alignment: Alignment.center, - child: Text("LiveCare Service", + child: Text(TranslationBase.of(context).livecareService, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 20.0))), Container( margin: EdgeInsets.only(top: 10.0), alignment: Alignment.center, child: Text( - "is to obtain medical advice with a specialist doctor Via a video call", + TranslationBase.of(context).livecareServiceDesc, textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0))), Container( margin: EdgeInsets.only(top: 15.0), - alignment: Alignment.centerLeft, - child: Text("WHY LIVECARE?", + child: Text(TranslationBase.of(context).whyLivecare, style: TextStyle( fontWeight: FontWeight.bold, fontSize: 20.0))), Container( @@ -77,7 +76,7 @@ class _LiveCareTypeSelectState extends State { width: MediaQuery.of(context).size.width * 0.72, margin: EdgeInsets.all(10.0), child: Text( - "No need to wait, you will get Medical consultation immediately via Video call.", + TranslationBase.of(context).livecarePoint1, overflow: TextOverflow.clip, style: TextStyle(fontSize: 14.0)), ) @@ -93,7 +92,7 @@ class _LiveCareTypeSelectState extends State { Container( width: MediaQuery.of(context).size.width * 0.72, margin: EdgeInsets.all(10.0), - child: Text("The doctor will see your medical file.", + child: Text(TranslationBase.of(context).docVirtualAppoIns4, overflow: TextOverflow.clip, style: TextStyle(fontSize: 14.0)), ) @@ -109,7 +108,7 @@ class _LiveCareTypeSelectState extends State { Container( width: MediaQuery.of(context).size.width * 0.72, margin: EdgeInsets.all(10.0), - child: Text("Free Prescription delivery service.", + child: Text(TranslationBase.of(context).docVirtualAppoIns5, overflow: TextOverflow.clip, style: TextStyle(fontSize: 14.0)), ) @@ -119,7 +118,7 @@ class _LiveCareTypeSelectState extends State { Container( margin: EdgeInsets.only(top: 20.0), child: Text( - "** The service is included with some insurance companies according to the terms and conditions With our best wishes for health and wellness", + TranslationBase.of(context).livecareSummary, style: TextStyle(fontSize: 16.0))), InkWell( onTap: (){ @@ -134,7 +133,7 @@ class _LiveCareTypeSelectState extends State { child: Row( children: [ Container( - margin: EdgeInsets.only(left: 20.0), + margin: EdgeInsets.only(left: 10.0, right: 10.0), child: SvgPicture.asset( "assets/images/new-design/liveCare_logo_icon_white.svg", width: 80), @@ -144,7 +143,7 @@ class _LiveCareTypeSelectState extends State { margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0), child: Column( children: [ - Text("Get Medical consultation immediately", + Text(TranslationBase.of(context).livecareOption1, overflow: TextOverflow.clip, style: TextStyle( fontWeight: FontWeight.bold, @@ -152,8 +151,7 @@ class _LiveCareTypeSelectState extends State { color: Colors.white)), Container( margin: EdgeInsets.only(top: 10.0), - alignment: Alignment.centerLeft, - child: Text("Instant video call", + child: Text(TranslationBase.of(context).livecareOption2, style: TextStyle( fontSize: 18.0, color: Colors.white)), ) @@ -176,19 +174,18 @@ class _LiveCareTypeSelectState extends State { child: Row( children: [ Container( - margin: EdgeInsets.only(left: 20.0), + margin: EdgeInsets.only(left: 10.0, right: 10.0), child: Image.asset( "assets/images/new-design/calendar.png", width: 70), ), Container( width: MediaQuery.of(context).size.width * 0.58, - margin: EdgeInsets.fromLTRB(30.0, 30.0, 0.0, 0.0), + margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0), child: Column( children: [ Container( - alignment: Alignment.centerLeft, - child: Text("Book Appointment", + child: Text(TranslationBase.of(context).livecareOption3, overflow: TextOverflow.clip, style: TextStyle( fontWeight: FontWeight.bold, @@ -197,8 +194,7 @@ class _LiveCareTypeSelectState extends State { ), Container( margin: EdgeInsets.only(top: 10.0), - alignment: Alignment.centerLeft, - child: Text("Schedule Video Call", + child: Text(TranslationBase.of(context).livecareOption4, style: TextStyle( fontSize: 18.0, color: Colors.white)), ) diff --git a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart index 15c14557..36e8274f 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; @@ -178,6 +178,7 @@ class _LiveCareHistoryCardState extends State { sendInvoiceEmail(context) { ConfirmDialog.closeAlertDialog(context); LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service .sendLiveCareInvoiceEmail( widget.erRequestHistoryList.appointmentNo.toString(), @@ -189,8 +190,7 @@ class _LiveCareHistoryCardState extends State { }).catchError((err) { 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..839fb02c 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,17 @@ class _LiveCarePendingRequestState extends State { cancelLiveCareRequest() { LiveCareService service = new LiveCareService(); + GifLoaderDialogUtils.showMyDialog(context); service .cancelLiveCareRequest(widget.pendingERRequestHistoryList.vCID, context) .then((res) { - AppToast.showSuccessToast( - message: "LiveCare request cancelled successfully"); - }) - .catchError((err) { - print(err); - }) - .showProgressBar( - text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)) - .then((value) { - widget.getLiveCareHistory(); - }); + GifLoaderDialogUtils.hideDialog(context); + AppToast.showSuccessToast( + message: "LiveCare request cancelled successfully"); + widget.getLiveCareHistory(); + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + }); } } diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index 56613034..9ea12f01 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,8 @@ class _State extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); 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 195d8879..5cfdacc6 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -54,6 +54,8 @@ class _clinic_listState extends State { MyInAppBrowser browser; + bool isLiveCareTypeSelected = false; + @override void initState() { liveCareClinicsListResponse = new LiveCareClinicsListResponse(); @@ -61,7 +63,7 @@ class _clinic_listState extends State { new LiveCareScheduleClinicsListResponse(); WidgetsBinding.instance.addPostFrameCallback((_) { - openLiveCareSelectionDialog(); + if (!isLiveCareTypeSelected) openLiveCareSelectionDialog(); }); getLanguageID(); @@ -431,6 +433,7 @@ class _clinic_listState extends State { Navigator.pop(context); } else { print(value); + isLiveCareTypeSelected = true; if (value == "immediate") { setState(() { currentSelectedLiveCareType = "immediate"; diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index 6beed0dc..795d1869 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -12,7 +12,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 fce664f7..c7dd5d37 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -20,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'; 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/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 72f18979..65fe2b04 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:flutter/cupertino.dart'; class DoctorsListService extends BaseService { @@ -934,6 +935,64 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future addVIDARequest(String advanceNumber, + String paymentReference, dynamic apptData, BuildContext context) async { + Map request; + if (await this.sharedPref.getObject(USER_PROFILE) != null) { + var data = AuthenticatedUser.fromJson( + await this.sharedPref.getObject(USER_PROFILE)); + authUser = data; + } + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + request = { + "AdvanceNumber": advanceNumber, + "PaymentReferenceNumber": paymentReference, + "AppointmentNo": apptData.AppointmentNo, + "AcceptedBy": apptData.DoctorID, + "ServiceID": apptData.ServiceID, + "ProjectID": apptData.ProjectID, + "ClinicID": apptData.ClinicID, + "ClientRequestID": Utils.getAppointmentTransID( + apptData.ProjectID, apptData.ClinicID, apptData.AppointmentNo), + "AppointmentDate": apptData.AppointmentDate, + "DeviceType": Platform.isIOS ? "iOS" : "Android", + "VersionID": req.VersionID, + "Channel": req.Channel, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, + "generalid": req.generalid, + "PatientOutSA": authUser.outSA, + "SessionID": "YckwoXhUmWBsnHKEKig", + "isDentalAllowedBackend": false, + "DeviceTypeID": req.DeviceTypeID, + "PatientID": authUser.patientID, + "TokenID": "@dm!n", + "PatientTypeID": authUser.patientType, + "PatientType": authUser.patientType + }; + + // request.DeviceToken = this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false); + // request.Latitude = this.cs.sharedService.getSharedData('userLat', false); + // request.Longitude = this.cs.sharedService.getSharedData('userLong', false); + // request.ServiceID = apptData.ServiceID; + // request.ProjectID = apptData.ProjectID; + // request.ClinicID = apptData.ClinicID; + // request.ClientRequestID = AppointmentModel.getAppointmentTransID(apptData); + // request.AppointmentDate = apptData.AppointmentDate; + // request.DeviceType = this.getDeviceType(); + // request.VoipToken = this.platform.is('ios') ? this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false) : ""; + dynamic localRes; + await baseAppClient.post(ADD_VIDA_REQUEST, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + Future isAllowedToAskDoctor(int docID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -1109,14 +1168,16 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, dynamic clinicID, BuildContext context) async { + Future getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, + dynamic clinicID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson( await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "AppointmentNo": appoNo, @@ -1140,10 +1201,10 @@ class DoctorsListService extends BaseService { dynamic localRes; await baseAppClient.post(GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index c3acb5fd..9bca1c03 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1007,6 +1007,33 @@ class TranslationBase { String get systolicAdd => localizedValues["systolic-add"][locale.languageCode]; String get diastolicAdd => localizedValues["systolic-add"][locale.languageCode]; String get cmcHeading => localizedValues["cmc-heading"][locale.languageCode]; + String get selectLocation => localizedValues["select-location"][locale.languageCode]; + String get resultHeader => localizedValues["result-header"][locale.languageCode]; + String get covidInfo => localizedValues["covid-info"][locale.languageCode]; + String get selectAppo => localizedValues["select-appo"][locale.languageCode]; + String get covidAlertHeader => localizedValues["covid-alert-header"][locale.languageCode]; + String get covidAlertInfo => localizedValues["covid-alert-info"][locale.languageCode]; + String get covidAlertMins => localizedValues["covid-alert-mins"][locale.languageCode]; + String get back => localizedValues["back"][locale.languageCode]; + String get getDirections => localizedValues["get-directions"][locale.languageCode]; + String get selectedLocation => localizedValues["selected-location"][locale.languageCode]; + String get testFee => localizedValues["test-fee"][locale.languageCode]; + String get payOptions => localizedValues["pay-options"][locale.languageCode]; + String get livecareService => localizedValues["livecare-service"][locale.languageCode]; + String get livecareServiceDesc => localizedValues["livecare-service-desc"][locale.languageCode]; + String get whyLivecare => localizedValues["why-livecare"][locale.languageCode]; + String get livecarePoint1 => localizedValues["livecare-point-1"][locale.languageCode]; + String get docVirtualAppoIns4 => localizedValues["doc-virtual-appo-ins4"][locale.languageCode]; + String get docVirtualAppoIns5 => localizedValues["doc-virtual-appo-ins5"][locale.languageCode]; + String get livecareSummary => localizedValues["livecare-summary"][locale.languageCode]; + + String get livecareOption1 => localizedValues["livecare-option-1"][locale.languageCode]; + String get livecareOption2 => localizedValues["livecare-option-2"][locale.languageCode]; + String get livecareOption3 => localizedValues["livecare-option-3"][locale.languageCode]; + String get livecareOption4 => localizedValues["livecare-option-4"][locale.languageCode]; + + + String get today => localizedValues["today"][locale.languageCode]; String get week => localizedValues["week"][locale.languageCode]; diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index ba7dfd8b..603c5108 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -8,17 +8,17 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; class MyInAppBrowser extends InAppBrowser { - // static String SERVICE_URL = - // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = - 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String PREAUTH_SERVICE_URL = - // 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + // static String SERVICE_URL = + // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE static String PREAUTH_SERVICE_URL = - 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + + // static String PREAUTH_SERVICE_URL = + // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store static List successURLS = [ 'success', diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 4de9efdf..1003446d 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,9 @@ class _SearchBot extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); 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 babbf052..eb0ad66e 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'; @@ -54,8 +55,6 @@ import 'package:speech_to_text/speech_to_text.dart'; 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 +733,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 +786,9 @@ class _FloatingSearchButton extends State AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); 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 24589cbb..c94b0a0f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -111,8 +111,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