diff --git a/assets/images/appointment_booking.png b/assets/images/appointment_booking.png new file mode 100644 index 00000000..14db8d89 Binary files /dev/null and b/assets/images/appointment_booking.png differ diff --git a/assets/images/book_appointment_arabic.png b/assets/images/book_appointment_arabic.png new file mode 100644 index 00000000..f0bc5aff Binary files /dev/null and b/assets/images/book_appointment_arabic.png differ diff --git a/assets/images/booking_ar.png b/assets/images/booking_ar.png new file mode 100644 index 00000000..b562f288 Binary files /dev/null and b/assets/images/booking_ar.png differ diff --git a/assets/images/booking_en.png b/assets/images/booking_en.png new file mode 100644 index 00000000..a3ffa8be Binary files /dev/null and b/assets/images/booking_en.png differ diff --git a/assets/images/check-in.png b/assets/images/check-in.png new file mode 100644 index 00000000..f6effbeb Binary files /dev/null and b/assets/images/check-in.png differ diff --git a/assets/images/device_icon.png b/assets/images/device_icon.png new file mode 100644 index 00000000..8ad55c09 Binary files /dev/null and b/assets/images/device_icon.png differ diff --git a/assets/images/new-design/check-in.png b/assets/images/new-design/check-in.png index 8bed2242..f6effbeb 100644 Binary files a/assets/images/new-design/check-in.png and b/assets/images/new-design/check-in.png differ diff --git a/assets/images/online_payment_icon.png b/assets/images/online_payment_icon.png index a6e0150a..6e167ace 100644 Binary files a/assets/images/online_payment_icon.png and b/assets/images/online_payment_icon.png differ diff --git a/ios/Flutter/.last_build_id b/ios/Flutter/.last_build_id index 6bca0336..4a225219 100644 --- a/ios/Flutter/.last_build_id +++ b/ios/Flutter/.last_build_id @@ -1 +1 @@ -f4a819c27119d0f472892c1088ad1ca3 \ No newline at end of file +d69545ca05f0ca200eba92121a1458fb \ No newline at end of file diff --git a/lib/config/config.dart b/lib/config/config.dart index 4e2791b1..c9f3186a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -38,8 +38,8 @@ const GET_PRESCRIPTION_REPORT_ENH = const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -const GET_Patient_LAB_RESULT = - 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; /// const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7e523457..dfd13cca 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -74,6 +74,10 @@ const Map localizedValues = { 'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء' }, + "book-success-confirm-more-24-1-2": { + "en": "The online payment process will be available 24 hours before the appointment.", + "ar": "- عملية الدفع الالكتروني ستكون متاحة قبل الموعد ب 24 ساعة." + }, 'upcoming-payment-pending': { 'en': 'Online Payment will be Activated before 24 Hours of Appointment Time', @@ -1110,4 +1114,44 @@ const Map localizedValues = { "not-active": {"en": "Not Active", "ar": "غير نشط"}, "card-detail": {"en": "Insurance Details", "ar": "منافعك التامينية"}, "Dr": {"en": "Dr. ", "ar": "الدكتور."}, + "empty": { + "en": "You do not have any records.", + "ar": "ليس لديك أي سجلات" + }, + "last-visit": { + "en": "How was your last visit with doctor?", + "ar": "كيف تقيم زيارتك الأخيرة للطبيب؟" + }, + "tap-title": { + "en": "Please rate the doctor", + "ar": "يرجى تقييم الطبيب" + }, + "later": { + "en": "Later", + "ar": "لاحقاً" + }, + "sendSuc":{ + "en":"A copy has been sent to the email", + "ar":"تم إرسال نسخة إلى البريد الإلكتروني" + }, + "instructions": { + "en": "You can now talk directly to the appointments department by chat or request a call back", + "ar": "يمكنك الان التحدث مباشرة مع قسم المواعيد عن طريق خدمة المحادثة النصية أو طلب معاودة الاتصال" + }, + "instructions-pharmacies": { + "en": "You can now talk directly to the pharmacist by chat or request a call back", + "ar": "يمكنك الآن التحدث مباشرة إلى الصيدلي عن طريق الدردشة أو طلب معاودة الاتصال" + }, + "select-hospital": { + "en": "Choose Hospital", + "ar": "اختر المستشفى" + }, + "start": { + "en": "Start", + "ar": "ابدأ" + }, + "info-chat": { + "en": "This service allows you to chat with customer service directly without the need to call.", + "ar": "المحادثة المباشرة: هذه الخدمة تمكنك التحدث كتابياً مع خدمة العملاء مباشرة دون الحاجة الى الاتصال هاتفياً." + }, }; diff --git a/lib/core/model/labs/LabOrderResult.dart b/lib/core/model/labs/LabOrderResult.dart new file mode 100644 index 00000000..ecb4ae65 --- /dev/null +++ b/lib/core/model/labs/LabOrderResult.dart @@ -0,0 +1,88 @@ +class LabOrderResult { + String description; + dynamic femaleInterpretativeData; + int gender; + int lineItemNo; + dynamic maleInterpretativeData; + dynamic notes; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; + dynamic superVerifiedOn; + String testCode; + String uOM; + String verifiedOn; + String verifiedOnDateTime; + + LabOrderResult( + {this.description, + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); + + LabOrderResult.fromJson(Map json) { + description = json['Description']; + femaleInterpretativeData = json['FemaleInterpretativeData']; + gender = json['Gender']; + lineItemNo = json['LineItemNo']; + maleInterpretativeData = json['MaleInterpretativeData']; + notes = json['Notes']; + packageID = json['PackageID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + referanceRange = json['ReferanceRange']; + resultValue = json['ResultValue']; + sampleCollectedOn = json['SampleCollectedOn']; + sampleReceivedOn = json['SampleReceivedOn']; + setupID = json['SetupID']; + superVerifiedOn = json['SuperVerifiedOn']; + testCode = json['TestCode']; + uOM = json['UOM']; + verifiedOn = json['VerifiedOn']; + verifiedOnDateTime = json['VerifiedOnDateTime']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Gender'] = this.gender; + data['LineItemNo'] = this.lineItemNo; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['Notes'] = this.notes; + data['PackageID'] = this.packageID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ReferanceRange'] = this.referanceRange; + data['ResultValue'] = this.resultValue; + data['SampleCollectedOn'] = this.sampleCollectedOn; + data['SampleReceivedOn'] = this.sampleReceivedOn; + data['SetupID'] = this.setupID; + data['SuperVerifiedOn'] = this.superVerifiedOn; + data['TestCode'] = this.testCode; + data['UOM'] = this.uOM; + data['VerifiedOn'] = this.verifiedOn; + data['VerifiedOnDateTime'] = this.verifiedOnDateTime; + return data; + } +} diff --git a/lib/core/model/prescriptions/request_prescription_report.dart b/lib/core/model/prescriptions/request_prescription_report.dart index df901a99..c8323740 100644 --- a/lib/core/model/prescriptions/request_prescription_report.dart +++ b/lib/core/model/prescriptions/request_prescription_report.dart @@ -82,7 +82,7 @@ class RequestPrescriptionReport { data['EpisodeID'] = this.episodeID; data['ClinicID'] = this.clinicID; data['ProjectID'] = this.projectID; - // data['DischargeNo'] = this.dischargeNo; + data['DischargeNo'] = this.dischargeNo; return data; } } diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 9154b9d3..d58054c4 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -47,15 +47,8 @@ class BaseAppClient { } body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; - body['LanguageID'] = body.containsKey('LanguageID') - ? body['LanguageID'] != null - ? body['LanguageID'] - : languageID == 'ar' - ? 1 - : 2 - : languageID == 'en' - ? 2 - : 1; + body['LanguageID'] = languageID == 'ar' ? 1 : 2; + body['IPAdress'] = IP_ADDRESS; body['generalid'] = GENERAL_ID; diff --git a/lib/core/service/contactus/livechat_service.dart b/lib/core/service/contactus/livechat_service.dart index b806d56b..025073ca 100644 --- a/lib/core/service/contactus/livechat_service.dart +++ b/lib/core/service/contactus/livechat_service.dart @@ -8,6 +8,7 @@ class LiveChatService extends BaseService { List LivechatModelList = List(); Map body = Map(); + // body['body'] Future getAllLiveChatOrders() async { hasError = false; diff --git a/lib/core/service/hospital_service.dart b/lib/core/service/hospital_service.dart index 194b8256..519fc8c0 100644 --- a/lib/core/service/hospital_service.dart +++ b/lib/core/service/hospital_service.dart @@ -13,14 +13,13 @@ class HospitalService extends BaseService { double _longitude; _getCurrentLocation() async { - await getLastKnownPosition().then((value) { + await Geolocator.getLastKnownPosition().then((value) { _latitude = value.latitude; _longitude = value.longitude; }).catchError((e) { _longitude = 0; _latitude = 0; }); - // currentLocation = LatLng(position.latitude, position.longitude); } Future getHospitals() async { diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 737b7b1b..8318025e 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; @@ -32,7 +33,7 @@ class LabsService extends BaseService { List patientLabSpecialResult = List(); List labResultList = List(); - List labOrdersResultsList = List(); + List labOrdersResultsList = List(); Future getLaboratoryResult( {String projectID, @@ -88,11 +89,11 @@ class LabsService extends BaseService { body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID; body['Procedure'] = procedure; - await baseAppClient.post(GET_Patient_LAB_RESULT, + await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { - labOrdersResultsList.add(LabResult.fromJson(lab)); + labOrdersResultsList.add(LabOrderResult.fromJson(lab)); }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/medical/prescriptions_service.dart b/lib/core/service/medical/prescriptions_service.dart index d6ad3732..e9741a7f 100644 --- a/lib/core/service/medical/prescriptions_service.dart +++ b/lib/core/service/medical/prescriptions_service.dart @@ -72,6 +72,7 @@ class PrescriptionsService extends BaseService { prescriptionReportEnhList.clear(); if(prescriptions.isInOutPatient){ response['ListPRM'].forEach((prescriptions) { + prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); }); }else{ diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index b3cb737b..965fa752 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -67,7 +67,7 @@ class RadiologyService extends BaseService { _requestSendRadReportEmail.patientName = user.firstName + " " + user.lastName; _requestSendRadReportEmail.patientIditificationNum = user.patientIdentificationNo; _requestSendRadReportEmail.projectName = finalRadiology.projectName; - _requestSendRadReportEmail.radResult = 'asd'; //finalRadiology.reportData; + _requestSendRadReportEmail.radResult = finalRadiology.reportData; _requestSendRadReportEmail.to = user.emailAddress; _requestSendRadReportEmail.dateofBirth = user.dateofBirth; diff --git a/lib/core/service/pharmacies_service.dart b/lib/core/service/pharmacies_service.dart index f89fb425..e2bb225b 100644 --- a/lib/core/service/pharmacies_service.dart +++ b/lib/core/service/pharmacies_service.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_list_model.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; +import 'package:geolocator/geolocator.dart'; class PharmacyService extends BaseService { List _medicineItem = List(); @@ -59,10 +60,29 @@ class PharmacyService extends BaseService { projectID: 15, ); + double _latitude; + double _longitude; + + _getCurrentLocation() async { + await Geolocator.getLastKnownPosition().then((value) { + _latitude = value.latitude; + _longitude = value.longitude; + }).catchError((e) { + _longitude = 0; + _latitude = 0; + }); + } + Future getMedicineList({String drugName}) async { hasError = false; - _requestGetPharmaciesModel.pHRItemName = drugName; - try { + // await _getCurrentLocation(); + Map body = Map(); + body['PHR_itemName'] = drugName; + body['isLoginForDoctorApp'] = true; + body['isDentalAllowedBackend'] = true; + // body['Latitude'] = _latitude; + // body['Longitude'] = _longitude; + await baseAppClient.post(GET_PHARMCY_ITEMS, onSuccess: (dynamic response, int statusCode) { _medicineItem.clear(); @@ -72,15 +92,18 @@ class PharmacyService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _requestGetPharmaciesModel.toJson()); - } catch (error) { - throw error; - } + }, body: body); + } Future getPharmaciesList({int itemID}) async { - _pharmaciesListModel.itemID = itemID; - try { + + await _getCurrentLocation(); + Map body = Map(); + body['ItemID'] = itemID; + body['Latitude'] = _latitude; + body['Longitude'] = _longitude; + await baseAppClient.post(GET_PHARMACY_LIST, onSuccess: (dynamic response, int statusCode) { _pharmaciesList.clear(); @@ -91,9 +114,7 @@ class PharmacyService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _pharmaciesListModel.toJson()); - } catch (error) { - throw error; - } + }, body:body); + } } diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 95be11db..c54084d6 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; @@ -12,7 +13,7 @@ class LabsViewModel extends BaseViewModel { FilterType filterType = FilterType.Clinic; LabsService _labsService = locator(); - List get labOrdersResultsList => _labsService.labOrdersResultsList; + List get labOrdersResultsList => _labsService.labOrdersResultsList; List _patientLabOrdersListClinic = List(); diff --git a/lib/core/viewModels/medical/prescriptions_view_model.dart b/lib/core/viewModels/medical/prescriptions_view_model.dart index 1cd934e2..2c32a081 100644 --- a/lib/core/viewModels/medical/prescriptions_view_model.dart +++ b/lib/core/viewModels/medical/prescriptions_view_model.dart @@ -119,6 +119,7 @@ class PrescriptionsViewModel extends BaseViewModel { int patientID, String clinicName, String doctorName, + String mes, int projectID}) async { setState(ViewState.BusyLocal); await _prescriptionsService.sendPrescriptionEmail( @@ -128,7 +129,7 @@ class PrescriptionsViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); AppToast.showErrorToast(message: error); } else { - AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail'); + AppToast.showSuccessToast(message: mes); setState(ViewState.Idle); } } diff --git a/lib/core/viewModels/medical/radiology_view_model.dart b/lib/core/viewModels/medical/radiology_view_model.dart index 26d40361..076707dc 100644 --- a/lib/core/viewModels/medical/radiology_view_model.dart +++ b/lib/core/viewModels/medical/radiology_view_model.dart @@ -80,7 +80,7 @@ class RadiologyViewModel extends BaseViewModel { } sendRadReportEmail( - {FinalRadiology finalRadiology}) async { + {FinalRadiology finalRadiology,String mes}) async { setState(ViewState.BusyLocal); await _radiologyService.sendRadReportEmail( finalRadiology: finalRadiology @@ -89,7 +89,7 @@ class RadiologyViewModel extends BaseViewModel { error = _radiologyService.error; AppToast.showErrorToast(message: error); } else { - AppToast.showSuccessToast(message: 'A copy has been sent to the email'); + AppToast.showSuccessToast(message: mes); } setState(ViewState.Idle); } diff --git a/lib/core/viewModels/pharmacies_view_model.dart b/lib/core/viewModels/pharmacies_view_model.dart index 01ad4e72..b9e162fc 100644 --- a/lib/core/viewModels/pharmacies_view_model.dart +++ b/lib/core/viewModels/pharmacies_view_model.dart @@ -23,9 +23,11 @@ class PharmacyViewModel extends BaseViewModel { setState(ViewState.Error); } else setState(ViewState.Idle); - //_pharmacyService.clearPharmaciesList(); } + clearMedicineSearch(){ + _pharmacyService.clearMedicineList(); + } Future getMedicine({String name}) async { hasError = false; _pharmacyService.clearMedicineList(); diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index d2b7cf8b..0c00345e 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -30,7 +30,6 @@ class ProjectViewModel extends BaseViewModel { bool get isArabic => _isArabic; - // BaseViewModel baseViewModel = locator() StreamSubscription subscription; ProjectViewModel() { @@ -54,7 +53,7 @@ class ProjectViewModel extends BaseViewModel { }); } - void loadSharedPrefLanguage() async { + Future loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); _appLocale = Locale(currentLanguage); diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 73975c58..f7cbd4f3 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -241,7 +241,7 @@ class _BookConfirmState extends State { ), ), Container( - margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0), + margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: Text( TranslationBase.of(context).date + ": " + diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 70a5b1fb..f513c434 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -165,6 +165,173 @@ class _BookSuccessState extends State { ], ), ), + bottomNavigationBar: getBottomContainer(), + ); + } + + Widget getBottomContainer() { + switch (widget.patientShareResponse.nextAction) { + case 0: + return Container(); + break; + case 10: + return _getConfirmAppoButtons(); + break; + case 15: + return _getPaymentPendingAppo(); + break; + case 20: + return _getPayNowButtons(); + break; + case 30: + return _getQRButtons(); + break; + case 50: + return _getConfirmAppoButtons(); + break; + } + } + + Widget _getQRButtons() { + return Container( + alignment: Alignment.bottomCenter, + height: MediaQuery.of(context).size.height * 0.18, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + 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: () { +// navigateToQR(context); + getAppoQR(context); + }, + child: Text(TranslationBase.of(context).viewQR.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ); + } + + Widget _getPayNowButtons() { + return Container( + alignment: Alignment.bottomCenter, + height: MediaQuery.of(context).size.height * 0.2, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + 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: () { + startPaymentProcess(); + }, + child: Text(TranslationBase.of(context).payNow.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF40ACC9), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text(TranslationBase.of(context).payLater.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), + ); + } + + Widget _getConfirmAppoButtons() { + return Container( + alignment: Alignment.bottomCenter, + margin: EdgeInsets.only(bottom: 5.0), + height: MediaQuery.of(context).size.height * 0.15, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + 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: () { + AppoitmentAllHistoryResultList appo = + new AppoitmentAllHistoryResultList(); + appo.clinicID = widget.docObject.clinicID; + appo.projectID = widget.docObject.projectID; + appo.appointmentNo = widget.patientShareResponse.appointmentNo; + appo.serviceID = widget.patientShareResponse.serviceID; + appo.isLiveCareAppointment = + widget.patientShareResponse.isLiveCareAppointment; + appo.doctorID = widget.patientShareResponse.doctorID; + confirmAppointment(appo); + }, + child: Text( + widget.patientShareResponse.isLiveCareAppointment + ? TranslationBase.of(context) + .confirmLiveCare + .toUpperCase() + : TranslationBase.of(context).confirm.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: RaisedButton( + color: new Color(0xFF40ACC9), + textColor: Colors.white, + disabledTextColor: Colors.white, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + navigateToHome(context); + }, + child: Text( + TranslationBase.of(context).confirmLater.toUpperCase(), + style: TextStyle(fontSize: 18.0)), + ), + ), + ], + ), ); } @@ -238,8 +405,7 @@ class _BookSuccessState extends State { _getBulletPoint("1"), Container( width: MediaQuery.of(context).size.width * 0.8, - child: Text( - "Please confirm the appointment to avoid the cancellation", + child: Text(TranslationBase.of(context).upcomingConfirm, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)), ), @@ -263,7 +429,7 @@ class _BookSuccessState extends State { Container( width: MediaQuery.of(context).size.width * 0.8, child: Text( - "The online payment process will be available 24 hours before the appointment.", + TranslationBase.of(context).upcomingConfirmMore, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)), ), @@ -277,67 +443,6 @@ class _BookSuccessState extends State { margin: EdgeInsets.fromLTRB(50.0, 20.0, 50.0, 20.0), child: Image.asset("assets/images/new-design/payment-method.png"), ), - Container( - alignment: Alignment.bottomCenter, - height: MediaQuery.of(context).size.height * 0.32, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - 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: () { - AppoitmentAllHistoryResultList appo = - new AppoitmentAllHistoryResultList(); - appo.clinicID = widget.docObject.clinicID; - appo.projectID = widget.docObject.projectID; - appo.appointmentNo = - widget.patientShareResponse.appointmentNo; - appo.serviceID = widget.patientShareResponse.serviceID; - appo.isLiveCareAppointment = - widget.patientShareResponse.isLiveCareAppointment; - appo.doctorID = widget.patientShareResponse.doctorID; - confirmAppointment(appo); - }, - child: Text( - widget.patientShareResponse.isLiveCareAppointment - ? TranslationBase.of(context) - .confirmLiveCare - .toUpperCase() - : TranslationBase.of(context).confirm.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF40ACC9), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - navigateToHome(context); - }, - child: Text( - TranslationBase.of(context).confirmLater.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ], - ), - ), ], ); } @@ -463,52 +568,6 @@ class _BookSuccessState extends State { ), ], ), - Container( - alignment: Alignment.bottomCenter, - height: MediaQuery.of(context).size.height * 0.2, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - 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: () { - startPaymentProcess(); - }, - child: Text(TranslationBase.of(context).payNow.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: RaisedButton( - color: new Color(0xFF40ACC9), - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), - onPressed: () { - navigateToHome(context); - }, - child: Text( - TranslationBase.of(context).payLater.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ], - ), - ), ], ); } @@ -770,34 +829,34 @@ class _BookSuccessState extends State { ), ], ), - Container( - alignment: Alignment.bottomCenter, - height: MediaQuery.of(context).size.height * 0.18, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - 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: () { -// navigateToQR(context); - getAppoQR(context); - }, - child: Text(TranslationBase.of(context).viewQR.toUpperCase(), - style: TextStyle(fontSize: 18.0)), - ), - ), - ], - ), - ), +// Container( +// alignment: Alignment.bottomCenter, +// height: MediaQuery.of(context).size.height * 0.18, +// child: Column( +// mainAxisAlignment: MainAxisAlignment.end, +// children: [ +// 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: () { +// // navigateToQR(context); +// getAppoQR(context); +// }, +// child: Text(TranslationBase.of(context).viewQR.toUpperCase(), +// style: TextStyle(fontSize: 18.0)), +// ), +// ), +// ], +// ), +// ), ], ); } diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index 5bffe17c..d85971bb 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -1,11 +1,15 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_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'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -27,13 +31,14 @@ class _HospitalsLiveChatPageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getLiveChatRequestOrders(), builder: (_, model, widget) => AppScaffold( baseViewModel: model, + isShowDecPage: false, body: SingleChildScrollView( child: Container( - margin: EdgeInsets.only(left: 15, right: 15), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -43,11 +48,11 @@ class _HospitalsLiveChatPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 20, + height: 70, ), Container( width: double.infinity, - height: 200, + height: 230, decoration: BoxDecoration( image: DecorationImage( image: ExactAssetImage( @@ -56,10 +61,29 @@ class _HospitalsLiveChatPageState extends State { ), child: Padding( padding: const EdgeInsets.all(8.0), - child: Texts( - 'You can now talk directly to the appointments department by chat or request a call back\n \nChoose Hospital :', - color: Colors.white, - textAlign: TextAlign.start, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: projectViewModel.isArabic? 10:20, + ), + Texts( + TranslationBase.of(context).instructions, + color: Colors.white, + textAlign: TextAlign.start, + ), + SizedBox( + height:projectViewModel.isArabic? 8:25, + ), + Texts( + TranslationBase.of(context) + .selectHospitalDec + + " :", + color: Colors.white, + fontWeight: FontWeight.w700, + textAlign: TextAlign.start, + ), + ], ), ), ), @@ -91,7 +115,7 @@ class _HospitalsLiveChatPageState extends State { borderRadius: BorderRadius.all( Radius.circular(5)), color: tappedIndex == index - ? Colors.red + ? Theme.of(context).primaryColor : Colors.white, ), child: Padding( @@ -104,8 +128,7 @@ class _HospitalsLiveChatPageState extends State { onTap: () { setState(() { tappedIndex = index; - chat = - "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=en&WorkGroup=${model.LiveChatModelList[index].value}"; + chat = "http://chat.dshmg.com:7788/hmgchatapp/hmgchattest/Index.aspx?Name=${model.user.firstName}&PatientID=${model.user.patientID}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.currentLanguage}&WorkGroup=${model.LiveChatModelList[index].value}"; }); }, child: Row( @@ -135,7 +158,8 @@ class _HospitalsLiveChatPageState extends State { .black, textAlign: TextAlign .center, - ))), //model.cOCItemList[index].cOCTitl + ))), + //model.cOCItemList[index].cOCTitl IconButton( icon: Icon( Icons.arrow_forward_ios, @@ -171,18 +195,19 @@ class _HospitalsLiveChatPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.13, + height: MediaQuery.of(context).size.height * 0.10, width: double.infinity, padding: EdgeInsets.all(8.0), child: Center( child: Container( - height: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery.of(context).size.height * 0.07, width: MediaQuery.of(context).size.width * 0.8, - child: Button( - label: 'ٍStart', + child: SecondaryButton( + label: TranslationBase.of(context).start, loading: model.state == ViewState.BusyLocal, + textColor: Colors.white, + disabled: chat.isEmpty, onTap: () { - print("chat=" + chat); launch(chat); }, ), diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart index b870234a..a747db3d 100644 --- a/lib/pages/ContactUs/LiveChat/livechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -1,6 +1,8 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/pharmaciesLivechat_page.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:flutter/cupertino.dart'; @@ -16,9 +18,15 @@ class LiveChatPage extends StatefulWidget { class _LiveChatPageState extends State with SingleTickerProviderStateMixin { TabController _tabController; + List imagesInfo = List(); + @override void initState() { super.initState(); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/1.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/2.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/2.png')); + _tabController = TabController(length: 2, vsync: this); } @@ -33,7 +41,10 @@ class _LiveChatPageState extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - appBarTitle: 'Locations', + imagesInfo: imagesInfo, + title: TranslationBase.of(context).liveChat, + description: TranslationBase.of(context).infoChat, + appBarTitle: TranslationBase.of(context).service, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( @@ -71,25 +82,22 @@ class _LiveChatPageState extends State isScrollable: true, controller: _tabController, indicatorWeight: 5.0, - //indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.tab, - - indicatorColor: Colors.red[800], + indicatorColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + labelPadding: EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), unselectedLabelColor: Colors.grey[800], tabs: [ 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/ContactUs/LiveChat/pharmaciesLivechat_page.dart b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart index cbda0828..c5300b5d 100644 --- a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart @@ -1,12 +1,15 @@ import 'package:diplomaticquarterapp/core/viewModels/contactus/findus_view_model.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/contactus/livechat_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/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'; +import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -28,10 +31,11 @@ class _PhamaciesLiveChatPageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getLiveChatRequestOrders(), builder: (_, model, widget) => AppScaffold( baseViewModel: model, + isShowDecPage: false, body: SingleChildScrollView( child: Container( margin: EdgeInsets.only(left: 15, right: 15), @@ -43,12 +47,9 @@ class _PhamaciesLiveChatPageState extends State { Container( width: double.infinity, height: 200, - decoration: BoxDecoration( - image: DecorationImage( - image: ExactAssetImage(''), fit: BoxFit.cover), - ), + child: Texts( - 'You can now talk directly to the pharmacist by chat or request a call back', + TranslationBase.of(context).instructionsPharmacies, color: Colors.black, textAlign: TextAlign.center, ), @@ -63,20 +64,20 @@ class _PhamaciesLiveChatPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.13, + height: MediaQuery.of(context).size.height * 0.10, width: double.infinity, padding: EdgeInsets.all(8.0), child: Center( child: Container( - height: MediaQuery.of(context).size.height * 0.1, + height: MediaQuery.of(context).size.height * 0.87, width: MediaQuery.of(context).size.width * 0.8, child: Button( - label: 'ٍStart', + label: TranslationBase.of(context).start, loading: model.state == ViewState.BusyLocal, onTap: () { print("chat=" + chat); chat = - "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=1"; + "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.isArabic? 1:2}"; launch(chat); }, ), diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index d8c5fd47..9ce6692c 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -411,11 +411,15 @@ class _AppointmentActionsState extends State { .getPatientRadOrders(widget.appo.appointmentNo.toString(), context) .then((res) { GifLoaderDialogUtils.hideDialog(context); - print(res['FinalRadiologyList']); - finalRadiology = - new FinalRadiology.fromJson(res['FinalRadiologyList'][0]); - print(finalRadiology.reportData); - navigateToRadiologyDetails(finalRadiology); + if (res['FinalRadiologyList'] != null) { + print(res['FinalRadiologyList']); + finalRadiology = + new FinalRadiology.fromJson(res['FinalRadiologyList'][0]); + print(finalRadiology.reportData); + navigateToRadiologyDetails(finalRadiology); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); @@ -429,19 +433,17 @@ class _AppointmentActionsState extends State { DoctorsListService service = new DoctorsListService(); service.getPatientPrescriptionReports(widget.appo, context).then((res) { GifLoaderDialogUtils.hideDialog(context); - res['ListPRM'].forEach((report) { - prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report)); - }); - print(prescriptionReportEnhList.length); - if (prescriptionReportEnhList.length != 0) { - navigateToMedicinePrescriptionReport( - prescriptionReportEnhList, res['ListPRM']); + if (res['ListPRM'].length != 0) { + res['ListPRM'].forEach((report) { + prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report)); + }); + print(prescriptionReportEnhList.length); } else { - AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + AppToast.showErrorToast(message: TranslationBase.of(context).noRecords); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); - // AppToast.showErrorToast(message: err); + AppToast.showErrorToast(message: err); }); } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 95e10879..25f2e0a7 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -63,6 +63,7 @@ class _ToDoState extends State { appBarTitle: TranslationBase.of(context).todoList, imagesInfo: imagesInfo, isShowAppBar: false, + isShowDecPage: true, description: TranslationBase.of(context).infoTodo, body: SingleChildScrollView( child: Column( diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index ed9fe2f4..1706ce8a 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -42,13 +42,7 @@ class HomePage extends StatefulWidget { class _HomePageState extends State { ToDoCountProviderModel toDoProvider; - @override - // void initState() { - // WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - // getToDoCount(); - // }); - // super.initState(); - // } + AuthenticatedUserObject authenticatedUserObject = locator(); @@ -93,10 +87,9 @@ class _HomePageState extends State { ) ], ), + ), - Container( - width: double.infinity, - height: projectViewModel.isArabic ? 120 : 110), + Container(width: double.infinity, height:projectViewModel.isArabic ? 120:110), ], ), Positioned( @@ -111,7 +104,7 @@ class _HomePageState extends State { Orientation.landscape ? 0.02 : 0.03), - child: (!model.isLogin) + child: (!model.isLogin ) ? Container( width: double.infinity, height: 160, @@ -180,6 +173,7 @@ class _HomePageState extends State { color: Theme.of(context) .primaryColor, fontSize: 14, + ), ), ), @@ -307,9 +301,7 @@ class _HomePageState extends State { bold: true, ), Texts( - TranslationBase.of( - context) - .height, + TranslationBase.of(context).height, color: Colors.white, fontSize: 10, ), @@ -341,9 +333,7 @@ class _HomePageState extends State { bold: true, ), Texts( - TranslationBase.of( - context) - .weight, + TranslationBase.of(context).weight, color: Colors.white, fontSize: 10, ) @@ -357,10 +347,8 @@ class _HomePageState extends State { ), Expanded( child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Image.asset( 'assets/images/blood-drop.png', @@ -374,9 +362,7 @@ class _HomePageState extends State { color: Colors.white, ), Texts( - TranslationBase.of( - context) - .bloodType, + TranslationBase.of(context).bloodType, color: Colors.white, fontSize: 10, ) @@ -415,35 +401,28 @@ class _HomePageState extends State { padding: const EdgeInsets.all(15.0), child: Column( children: [ - SizedBox( - height: 15, - ), + SizedBox(height: 15,), + Container( width: 60, decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, - borderRadius: - BorderRadius.circular(12)), - child: Center( - child: Image.asset( - 'assets/images/vital_sign_icon.png', + borderRadius: BorderRadius.circular(12) + ), + child: Center(child: Image.asset('assets/images/vital_sign_icon.png', width: 80, height: 50, - fit: BoxFit.contain, - )), - ), - SizedBox( - height: 20, + fit: BoxFit.contain,)), ), + SizedBox(height: 20,), Texts( - TranslationBase.of(context).vitalSigns, + TranslationBase.of(context) + .vitalSigns, textAlign: TextAlign.center, color: Colors.white, bold: true, - fontSize: projectViewModel.isArabic - ? SizeConfig.textMultiplier * 1.5 - : SizeConfig.textMultiplier * 1.7, + fontSize: projectViewModel.isArabic? SizeConfig.textMultiplier * 1.5 :SizeConfig.textMultiplier * 1.7, ) ], ), @@ -471,35 +450,26 @@ class _HomePageState extends State { padding: const EdgeInsets.all(15.0), child: Column( children: [ - SizedBox( - height: 15, - ), + SizedBox(height: 15,), Container( width: 50, decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, - borderRadius: - BorderRadius.circular(12)), - child: Center( - child: Image.asset( - 'assets/images/search_medicine_icon.png', + borderRadius: BorderRadius.circular(12) + ), + child: Center(child: Image.asset('assets/images/search_medicine_icon.png', width: 50, height: 50, - fit: BoxFit.contain, - )), - ), - SizedBox( - height: 20, + fit: BoxFit.contain,)), ), + SizedBox(height: 20,), Texts( TranslationBase.of(context).searchMedicine, textAlign: TextAlign.center, color: Colors.white, bold: true, - fontSize: projectViewModel.isArabic - ? SizeConfig.textMultiplier * 1.5 - : SizeConfig.textMultiplier * 1.7, + fontSize: projectViewModel.isArabic? SizeConfig.textMultiplier * 1.5 :SizeConfig.textMultiplier * 1.7, ) ], ), @@ -511,9 +481,8 @@ class _HomePageState extends State { ), ), Expanded( - child: DashboardItem( - opacity: 1.0, - onTap: () { + child: DashboardItem(opacity: 1.0, + onTap: (){ Navigator.push( context, FadePage( @@ -526,35 +495,25 @@ class _HomePageState extends State { padding: const EdgeInsets.all(15.0), child: Column( children: [ - SizedBox( - height: 15, - ), + SizedBox(height: 15,), Container( decoration: BoxDecoration( color: Colors.white, shape: BoxShape.rectangle, - borderRadius: - BorderRadius.circular(12)), - child: Center( - child: Image.asset( - 'assets/images/online_payment_icon.png', + borderRadius: BorderRadius.circular(12) + ), + child: Center(child: Image.asset('assets/images/online_payment_icon.png', width: 80, height: 50, - fit: BoxFit.contain, - )), - ), - SizedBox( - height: 15, + fit: BoxFit.contain,)), ), + SizedBox(height: 15,), Texts( - TranslationBase.of(context) - .onlinePaymentService, + TranslationBase.of(context).onlinePaymentService, textAlign: TextAlign.center, color: Colors.white, bold: true, - fontSize: projectViewModel.isArabic - ? SizeConfig.textMultiplier * 1.5 - : SizeConfig.textMultiplier * 1.7, + fontSize: projectViewModel.isArabic? SizeConfig.textMultiplier * 1.5 :SizeConfig.textMultiplier * 1.7, ) ], ), @@ -590,33 +549,34 @@ class _HomePageState extends State { ); }, child: MedicalProfileItem( - title: - TranslationBase.of(context).myAppointments, + title: TranslationBase.of(context) + .myAppointments, imagePath: 'my_appointment_icon.png', - subTitle: TranslationBase.of(context) - .myAppointmentsList, + subTitle: TranslationBase.of(context).myAppointmentsList, ), ), ), Expanded( flex: 1, child: InkWell( - onTap: () => Navigator.push( - context, FadePage(page: LabsHomePage())), + onTap: () => Navigator.push(context, + FadePage(page: LabsHomePage())), child: MedicalProfileItem( title: TranslationBase.of(context).lab, imagePath: 'lab_result_icon.png', - subTitle: TranslationBase.of(context).lab, + subTitle: + TranslationBase.of(context).lab, ), ), ), Expanded( flex: 1, child: InkWell( - onTap: () => Navigator.push( - context, FadePage(page: RadiologyHomePage())), + onTap: () => Navigator.push(context, + FadePage(page: RadiologyHomePage())), child: MedicalProfileItem( - title: TranslationBase.of(context).radiology, + title: TranslationBase.of(context) + .radiology, imagePath: 'radiology_icon.png', subTitle: TranslationBase.of(context) .radiologySubtitle, @@ -639,7 +599,8 @@ class _HomePageState extends State { ); }, child: MedicalProfileItem( - title: TranslationBase.of(context).medicines, + title: TranslationBase.of(context) + .medicines, imagePath: 'prescription_icon.png', subTitle: TranslationBase.of(context) .medicinesSubtitle, @@ -658,7 +619,8 @@ class _HomePageState extends State { ); }, child: MedicalProfileItem( - title: TranslationBase.of(context).myDoctor, + title: TranslationBase.of(context) + .myDoctor, imagePath: 'doctor_icon.png', subTitle: TranslationBase.of(context) .myDoctorSubtitle, @@ -669,11 +631,12 @@ class _HomePageState extends State { flex: 1, child: InkWell( onTap: () { - Navigator.push( - context, FadePage(page: InsuranceCard())); + Navigator.push(context, + FadePage(page: InsuranceCard())); }, child: MedicalProfileItem( - title: TranslationBase.of(context).insurance, + title: TranslationBase.of(context) + .insurance, imagePath: 'insurance_card_icon.png', subTitle: TranslationBase.of(context) .insuranceSubtitle, @@ -682,6 +645,7 @@ class _HomePageState extends State { ), ], ), + ], ), ), @@ -694,7 +658,7 @@ class _HomePageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ DashboardItem( - opacity: 1.0, + opacity:1.0, child: Container( width: double.infinity, padding: EdgeInsets.all(10), @@ -707,38 +671,31 @@ class _HomePageState extends State { bold: true, ), Texts( - TranslationBase.of(context) - .viewAllHabibMedicalService, + TranslationBase.of(context).viewAllHabibMedicalService, color: Colors.white, fontWeight: FontWeight.normal, fontSize: 10, ), - // Expanded( - // child: Container(), - // ), - Text( + Expanded( + child: Container(), + ), + Texts( TranslationBase.of(context).viewAll, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold), - overflow: TextOverflow.ellipsis, + color: Colors.white, + bold: true, ) ], ), ), height: 106, imageName: 'ask_doctor_bg.png', - //color: Colors.grey[700], + //color: Colors.grey[700], width: MediaQuery.of(context).size.width * 0.45, onTap: () => Navigator.push( - context, - FadePage( - page: AllHabibMedicalService( - goToMyProfile: widget.goToMyProfile, - ))), + context, FadePage(page: AllHabibMedicalService(goToMyProfile: widget.goToMyProfile,))), ), DashboardItem( - opacity: 1.0, + opacity:1.0, onTap: () { Navigator.push( context, FadePage(page: ContactUsPage())); @@ -758,7 +715,7 @@ class _HomePageState extends State { TranslationBase.of(context).viewAllWaysReachUs, color: Colors.white, fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 1.0, + fontSize: SizeConfig.textMultiplier * 1.0 , ), Expanded( child: Container(), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index d348060a..f86511c1 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -468,7 +468,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { case 3: return TranslationBase.of(context).services; case 4: - return TranslationBase.of(context).bookAppo; + return TranslationBase.of(context).todoList; } } diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index 2fb8c51c..50bb2dea 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -45,21 +45,22 @@ class MyBalancePage extends StatelessWidget { width: double.infinity, height: 65, decoration: BoxDecoration( - color: HexColor('#B61422'), + color: Theme.of(context).primaryColor, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(7), ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ + Texts( - TranslationBase.of(context).totalBalance, + '${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar, color: Colors.white, + bold: true, ), Texts( - '${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar, + TranslationBase.of(context).totalBalance, color: Colors.white, - bold: true, ), ], ), diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index 696ea2db..d4a9e500 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -63,6 +63,7 @@ class PrescriptionItemsPage extends StatelessWidget { height: 70, ), ), + SizedBox(width: 10,), Expanded( child: Padding( padding: const EdgeInsets.all(8.0), @@ -121,6 +122,7 @@ class PrescriptionItemsPage extends StatelessWidget { height: 70, ), ), + SizedBox(width: 10,), Expanded( child: Padding( padding: const EdgeInsets.all(8.0), @@ -133,6 +135,11 @@ class PrescriptionItemsPage extends StatelessWidget { ), ), ), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) ], ), ), @@ -143,7 +150,7 @@ class PrescriptionItemsPage extends StatelessWidget { ), bottomSheet: Container( width: double.infinity, - height: MediaQuery.of(context).size.height * 0.23, + height: MediaQuery.of(context).size.height * 0.1, color: Colors.grey[100], child: Column( children: [ @@ -157,10 +164,12 @@ class PrescriptionItemsPage extends StatelessWidget { patientID: prescriptions.patientID, clinicName: prescriptions.companyName, doctorName: prescriptions.doctorName, + mes: TranslationBase.of(context).sendSuc, projectID: prescriptions.projectID), loading: model.state == ViewState.BusyLocal, ), ), + if(false) Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 68846968..0e0967d0 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -51,11 +51,13 @@ class RadiologyDetailsPage extends StatelessWidget { ), bottomSheet: Container( width: double.infinity, + height: model.radImageURL.isNotEmpty ? MediaQuery.of(context).size.height * 0.2:MediaQuery.of(context).size.height * 0.15, color: Colors.grey[100], child: Column( mainAxisSize: MainAxisSize.min, children: [ Divider(), + if(model.radImageURL.isNotEmpty) Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( @@ -70,6 +72,7 @@ class RadiologyDetailsPage extends StatelessWidget { width: MediaQuery.of(context).size.width * 0.8, child: Button( onTap: () => model.sendRadReportEmail( + mes: TranslationBase.of(context).sendSuc, finalRadiology: finalRadiology), label: TranslationBase.of(context).sendCopyRad, loading: model.state == ViewState.BusyLocal, diff --git a/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart b/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart index 589284a1..113e29a6 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_wideget.dart @@ -1,9 +1,12 @@ import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.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'; +import 'package:provider/provider.dart'; class VitalSignDetailsWidget extends StatefulWidget { final List vitalList; @@ -21,6 +24,7 @@ class VitalSignDetailsWidget extends StatefulWidget { class _VitalSignDetailsWidgetState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return Container( decoration: BoxDecoration( color: Colors.transparent, @@ -38,7 +42,7 @@ class _VitalSignDetailsWidgetState extends State { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(projectViewModel), ), ], ), @@ -46,20 +50,21 @@ class _VitalSignDetailsWidgetState extends State { ); } - List fullData() { + List fullData(ProjectViewModel projectViewModel) { List tableRow = []; tableRow.add(TableRow(children: [ Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) ), ), child: Center( child: Texts( - widget.title1, + TranslationBase.of(context).date, color: Colors.white, ), ), @@ -69,9 +74,10 @@ class _VitalSignDetailsWidgetState extends State { Container( child: Container( decoration: BoxDecoration( - color: HexColor('#515B5D'), + color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) ), ), child: Center( @@ -81,32 +87,34 @@ class _VitalSignDetailsWidgetState extends State { ) ])); widget.vitalList.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} ', - textAlign: TextAlign.center, + var data = vital.toJson()[widget.viewKey]; + if (data != 0) + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${projectViewModel.isArabic ? DateUtil.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtil.getMonthArabic(vital.vitalSignDate.month) : DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + textAlign: TextAlign.center, + ), ), ), ), - ), - Container( - child: Container( - padding: EdgeInsets.all(10), - color: Colors.white, - child: Center( - child: Texts( - '${vital.toJson()[widget.viewKey]}', - textAlign: TextAlign.center, + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${vital.toJson()[widget.viewKey]}', + textAlign: TextAlign.center, + ), ), ), ), - ), - ])); + ])); }); return tableRow; } diff --git a/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart index 802aae38..55f91d02 100644 --- a/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_item_details_screen.dart @@ -1,8 +1,10 @@ import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart'; import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sing_chart_and_detials.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class VitalSignItemDetailsScreen extends StatelessWidget { final VitalSignDetails pageKey; @@ -15,43 +17,56 @@ class VitalSignItemDetailsScreen extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); switch (pageKey) { case VitalSignDetails.BodyMeasurements: VSchart = [ { 'name': 'Height', + 'nameAr': 'الطول', 'title1': 'Date', 'title2': 'Cm', + 'title2Ar': 'سم', 'viewKey': 'HeightCm', }, { 'name': 'Weight Kg', + 'nameAr': 'الوزن كجم', 'title1': 'Date', 'title2': 'Kg', + 'title2Ar': 'كجم', 'viewKey': 'WeightKg', }, { - 'name': 'BodyMassIndex', + 'name': 'Body Mass Index', + 'nameAr': 'مؤشر كتلة الجسم', 'title1': 'Date', 'title2': 'BodyMass', + 'title2Ar': 'كتلة الجسم', 'viewKey': 'BodyMassIndex', }, { - 'name': 'HeadCircumCm', + 'name': 'Head Circum Cm', + 'nameAr': 'محيط رأس سم', 'title1': 'Date', 'title2': 'Cm', + 'title2Ar': 'سم', 'viewKey': 'HeadCircumCm', }, { 'name': 'Ideal Body Weight (Lbs)', + 'nameAr': 'وزن الجسم المثالي (رطل)', 'title1': 'Date', 'title2': 'Ideal Weight', + 'title2Ar': 'الوزن المثالي', 'viewKey': 'IdealBodyWeightLbs', }, { - 'name': 'LeanBodyWeightLbs (Lbs)', + 'name': 'Lean Body WeightLbs (Lbs)', + 'nameAr': 'رطل وزن الجسم النحيل (رطل)', 'title1': 'Date', 'title2': 'Lean Weight', + 'title2Ar': 'وزن خفيف', 'viewKey': 'LeanBodyWeightLbs', } ]; @@ -61,9 +76,11 @@ class VitalSignItemDetailsScreen extends StatelessWidget { case VitalSignDetails.Temperature: VSchart = [ { - 'name': 'Temperature In Celcius', + 'name': 'Temperature In Celsius', + 'nameAr': 'درجة الحرارة بالدرجة المئوية', 'title1': 'Date', 'title2': 'C', + 'title2Ar': 'ْس', 'viewKey': 'TemperatureCelcius', }, ]; @@ -73,8 +90,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Pulse Beat Per Minute', + 'nameAr': 'نبضة نبضة في الدقيقة', 'title1': 'Date', 'title2': 'Minute', + 'title2Ar': 'دقيقة', 'viewKey': 'PulseBeatPerMinute', }, ]; @@ -84,8 +103,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Respiration Beat Per Minute', + 'nameAr': 'ضربات التنفس في الدقيقة', 'title1': 'Date', 'title2': 'Beat Per Minute', + 'title2Ar': 'نفس في الدقيقة', 'viewKey': 'RespirationBeatPerMinute', }, ]; @@ -95,14 +116,18 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Blood Pressure Higher', + 'nameAr': 'ضغط الدم الإنقباض', 'title1': 'Date', 'title2': 'Minute', + 'title2Ar': 'الإنقباض', 'viewKey': 'BloodPressureHigher', }, { 'name': 'Blood Pressure Lower', + 'nameAr': 'ضغط الدم الإنبساط', 'title1': 'Date', 'title2': 'Minute', + 'title2Ar': 'الإنبساط', 'viewKey': 'BloodPressureLower', } ]; @@ -112,8 +137,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Respiration Rate', + 'nameAr': 'معدل التنفس', 'title1': 'Date', 'title2': 'bpm', + 'title2Ar': 'نفس', 'viewKey': 'RespirationBeatPerMinute', }, ]; @@ -123,8 +150,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'FIO2', + 'nameAr': 'معدل النبض بالدقيقة', 'title1': 'Date', 'title2': 'bpm', + 'title2Ar': 'نبضة', 'viewKey': 'PulseBeatPerMinute', }, ]; @@ -134,8 +163,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'PainScore', + 'nameAr': 'نقاط الألم', 'title1': 'Date', 'title2': 'Cm', + 'title2Ar': 'سم', 'viewKey': 'PainScore', }, ]; @@ -145,8 +176,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Weight Kg', + 'nameAr': 'الوزن كجم', 'title1': 'Date', 'title2': 'Kg', + 'title2Ar': 'كجم', 'viewKey': 'WeightKg', }, ]; @@ -157,8 +190,10 @@ class VitalSignItemDetailsScreen extends StatelessWidget { VSchart = [ { 'name': 'Height Cm', + 'nameAr': 'الطول سم', 'title1': 'Date', 'title2': 'Cm', + 'title2Ar': 'سم', 'viewKey': 'HeightCm', }, ]; @@ -177,9 +212,9 @@ class VitalSignItemDetailsScreen extends StatelessWidget { return vitalListTemp.length != 0 ? VitalSingChartAndDetials( vitalList: vitalList, - name: chartInfo['name'], + name:projectViewModel.isArabic? chartInfo['nameAr']:chartInfo['name'], title1: chartInfo['title1'], - title2: chartInfo['title2'], + title2:projectViewModel.isArabic?chartInfo['title2Ar']: chartInfo['title2'], viewKey: chartInfo['viewKey']) : Container(); }).toList(), diff --git a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart index 299605ef..a56ee0ba 100644 --- a/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/pages/medical/vital_sign/vital_sing_chart_and_detials.dart @@ -45,7 +45,7 @@ class VitalSingChartAndDetials extends StatelessWidget { endDate: vitalList[0].vitalSignDate, ), bodyWidget: VitalSignDetailsWidget( - vitalList: vitalList.reversed.toList(), + vitalList: vitalList, title1: title1, title2: title2, viewKey: viewKey, @@ -59,6 +59,7 @@ class VitalSingChartAndDetials extends StatelessWidget { if (vitalList.length > 0) { vitalList.forEach( (element) { + if( element.toJson()[viewKey]?.toInt()!=0) timeSeriesData.add( TimeSeriesSales( new DateTime(element.vitalSignDate.year, diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index cc2fd7ca..63d09f3a 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -50,11 +51,15 @@ class PaymentService extends StatelessWidget { fontSize: 14, fontWeight: FontWeight.normal, ), - Image.asset( - 'assets/images/al-habib_online_payment_service_icon.png', - fit: BoxFit.fill, - height: 55, - width: double.infinity, + SizedBox(height: 12,), + Container( + margin: EdgeInsets.only(left: 10,right: 10), + child: Image.asset( + 'assets/images/online_payment_icon.png', + fit: BoxFit.fill, + height: 55, + width: double.infinity, + ), ), ], ), @@ -82,12 +87,13 @@ class PaymentService extends StatelessWidget { fontSize: 14, fontWeight: FontWeight.normal, ), + SizedBox(height: 12,), Align( - alignment: projectViewModel.isArabic + alignment: !projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, child: Image.asset( - 'assets/images/al-habib_online_payment_service_icon.png', + 'assets/images/device_icon.png', height: 55, ), ), @@ -124,12 +130,13 @@ class PaymentService extends StatelessWidget { fontSize: 14, fontWeight: FontWeight.normal, ), + SizedBox(height: 12,), Align( - alignment: projectViewModel.isArabic + alignment: !projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, child: Image.asset( - 'assets/images/al-habib_online_payment_service_icon.png', + 'assets/images/new-design/check-in.png', height: 55, ), ), diff --git a/lib/pages/pharmacies/medicine_search_screen.dart b/lib/pages/pharmacies/medicine_search_screen.dart index 62cacb7f..adf99ce1 100644 --- a/lib/pages/pharmacies/medicine_search_screen.dart +++ b/lib/pages/pharmacies/medicine_search_screen.dart @@ -21,6 +21,8 @@ class MedicineSearch extends StatelessWidget { @override Widget build(BuildContext context) { return BaseView( + allowAny: true, + onModelReady: (model) => model.clearMedicineSearch(), builder: (BuildContext context, PharmacyViewModel model, Widget child) => AppScaffold( baseViewModel: model, diff --git a/lib/pages/pharmacies/pharmacies_list_screen.dart b/lib/pages/pharmacies/pharmacies_list_screen.dart index dc69a3e2..a35a77c9 100644 --- a/lib/pages/pharmacies/pharmacies_list_screen.dart +++ b/lib/pages/pharmacies/pharmacies_list_screen.dart @@ -24,12 +24,14 @@ class PharmaciesList extends StatelessWidget { @override Widget build(BuildContext context) { return BaseView( + allowAny: true, onModelReady: (model) => model.getPharmacies(id: medicineID), builder: (BuildContext context, PharmacyViewModel model, Widget child) => AppScaffold( appBarTitle: TranslationBase.of(context).pharmaciesList, baseViewModel: model, isShowAppBar: true, + isShowDecPage: false, body: Container( height: SizeConfig.screenHeight, child: ListView( @@ -146,7 +148,7 @@ class PharmaciesList extends StatelessWidget { child: InkWell( child: Icon( Icons.phone, - color: Colors.red, + color: Theme.of(context).primaryColor, ), onTap: () => launch("tel://" + model.pharmacyList[index].phoneNumber), @@ -157,7 +159,7 @@ class PharmaciesList extends StatelessWidget { child: InkWell( child: Icon( Icons.local_pharmacy, - color: Colors.red, + color: Theme.of(context).primaryColor, ), onTap: () { MapsLauncher.launchCoordinates( diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 7a128b10..1cd560d4 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_clinic.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -60,10 +61,10 @@ class _RateAppointmentDoctorState extends State { child: Column( children: [ SizedBox( - height: 25, + height: 25, //5598 ), Texts( - 'How would you rate your last visit to the doctor', + TranslationBase.of(context).lastVisit, bold: true, color: Colors.black, ), @@ -114,7 +115,7 @@ class _RateAppointmentDoctorState extends State { ), Center( child: Texts( - 'Please rate the doctor', + TranslationBase.of(context).tapTitle, textAlign: TextAlign.center, )), SizedBox( @@ -204,7 +205,7 @@ class _RateAppointmentDoctorState extends State { ); } }, - label: "Next", + label: TranslationBase.of(context).next, disabled: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal, textColor: Theme.of(context).backgroundColor), @@ -222,7 +223,7 @@ class _RateAppointmentDoctorState extends State { ); }, child: Texts( - 'Later', + TranslationBase.of(context).later, decoration: TextDecoration.underline, color: HexColor('#151DFE'), fontSize: 18, diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 2c12d6fd..2d8c3ef9 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -27,7 +27,7 @@ class _SplashScreenState extends State { Timer( Duration(seconds: 1, milliseconds: 500), () { - getUserData().then((value) { + Provider.of(context, listen: false).loadSharedPrefLanguage().then((value) { Navigator.of(context).pushReplacement( MaterialPageRoute( builder: (BuildContext context) => LandingPage(), @@ -39,13 +39,7 @@ class _SplashScreenState extends State { } Future getUserData() async { - 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).loadSharedPrefLanguage(); } @override diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 95086f10..3e6123c2 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -24,7 +24,8 @@ class DateUtil { 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])); + var dateP = DateTime(int.parse(year),int.parse(dateT[1]),int.parse(dateT[0])); + return dateP; } catch (e) { print(e); } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 5be01ab1..80fb0cfe 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -220,6 +220,9 @@ class TranslationBase { String get upcomingConfirm => localizedValues['upcoming-confirm'][locale.languageCode]; + String get upcomingConfirmMore => + localizedValues['book-success-confirm-more-24-1-2'][locale.languageCode]; + String get upcomingPaymentPending => localizedValues['upcoming-payment-pending'][locale.languageCode]; @@ -1000,6 +1003,18 @@ class TranslationBase { String get notActive => localizedValues['not-active'][locale.languageCode]; String get cardDetail => localizedValues['card-detail'][locale.languageCode]; String get dr => localizedValues['Dr'][locale.languageCode]; + String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; + String get instructions => localizedValues['instructions'][locale.languageCode]; + String get instructionsPharmacies => localizedValues['instructions-pharmacies'][locale.languageCode]; + String get selectHospitalDec => localizedValues['select-hospital'][locale.languageCode]; + String get start => localizedValues['start'][locale.languageCode]; + String get infoChat => localizedValues['info-chat'][locale.languageCode]; + + + String get noRecords => localizedValues['empty'][locale.languageCode]; + String get lastVisit => localizedValues['last-visit'][locale.languageCode]; + String get tapTitle => localizedValues['tap-title'][locale.languageCode]; + String get later => localizedValues['later'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/buttons/floatingActionButton.dart b/lib/widgets/buttons/floatingActionButton.dart index d2715346..4afd72b3 100644 --- a/lib/widgets/buttons/floatingActionButton.dart +++ b/lib/widgets/buttons/floatingActionButton.dart @@ -25,6 +25,7 @@ class _FloatingButtonState extends State AnimationController _animationController; Animation _animation; PermissionService permission = new PermissionService(); + @override void initState() { _animationController = AnimationController( @@ -63,16 +64,17 @@ class _FloatingButtonState extends State onTapCancel: () { _animationController.forward(); }, - onTap: (){permission.vibrate(widget.onTap, context);}, + onTap: () { + permission.vibrate(widget.onTap, context); + }, behavior: HitTestBehavior.opaque, child: Transform.scale( scale: _buttonSize, child: AnimatedContainer( duration: Duration(milliseconds: 150), margin: EdgeInsets.only(bottom: 4), - padding: EdgeInsets.symmetric(vertical: 24, horizontal: 24), decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(54.0)), + borderRadius: BorderRadius.all(Radius.circular(70.0)), color: Theme.of(context).primaryColor, boxShadow: [ BoxShadow( @@ -81,31 +83,15 @@ class _FloatingButtonState extends State spreadRadius: _buttonSize < 1.0 ? -(1 - _buttonSize) * 50 : 0.0, offset: Offset(0, 7.0), - blurRadius: 55.0) + blurRadius: 70.0) ]), - child: Container( - child: Column( - children: [ - Icon(EvaIcons.calendar,color: Colors.white,size: 23,), - Texts( - TranslationBase.of(context).book, - bold: !projectViewModel.isArabic, - color: Colors.white, - fontSize: projectViewModel.isArabic ? 8 : 17, - ), - Texts( - TranslationBase.of(context).appointmentLabel, - bold: projectViewModel.isArabic, - color: Colors.white, - fontSize:projectViewModel.isArabic ? 8.8 : 8, - ), - ], - ), - width: 54, - height: 54, - decoration: BoxDecoration( - shape: BoxShape.circle, - ), + child: Image.asset( + projectViewModel.isArabic + ? 'assets/images/booking_ar.png' + : 'assets/images/booking_en.png', + // fit: BoxFit.cover, + width: 90, + height: 90, ), )), )); diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index d5687554..71a88554 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -177,7 +177,7 @@ class _SecondaryButtonState extends State width: MediaQuery.of(context).size.width, height: 100, decoration: BoxDecoration( - color: Theme.of(context).primaryColor, + color: widget.disabled? Colors.grey: widget.color ?? Theme.of(context).primaryColor, ), ), ), 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 753f3deb..68d01e4a 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 @@ -1,12 +1,16 @@ +import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.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'; +import 'package:provider/provider.dart'; class LabResultDetailsWidget extends StatefulWidget { - final List labResult; + final List labResult; LabResultDetailsWidget({ this.labResult, @@ -19,6 +23,7 @@ class LabResultDetailsWidget extends StatefulWidget { class _VitalSignDetailsWidgetState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return Container( decoration: BoxDecoration( color: Colors.transparent, @@ -36,7 +41,7 @@ class _VitalSignDetailsWidgetState extends State { border: TableBorder.symmetric( inside: BorderSide(width: 2.0, color: Colors.grey[300]), ), - children: fullData(), + children: fullData(projectViewModel), ), ], ), @@ -44,7 +49,7 @@ class _VitalSignDetailsWidgetState extends State { ); } - List fullData() { + List fullData(ProjectViewModel projectViewModel) { List tableRow = []; tableRow.add(TableRow(children: [ Container( @@ -52,7 +57,8 @@ class _VitalSignDetailsWidgetState extends State { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), ), ), child: Center( @@ -69,7 +75,8 @@ class _VitalSignDetailsWidgetState extends State { decoration: BoxDecoration( color: Theme.of(context).primaryColor, borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), ), ), child: Center( @@ -79,6 +86,7 @@ class _VitalSignDetailsWidgetState extends State { ) ])); widget.labResult.forEach((vital) { + var date =DateUtil.convertStringToDate(vital.verifiedOnDateTime); tableRow.add(TableRow(children: [ Container( child: Container( @@ -86,7 +94,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: Texts( - '${vital.verifiedOn}', + '${projectViewModel.isArabic? DateUtil.getWeekDayArabic(date.weekday): DateUtil.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? DateUtil.getMonthArabic(date.month) : DateUtil.getMonth(date.month)} ${date.year}', textAlign: TextAlign.center, ), ), 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 index 19a95bac..dabad6af 100644 --- 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 @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart'; 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'; @@ -15,7 +16,7 @@ class LabResultChartAndDetails extends StatelessWidget { @required this.name, }) : super(key: key); - final List labResult; + final List labResult; final String name; List _timeSeriesData = []; @@ -28,8 +29,8 @@ class LabResultChartAndDetails extends StatelessWidget { headerWidget: AppTimeSeriesChart( seriesList: generateData(), chartName: name, - startDate: DateUtil.convertStringToDateTime(labResult[0].sampleCollectedOn), - endDate: DateTime.now(), + startDate: DateUtil.convertStringToDate(labResult[0].verifiedOnDateTime), + endDate: DateUtil.convertStringToDate(labResult[labResult.length-1].verifiedOnDateTime), ), bodyWidget: LabResultDetailsWidget( labResult: labResult, @@ -49,7 +50,7 @@ class LabResultChartAndDetails extends StatelessWidget { var resultValueInt = resultValueDouble.toInt(); _timeSeriesData.add( TimeSeriesSales( - DateUtil.convertStringToDateTime(element.sampleCollectedOn), + DateUtil.convertStringToDate(element.verifiedOnDateTime), resultValueInt, ), ); diff --git a/lib/widgets/pharmacy/drug_item.dart b/lib/widgets/pharmacy/drug_item.dart index 05f6ef4c..ae64349e 100644 --- a/lib/widgets/pharmacy/drug_item.dart +++ b/lib/widgets/pharmacy/drug_item.dart @@ -38,18 +38,18 @@ class _MedicineItemWidgetState extends State { children: [ if (widget.url != null) Container( - height: 39.0, - width: 39.0, + child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(7)), child: Image.memory( dataFromBase64String(widget.url), - height: SizeConfig.imageSizeMultiplier * 11, - width: SizeConfig.imageSizeMultiplier * 11, + height: SizeConfig.imageSizeMultiplier * 19, + width: SizeConfig.imageSizeMultiplier * 18, fit: BoxFit.cover, ), ), ), + SizedBox(width: 10,), Expanded( child: Center( child: Padding(