diff --git a/lib/config/config.dart b/lib/config/config.dart index dabfdf55..dd9711b3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -163,13 +163,11 @@ const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalRe ///Rate const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; const GET_APPOINTMENT_DETAILS_BY_NO = 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; +const NEW_RATE_APPOINTMENT_URL = "Services/Doctors.svc/REST/AppointmentsRating_InsertAppointmentRate"; +const NEW_RATE_DOCTOR_URL = "Services/Doctors.svc/REST/DoctorsRating_InsertDoctorRate"; const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; -//const BASE_URL = 'https://hmgwebservices.com/'; // Production Environment -//const BASE_URL = 'https://hmgwebservices.com/Services'; // Production Environment -//const BASE_URL = 'https://uat.hmgwebservices.com/Services'; // UAT Environment - //URL to get clinic list const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 713b009f..03e966ff 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -303,11 +303,11 @@ const Map localizedValues = { "gate": {"en": "Gate:", "ar": "بوابة"}, "building": {"en": "Building:", "ar": "المبنى"}, "branch": {"en": "Branch:", "ar": "الفرع"}, - "emergencyServices": {"en": "Emergency Services:", "ar": "خدمات الطوارئ"}, - "nearester": {"en": "Nearest ER:", "ar": "أقرب طوارى"}, - "locationa": {"en": "location:", "ar": "الموقع"}, - "ambulancerequest": {"en": "Ambulance :", "ar": "طلب نقل "}, - "requestA": {"en": "Request:", "ar": "اسعاف"}, + "emergencyServices": {"en": "Emergency Services", "ar": "خدمات الطوارئ"}, + "nearester": {"en": "Nearest ER", "ar": "أقرب طوارى"}, + "locationa": {"en": "location", "ar": "الموقع"}, + "ambulancerequest": {"en": "Ambulance", "ar": "طلب نقل "}, + "requestA": {"en": "Request", "ar": "اسعاف"}, "MyAppointments": {"en": "My", "ar": "مواعيدي"}, "NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"}, "NoConfirmedAppointments": {"en": "No Confirmed Appointments", "ar": "لا توجد مواعيد مؤكدة"}, @@ -418,7 +418,7 @@ const Map localizedValues = { "PleaseEnterTheVerificationCode": {"en": "Please enter the verification code send to", "ar": "الرجاء إدخال رمز التحقق المرسل إلى"}, "EyeMeasurements": {"en": "Eye Measurements", "ar": "قياسات النظر"}, "Measurements": {"en": "Measurements", "ar": "قياسات"}, - "Classes": {"en": "Classes", "ar": "نظارات"}, + "Classes": {"en": "Glasses", "ar": "نظارات"}, "ContactLens": {"en": "Contact Lens", "ar": "العدسات اللاصقة"}, "RightEye": {"en": "Right Eye", "ar": "العين اليمين"}, "Sphere": {"en": "Sphere", "ar": "القوة"}, @@ -901,9 +901,9 @@ const Map localizedValues = { "YouCanPayByTheFollowingOptions": {"en": "You can pay by the following options:", "ar": "I Accept the Terms And Conditions"}, "RRTDDetails": { "en": - "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a copmplete medical team at home", + "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a complete medical team at home", "ar": - "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a copmplete medical team at home" + "The RRT service provides medical services urgent and stable cases, not life-threatening situation or extremities and the service includes providing medical care from a complete medical team at home" }, "rrtService": {"en": "RRT Service", "ar": "خدمة RRT"}, "bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"}, @@ -1417,5 +1417,48 @@ const Map localizedValues = { }, "dental-procedure-list": {"en": "Dental Procedures for this Appointment: ", "ar": "إجراءات الأسنان لهذا الموعد:"}, "time-needed": {"en": "Time Needed:", "ar": "الوقت اللازم:"}, - "total-time-needed": {"en": "Total Appointment Time:", "ar": "وقت المواعيد الكلي:"}, + "total-time-needed": { + "en": "Total Appointment Time:", + "ar": "وقت المواعيد الكلي:" + }, + "info-eye": { + "en": "This service allows you to view all the eye measurements, lenses, and eyeglasses that have been made in the Habib Medical Group.", + "ar": " خدمة قياسات النظر: هذه الخدمة تمكنك من الاطلاع على جميع قياسات النظر والعدسات والنظارات التي تمت في مجموعة الحبيب الطبية." + }, + "info-vaccines": { + "en": "This service allows you to view all the vaccinations that were taken in Al Habib Medical Group.", + "ar": "خدمة تطعيماتي: هذه الخدمة تمكنك من الاطلاع على جميع التطعيمات التي تمت في مجموعة الحبيب الطبية." + }, + "info-trackers": { + "en": "This service allows you to record the readings of the measurement of sugar, pressure, and weight and then refer to them as a reference in addition to view the statistics charts.", + "ar": "متابعة قراءاتي: هذه الخدمة تمكنك من تسجيل قراءات قياس السكر والضغط والوزن بشكل دوري ومن ثم الاطلاع عليها كمرجع وكذلك الاطلاع على الرسوم البيانية لمتابعة تطور الحالة." + }, + "info-health-data": { + "en": "This service is designed to allows you to synchronize the health data from your smart watches into your health record system in Habib Medical Group so that the doctors you are visiting can analyze your health & activity level.", + "ar": "تم تصميم هذه الخدمة للسماح لك بمزامنة البيانات الصحية من ساعاتك الذكية الى نظام السجلات الصحية الخاص بك في مجموعة حبيب الطبية حتى يتمكن الأطباء الذين تزورهم من تحليل مستوى صحتك ونشاطك." + }, + "info-ask-doc": { + "en": "This service allows you to ask the doctor you have visited during the last 14 days. When you receive a response from the doctor, you will be notified via the system to view the doctor's reply.", + "ar": "اسال طبيبك: هذه الخدمة تمكنك من توجيه استفسارات الى الطبيب الذي قمت بزيارته خلال اخر 14 يوم وكذلك عند تلقى الرد من الطبيب سوف يتم ابلاغك عن طريق النظام للاطلاع على رد الطبيب." + }, + "info-auto-wifi": { + "en": "This service allows you to connect to the Internet directly without the need for entering a user name or password.", + "ar": "الاتصال بالانترنت: هذه الخدمة تمكنك من الاتصال بالانترنت مباشرة دون الحاجة الى اسم مستخدم او كلمة مرور." + }, + "auto-wifi": { + "en": "Connect To Internet", + "ar": "الإتصال بالإنترنت" + }, + "child-vaccine-info": { + "en": "This service to remind you of the deadlines of the necessary vaccinations for your child’s against diseases targeted by immunization according to the MOH vaccinations schedule by sending a reminding message and notifications of the vaccination date to the registered mobile phone.", + "ar": "هذه الخدمة تم تصميمها لتذكيرك بالمواعيد النهائية للتحصينات اللازمة لطفلك ضد الأمراض المستهدفة بالتحصين وفقًا لجدول تطعيمات وزارة الصحة عن طريق إرسال رسالة تذكير وإشعارات عن مواعيد التطعيم على الجوال المسجل." + }, + "h2o-info": { + "en": "This service is designed to help you to set drinking water goals and track the volume of water you are drinking on a daily basis. This service allows for schedule reminders and offers a basic statistical analysis of the amount of what you have consumed over the course of a day, week or month.", + "ar": "تم تصميم هذه الخدمة لمساعدتك في تحديد وتتبع كميات المياه التي يتوجب شربها بشكل يومي. كما توفر هذه الخدمة تذكيرات الجدول الزمني وتقدم تحليلًا إحصائيًا لمقدار ما استهلكته خلال اليوم أو الأسبوع أو الشهر." + }, + "ask-doc-empty": { + "en": "This service is available to doctors visited during the past 15 days", + "ar": "هذه الخدمة متاحة للاطباء الذين تمت زيارتهم خلال ال 15 يوم الماضية" + }, }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 50390ae2..752938ad 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -33,3 +33,4 @@ const H2O_UNIT = 'H2O_UNIT'; const H2O_REMINDER = 'H2O_REMINDER'; const LIVECARE_CLINIC_DATA = 'LIVECARE_CLINIC_DATA'; const DOCTOR_SCHEDULE_DATE_SEL = 'DOCTOR_SCHEDULE_DATE_SEL'; +const APPOINTMENT_HISTORY_MEDICAL = 'APPOINTMENT_HISTORY_MEDICAL'; diff --git a/lib/core/service/appointment_rate_service.dart b/lib/core/service/appointment_rate_service.dart index a0c2b208..16355e9a 100644 --- a/lib/core/service/appointment_rate_service.dart +++ b/lib/core/service/appointment_rate_service.dart @@ -1,7 +1,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart'; import 'package:diplomaticquarterapp/core/model/rate/appointment_rate.dart'; import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart'; -import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; class AppointmentRateService extends BaseService { @@ -10,8 +10,7 @@ class AppointmentRateService extends BaseService { Future getIsLastAppointmentRatedList() async { hasError = false; - await baseAppClient.post(IS_LAST_APPOITMENT_RATED, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(IS_LAST_APPOITMENT_RATED, onSuccess: (dynamic response, int statusCode) { appointmentRatedList.clear(); response['IsLastAppoitmentRatedList'].forEach((appoint) { appointmentRatedList.add(AppoitmentRated.fromJson(appoint)); @@ -27,19 +26,15 @@ class AppointmentRateService extends BaseService { Map bodyData = Map(); bodyData['AppointmentNumber'] = appointmentRatedList[0].appointmentNo; bodyData['ProjectID'] = appointmentRatedList[0].projectID; - await baseAppClient.post(GET_APPOINTMENT_DETAILS_BY_NO, - onSuccess: (dynamic response, int statusCode) { - if (response['AppointmentDetails'] != null) - appointmentDetails = - AppointmentDetails.fromJson(response['AppointmentDetails']); + await baseAppClient.post(GET_APPOINTMENT_DETAILS_BY_NO, onSuccess: (dynamic response, int statusCode) { + if (response['AppointmentDetails'] != null) appointmentDetails = AppointmentDetails.fromJson(response['AppointmentDetails']); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: bodyData); } - Future sendAppointmentRate(int rate, int appointmentNo, int projectID, - int doctorID, int clinicID, String note) async { + Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async { hasError = false; AppointmentRate appointmentRate = AppointmentRate(); appointmentRate.rate = rate; @@ -48,18 +43,45 @@ class AppointmentRateService extends BaseService { appointmentRate.doctorID = doctorID; appointmentRate.clinicID = clinicID; appointmentRate.note = note; + appointmentRate.createdBy = 2; + appointmentRate.editedBy = 2; - await baseAppClient.post(GET_APPOINTMENT_DETAILS_BY_NO, - onSuccess: (dynamic response, int statusCode) {}, - onFailure: (String error, int statusCode) { + await baseAppClient.post(NEW_RATE_APPOINTMENT_URL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: appointmentRate.toJson()); } + Future sendDoctorRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, String appoDate, String docName, String projectName, String clinicName) async { + Map request; + hasError = false; + request = { + "DoctorID": doctorID, + "Rate": rate, + "ClinicID": clinicID, + "ProjectID": projectID, + "AppointmentNo": appointmentNo, + "Note": note, + "MobileNumber": authenticatedUserObject.user.mobileNumber, + "AppointmentDate": appoDate, + "DoctorName": docName, + "ProjectName": projectName, + "COCTypeName": 1, + "PatientName": authenticatedUserObject.user.firstName + " " + authenticatedUserObject.user.lastName, + "PatientOutSA": authenticatedUserObject.user.outSA, + "PatientTypeID": authenticatedUserObject.user.patientType, + "ClinicName": clinicName, + "PatientIdentificationID": authenticatedUserObject.user.patientIdentificationNo + }; + + await baseAppClient.post(NEW_RATE_DOCTOR_URL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: request); + } + AppoitmentRated get lastAppointmentRated { - if (appointmentRatedList.length > 0) - return appointmentRatedList[appointmentRatedList.length - 1]; + if (appointmentRatedList.length > 0) return appointmentRatedList[appointmentRatedList.length - 1]; return null; } diff --git a/lib/core/service/er/er_service.dart b/lib/core/service/er/er_service.dart index bd3b6116..3e899f97 100644 --- a/lib/core/service/er/er_service.dart +++ b/lib/core/service/er/er_service.dart @@ -7,9 +7,6 @@ class ErService extends BaseService { List projectAvgERWaitingTimeModelList = List(); Map body = Map(); - String Latitude = ""; - String Longitude = ""; - String PhoneNumber = ""; Future getProjectAvgERWaitingTimeOrders({int id, int projectID}) async { hasError = false; @@ -23,21 +20,15 @@ class ErService extends BaseService { body['Latitude'] = lat ?? 0; body['Longitude'] = long ?? 0; + dynamic localRes; + await baseAppClient.post(GET_NEAREST_HOSPITAL, onSuccess: (dynamic response, int statusCode) { - projectAvgERWaitingTimeModelList.clear(); - response['List_ProjectAvgERWaitingTime'].forEach((vital) { - projectAvgERWaitingTimeModelList - .add(ProjectAvgERWaitingTime.fromJson(vital)); - }); - projectAvgERWaitingTimeModelList.forEach((element) { - Latitude = '${element.latitude}'; - Longitude = '${element.longitude}'; - PhoneNumber = '${element.phoneNumber}'; - }); + localRes = response; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: body); + return Future.value(localRes); } } diff --git a/lib/core/service/medical/ask_doctor_services.dart b/lib/core/service/medical/ask_doctor_services.dart index 9a819a6e..57ab856b 100644 --- a/lib/core/service/medical/ask_doctor_services.dart +++ b/lib/core/service/medical/ask_doctor_services.dart @@ -16,14 +16,16 @@ class AskDoctorService extends BaseService { body['DoctorID'] = doctorId; body['ProjectID'] = projectId; + dynamic localRes; + await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT, onSuccess: (dynamic response, int statusCode) { - ///OKAY - var asd=""; + localRes = response; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: body); + return Future.value(localRes); } Future getCallRequestTypeLOV() async { diff --git a/lib/core/service/medical/medical_service.dart b/lib/core/service/medical/medical_service.dart index 7e7cbe13..5c5e2d06 100644 --- a/lib/core/service/medical/medical_service.dart +++ b/lib/core/service/medical/medical_service.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:flutter/cupertino.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart'; @@ -18,16 +19,24 @@ class MedicalService extends BaseService { body['IsActiveAppointment'] = true; body['isDentalAllowedBackend'] = false; } - - await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async { + var appoHistory = await sharedPref.getObject(APPOINTMENT_HISTORY_MEDICAL); + if (appoHistory != null) { appoitmentAllHistoryResultList.clear(); - response['AppoimentAllHistoryResultList'].forEach((appoitment) { + appoHistory.forEach((appoitment) { appoitmentAllHistoryResultList.add(AppoitmentAllHistoryResultList.fromJson(appoitment)); }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + } else { + await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async { + appoitmentAllHistoryResultList.clear(); + response['AppoimentAllHistoryResultList'].forEach((appoitment) { + appoitmentAllHistoryResultList.add(AppoitmentAllHistoryResultList.fromJson(appoitment)); + }); + sharedPref.setObject(APPOINTMENT_HISTORY_MEDICAL, response['AppoimentAllHistoryResultList']); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } } addAmbulanceRequest({@required PatientER patientER}) async { diff --git a/lib/core/service/medical/my_balance_service.dart b/lib/core/service/medical/my_balance_service.dart index e2744250..6fb91a37 100644 --- a/lib/core/service/medical/my_balance_service.dart +++ b/lib/core/service/medical/my_balance_service.dart @@ -17,7 +17,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class MyBalanceService extends BaseService { List patientAdvanceBalanceAmountList = List(); - double totalAdvanceBalanceAmount; + dynamic totalAdvanceBalanceAmount; List patientInfoList = List(); GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse(); diff --git a/lib/core/viewModels/appointment_rate_view_model.dart b/lib/core/viewModels/appointment_rate_view_model.dart index e1bdfc9e..9e0d338b 100644 --- a/lib/core/viewModels/appointment_rate_view_model.dart +++ b/lib/core/viewModels/appointment_rate_view_model.dart @@ -3,16 +3,15 @@ import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart'; import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart'; import 'package:diplomaticquarterapp/core/service/appointment_rate_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; + import '../../locator.dart'; class AppointmentRateViewModel extends BaseViewModel { - AppointmentRateService _appointmentRateService = - locator(); + AppointmentRateService _appointmentRateService = locator(); bool isHaveAppointmentNotRate = false; AppointmentDetails get appointmentDetails => _appointmentRateService.appointmentDetails; - Future getIsLastAppointmentRatedList() async { isHaveAppointmentNotRate = false; setState(ViewState.Busy); @@ -21,8 +20,7 @@ class AppointmentRateViewModel extends BaseViewModel { error = _appointmentRateService.error; setState(ViewState.Error); } else { - if(_appointmentRateService.appointmentRatedList.length>0) - await getAppointmentDetails(); + if (_appointmentRateService.appointmentRatedList.length > 0) await getAppointmentDetails(); } } @@ -32,17 +30,14 @@ class AppointmentRateViewModel extends BaseViewModel { error = _appointmentRateService.error; setState(ViewState.Error); } else { - if (_appointmentRateService.appointmentDetails != null) - isHaveAppointmentNotRate = true; + if (_appointmentRateService.appointmentDetails != null) isHaveAppointmentNotRate = true; setState(ViewState.Idle); } } - Future sendAppointmentRate(int rate, int appointmentNo, int projectID, - int doctorID, int clinicID, String note) async { + Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async { setState(ViewState.Busy); - await _appointmentRateService.sendAppointmentRate( - rate, appointmentNo, projectID, doctorID, clinicID, note); + await _appointmentRateService.sendAppointmentRate(rate, appointmentNo, projectID, doctorID, clinicID, note); if (_appointmentRateService.hasError) { error = _appointmentRateService.error; setState(ViewState.ErrorLocal); @@ -52,14 +47,23 @@ class AppointmentRateViewModel extends BaseViewModel { } } - AppoitmentRated get lastAppointmentRated => - _appointmentRateService.lastAppointmentRated; + Future sendDoctorRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, String appoDate, String docName, String projectName, String clinicName) async { + setState(ViewState.Busy); + await _appointmentRateService.sendDoctorRate(rate, appointmentNo, projectID, doctorID, clinicID, note, appoDate, docName, projectName, clinicName); + if (_appointmentRateService.hasError) { + error = _appointmentRateService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + _appointmentRateService.deleteAllAppAppointmentRate(); + } + } - deleteAppointmentRated(AppoitmentRated appointmentRated) => - _appointmentRateService.deleteAppointmentRated(appointmentRated); + AppoitmentRated get lastAppointmentRated => _appointmentRateService.lastAppointmentRated; - deleteAppAppointmentRate() => - _appointmentRateService.deleteAllAppAppointmentRate(); + deleteAppointmentRated(AppoitmentRated appointmentRated) => _appointmentRateService.deleteAppointmentRated(appointmentRated); + + deleteAppAppointmentRate() => _appointmentRateService.deleteAllAppAppointmentRate(); setIsRated(bool isRated) { this.isHaveAppointmentNotRate = isRated; diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart index cd34fd70..c2211993 100644 --- a/lib/core/viewModels/dashboard_view_model.dart +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -12,11 +12,10 @@ class DashboardViewModel extends BaseViewModel { String get heightCm => _vitalSignService.heightCm; String booldType = "-"; + DashboardViewModel() { - this.getPatientRadOrders(); + // this.getPatientRadOrders(); } - // ToDoCountProviderModel toDoProvider = - // Provider.of(AppGlobal.context); getPatientRadOrders() async { if (isLogin && _vitalSignService.weightKg.isEmpty) { @@ -31,17 +30,4 @@ class DashboardViewModel extends BaseViewModel { } } } - -// getToDoCount() { -// toDoProvider.setState(0); -// ClinicListService service = new ClinicListService(); -// service.getActiveAppointmentNo(AppGlobal.context).then((res) { -// print(res['AppointmentActiveNumber']); -// if (res['MessageStatus'] == 1) { -// toDoProvider.setState(res['AppointmentActiveNumber']); -// } else {} -// }).catchError((err) { -// print(err); -// }); -// } } diff --git a/lib/core/viewModels/medical/ask_doctor_view_model.dart b/lib/core/viewModels/medical/ask_doctor_view_model.dart index 629df0a9..7890fb3a 100644 --- a/lib/core/viewModels/medical/ask_doctor_view_model.dart +++ b/lib/core/viewModels/medical/ask_doctor_view_model.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/ask_doctor/AskDoctorReqTypes.dart'; import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.dart'; @@ -6,51 +7,40 @@ import 'package:diplomaticquarterapp/core/service/medical/my_doctor_service.dart import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; class AskDoctorViewModel extends BaseViewModel { AskDoctorService _askDoctorService = locator(); MyDoctorService _myDoctorService = locator(); - List patientDoctorAppointmentListHospital = - List(); + List patientDoctorAppointmentListHospital = List(); - List get askDoctorReqTypes => - _askDoctorService.askDoctorReqTypes; + List get askDoctorReqTypes => _askDoctorService.askDoctorReqTypes; - List get doctorResponseList => - _askDoctorService.doctorResponseList; + List get doctorResponseList => _askDoctorService.doctorResponseList; Future getMyDoctor() async { setState(ViewState.Busy); - await _myDoctorService.getPatientDoctorAppointmentList( - top: 25, beforeDays: 15); + await _myDoctorService.getPatientDoctorAppointmentList(top: 25, beforeDays: 15); if (_myDoctorService.hasError) { error = _myDoctorService.error; setState(ViewState.Error); - } else - var asd = ""; - _myDoctorService.patientDoctorAppointmentList.forEach((element) { - List doctorByClinic = - patientDoctorAppointmentListHospital - .where((elementClinic) => - elementClinic.filterName == element.projectName) - .toList(); - - if (doctorByClinic.length != 0) { - patientDoctorAppointmentListHospital[ - patientDoctorAppointmentListHospital.indexOf(doctorByClinic[0])] - .patientDoctorAppointmentList - .add(element); - } else { - patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList( - filterName: element.projectName, - patientDoctorAppointment: element)); - } + } else if (_myDoctorService.patientDoctorAppointmentList.length != 0) { + _myDoctorService.patientDoctorAppointmentList.forEach((element) { + List doctorByClinic = patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList(); + if (doctorByClinic.length != 0) { + patientDoctorAppointmentListHospital[patientDoctorAppointmentListHospital.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); + } else { + patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); + } + setState(ViewState.Idle); + }); + } else { setState(ViewState.Idle); - }); + AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).askDocEmpty); + } } Future getCallRequestTypeLOVs() async { @@ -66,8 +56,7 @@ class AskDoctorViewModel extends BaseViewModel { Future getCallInfoHoursResult({int projectId, int doctorId}) async { setState(ViewState.Busy); - await _askDoctorService.getCallInfoHoursResult( - projectId: projectId, doctorId: doctorId); + await _askDoctorService.getCallInfoHoursResult(projectId: projectId, doctorId: doctorId); if (_askDoctorService.hasError) { error = _askDoctorService.error; setState(ViewState.ErrorLocal); @@ -95,11 +84,9 @@ class AskDoctorViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future sendRequestLOV( - {DoctorList doctorList, String requestType, String remark}) async { + Future sendRequestLOV({DoctorList doctorList, String requestType, String remark}) async { setState(ViewState.BusyLocal); - await _askDoctorService.sendRequestLOV( - doctorList: doctorList, requestType: requestType, remark: remark); + await _askDoctorService.sendRequestLOV(doctorList: doctorList, requestType: requestType, remark: remark); if (_askDoctorService.hasError) { error = _askDoctorService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index e33bc86c..ce9f35fa 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -38,7 +38,7 @@ class MyBalanceViewModel extends BaseViewModel { //=========================== - double get totalAdvanceBalanceAmount => + dynamic get totalAdvanceBalanceAmount => _myBalanceService.totalAdvanceBalanceAmount; String get updatedRegisterBloodMessage => diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart index f1d3e72f..d7ebad6c 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart @@ -43,9 +43,8 @@ class _CMCPageState extends State with SingleTickerProviderStateMixin { description: TranslationBase.of(context).infoCMC, imagesInfo: [ ImagesInfo( - imageAr: 'assets/images/Wifi-AR.png', - imageEn: 'assets/images/wifi-EN.png', - isAsset: true) + imageAr: 'https://hmgwebservices.com/Images/MobileApp/CMC/ar/0.png', + imageEn: 'https://hmgwebservices.com/Images/MobileApp/CMC/en/0.png') ], appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup, body: Scaffold( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart index b39c918f..001ecbb1 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart @@ -2,7 +2,6 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -46,9 +45,8 @@ class _HomeHealthCarePageState extends State appBarTitle: TranslationBase.of(context).homeHealthCare, imagesInfo: [ ImagesInfo( - imageAr: 'assets/images/Wifi-AR.png', - imageEn: 'assets/images/wifi-EN.png', - isAsset: true) + imageAr: 'https://hmgwebservices.com/Images/MobileApp/HHC/ar/0.png', + imageEn: 'https://hmgwebservices.com/Images/MobileApp/HHC/en/0.png') ], body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index c7b91f89..828b4622 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; +import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; @@ -23,6 +24,7 @@ import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; +import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; @@ -226,7 +228,7 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(), + FadePage(page: CovidDrivethruLocation()), ), imageLocation: 'assets/images/al-habib_online_payment_service_icon.png', title: TranslationBase.of(context).covid19_driveThrueTest, @@ -247,12 +249,6 @@ class _AllHabibMedicalServiceState extends State { ), ServicesContainer( onTap: () => getPharmacyToken(), - // Navigator.push( - // context, - // FadePage( - // page: ParkingPage(), - // ), - // ), imageLocation: 'assets/images/pharmacy_logo.png', title: TranslationBase.of(context).pharmacy), ServicesContainer( @@ -300,14 +296,14 @@ class _AllHabibMedicalServiceState extends State { imageLocation: 'assets/images/new-design/upcoming_icon_bottom_bar.png', title: TranslationBase.of(context).todoList, ), - if (projectViewModel.havePrivilege(42)) - ServicesContainer( - onTap: () => Navigator.push( - context, - FadePage(page: SymptomInfo()), - ), - imageLocation: 'assets/images/new-design/body_icon.png', - title: TranslationBase.of(context).symptomCheckerTitle), + // if (projectViewModel.havePrivilege(42)) + // ServicesContainer( + // onTap: () => Navigator.push( + // context, + // FadePage(page: SymptomInfo()), + // ), + // imageLocation: 'assets/images/new-design/body_icon.png', + // title: TranslationBase.of(context).symptomCheckerTitle), if (projectViewModel.havePrivilege(36)) ServicesContainer( onTap: () => Navigator.push( @@ -340,12 +336,6 @@ class _AllHabibMedicalServiceState extends State { if (projectViewModel.havePrivilege(38)) ServicesContainer( onTap: () => Navigator.push(context, FadePage(page: H2OPage())), - // Navigator.push( - // context, - // FadePage( - // page: H2OPageIndexPage(), - // ), - // ), imageLocation: 'assets/images/new-design/water_icon.png', title: TranslationBase.of(context).h2o, ), @@ -353,7 +343,9 @@ class _AllHabibMedicalServiceState extends State { ServicesContainer( onTap: () => Navigator.push( context, - FadePage(), + FadePage( + page: SmartWatchInstructions() + ), ), imageLocation: 'assets/images/new-design/smartwatch_icon.png', title: TranslationBase.of(context).smartWatches, diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart index b847190f..7c4e8b8b 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -1,12 +1,12 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/month_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/week_page.dart'; -import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; @@ -49,22 +49,29 @@ class _H2OPageState extends State with SingleTickerProviderStateMixin { builder: (_, model, widget) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).waterTracker, + description: TranslationBase.of(context).h2oInfo, + imagesInfo: [ + ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/h2o/ar/0.png') + ], showHomeAppBarIcon: false, baseViewModel: model, isHelp: true, appBarIcons: [ - IconButton( - icon: Image.asset("assets/images/new-design/setting_gear_icon.png"), - color: Colors.white, - onPressed: () { - Navigator.push( - context, - FadePage( - page: H2oSetting(userDetailModel: model.userDetail, viewModel: model), - ), - ); - }, - ), + model.isLogin + ? IconButton( + icon: Image.asset("assets/images/new-design/setting_gear_icon.png"), + color: Colors.white, + onPressed: () { + Navigator.push( + context, + FadePage( + page: H2oSetting(userDetailModel: model.userDetail, viewModel: model), + ), + ); + }, + ) + : Container(), ], body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index ce6ab8ee..f362c2bc 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -56,28 +56,28 @@ class _BloodDonationPageState extends State { AuthenticatedUser authenticatedUser; GetAllSharedRecordsByStatusList selectedPatientFamily; AdvanceModel advanceModel = AdvanceModel(); - List_BloodGroupDetailsModel bloodDetails = - List_BloodGroupDetailsModel(bloodGroup: "A-"); + List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-"); AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser; var checkedValue = false; List imagesInfo = List(); + + ProjectViewModel projectProvider; + @override void initState() { + imagesInfo.add( + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/ar/0.png'), + ); + WidgetsBinding.instance.addPostFrameCallback((_) { + if (projectProvider.isLogin) getAuthUser(); + }); super.initState(); - getAuthUser(); } @override Widget build(BuildContext context) { - imagesInfo.add( - ImagesInfo( - imageEn: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/images-info-home/blood/ar/0.png'), - ); - ProjectViewModel projectProvider = Provider.of(context); + projectProvider = Provider.of(context); return BaseView( onModelReady: (model) => model.getCities(), //model.getHospitals(), @@ -102,22 +102,16 @@ class _BloodDonationPageState extends State { height: 12, ), InkWell( - onTap: () => - confirmSelectHospitalDialog(model.CitiesModelList), + onTap: () => confirmSelectHospitalDialog(model.CitiesModelList), //model.hospitals child: Container( padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Theme.of(context).primaryColor), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Theme.of(context).primaryColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(getHospitalName(projectProvider, context)), - Icon(Icons.arrow_drop_down) - ], + children: [Texts(getHospitalName(projectProvider, context)), Icon(Icons.arrow_drop_down)], ), ), ), @@ -132,9 +126,7 @@ class _BloodDonationPageState extends State { padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Theme.of(context).primaryColor), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Theme.of(context).primaryColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -156,9 +148,7 @@ class _BloodDonationPageState extends State { padding: EdgeInsets.all(12), width: double.infinity, height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Theme.of(context).primaryColor), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Theme.of(context).primaryColor), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -175,16 +165,14 @@ class _BloodDonationPageState extends State { Row( children: [ Container( - child: Text( - TranslationBase.of(context).viewTermsConditions), + child: Text(TranslationBase.of(context).viewTermsConditions), ), SizedBox( width: MediaQuery.of(context).size.height * 0.10, ), InkWell( onTap: () { - Navigator.of(context) - .push(FadePage(page: UserAgreementPage())); + Navigator.of(context).push(FadePage(page: UserAgreementPage())); }, child: Container( child: Texts( @@ -220,12 +208,8 @@ class _BloodDonationPageState extends State { width: 10, ), Text( - TranslationBase.of(context) - .iAgreeToTheTermsAndConditions, - style: Theme.of(context).textTheme.subtitle1.copyWith( - color: checkedValue - ? Color(0xFFc5272d) - : Colors.black), + TranslationBase.of(context).iAgreeToTheTermsAndConditions, + style: Theme.of(context).textTheme.subtitle1.copyWith(color: checkedValue ? Color(0xFFc5272d) : Colors.black), ), ], ), @@ -247,23 +231,15 @@ class _BloodDonationPageState extends State { builder: (_) => AssetGiffyDialog( title: Text( "", - style: TextStyle( - fontSize: 22.0, - fontWeight: FontWeight.w600), + style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600), ), - image: Image.asset( - 'assets/images/BloodChrt_EN.png'), - buttonCancelText: Text( - TranslationBase.of(context).cancel), + image: Image.asset('assets/images/BloodChrt_EN.png'), + buttonCancelText: Text(TranslationBase.of(context).cancel), buttonCancelColor: Colors.grey, onlyCancelButton: true, )); }, - child: Container( - width: 250, - height: 200, - child: Image.asset( - 'assets/images/BloodChrt_EN.png')), + child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png')), ), ), ), @@ -293,19 +269,15 @@ class _BloodDonationPageState extends State { label: TranslationBase.of(context).save, onTap: () async { if (_selectedHospital == null) { - AppToast.showErrorToast( - message: TranslationBase.of(context).selectCity); + AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); return; } - bloodDetails.city = projectProvider.isArabic - ? _selectedHospital.descriptionN - : _selectedHospital.description; + bloodDetails.city = projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; bloodDetails.cityCode = _selectedHospital.iD.toString(); bloodDetails.gender = gender == Gender.Male ? 1 : 2; await model.updateBloodGroup(bloodDetails); if (model.state == ViewState.Idle) { - AppToast.showSuccessToast( - message: model.updatedRegisterBloodMessage); + AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage); } else { AppToast.showErrorToast(message: model.error); } @@ -325,8 +297,7 @@ class _BloodDonationPageState extends State { setState(() { if (value == BeneficiaryType.MyAccount) { _fileTextController.text = model.user.patientID.toString(); - advanceModel.depositorName = - model.user.firstName + " " + model.user.lastName; + advanceModel.depositorName = model.user.firstName + " " + model.user.lastName; } else _fileTextController.text = ""; @@ -453,8 +424,7 @@ class _BloodDonationPageState extends State { ); } - void confirmSelectFamilyDialog( - List getAllSharedRecordsByStatusList) { + void confirmSelectFamilyDialog(List getAllSharedRecordsByStatusList) { showDialog( context: context, child: SelectPatientFamilyDialog( @@ -463,8 +433,7 @@ class _BloodDonationPageState extends State { onValueSelected: (value) { setState(() { selectedPatientFamily = value; - _fileTextController.text = - selectedPatientFamily.patientID.toString(); + _fileTextController.text = selectedPatientFamily.patientID.toString(); advanceModel.depositorName = value.patientName; }); }, @@ -538,12 +507,9 @@ class _BloodDonationPageState extends State { return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary; } - String getHospitalName( - ProjectViewModel projectProvider, BuildContext context) { + String getHospitalName(ProjectViewModel projectProvider, BuildContext context) { if (_selectedHospital != null) - return projectProvider.isArabic - ? _selectedHospital.descriptionN - : _selectedHospital.description; + return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; else return TranslationBase.of(context).selectCity; // return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital; @@ -558,8 +524,7 @@ class _BloodDonationPageState extends State { getAuthUser() async { if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson( - await this.sharedPref.getObject(USER_PROFILE)); + var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); setState(() { authUser = data; }); diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index c384b7b5..f3f7bffb 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -218,7 +218,9 @@ class ConfirmPaymentPage extends StatelessWidget { authenticatedUser.patientID, authenticatedUser, browser, - false); + false, + null, + null); } onBrowserLoadStart(String url) { diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 89b8b710..c70932ee 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -509,6 +509,8 @@ class _BookSuccessState extends State { authenticatedUser, widget.browser, widget.patientShareResponse.isLiveCareAppointment, + null, + null, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo, widget.patientShareResponse.clinicID, diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 79b7758e..f083f3ae 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -53,6 +53,7 @@ class _DentalComplaintsState extends State { appBarTitle: "Symptoms", showNewAppBar: true, showNewAppBarTitle: true, + isShowDecPage: false, backgroundColor: CustomColors.appBackgroudGreyColor, body: Container( child: !hasDentalPlan diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 9668482c..4c87ebe4 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -115,6 +115,7 @@ class _DoctorProfileState extends State with TickerProviderStateM widget.doctor.noOfPatientsRate, "", ), + buttonIcon: 'assets/images/new/Boo_ Appointment.svg', showConfirmMessageDialog: false, onTap: () { Navigator.push( diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index eef70269..3eab535c 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -173,7 +173,7 @@ class _SearchByClinicState extends State { ), ), Text( - "30", + projectViewModel.isLogin ? projectViewModel.user.age.toString() : "", style: TextStyle( fontSize: 15, letterSpacing: -0.59, @@ -251,6 +251,9 @@ class _SearchByClinicState extends State { height: 18, child: DropdownButtonHideUnderline( child: DropdownButton( + onTap: () { + print("Clicked"); + }, key: clinicDropdownKey, hint: new Text( TranslationBase.of(context).selectClinic, @@ -270,6 +273,9 @@ class _SearchByClinicState extends State { item.liveCareServiceID.toString(), child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text(item.clinicDescription), + item.isLiveCareClinicAndOnline + ? SvgPicture.asset('assets/images/new-design/video_icon_green_right.svg', height: 12, width: 12, fit: BoxFit.cover) + : Container(), ]), ); }).toList(), @@ -448,8 +454,10 @@ class _SearchByClinicState extends State { page: LiveCareBookAppointment(clinicName: "Family Medicine", liveCareClinicID: dropdownValue.split("-")[2], liveCareServiceID: dropdownValue.split("-")[3]), ), ).then((value) { - print(value); - if (value == "false") dropdownValue = ""; + setState(() { + print(value); + if (value == "false") dropdownValue = null; + }); if (value == "livecare") { Navigator.push(context, FadePage(page: LiveCareHome())); } @@ -517,13 +525,20 @@ class _SearchByClinicState extends State { FadePage( page: DentalComplaints(searchInfo: searchInfo), ), - ); + ).then((value) { + setState(() { + dropdownValue = null; + }); + }); } Future navigateToSearchResults(context, List docList, List patientDoctorAppointmentListHospital) async { isProjectLoaded = false; Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital))) .then((value) { + setState(() { + dropdownValue = null; + }); getProjectsList(); }); } diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index faf8be9e..4ab3f1ca 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -1,3 +1,4 @@ +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/services/appointment_services/GetDoctorsList.dart'; @@ -9,6 +10,7 @@ import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; import '../DoctorProfile.dart'; @@ -21,8 +23,11 @@ class DoctorView extends StatelessWidget { DoctorView({@required this.doctor, @required this.isLiveCareAppointment, this.isShowFlag = true, this.onTap}); + ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return InkWell( onTap: onTap ?? () { @@ -69,8 +74,8 @@ class DoctorView extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - if (doctor.clinicName != null) myRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName), - if (doctor.projectName != null) myRichText(TranslationBase.of(context).hospital + ":", doctor.projectName), + if (doctor.clinicName != null) myRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName, projectViewModel.isArabic), + if (doctor.projectName != null) myRichText(TranslationBase.of(context).hospital + ":", doctor.projectName, projectViewModel.isArabic), if (doctor.speciality != null) Text( getDoctorSpeciality(this.doctor.speciality).trim(), @@ -135,6 +140,8 @@ class DoctorView extends StatelessWidget { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); }); } diff --git a/lib/pages/ChildVaccines/child_vaccines_page.dart b/lib/pages/ChildVaccines/child_vaccines_page.dart index 38c6b5af..f70fe64d 100644 --- a/lib/pages/ChildVaccines/child_vaccines_page.dart +++ b/lib/pages/ChildVaccines/child_vaccines_page.dart @@ -1,6 +1,5 @@ -import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -18,8 +17,7 @@ class ChildVaccinesPage extends StatefulWidget { _ChildVaccinesPageState createState() => _ChildVaccinesPageState(); } -class _ChildVaccinesPageState extends State - with SingleTickerProviderStateMixin { +class _ChildVaccinesPageState extends State with SingleTickerProviderStateMixin { TextEditingController titleController = TextEditingController(); var checkedValue = false; String addEmail = ""; @@ -30,9 +28,17 @@ class _ChildVaccinesPageState extends State onModelReady: (model) => model.getUserInformationRequestOrders(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - baseViewModel: model, + isShowDecPage: true, + description: TranslationBase.of(context).childVaccineInfo, + imagesInfo: [ + ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/child-vaccines/en/0.png', + imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/child-vaccines/ar/0.png'), + ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/child-vaccines/en/1.png', + imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/child-vaccines/ar/1.png') + ], appBarTitle: TranslationBase.of(context).vaccination, - //TranslationBase.of(context).advancePayment, body: SingleChildScrollView( physics: ScrollPhysics(), child: Column( @@ -80,16 +86,14 @@ class _ChildVaccinesPageState extends State margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( fillColor: Colors.red, - hintText: model.user.emailAddress, + hintText: model.user != null ? model.user.emailAddress : "", controller: titleController, fontSize: 20, hintColor: Colors.black, fontWeight: FontWeight.w600, onChanged: (text) { addEmail = text; - model.user.emailAddress == addEmail - ? checkedValue = false - : checkedValue = true; + model.user.emailAddress == addEmail ? checkedValue = false : checkedValue = true; }, validator: (value) { if (value == null) { @@ -119,8 +123,7 @@ class _ChildVaccinesPageState extends State // onTap: () { model.user.emailAddress = addEmail.toString(); - AppToast.showSuccessToast( - message: TranslationBase.of(context).updateEmailMsg); + AppToast.showSuccessToast(message: TranslationBase.of(context).updateEmailMsg); // bloodDetails.city=_selectedHospital.toString(); // bloodDetails. diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart index d85971bb..01e03e6c 100644 --- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart @@ -4,6 +4,7 @@ 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/defaultButton.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'; @@ -37,182 +38,89 @@ class _HospitalsLiveChatPageState extends State { builder: (_, model, widget) => AppScaffold( baseViewModel: model, isShowDecPage: false, - body: SingleChildScrollView( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Stack( + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 70, - ), - Container( - width: double.infinity, - height: 230, + Text( + TranslationBase.of(context).instructions, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + ), + SizedBox(height: 20), + Text( + TranslationBase.of(context).selectHospitalDec + " :", + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + ), + SizedBox(height: 20), + ListView.separated( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + separatorBuilder: (context, index) => SizedBox(height: 14), + itemCount: model.LiveChatModelList.length, + itemBuilder: (context, index) => InkWell( + 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=${projectViewModel.currentLanguage}&WorkGroup=${model.LiveChatModelList[index].value}"; + }); + }, + child: Container( + padding: EdgeInsets.only(right: 12, left: 18, top: 16, bottom: 16), decoration: BoxDecoration( - image: DecorationImage( - image: ExactAssetImage( - 'assets/images/dashboard_top_bg.png'), - fit: BoxFit.cover), - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - 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, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + blurRadius: 27, + offset: Offset(0, -3), ), ], - ), + color: tappedIndex == index ? Color(0xff28323A).withOpacity(.7) : Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Text( + model.LiveChatModelList[index]?.projectName ?? "", + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: tappedIndex == index ? Colors.white : Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + ), + ), + Icon( + Icons.arrow_forward_ios, + color: tappedIndex == index ? Colors.white : Colors.black, + ), + ], ), ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.85, - ), - SizedBox( - height: 100, - ), - ], - ), - Positioned( - left: 13, - right: 13, - top: 200, - child: Container( - width: double.maxFinite, - child: Column( - children: [ - ...List.generate( - model.LiveChatModelList.length, - (index) => Container( - margin: EdgeInsets.only( - left: 0, right: 0, bottom: 20), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all( - color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all( - Radius.circular(5)), - color: tappedIndex == index - ? Theme.of(context).primaryColor - : Colors.white, - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - InkWell( - 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=${projectViewModel.currentLanguage}&WorkGroup=${model.LiveChatModelList[index].value}"; - }); - }, - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceAround, - crossAxisAlignment: - CrossAxisAlignment.center, - children: [ - SizedBox( - width: 20, - ), - Expanded( - child: Container( - margin: - EdgeInsets.only( - left: 5, - right: 5), - child: Texts( - '${model.LiveChatModelList[index].projectName}', - color: - tappedIndex == - index - ? Colors - .white - : Colors - .black, - textAlign: TextAlign - .center, - ))), - //model.cOCItemList[index].cOCTitl - IconButton( - icon: Icon( - Icons.arrow_forward_ios, - color: - tappedIndex == index - ? Colors.white - : Colors.black, - ), - tooltip: '', - onPressed: () { - setState(() {}); - }, - ), - ], - ), - ) - ], - ), - ), - )), - ], - ), ), ), ], ), - Container( - height: MediaQuery.of(context).size.height * 0.20, - width: double.maxFinite, - ) - ], + ), ), - ), - ), - bottomSheet: Container( - 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.07, - width: MediaQuery.of(context).size.width * 0.8, - child: SecondaryButton( - label: TranslationBase.of(context).start, - loading: model.state == ViewState.BusyLocal, - textColor: Colors.white, - disabled: chat.isEmpty, - onTap: () { - launch(chat); - }, + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).start, + chat.isEmpty ? null : () => {launch(chat)}, + color: Color(0xffD02127), + textColor: chat.isEmpty ? Color(0xff000000) : Colors.white, + disabledColor: Color(0xffEAEAEA), ), ), - ), + ], ), ), ); diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart index e3826396..0f1bc517 100644 --- a/lib/pages/ContactUs/LiveChat/livechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -2,6 +2,7 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart'; +import 'package:diplomaticquarterapp/theme/colors.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'; @@ -15,17 +16,19 @@ class LiveChatPage extends StatefulWidget { _LiveChatPageState createState() => _LiveChatPageState(); } -class _LiveChatPageState extends State - with SingleTickerProviderStateMixin { +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')); + 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); } @@ -44,84 +47,42 @@ class _LiveChatPageState extends State title: TranslationBase.of(context).liveChat, description: TranslationBase.of(context).infoChat, appBarTitle: TranslationBase.of(context).service, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), - height: 70.0, - ), - ), - ), - Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.92, // 0.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, - width: 0.9), //width: 0.7 - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - indicatorColor: Theme.of(context).primaryColor, - labelColor: Theme.of(context).primaryColor, - 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(TranslationBase.of(context).hospitals), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: Texts(TranslationBase.of(context).pharmacies), - ), - ), - ], - ), - ), - ), - ), - ], + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGrey2Color, + body: Column( + children: [ + TabBar( + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [Text(TranslationBase.of(context).hospitals), Text(TranslationBase.of(context).pharmacies)], ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [ - HospitalsLiveChatPage(), //SendFeedbackPage(), - PhamaciesLiveChatPage() - //StatusFeedbackPage() - ], - ), - ) - ], - ), + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + HospitalsLiveChatPage(), //SendFeedbackPage(), + PharmaciesLiveChatPage() + //StatusFeedbackPage() + ], + ), + ) + ], ), ); } diff --git a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart index 26ccc1fc..9657e234 100644 --- a/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/pharmaciesLivechat_page.dart @@ -5,6 +5,7 @@ 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/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -13,21 +14,8 @@ import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; -class PhamaciesLiveChatPage extends StatefulWidget { - @override - _PhamaciesLiveChatPageState createState() => _PhamaciesLiveChatPageState(); -} - -class _PhamaciesLiveChatPageState extends State { - int tappedIndex; - String chat; - - @override - void initState() { - super.initState(); - tappedIndex = -1; - chat = ""; - } +class PharmaciesLiveChatPage extends StatelessWidget { + PharmaciesLiveChatPage({Key key}) : super(key: key); @override Widget build(BuildContext context) { @@ -36,53 +24,43 @@ class _PhamaciesLiveChatPageState extends State { builder: (_, model, widget) => AppScaffold( baseViewModel: model, isShowDecPage: false, - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.only(left: 15, right: 15), - child: Column( - children: [ - SizedBox( - height: 20, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox(height: 20), + Text( + TranslationBase.of(context).instructions, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + ), + ], ), - Container( - width: double.infinity, - height: 200, - - child: Texts( - TranslationBase.of(context).instructionsPharmacies, - color: Colors.black, - textAlign: TextAlign.center, - ), - ), - /////////// - - SizedBox( - height: 100, - ), - ], + ), ), - ), - ), - bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.11, - width: double.infinity, - padding: EdgeInsets.all(8.0), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.7, - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - label: TranslationBase.of(context).start, - loading: model.state == ViewState.BusyLocal, - onTap: () { - print("chat=" + chat); + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).start, + () { + String chat; chat = - "http://chat.dshmg.com:7788/EPharmacyChat/EIndex.aspx?CustomerID=undefined&Name=${model.user.firstName}&MobileNo=${model.user.mobileNumber}&Language=${projectViewModel.isArabic? 1:2}"; + "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); }, + color: Color(0xffD02127), + textColor: Colors.white, + disabledColor: Color(0xffEAEAEA), ), ), - ), + ], ), ), ); diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart index 7d2bd31d..41dcdf58 100644 --- a/lib/pages/ContactUs/findus/hospitrals_page.dart +++ b/lib/pages/ContactUs/findus/hospitrals_page.dart @@ -195,178 +195,5 @@ class _HospitalsPageState extends State { ], ), ); - - AppScaffold( - isShowDecPage: false, - body: SingleChildScrollView( - child: Container( - // margin: EdgeInsets.only(left: 15,right: 15,top: 70), - margin: EdgeInsets.only(left: 15, right: 15, top: 70), - child: Column( - children: [ - ...List.generate( - widget.findusHospitalModelList.length, - (index) => Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - InkWell( - onTap: () { - showDialog( - context: context, - builder: (_) => AssetGiffyDialog( - title: Text( - widget.findusHospitalModelList[index].locationName, - style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600), - ), - image: Image.network( - widget.findusHospitalModelList[index].projectImageURL.toString(), - fit: BoxFit.cover, - ), - buttonCancelText: Text('cancel'), - buttonCancelColor: Colors.grey, - onlyCancelButton: true, - )); - }, - child: Container(width: 70, height: 70, child: Image.network(widget.findusHospitalModelList[index].projectImageURL.toString())), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.only(left: 5, right: 5, top: 10, bottom: 1), - child: Texts( - '${widget.findusHospitalModelList[index].locationName}', - textAlign: TextAlign.start, - ))), //model.cOCItemList[index].cOCTitl - Expanded( - flex: 2, - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - IconButton( - icon: Icon( - Icons.location_on, - color: Theme.of(context).primaryColor, - size: 35, - ), - // icon: new Image.asset( - // 'assets/images/new-design/navigate.png'), - tooltip: '', - onPressed: () { - setState(() { - MapsLauncher.launchCoordinates(double.parse(widget.findusHospitalModelList[index].latitude), - double.parse(widget.findusHospitalModelList[index].longitude), widget.findusHospitalModelList[index].locationName); - }); - }, - ), - IconButton( - icon: Icon( - Icons.phone, - color: Theme.of(context).primaryColor, - size: 35, - ), - // icon: new Image.asset( - // 'assets/images/new-design/call.png'), - tooltip: '', - onPressed: () { - setState(() { - // _volume += 10; - launch("tel://" + widget.findusHospitalModelList[index].phoneNumber); - }); - }, - ), - ], - ), - ), - ], - ), - ), - ], - ), - // Texts('${model.FindusHospitalModelList[index].locationName}'), - Divider( - height: 4.5, - color: Colors.grey[500], - ) - ], - ), - ), - )), - SizedBox( - height: 8, - ), - Container( - width: double.infinity, - height: 100, - color: Colors.white, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - IconButton( - icon: new Image.asset('assets/images/new-design/youtube.png'), - iconSize: 70, - tooltip: 'Youtube', - onPressed: () { - setState(() { - launch("https://www.youtube.com/c/DrsulaimanAlhabibHospitals"); - }); - }, - ), - IconButton( - icon: new Image.asset('assets/images/new-design/linkedin.png'), - tooltip: 'LinkedIn', - iconSize: 70, - onPressed: () { - setState(() { - launch("https://www.linkedin.com/company/drsulaiman-alhabib-medical-group"); - }); - }, - ), - IconButton( - icon: new Image.asset('assets/images/new-design/twitter.png'), - tooltip: 'Twitter', - iconSize: 70, - onPressed: () { - setState(() { - launch("https://twitter.com/HMG"); - }); - }, - ), - IconButton( - icon: new Image.asset('assets/images/new-design/facebook.png'), - tooltip: 'facebook', - iconSize: 70, - onPressed: () { - setState(() { - launch("https://www.facebook.com/DrSulaimanAlHabib?ref=tn_tnmn"); - }); - }, - ), - ], - ), - ), - ], - ), - ), - ), - ); } } diff --git a/lib/pages/ContactUs/widgets/card_common_contat.dart b/lib/pages/ContactUs/widgets/card_common_contat.dart index fb8fe6b6..b6a2640d 100644 --- a/lib/pages/ContactUs/widgets/card_common_contat.dart +++ b/lib/pages/ContactUs/widgets/card_common_contat.dart @@ -38,7 +38,12 @@ class CardCommonContact extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Image.asset(this.image, width: 42.0, height: 42.0), + Image.asset( + this.image, + width: 42.0, + height: 42.0, + color: Color(0xff2E303A), + ), Text( text + "${subText.isEmpty ? "" : "\n$subText"}", style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), diff --git a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart index ed048b9f..0f07081f 100644 --- a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart +++ b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart @@ -152,6 +152,7 @@ class CovidDirveThruQuestionsState extends State { service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { + covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); Navigator.push( context, FadePage( diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 3846c03b..4040abf5 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'covid-dirvethru-questions.dart'; @@ -34,15 +33,14 @@ class _CovidDrivethruLocationState extends State { String projectID = ""; List imagesInfo = List(); + DriveThroughTestingCenterModel selectedProject; + ProjectViewModel projectViewModel; @override void initState() { imagesInfo.add( - ImagesInfo( - imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', - imageAr: - 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'), + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'), ); WidgetsBinding.instance.addPostFrameCallback((_) { if (projectViewModel.isLogin) { @@ -56,9 +54,7 @@ class _CovidDrivethruLocationState extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - imagesInfo.add(ImagesInfo( - imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', - imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png')); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png')); return AppScaffold( appBarTitle: TranslationBase.of(context).covidTest, isShowAppBar: true, @@ -72,31 +68,17 @@ class _CovidDrivethruLocationState extends State { mainAxisSize: MainAxisSize.max, children: [ Container( - alignment: projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Text(TranslationBase.of(context).resultHeader, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 22.0, - color: Colors.black)), + alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, + child: Text(TranslationBase.of(context).resultHeader, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 22.0, color: Colors.black)), ), Container( margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).covidInfo, - style: TextStyle(fontSize: 16.0, color: Colors.black)), + child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 16.0, color: Colors.black)), ), Container( margin: EdgeInsets.only(top: 20.0), - alignment: projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Text(TranslationBase.of(context).selectLocation, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18.0, - letterSpacing: 0.8, - color: Colors.grey[700])), + alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, + child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.grey[700])), ), Container( height: 60.0, @@ -112,18 +94,18 @@ class _CovidDrivethruLocationState extends State { width: MediaQuery.of(context).size.width, margin: EdgeInsets.only(top: 15.0), child: DropdownButtonHideUnderline( - child: DropdownButton( + child: DropdownButton( hint: new Text(TranslationBase.of(context).selectAddress), - value: projectDropdownValue, - items: projectsList.map((item) { - return new DropdownMenuItem( - value: item.iD.toString(), + value: selectedProject, + items: projectsList.map((DriveThroughTestingCenterModel item) { + return new DropdownMenuItem( + value: item, child: new Text(item.projectName), ); }).toList(), onChanged: (newValue) { setState(() { - projectDropdownValue = newValue; + selectedProject = newValue; setProjectLocation(newValue); }); }, @@ -132,15 +114,8 @@ class _CovidDrivethruLocationState extends State { isLocationSelected ? Container( margin: EdgeInsets.only(top: 15.0), - alignment: projectViewModel.isArabic - ? Alignment.centerRight - : Alignment.centerLeft, - child: Text(TranslationBase.of(context).selectLocation, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 18.0, - letterSpacing: 0.8, - color: Colors.black)), + alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft, + child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.black)), ) : Container(), isLocationSelected @@ -149,16 +124,15 @@ class _CovidDrivethruLocationState extends State { decoration: BoxDecoration( border: Border.all(color: Colors.grey[400], width: 1.0), ), - child: Image.network( - "https://maps.googleapis.com/maps/api/staticmap?center=" + - this.projectLat + - "," + - this.projectLong + - "&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" + - this.projectLat + - "," + - this.projectLong + - "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"), + child: Image.network("https://maps.googleapis.com/maps/api/staticmap?center=" + + this.projectLat + + "," + + this.projectLong + + "&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" + + this.projectLat + + "," + + this.projectLong + + "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"), ) : SizedBox( height: MediaQuery.of(context).size.height * 0.35, @@ -184,8 +158,7 @@ class _CovidDrivethruLocationState extends State { onPressed: () { getDirections(); }, - child: Text(TranslationBase.of(context).getDirections, - style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).getDirections, style: TextStyle(fontSize: 18.0)), ), ), ), @@ -202,8 +175,7 @@ class _CovidDrivethruLocationState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: - MediaQuery.of(context).size.width * 0.7, + minWidth: MediaQuery.of(context).size.width * 0.7, height: 45.0, child: RaisedButton( color: new Color(0xFF60686b), @@ -213,8 +185,7 @@ class _CovidDrivethruLocationState extends State { onPressed: () { back(); }, - child: Text(TranslationBase.of(context).back, - style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).back, style: TextStyle(fontSize: 18.0)), ), ), ), @@ -227,8 +198,7 @@ class _CovidDrivethruLocationState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10.0), ), - minWidth: - MediaQuery.of(context).size.width * 0.7, + minWidth: MediaQuery.of(context).size.width * 0.7, height: 45.0, child: RaisedButton( color: new Color(0xFF60686b), @@ -238,8 +208,7 @@ class _CovidDrivethruLocationState extends State { onPressed: () { next(); }, - child: Text(TranslationBase.of(context).next, - style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)), ), ), ), @@ -259,22 +228,17 @@ class _CovidDrivethruLocationState extends State { getDirections() { if (isLocationSelected) { - MapsLauncher.launchCoordinates(double.parse(projectLat), - double.parse(projectLong), this.projectName); + MapsLauncher.launchCoordinates(double.parse(projectLat), double.parse(projectLong), this.projectName); } else { - Utils.showErrorToast( - "Please select address from the dropdown menu to get directions"); + Utils.showErrorToast("Please select address from the dropdown menu to get directions"); } } next() { if (isLocationSelected) { - Navigator.push( - context, - FadePage(page: CovidDirveThruQuestions(projectId: projectID, proceduresList: proceduresList,))); + Navigator.push(context, FadePage(page: CovidDirveThruQuestions(projectId: projectID, proceduresList: proceduresList))); } else { - Utils.showErrorToast( - "Please select address from the dropdown menu to continue"); + Utils.showErrorToast("Please select address from the dropdown menu to continue"); } } @@ -282,34 +246,25 @@ class _CovidDrivethruLocationState extends State { Navigator.of(context).popAndPushNamed(HOME); } - setProjectLocation(newValue) { - print(newValue); + setProjectLocation(DriveThroughTestingCenterModel newValue) { setState(() { - this.projectLat = - projectsList[(int.parse(newValue) - 1)].latitude.toString(); - this.projectLong = - projectsList[(int.parse(newValue) - 1)].longitude.toString(); - this.projectName = projectsList[(int.parse(newValue) - 1)].projectName; - this.projectID = - projectsList[(int.parse(newValue) - 1)].projectID.toString(); + this.projectLat = newValue.latitude.toString(); + this.projectLong = newValue.longitude.toString(); + this.projectName = newValue.projectName; + this.projectID = newValue.projectID.toString(); isLocationSelected = true; }); } getPaymentInfo(BuildContext context, String projectID) { CovidDriveThruService service = new CovidDriveThruService(); - CovidPaymentInfoResponse covidPaymentInfoResponse = - new CovidPaymentInfoResponse(); + CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse(); GifLoaderDialogUtils.showMyDialog(context); - service - .getCovidPaymentInformation( - context, int.parse(projectID), proceduresList[0].procedureID) - .then((res) { + service.getCovidPaymentInformation(context, int.parse(projectID), proceduresList[0].procedureID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { - covidPaymentInfoResponse = - CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); + covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); }); Navigator.push( context, @@ -329,8 +284,7 @@ class _CovidDrivethruLocationState extends State { CovidDriveThruService service = new CovidDriveThruService(); GifLoaderDialogUtils.showMyDialog(context); - CovidTestProceduresResponse covidTestProceduresResponse = - new CovidTestProceduresResponse(); + CovidTestProceduresResponse covidTestProceduresResponse = new CovidTestProceduresResponse(); service.getCovidTestProceduresList(context).then((res) { if (res['MessageStatus'] == 1) { diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index 488dd3bf..67b973fe 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -30,7 +30,6 @@ class _CovidPaymentDetailsState extends State { @override void initState() { - print(widget.proceduresList[0].procedureName); widget.selectedProcedure = widget.proceduresList[0]; super.initState(); } @@ -336,14 +335,6 @@ class _CovidPaymentDetailsState extends State { widget.covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); }); - // Navigator.push( - // context, - // FadePage( - // page: CovidPaymentDetails( - // covidPaymentInfoResponse: covidPaymentInfoResponse, - // projectID: int.parse(projectID), - // proceduresList: proceduresList, - // ))); } else {} }).catchError((err) { print(err); diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index e71285b5..c3c70578 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -191,6 +191,8 @@ class _CovidPaymentSummaryState extends State { authenticatedUser, widget.browser, widget.patientShareResponse.isLiveCareAppointment, + null, + null, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo, widget.patientShareResponse.clinicID, diff --git a/lib/pages/ErService/EdOnline/DdServicesPage.dart b/lib/pages/ErService/EdOnline/DdServicesPage.dart index 7395b901..47f73c42 100644 --- a/lib/pages/ErService/EdOnline/DdServicesPage.dart +++ b/lib/pages/ErService/EdOnline/DdServicesPage.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/er/TriageInformationRequest.dart import 'package:diplomaticquarterapp/core/model/er/TriageQuestionsModel.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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'; @@ -44,36 +45,39 @@ class _DdServicesPageState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return Scaffold( - appBar: AppBar( - elevation: 0, - textTheme: TextTheme( - headline6: TextStyle( - color: Theme.of(context).textTheme.headline1.color, - fontWeight: FontWeight.bold), - ), - title: Text( - 'ED Online', - style: TextStyle( - fontWeight: FontWeight.bold, - color: Theme.of(context).textTheme.headline1.color, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), - // bold: true, - // color: Colors.white, - ), - leading: Builder( - builder: (BuildContext context) { - return IconButton( - icon: Icon(Icons.arrow_back), - color: Theme.of(context).textTheme.headline1.color, - onPressed: () { - showConfirmMessage(context); - }, - ); - }, - ), - centerTitle: true, - ), + return AppScaffold( + appBarTitle: 'ED Online', + isShowDecPage: true, + isShowAppBar: true, + // appBarTitle: AppBar( + // elevation: 0, + // textTheme: TextTheme( + // headline6: TextStyle( + // color: Theme.of(context).textTheme.headline1.color, + // fontWeight: FontWeight.bold), + // ), + // title: Text( + // 'ED Online', + // style: TextStyle( + // fontWeight: FontWeight.bold, + // color: Theme.of(context).textTheme.headline1.color, + // fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), + // // bold: true, + // // color: Colors.white, + // ), + // leading: Builder( + // builder: (BuildContext context) { + // return IconButton( + // icon: Icon(Icons.arrow_back), + // color: Theme.of(context).textTheme.headline1.color, + // onPressed: () { + // showConfirmMessage(context); + // }, + // ); + // }, + // ), + // centerTitle: true, + // ), body: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 6cc61195..8b3e03ed 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -44,7 +44,7 @@ class _ErOptionsState extends State { return AppScaffold( isShowAppBar: widget.isAppbar, - appBarTitle: TranslationBase.of(context).bookAppo, + appBarTitle: TranslationBase.of(context).emergencyServices, isShowDecPage: false, showNewAppBar: true, showNewAppBarTitle: true, diff --git a/lib/pages/ErService/NearestEr.dart b/lib/pages/ErService/NearestEr.dart index 0ecb19a7..57a3a8ae 100644 --- a/lib/pages/ErService/NearestEr.dart +++ b/lib/pages/ErService/NearestEr.dart @@ -1,16 +1,15 @@ -import 'package:diplomaticquarterapp/core/viewModels/er/near_hospital_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/uitl/location_util.dart'; +import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart'; +import 'package:diplomaticquarterapp/core/service/er/er_service.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import '../../uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; import 'widgets/card_position.dart'; -class NearestEr extends StatelessWidget { +class NearestEr extends StatefulWidget { static const String _url = "assets/images/"; int appointmentNo; @@ -18,92 +17,89 @@ class NearestEr extends StatelessWidget { NearestEr({this.appointmentNo, this.projectID}); + @override + _NearestErState createState() => _NearestErState(); +} + +class _NearestErState extends State { + List projectAvgERWaitingTimeModelList = List(); + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((_) => getERList()); + super.initState(); + } + @override Widget build(BuildContext context) { var size = MediaQuery.of(context).size; final double itemHeight = (size.height - kToolbarHeight - 24) / 2; final double itemWidth = size.width / 2; - return BaseView( - onModelReady: appointmentNo != null && projectID != null - ? (model) => model.getProjectAvgERWaitingTimeOrders( - id: appointmentNo, projectID: projectID) - : (model) => model.getProjectAvgERWaitingTimeOrders(), - builder: (_, mode, widget) => AppScaffold( - isShowAppBar: true, - isShowDecPage: false, - appBarTitle: TranslationBase.of(context).NearestEr, - baseViewModel: mode, - body: mode.ProjectAvgERWaitingTimeModeList.length > 0 - ? Container( - child: ListView( - children: [ - Text( - "${TranslationBase.of(context).NearestErDesc}", - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 18.0, - letterSpacing: 1.0, - fontWeight: FontWeight.w900, - color: new Color(0xFF60686b))), - Container( - margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0), - child: GridView.count( - crossAxisCount: 2, - childAspectRatio: (itemWidth / itemWidth), - crossAxisSpacing: 10, - mainAxisSpacing: 10, - controller: - new ScrollController(keepScrollOffset: false), - shrinkWrap: true, - padding: const EdgeInsets.all(4.0), - children: List.generate(7, (index) { - return Container( - child: CardPosition( - waitingTime: mode - .ProjectAvgERWaitingTimeModeList[index] - .avgTimeInHHMM - .toString(), - text: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectName - .toString(), - image: - 'assets/images/new-design/find_us_icon.png', - subText: '${mode.ProjectAvgERWaitingTimeModeList[index].distanceInKilometers ?? 0.0} ${TranslationBase.of(context).km_}', - type: mode - .ProjectAvgERWaitingTimeModeList[index].iD - .toString(), - telephone: mode - .ProjectAvgERWaitingTimeModeList[index] - .phoneNumber - .toString(), - networkImage: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectImageURL - .toString(), - latitude: mode - .ProjectAvgERWaitingTimeModeList[index] - .latitude, - longitude: mode - .ProjectAvgERWaitingTimeModeList[index] - .longitude, - projectname: mode - .ProjectAvgERWaitingTimeModeList[index] - .projectName, - cardSize: itemWidth, - ), - ); - }), - ), + return AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + appBarTitle: TranslationBase.of(context).NearestEr, + body: projectAvgERWaitingTimeModelList.length > 0 + ? Container( + child: ListView( + children: [ + Text("${TranslationBase.of(context).NearestErDesc}", + textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, letterSpacing: 1.0, fontWeight: FontWeight.w900, color: new Color(0xFF60686b))), + Container( + margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0), + child: GridView.count( + crossAxisCount: 2, + childAspectRatio: (itemWidth / itemWidth), + crossAxisSpacing: 10, + mainAxisSpacing: 10, + controller: new ScrollController(keepScrollOffset: false), + shrinkWrap: true, + padding: const EdgeInsets.all(4.0), + children: List.generate(7, (index) { + return Container( + child: CardPosition( + waitingTime: projectAvgERWaitingTimeModelList[index].avgTimeInHHMM.toString(), + text: projectAvgERWaitingTimeModelList[index].projectName.toString(), + image: 'assets/images/new-design/find_us_icon.png', + subText: '${projectAvgERWaitingTimeModelList[index].distanceInKilometers ?? 0.0} ${TranslationBase.of(context).km_}', + type: projectAvgERWaitingTimeModelList[index].iD.toString(), + telephone: projectAvgERWaitingTimeModelList[index].phoneNumber.toString(), + networkImage: projectAvgERWaitingTimeModelList[index].projectImageURL.toString(), + latitude: projectAvgERWaitingTimeModelList[index].latitude, + longitude: projectAvgERWaitingTimeModelList[index].longitude, + projectname: projectAvgERWaitingTimeModelList[index].projectName, + cardSize: itemWidth, + ), + ); + }), ), - ], - ), - ) - : Center( - child: Texts('No Data'), + ), + ], ), - ), + ) + : Center( + child: Texts('No Data'), + ), ); } + + getERList() async { + GifLoaderDialogUtils.showMyDialog(context); + ErService service = new ErService(); + service.getProjectAvgERWaitingTimeOrders().then((response) { + if (response['MessageStatus'] == 1) { + setState(() { + projectAvgERWaitingTimeModelList.clear(); + response['List_ProjectAvgERWaitingTime'].forEach((vital) { + projectAvgERWaitingTimeModelList.add(ProjectAvgERWaitingTime.fromJson(vital)); + }); + }); + GifLoaderDialogUtils.hideDialog(context); + } else {} + }).catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + }); + } } diff --git a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart index 905d0810..9ee7bd1c 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-main-screen.dart @@ -1,4 +1,4 @@ - +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-logs-page.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-request-page.dart'; @@ -8,13 +8,12 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class RRTMainScreen extends StatefulWidget{ +class RRTMainScreen extends StatefulWidget { @override State createState() => RRTMainScreenState(); } -class RRTMainScreenState extends State with SingleTickerProviderStateMixin{ - +class RRTMainScreenState extends State with SingleTickerProviderStateMixin { int currentIndex = 0; TabController tabController; PageController pageController = PageController(initialPage: 0, keepPage: true); @@ -22,84 +21,85 @@ class RRTMainScreenState extends State with SingleTickerProvider RRTViewModel viewModel; bool loadingData; + List imagesInfo = List(); + @override void initState() { super.initState(); + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/RRT/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/RRT/ar/0.png')); tabController = TabController(length: 2, vsync: this); } TranslationBase localize; + @override Widget build(BuildContext context) { localize = TranslationBase.of(context); return AppScaffold( - appBarTitle: localize.rapidResponseTeam, - isShowAppBar: true, - body: BaseView( - onModelReady: (vm) async { - viewModel = vm; - loadingData = true; - await vm.loadRequiredData().then((value){ - }).whenComplete(() => setState(() => loadingData = false)); - }, - builder: (ctx, vm, widget) => content(), - ) - ); + appBarTitle: localize.rapidResponseTeam, + isShowAppBar: true, + description: TranslationBase.of(context).rrtDDetails, + imagesInfo: imagesInfo, + body: BaseView( + onModelReady: (vm) async { + viewModel = vm; + loadingData = true; + await vm.loadRequiredData().then((value) {}).whenComplete(() => setState(() => loadingData = false)); + }, + builder: (ctx, vm, widget) => content(), + )); } - Widget content(){ - if(loadingData == true){ + Widget content() { + if (loadingData == true) { return Center(child: CircularProgressIndicator()); // else if(viewModel.state == ViewState.Error) - }else if(viewModel.rrtServiceData != null && viewModel.rrtServiceData.servicePrice != null){ + } else if (viewModel.rrtServiceData != null && viewModel.rrtServiceData.servicePrice != null) { return Column( - children: [ - tabBar(), - Expanded( - child: contentPager() - ) - ], + children: [tabBar(), Expanded(child: contentPager())], ); - }else{ + } else { return Container( alignment: Alignment.center, - child: Text(localize.somethingWentWrongTryLater, style: TextStyle(color: Colors.red), maxLines: 5,), + child: Text( + localize.somethingWentWrongTryLater, + style: TextStyle(color: Colors.red), + maxLines: 5, + ), ); } } Widget tabBar() => Container( - margin: EdgeInsets.all(15), - clipBehavior: Clip.hardEdge, - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)), - child: TabBar( - onTap: onPageChanged, - indicatorWeight: 3, - indicatorColor: Color(0xFFc5272d), - isScrollable: false, - controller: tabController, - indicatorSize: TabBarIndicatorSize.label, - tabs: [ + margin: EdgeInsets.all(15), + clipBehavior: Clip.hardEdge, + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)), + child: TabBar(onTap: onPageChanged, indicatorWeight: 3, indicatorColor: Color(0xFFc5272d), isScrollable: false, controller: tabController, indicatorSize: TabBarIndicatorSize.label, tabs: [ Tab( - child: Text(localize.rapidResponseTeam, style: TextStyle(color: Theme.of(context).appBarTheme.color),), + child: Text( + localize.rapidResponseTeam, + style: TextStyle(color: Theme.of(context).appBarTheme.color), + ), ), Tab( - child: Text(localize.orderLog, style: TextStyle(color: Theme.of(context).appBarTheme.color),), + child: Text( + localize.orderLog, + style: TextStyle(color: Theme.of(context).appBarTheme.color), + ), ), - ] - ), - ); + ]), + ); Widget contentPager() => PageView( - onPageChanged: onPageChanged, - controller: pageController, - children: [ - RRTRequestPage(servicePrice: viewModel.rrtServiceData.servicePrice, pendingOrders: viewModel.rrtServiceData.pendingOrders), - RRTLogPage(orders: viewModel.rrtServiceData.completedOrders), - ], - ); + onPageChanged: onPageChanged, + controller: pageController, + children: [ + RRTRequestPage(servicePrice: viewModel.rrtServiceData.servicePrice, pendingOrders: viewModel.rrtServiceData.pendingOrders), + RRTLogPage(orders: viewModel.rrtServiceData.completedOrders), + ], + ); void onPageChanged(int index) { pageController.animateToPage(index, duration: Duration(milliseconds: 200), curve: Curves.easeInOut); diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index ec658c67..7450eae9 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -45,6 +45,7 @@ class _AppointmentDetailsState extends State with SingleTick List doctorDetailsList = List(); ToDoCountProviderModel toDoProvider; + ProjectViewModel projectViewModel; DoctorList doctorList = new DoctorList(); @@ -73,7 +74,7 @@ class _AppointmentDetailsState extends State with SingleTick @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); toDoProvider = Provider.of(context); @@ -158,7 +159,7 @@ class _AppointmentDetailsState extends State with SingleTick child: TabBarView( physics: NeverScrollableScrollPhysics(), children: [ - AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton), + AppointmentActions(appo: widget.appo, tabController: _tabController, enableFooterButton: enableFooterButton, projectViewModel: projectViewModel), DocAvailableAppointments(doctor: getDoctorObject(), doctorSchedule: widget.doctorSchedule, isLiveCareAppointment: widget.appo.isLiveCareAppointment) ], controller: _tabController, @@ -533,8 +534,7 @@ class _AppointmentDetailsState extends State with SingleTick setTab() async { var scheduleDoctor = await sharedPref.getObject(DOCTOR_SCHEDULE_DATE_SEL); - - widget.appo.appointmentDate = scheduleDoctor['Date']; + if (scheduleDoctor != null) widget.appo.appointmentDate = scheduleDoctor['Date']; } confirmAppointment() { diff --git a/lib/pages/MyAppointments/SchedulePage.dart b/lib/pages/MyAppointments/SchedulePage.dart index ef53ab04..10b52f10 100644 --- a/lib/pages/MyAppointments/SchedulePage.dart +++ b/lib/pages/MyAppointments/SchedulePage.dart @@ -64,6 +64,8 @@ class _SchedulePageState extends State { } return AppScaffold( appBarTitle: TranslationBase.of(context).schedule, + showNewAppBar: true, + showNewAppBarTitle: true, isShowAppBar: true, baseViewModel: model2, isShowDecPage: false, diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 9792b4b9..76f0235d 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -1,4 +1,3 @@ -import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; @@ -7,7 +6,6 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart'; - import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart'; @@ -17,23 +15,17 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButton import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButtonsAllowCheckIn.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/PrescriptionReport.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart'; -import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; - import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/laboratory_result_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; -import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; -import 'package:diplomaticquarterapp/uitl/CalendarUtils.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/data_display/medical/medical_profile_item.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -45,8 +37,9 @@ class AppointmentActions extends StatefulWidget { TabController tabController; final Function enableFooterButton; MyInAppBrowser browser; + final ProjectViewModel projectViewModel; - AppointmentActions({@required this.appo, @required this.tabController, @required this.enableFooterButton}); + AppointmentActions({@required this.appo, @required this.tabController, @required this.enableFooterButton, this.projectViewModel}); @override _AppointmentActionsState createState() => _AppointmentActionsState(); @@ -74,86 +67,25 @@ class _AppointmentActionsState extends State { padding: EdgeInsets.all(21), shrinkWrap: true, itemBuilder: (context, index) { + bool shouldEnable = (widget.appo.clinicID == 17 && appoButtonsList[index].caller == "openReschedule"); return InkWell( - onTap: () { - _handleButtonClicks(appoButtonsList[index]); - }, + onTap: shouldEnable + ? null + : () { + _handleButtonClicks(appoButtonsList[index]); + }, child: MedicalProfileItem( title: appoButtonsList[index].title, imagePath: appoButtonsList[index].icon, subTitle: appoButtonsList[index].subtitle, hasBadge: true, - isEnable: projectViewModel.havePrivilege(5), + isEnable: !shouldEnable, imgColor: Color(0xff28323A), ), ); }, itemCount: appoButtonsList.length, ); - - return Container( - margin: EdgeInsets.all(5.0), - child: CustomScrollView( - primary: false, - physics: NeverScrollableScrollPhysics(), - slivers: [ - SliverPadding( - padding: const EdgeInsets.fromLTRB(15, 0, 15, 0), - sliver: SliverGrid.count( - crossAxisCount: 2, - childAspectRatio: (itemWidth / itemHeight), - children: appoButtonsList - .map((e) => GestureDetector( - onTap: () { - _handleButtonClicks(e); - }, - child: Container( - margin: EdgeInsets.all(8.0), - padding: EdgeInsets.only(bottom: 4.0), - decoration: BoxDecoration(boxShadow: [BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)], borderRadius: BorderRadius.circular(10), color: Colors.white), - child: Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - children: [ - Container( - margin: EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 5.0), - child: Texts( - e.title, - color: Color(0xffB8382C), - variant: "overline", - fontSize: SizeConfig.textMultiplier * 1.8, - ), - ), - Container( - margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0), - child: Texts( - e.subtitle, - color: Colors.black, - variant: "overline", - fontSize: SizeConfig.textMultiplier * 1.6, - ), - ), - ], - ), - ), - Container( - alignment: projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, - margin: projectViewModel.isArabic ? EdgeInsets.fromLTRB(10.0, 7.0, 0.0, 8.0) : EdgeInsets.fromLTRB(0.0, 7.0, 10.0, 8.0), - child: Image.asset(e.icon, width: 40.0, height: 40.0), - ), - ], - ), - ), - )) - .toList(), - ), - ), - ], - ), - ); } _handleButtonClicks(AppoDetailsButton) { @@ -164,65 +96,40 @@ class _AppointmentActionsState extends State { widget.enableFooterButton(); }); break; - - // case "onCancelAppointment": - // ConfirmDialog dialog = new ConfirmDialog( - // context: context, - // confirmMessage: TranslationBase.of(context).cancelAppoMsg, - // okText: TranslationBase.of(context).confirm, - // cancelText: TranslationBase.of(context).cancel_nocaps, - // okFunction: () => {cancelAppointment()}, - // cancelFunction: () => {}); - // dialog.showAlertDialog(context); - // break; - - // case "confirmAppointment": - // confirmAppointment(); - // break; - case "navigateToProject": openMap(double.parse(widget.appo.latitude), double.parse(widget.appo.longitude)); break; - case "addReminder": - // showReminderDialog(widget.appo); showReminderDialog( context, DateUtil.convertStringToDate(widget.appo.appointmentDate), widget.appo.doctorNameObj, "", - DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate)), + DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate), widget.projectViewModel.isArabic), DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.appo.appointmentDate)), onSuccess: () { AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); }, ); break; - case "goToTodoList": Navigator.of(context).pop(); break; - case "askDoc": askYourDoc(); break; - case "radiology": openAppointmentRadiology(); break; - case "labResult": openAppointmentLabResults(); break; - case "prescriptions": openPrescriptionReport(); break; - case "Survey": rateAppointment(); break; - case "Insurance": navigateToInsuranceApprovals(widget.appo.appointmentNo); break; @@ -438,7 +345,17 @@ class _AppointmentActionsState extends State { patientLabOrders.orderNo = res['ListLabResultsByAppNo'][0]['OrderNo'].toString(); patientLabOrders.invoiceNo = res['ListLabResultsByAppNo'][0]['InvoiceNo'].toString(); patientLabOrders.clinicID = widget.appo.clinicID; + patientLabOrders.clinicDescription = widget.appo.clinicName; patientLabOrders.projectID = widget.appo.projectID.toString(); + patientLabOrders.doctorName = widget.appo.doctorNameObj; + patientLabOrders.doctorImageURL = widget.appo.doctorImageURL; + patientLabOrders.speciality = widget.appo.doctorSpeciality; + patientLabOrders.projectName = widget.appo.projectName; + patientLabOrders.orderDate = DateUtil.convertStringToDate(widget.appo.appointmentDate); + patientLabOrders.doctorRate = widget.appo.doctorRate; + patientLabOrders.actualDoctorRate = widget.appo.actualDoctorRate; + patientLabOrders.noOfPatientsRate = widget.appo.noOfPatientsRate; + print(patientLabOrders.invoiceNo); print(patientLabOrders.orderNo); navigateToLabResults(patientLabOrders); @@ -516,36 +433,6 @@ class _AppointmentActionsState extends State { } } - // showReminderDialog(AppoitmentAllHistoryResultList appo) { - // - // - // //old reminder dialog having location - // showGeneralDialog( - // barrierColor: Colors.black.withOpacity(0.5), - // transitionBuilder: (context, a1, a2, widget) { - // final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; - // return Transform( - // transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), - // child: Opacity( - // opacity: a1.value, - // child: ReminderDialog( - // eventId: appo.appointmentNo.toString(), - // title: "Doctor Appointment", - // description: "You have an appointment with " + appo.doctorTitle + " " + appo.doctorNameObj, - // startDate: appo.appointmentDate, - // endDate: appo.appointmentDate, - // location: appo.projectName, - // ), - // ), - // ); - // }, - // transitionDuration: Duration(milliseconds: 500), - // barrierDismissible: true, - // barrierLabel: '', - // context: context, - // pageBuilder: (context, animation1, animation2) {}); - // } - askYourDoc() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 7053d7fb..e9c096cf 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -612,6 +612,8 @@ class _ToDoState extends State { authenticatedUser, widget.browser, appo.isLiveCareAppointment, + null, + null, appo.appointmentDate, appo.appointmentNo, appo.clinicID, diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart index 15f348f9..06a7f7cd 100644 --- a/lib/pages/feedback/feedback_home_page.dart +++ b/lib/pages/feedback/feedback_home_page.dart @@ -3,6 +3,7 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/pages/feedback/send_feedback_page.dart'; +import 'package:diplomaticquarterapp/theme/colors.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'; @@ -14,14 +15,13 @@ import 'status_feedback_page.dart'; class FeedbackHomePage extends StatefulWidget { final AppoitmentAllHistoryResultList appointment; final MessageType messageType; - const FeedbackHomePage({Key key, this.appointment, this.messageType= MessageType.NON}) : super(key: key); + const FeedbackHomePage({Key key, this.appointment, this.messageType = MessageType.NON}) : super(key: key); @override _FeedbackHomePageState createState() => _FeedbackHomePageState(); } -class _FeedbackHomePageState extends State - with SingleTickerProviderStateMixin { +class _FeedbackHomePageState extends State with SingleTickerProviderStateMixin { TabController _tabController; @override @@ -43,79 +43,44 @@ class _FeedbackHomePageState extends State isBottomBar: false, isShowDecPage: false, appBarTitle: TranslationBase.of(context).feedbackTitle, - body: Scaffold( - extendBodyBehindAppBar: true, - appBar: PreferredSize( - preferredSize: Size.fromHeight(65.0), - child: Stack( - children: [ - Positioned( - bottom: 1, - left: 0, - right: 0, - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Theme.of(context) - .scaffoldBackgroundColor - .withOpacity(0.8), - height: 70.0, - ), - ), - ), - Center( - child: Container( - height: 60.0, - margin: EdgeInsets.only(top: 10.0), - width: MediaQuery.of(context).size.width * 0.9, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - color: Theme.of(context).dividerColor, width: 0.7), - ), - color: Colors.white), - child: Center( - child: TabBar( - isScrollable: true, - controller: _tabController, - indicatorWeight: 5.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Theme.of(context).primaryColor, - labelPadding: - EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), - unselectedLabelColor: Colors.grey[800], - tabs: [ - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: Texts(TranslationBase.of(context).send), - ), - ), - Container( - width: MediaQuery.of(context).size.width * 0.30, - child: Center( - child: Texts(TranslationBase.of(context).status), - ), - ), - ], - ), - ), - ), - ), - ], + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGrey2Color, + body: Column( + children: [ + TabBar( + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [Text(TranslationBase.of(context).send), Text(TranslationBase.of(context).status)], ), - ), - body: Column( - children: [ - Expanded( - child: TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController, - children: [SendFeedbackPage(appointment: widget.appointment,messageType: widget.messageType,), StatusFeedbackPage()], - ), - ) - ], - ), + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + SendFeedbackPage( + appointment: widget.appointment, + messageType: widget.messageType, + ), + StatusFeedbackPage() + ], + ), + ) + ], ), ); } diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index bbef1757..a7bfde60 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; @@ -102,447 +103,447 @@ class _SendFeedbackPageState extends State { builder: (_, model, widget) => AppScaffold( baseViewModel: model, isShowDecPage: false, - body: Container( - height: MediaQuery.of(context).size.height * 0.8, - child: SingleChildScrollView( - child: Form( - key: formKey, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 65, - ), - Container( - margin: EdgeInsets.only(left: 20, right: 20, top: 8), - child: Texts( - TranslationBase.of(context).likeToHear, - textAlign: TextAlign.center, - ), - ), - InkWell( - onTap: () { - confirmBox(model); - }, - child: Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - height: 50, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(7), - color: Colors.white, - shape: BoxShape.rectangle, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: Form( + key: formKey, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).likeToHear, + textAlign: TextAlign.center, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - child: Texts( - getSelected(context), - variant: 'bodyText', + SizedBox(height: 21), + InkWell( + onTap: () { + confirmBox(model); + }, + child: Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, ), - margin: EdgeInsets.only(left: 10, right: 10), ), - Icon( - Icons.arrow_drop_down, - size: 22, - color: Colors.grey, - ) - ], - ), - ), - ), - if (appointHistory != null && - messageType == MessageType.ComplaintOnAnAppointment) - InkWell( - onTap: () { - setState(() { - isShowListAppointHistory = true; - }); - }, - child: Container( - margin: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8) - ), - child: Row( - children: [ - Container( - width: projectViewModel.isArabic ? 27 : 20, - height: projectViewModel.isArabic ? 105 : 90, - decoration: BoxDecoration( - //Colors.red[900] Color(0xff404545) - color: appointHistory.isLiveCareAppointment - ? Color(0xff404545) - : !appointHistory.isInOutPatient - ? Colors.red[900] - : Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(0) - : Radius.circular(8), - bottomLeft: projectViewModel.isArabic - ? Radius.circular(0) - : Radius.circular(8), - topRight: projectViewModel.isArabic - ? Radius.circular(8) - : Radius.circular(0), - bottomRight: projectViewModel.isArabic - ? Radius.circular(8) - : Radius.circular(0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + getSelected(context), + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: Color(0xff2B353E), ), ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - appointHistory.isLiveCareAppointment - ? TranslationBase.of(context).liveCare.toUpperCase() - : !appointHistory.isInOutPatient - ? TranslationBase.of(context) - .inPatient - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), - style: TextStyle(color: Colors.white,fontSize: 12), + Icon( + Icons.keyboard_arrow_down, + size: 22, + color: Colors.grey, + ) + ], + ), + ), + ), + SizedBox(height: 12), + if (appointHistory != null && messageType == MessageType.ComplaintOnAnAppointment) + InkWell( + onTap: () { + setState(() { + isShowListAppointHistory = true; + }); + }, + child: Container( + // margin: EdgeInsets.all(8.0), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), + child: Row( + children: [ + Container( + width: projectViewModel.isArabic ? 27 : 20, + height: projectViewModel.isArabic ? 105 : 90, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: appointHistory.isLiveCareAppointment + ? Color(0xff404545) + : !appointHistory.isInOutPatient + ? Colors.red[900] + : Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), + topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), + bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), ), - )), - ), - Expanded( - flex: 4, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - children: [ - Expanded( - flex: 1, - child: LargeAvatar( - name: appointHistory.doctorNameObj, - url: appointHistory.doctorImageURL, - ), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + appointHistory.isLiveCareAppointment + ? TranslationBase.of(context).liveCare.toUpperCase() + : !appointHistory.isInOutPatient + ? TranslationBase.of(context).inPatient.toUpperCase() + : TranslationBase.of(context).outpatient.toUpperCase(), + style: TextStyle(color: Colors.white, fontSize: 12), ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - appointHistory.doctorNameObj, - bold: true, - ), - Texts( - DateUtil - .getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointHistory.appointmentDate)), - variant: 'caption3', + )), + ), + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + children: [ + Expanded( + flex: 1, + child: LargeAvatar( + name: appointHistory.doctorNameObj, + url: appointHistory.doctorImageURL, + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + appointHistory.doctorNameObj, + bold: true, + ), + Texts( + DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointHistory.appointmentDate)), + variant: 'caption3', + ), + StarRating(totalAverage: appointHistory.doctorRate.toDouble(), forceStars: true), + ], ), - StarRating( - totalAverage: appointHistory - .doctorRate - .toDouble(), - forceStars: true), - ], + ), ), - ), + ], ), - ], + ), + ], + ), + ), + Expanded( + flex: 1, + child: Center( + child: Icon( + Icons.arrow_forward_ios, + size: 15, ), ), - ], - ), + ) + ], ), - Expanded( - flex: 1, - child: Center( - child: Icon( - Icons.arrow_forward_ios, - size: 15, - ), - ), - ) - ], + ), ), - ), - ), - if (messageType == MessageType.ComplaintOnAnAppointment && - model.appointHistoryList.length != 0 && - isShowListAppointHistory) - Container( - height: model.appointHistoryList.length > 2 - ? MediaQuery.of(context).size.height * 0.25 - : MediaQuery.of(context).size.height * 0.15, - child: ListView.builder( - itemCount: model.appointHistoryList.length, - itemBuilder: (context, index) => InkWell( - onTap: () { - setState(() { - appointHistory = model.appointHistoryList[index]; - isShowListAppointHistory = false; - }); - }, - child: Container( - margin: EdgeInsets.only(left: 8, right: 8), - color: Colors.white, - child: Column( - children: [ - Row( + if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 && isShowListAppointHistory) + Container( + height: model.appointHistoryList.length > 2 ? MediaQuery.of(context).size.height * 0.25 : MediaQuery.of(context).size.height * 0.15, + child: ListView.builder( + itemCount: model.appointHistoryList.length, + itemBuilder: (context, index) => InkWell( + onTap: () { + setState(() { + appointHistory = model.appointHistoryList[index]; + isShowListAppointHistory = false; + }); + }, + child: Container( + margin: EdgeInsets.only(left: 8, right: 8), + color: Colors.white, + child: Column( children: [ - Expanded( - flex: 4, - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - children: [ - Expanded( - flex: 1, - child: LargeAvatar( - name: model - .appointHistoryList[ - index] - .doctorNameObj, - url: model - .appointHistoryList[ - index] - .doctorImageURL, - ), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Texts( - model - .appointHistoryList[ - index] - .doctorNameObj, - bold: true, - ), - Texts( - DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)), - variant: 'caption3', + Row( + children: [ + Expanded( + flex: 4, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + children: [ + Expanded( + flex: 1, + child: LargeAvatar( + name: model.appointHistoryList[index].doctorNameObj, + url: model.appointHistoryList[index].doctorImageURL, + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + model.appointHistoryList[index].doctorNameObj, + bold: true, + ), + Texts( + DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)), + variant: 'caption3', + ), + StarRating(totalAverage: model.appointHistoryList[index].doctorRate.toDouble(), forceStars: true), + ], ), - StarRating( - totalAverage: model - .appointHistoryList[ - index] - .doctorRate - .toDouble(), - forceStars: true), - ], + ), ), - ), + ], ), - ], + ), + ], + ), + ), + Expanded( + flex: 1, + child: Center( + child: Icon( + Icons.arrow_forward_ios, + size: 15, ), ), - ], - ), + ) + ], ), - Expanded( - flex: 1, - child: Center( - child: Icon( - Icons.arrow_forward_ios, - size: 15, - ), - ), + SizedBox( + height: 5, + ), + Divider( + height: 0.5, + color: Colors.grey[400], ) ], ), - SizedBox( - height: 5, - ), - Divider( - height: 0.5, - color: Colors.grey[400], - ) - ], + ), ), ), ), - ), - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: TranslationBase.of(context).subject, - controller: titleController, - fontSize: 13.5, - hintColor: Colors.black, - fontWeight: FontWeight.w600, - onChanged: (v) { - setState(() {}); - }, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context).emptySubject; - else - return null; - }, - ), - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: TranslationBase.of(context).message, - fontSize: 13.5, - hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: messageController, - suffixIcon: Icons.mic, - onSuffixTap: () { - openSpeechReco(); - }, - onChanged: (v) { - setState(() {}); + inputWidget(TranslationBase.of(context).subject, "xxxxxxxx", titleController), + SizedBox(height: 12), + inputWidget(TranslationBase.of(context).message, "xxxxxxxx", messageController, lines: 11, suffixTap: () { + openSpeechReco(); + }), + SizedBox(height: 12), + InkWell( + onTap: () { + ImageOptions.showImageOptions(context, (String image, File file) { + setState(() { + images.add(image); + }); + }); }, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context).emptyMessage; - else - return null; - }), - ), - InkWell( - onTap: () { - ImageOptions.showImageOptions(context, - (String image, File file) { - setState(() { - images.add(image); - }); - }); - }, - child: Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - height: 50, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(7), - color: Colors.white, - shape: BoxShape.rectangle, - ), - child: Center( - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon(Icons.attach_file), - Texts( - TranslationBase.of(context).selectAttachment, - variant: 'bodyText', - textAlign: TextAlign.center, + child: Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, ), - ], + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + Icons.attach_file, + color: Color(0xff2B353E), + ), + Text( + TranslationBase.of(context).selectAttachment, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + ), + ], + ), ), ), - ), - ), - ...List.generate( - images.length, - (index) => Container( - margin: EdgeInsets.all(10), - padding: EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, + ...List.generate( + images.length, + (index) => Container( + margin: EdgeInsets.all(10), + padding: EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Icon(FontAwesomeIcons.paperclip), - SizedBox( - width: 8, - ), - Texts( - 'image ${index + 1}.png', + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon(FontAwesomeIcons.paperclip), + SizedBox( + width: 8, + ), + Texts( + 'image ${index + 1}.png', + ), + ], ), + InkWell( + onTap: () { + setState(() { + images.remove(images[index]); + }); + }, + child: Icon( + FontAwesomeIcons.trashAlt, + color: Colors.red[300], + )) ], ), - InkWell( - onTap: () { - setState(() { - images.remove(images[index]); - }); - }, - child: Icon( - FontAwesomeIcons.trashAlt, - color: Colors.red[300], - )) - ], - ), - )), - SizedBox( - height: 100, + )), + ], ), - ], + ), ), ), - ), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).send, + (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty) + ? null + : () { + final form = formKey.currentState; + if (form.validate()) { + GifLoaderDialogUtils.showMyDialog(context); + model + .sendCOCItem( + title: titleController.text, + attachment: images.length > 0 ? images[0] : "", + details: messageController.text, + cOCTypeName: getCOCName(), + appointHistory: messageType == MessageType.ComplaintOnAnAppointment ? appointHistory : null) + .then((value) { + if (value) { + setState(() { + titleController.text = ""; + messageController.text = ""; + images = []; + }); + setMessageType(MessageType.NON); + GifLoaderDialogUtils.hideDialog(context); + AppToast.showSuccessToast(message: TranslationBase.of(context).yourFeedback); + } else { + AppToast.showErrorToast(message: model.error); + GifLoaderDialogUtils.hideDialog(context); + } + }); + } + }, + color: Color(0xffD02127), + textColor: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty) ? Color(0xff000000) : Colors.white, + disabledColor: Color(0xffEAEAEA), + ), + ), + ], ), - bottomSheet: Container( - height: 80, - width: double.infinity, - padding: EdgeInsets.all(15.0), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.1, - child: SecondaryButton( - label: TranslationBase.of(context).send, - textColor: Colors.white, - disabled: (titleController.text.toString().isEmpty || - messageController.text.toString().isEmpty), - onTap: () { - final form = formKey.currentState; - if (form.validate()) { - GifLoaderDialogUtils.showMyDialog(context); - model - .sendCOCItem( - title: titleController.text, - attachment: images.length > 0 ? images[0] : "", - details: messageController.text, - cOCTypeName: getCOCName(), - appointHistory: messageType == - MessageType.ComplaintOnAnAppointment - ? appointHistory - : null) - .then((value) { - if (value) { - setState(() { - titleController.text = ""; - messageController.text = ""; - images = []; - }); - setMessageType(MessageType.NON); - GifLoaderDialogUtils.hideDialog(context); - AppToast.showSuccessToast( - message: TranslationBase.of(context).yourFeedback); - } else { - AppToast.showErrorToast(message: model.error); - GifLoaderDialogUtils.hideDialog(context); - } - }); - } - }, + ), + ); + } + + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines}) { + return Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: TextInputType.number, + controller: _controller, + maxLines: lines, + onChanged: (value) => {setState(() {})}, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + suffixIconConstraints: BoxConstraints(minWidth: 50), + suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), + // prefixIconConstraints: BoxConstraints(minWidth: 50), + // prefixIcon: suffix == null + // ? null + // : Text( + // "+" + suffix, + // style: TextStyle( + // fontSize: 14, + // height: 21 / 14, + // fontWeight: FontWeight.w500, + // color: Color(0xff2E303A), + // letterSpacing: -0.56, + // ), + // ), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], ), ), - ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], ), ), ); @@ -595,10 +596,8 @@ class _SendFeedbackPageState extends State { openSpeechReco() async { new RoboSearch(context: context).showAlertDialog(context); - _currentLocaleId = - TranslationBase.of(AppGlobal.context).locale.languageCode; - bool available = await speech.initialize( - onStatus: statusListener, onError: errorListener); + _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode; + bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); if (available) { speech.listen( onResult: resultListener, @@ -641,8 +640,7 @@ class _SendFeedbackPageState extends State { } Future initSpeechState() async { - bool hasSpeech = await speech.initialize( - onError: errorListener, onStatus: statusListener); + bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); print(hasSpeech); if (!mounted) return; } @@ -652,9 +650,7 @@ class FeedbackTypeDialog extends StatefulWidget { final Function(MessageType) onValueSelected; final MessageType messageTypeDialog; - const FeedbackTypeDialog( - {Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) - : super(key: key); + const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) : super(key: key); @override State createState() => new FeedbackTypeDialogState(); @@ -699,14 +695,12 @@ class FeedbackTypeDialogState extends State { child: InkWell( onTap: () => setMessageDialogType(MessageType.NON), child: ListTile( - title: - Texts(TranslationBase.of(context).notClassified), + title: Texts(TranslationBase.of(context).notClassified), leading: Radio( value: MessageType.NON, groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, - onChanged: (MessageType value) => - setMessageDialogType(value), + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), @@ -721,17 +715,14 @@ class FeedbackTypeDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () => setMessageDialogType( - MessageType.ComplaintOnAnAppointment), + onTap: () => setMessageDialogType(MessageType.ComplaintOnAnAppointment), child: ListTile( - title: - Texts(TranslationBase.of(context).complainAppo), + title: Texts(TranslationBase.of(context).complainAppo), leading: Radio( value: MessageType.ComplaintOnAnAppointment, groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, - onChanged: (MessageType value) => - setMessageDialogType(value), + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), @@ -746,17 +737,14 @@ class FeedbackTypeDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () => setMessageDialogType( - MessageType.ComplaintWithoutAppointment), + onTap: () => setMessageDialogType(MessageType.ComplaintWithoutAppointment), child: ListTile( - title: Texts( - TranslationBase.of(context).complainWithoutAppo), + title: Texts(TranslationBase.of(context).complainWithoutAppo), leading: Radio( value: MessageType.ComplaintWithoutAppointment, groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, - onChanged: (MessageType value) => - setMessageDialogType(value), + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), @@ -778,8 +766,7 @@ class FeedbackTypeDialogState extends State { value: MessageType.Question, groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, - onChanged: (MessageType value) => - setMessageDialogType(value), + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), @@ -794,16 +781,14 @@ class FeedbackTypeDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () => - setMessageDialogType(MessageType.Compliment), + onTap: () => setMessageDialogType(MessageType.Compliment), child: ListTile( title: Texts(TranslationBase.of(context).compliment), leading: Radio( value: MessageType.Compliment, groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, - onChanged: (MessageType value) => - setMessageDialogType(value), + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), @@ -818,16 +803,14 @@ class FeedbackTypeDialogState extends State { Expanded( flex: 1, child: InkWell( - onTap: () => - setMessageDialogType(MessageType.Suggestion), + onTap: () => setMessageDialogType(MessageType.Suggestion), child: ListTile( title: Texts(TranslationBase.of(context).suggestion), leading: Radio( value: MessageType.Suggestion, groupValue: messageTypeDialog, activeColor: Theme.of(context).primaryColor, - onChanged: (MessageType value) => - setMessageDialogType(value), + onChanged: (MessageType value) => setMessageDialogType(value), ), ), ), diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index 7541855f..b1eb60ac 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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'; @@ -24,120 +25,116 @@ class _StatusFeedbackPageState extends State { builder: (_, model, widget) => AppScaffold( baseViewModel: model, isShowDecPage: false, - body: model.cOCItemList.isNotEmpty - ? Container( - margin: EdgeInsets.only( - top: 8.0, left: 8.0, right: 8.0, bottom: 80), - padding: EdgeInsets.all(15.0), - child: ListView.builder( - itemCount: model.cOCItemList.length, - itemBuilder: (context, index) => InkWell( - onTap: () { - gotodetails(model.cOCItemList[index]); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - margin: EdgeInsets.all(4), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 8, + body: Column( + children: [ + Expanded( + child: model.cOCItemList.isNotEmpty + ? Container( + margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0, bottom: 80), + padding: EdgeInsets.all(15.0), + child: ListView.builder( + itemCount: model.cOCItemList.length, + itemBuilder: (context, index) => InkWell( + onTap: () { + gotodetails(model.cOCItemList[index]); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(5)), + color: Colors.white, ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Texts( - '${model.cOCItemList[index].cOCTitle}'), - Texts( - TranslationBase.of(context).number + - ' : ${model.cOCItemList[index].itemID}', - variant: 'overline', - ), - ], + margin: EdgeInsets.all(4), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, ), - ), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts( - '${model.cOCItemList[index].status}'), - Texts( - '${model.cOCItemList[index].date}', - variant: 'overline', + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('${model.cOCItemList[index].cOCTitle}'), + Texts( + TranslationBase.of(context).number + ' : ${model.cOCItemList[index].itemID}', + variant: 'overline', + ), + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('${model.cOCItemList[index].status}'), + Texts( + '${model.cOCItemList[index].date}', + variant: 'overline', + ), + ], + ), ), ], ), - ), - ], + Texts('${model.cOCItemList[index].formType}'), + Divider( + height: 4.5, + color: Colors.grey[500], + ) + ], + ), ), - Texts('${model.cOCItemList[index].formType}'), - Divider( - height: 4.5, - color: Colors.grey[500], - ) - ], + ))), + ) + : Center( + child: Column( + children: [ + SizedBox( + height: MediaQuery.of(context).size.height * 0.4, + ), + Image.asset( + 'assets/images/comments.png', + width: 80, + height: 80, + ), + SizedBox( + height: 15, + ), + Text( + TranslationBase.of(context).noSearchResult, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: Color(0xff2B353E), ), ), - ))), - ) - : Container( - child: Center( - child: Column( - children: [ - SizedBox( - height: MediaQuery.of(context).size.height * 0.4, - ), - Image.asset( - 'assets/images/comments.png', - width: 80, - height: 80, + ], ), - SizedBox( - height: 15, - ), - Texts(TranslationBase.of(context).noSearchResult), - ], - ), - ), - ), - bottomSheet: Container( - height: 80, - width: double.infinity, - padding: EdgeInsets.all(15.0), - child: Center( - child: Container( - height: MediaQuery.of(context).size.height * 0.1, - child: SecondaryButton( - label: TranslationBase.of(context).search, - textColor: Colors.white, - disabled: true, - onTap: () {}, + ), + ), + Container( + color: Colors.white, + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).search, + () => {}, ), ), - ), + ], ), ), ); } gotodetails(item) { - Navigator.pushReplacement( - context, FadePage(page: FeedbackDetails(items: item))); + Navigator.pushReplacement(context, FadePage(page: FeedbackDetails(items: item))); } } diff --git a/lib/pages/landing/fragments/home_page_fragment.dart b/lib/pages/landing/fragments/home_page_fragment.dart index c5ad8dad..9f92a86b 100644 --- a/lib/pages/landing/fragments/home_page_fragment.dart +++ b/lib/pages/landing/fragments/home_page_fragment.dart @@ -36,7 +36,7 @@ class _HomePageFragmentState extends State { hmgServices.add(new HmgServices(2, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(new HmgServices(4, TranslationBase.of(context).refferal, TranslationBase.of(context).services2, "assets/images/new/E_Refferal.svg", isLogin)); - hmgServices.add(new HmgServices(5, "RRT", TranslationBase.of(context).emergency, "assets/images/new/RRT.svg", isLogin)); + hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergency, TranslationBase.of(context).services, "assets/images/new/RRT.svg", isLogin)); } @override diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 374a69e5..68bf2ffe 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -26,9 +26,9 @@ import 'dart:math' as math; class HomePageFragment2 extends StatefulWidget { DashboardViewModel model; - Function onPharmacyClick, onLoginClick,onMedicalFileClick; + Function onPharmacyClick, onLoginClick, onMedicalFileClick; - HomePageFragment2(this.model, {this.onLoginClick, this.onPharmacyClick,this.onMedicalFileClick}); + HomePageFragment2(this.model, {this.onLoginClick, this.onPharmacyClick, this.onMedicalFileClick}); @override _HomePageFragment2State createState() => _HomePageFragment2State(); @@ -55,7 +55,7 @@ class _HomePageFragment2State extends State { hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/visa.png", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); - hmgServices.add(new HmgServices(5, "RRT", TranslationBase.of(context).emergency, "assets/images/new/emergency.svg", isLogin)); + hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergency, TranslationBase.of(context).services2, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(new HmgServices(6, TranslationBase.of(context).refferal, TranslationBase.of(context).services2, "assets/images/new/E_Referral.svg", isLogin)); hmgServices.add(new HmgServices(7, "H\u2082O", TranslationBase.of(context).dailyWater, "assets/images/new/h2o.svg", isLogin)); hmgServices.add(new HmgServices(8, TranslationBase.of(context).reachUs, TranslationBase.of(context).findUs, "assets/images/new/reach_us.svg", isLogin)); @@ -130,7 +130,7 @@ class _HomePageFragment2State extends State { FlatButton( onPressed: () { widget.onMedicalFileClick(); - // navigateTo(context, MedicalProfilePageNew()); + // navigateTo(context, MedicalProfilePageNew()); }, child: Text( TranslationBase.of(context).viewMedicalFile, diff --git a/lib/pages/landing/fragments/logged_home_page_fragment.dart b/lib/pages/landing/fragments/logged_home_page_fragment.dart index eff13328..92f3e960 100644 --- a/lib/pages/landing/fragments/logged_home_page_fragment.dart +++ b/lib/pages/landing/fragments/logged_home_page_fragment.dart @@ -61,7 +61,7 @@ class _HomePageFragmentState extends State { hmgServices.add(new HmgServices(2, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(new HmgServices(4, TranslationBase.of(context).refferal, TranslationBase.of(context).services2, "assets/images/new/E_Refferal.svg", isLogin)); - hmgServices.add(new HmgServices(5, "RRT", TranslationBase.of(context).emergency, "assets/images/new/RRT.svg", isLogin)); + hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergency, TranslationBase.of(context).services, "assets/images/new/RRT.svg", isLogin)); } Future getFamilyFiles() async { @@ -93,7 +93,8 @@ class _HomePageFragmentState extends State { child: LoggedSliderView( widget.projectViewModel, new SliderData(TranslationBase.of(context).fileno + ": " + widget.projectViewModel.user.patientID.toString(), - widget.projectViewModel.user.firstName + ' ' + widget.projectViewModel.user.lastName, "", bannerColor[0].darkColor, bannerColor[0].lightColor),null), + widget.projectViewModel.user.firstName + ' ' + widget.projectViewModel.user.lastName, "", bannerColor[0].darkColor, bannerColor[0].lightColor), + null), ), ), appoCountProvider.count == 0 diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index e686ed5a..80dcaa88 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -1,11 +1,10 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; @@ -21,7 +20,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:feather_icons_flutter/feather_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -42,6 +40,12 @@ class HomePage extends StatefulWidget { class _HomePageState extends State { PharmacyModuleViewModel pharmacyModuleViewModel = locator(); + @override + void initState() { + // TODO: implement initState + super.initState(); + } + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -603,14 +607,14 @@ class _HomePageState extends State { SizedBox( height: 8, ), - InkWell( - onTap: () => Navigator.push(context, FadePage(page: PaymentService())), - child: Container( - margin: EdgeInsets.only(left: 15, right: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + onTap: () => Navigator.push(context, FadePage(page: PaymentService())), + child: Container( width: MediaQuery.of(context).size.width * 0.29, child: Center( child: Padding( @@ -641,7 +645,12 @@ class _HomePageState extends State { color: Colors.white, ), ), - Container( + ), + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: EReferralPage())); + }, + child: Container( child: Center( child: Padding( padding: const EdgeInsets.all(15.0), @@ -656,7 +665,7 @@ class _HomePageState extends State { height: 10, ), Texts( - TranslationBase.of(context).offersAndPackages, + TranslationBase.of(context).ereferral, textAlign: TextAlign.center, color: Colors.black87, bold: false, @@ -672,51 +681,52 @@ class _HomePageState extends State { borderRadius: BorderRadius.circular(6.0), color: Colors.white, )), - if (projectViewModel.havePrivilege(60)) - Container( - width: MediaQuery.of(context).size.width * 0.29, - child: InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: ErOptions( - isAppbar: true, - ))), - child: Center( - child: Padding( - padding: const EdgeInsets.all(15.0), - child: Column( - children: [ - Image.asset( - 'assets/images/Dr_Schedule_report.png', - width: 50, - height: 50, - ), - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context).emergencyServices, - textAlign: TextAlign.center, - color: Colors.black87, - bold: false, - fontSize: SizeConfig.textMultiplier * 1.7, - ) - ], - ), + ), + if (projectViewModel.havePrivilege(60)) + Container( + width: MediaQuery.of(context).size.width * 0.29, + child: InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: ErOptions( + isAppbar: true, + ))), + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/Dr_Schedule_report.png', + width: 50, + height: 50, + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context).emergencyServices, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 1.7, + ) + ], ), ), ), - height: MediaQuery.of(context).size.width * 0.4, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Colors.white, - ), ), - ], - ), + height: MediaQuery.of(context).size.width * 0.4, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + ), + ), + ], ), ), + // ), SizedBox( height: 5, ), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 5e203d29..cc57ba5e 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -157,21 +157,28 @@ class _LandingPageState extends State with WidgetsBindingObserver { return; } } + setState(() { - if (currentTab > 0 && tab == 2) - pageController.jumpToPage(0); - else if (tab != 0) { - if (tab == 4 && model.count == 0) { - AppToast.showErrorToast(message: TranslationBase.of(context).noBookedAppo); + if (tab == 5) { + IS_VOICE_COMMAND_CLOSED = false; + triggerRobot(); + + // pageController.jumpToPage(tab); + } else { + if (currentTab > 0 && tab == 2) + pageController.jumpToPage(0); + else if (tab != 0) { + if (tab == 4 && projectViewModel.isLogin && model.count == 0) { + AppToast.showErrorToast(message: TranslationBase.of(context).noBookedAppo); + } else { + pageController.jumpToPage(tab); + } } else { pageController.jumpToPage(tab); } - } else { - IS_VOICE_COMMAND_CLOSED = false; - pageController.jumpToPage(tab); + currentTab = tab; } - currentTab = tab; }); } @@ -225,7 +232,6 @@ class _LandingPageState extends State with WidgetsBindingObserver { locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); WidgetsBinding.instance.addPostFrameCallback((_) { - // locationUtils.getCurrentLocation(); if (projectViewModel.isLogin) { familyFileProvider.getSharedRecordByStatus(); } @@ -242,6 +248,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { } requestPermissions().then((results) { + locationUtils.getCurrentLocation(); _firebaseMessaging.getToken().then((String token) { print("Firebase Token: " + token); sharedPref.setString(PUSH_TOKEN, token); @@ -259,7 +266,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { // if (results[Permission.calendar].isGranted) ; }); - requestPermissions(); + // requestPermissions(); // }); // @@ -608,7 +615,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { onLoginClick: () { login(); }, - onMedicalFileClick: (){ + onMedicalFileClick: () { changeCurrentTab(1); }, ), @@ -634,7 +641,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { } triggerRobot() { - event.setValue({"isRobot": 'true'}); + event.setValue({"isRobotVisible": 'true'}); } getText(currentTab) { diff --git a/lib/pages/landing/widgets/logged_slider_view.dart b/lib/pages/landing/widgets/logged_slider_view.dart index 6570bb18..958135d0 100644 --- a/lib/pages/landing/widgets/logged_slider_view.dart +++ b/lib/pages/landing/widgets/logged_slider_view.dart @@ -148,7 +148,7 @@ class LoggedSliderView extends StatelessWidget { ), mWidth(6), Texts( - "Height: ${model.heightCm} ${TranslationBase.of(context).cm}", + "${TranslationBase.of(context).height}: ${model.heightCm} ${TranslationBase.of(context).cm}", color: Colors.white, fontSize: 10, ) @@ -167,7 +167,7 @@ class LoggedSliderView extends StatelessWidget { height: 12, ), mWidth(6), - Texts('Weight: ${model.weightKg} ${TranslationBase.of(context).kg}', color: Colors.white, fontSize: 10) + Texts('${TranslationBase.of(context).weight}: ${model.weightKg} ${TranslationBase.of(context).kg}', color: Colors.white, fontSize: 10) ], ), ), @@ -183,7 +183,7 @@ class LoggedSliderView extends StatelessWidget { height: 12, ), mWidth(6), - Texts('Blood: ${model.booldType}', color: Colors.white, fontSize: 10) + Texts('${TranslationBase.of(context).bloodD}: ${model.booldType}', color: Colors.white, fontSize: 10) ], ), ), diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index 7276b961..6a7573d7 100644 --- a/lib/pages/livecare/widgets/clinic_card.dart +++ b/lib/pages/livecare/widgets/clinic_card.dart @@ -39,7 +39,7 @@ class _State extends State { children: [ Card( margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0), - color: widget.isSelected ? Colors.blue : widget.patientERGetClinicsList.isOnline == 1 ? Colors.white : Colors.grey, + color: widget.isSelected ? Color(0xff06b806) : widget.patientERGetClinicsList.isOnline == 1 ? Colors.white : Colors.grey, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 3bf83ac0..94bce343 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -256,7 +256,7 @@ class _clinic_listState extends State { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(12, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod, - authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false); + authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID.toString()); } onBrowserLoadStart(String url) { diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 85669531..a4f9f0b0 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; @@ -23,9 +24,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.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'; @@ -35,7 +34,6 @@ import 'package:intl/intl.dart'; import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; class ConfirmLogin extends StatefulWidget { @override @@ -161,9 +159,9 @@ class _ConfirmLogin extends State { ), Text( user.editedOn != null - ? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.editedOn)) + ? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.editedOn), projectViewModel.isArabic) : user.createdOn != null - ? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.createdOn)) + ? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.createdOn), projectViewModel.isArabic) : '--', style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), ), @@ -375,6 +373,7 @@ class _ConfirmLogin extends State { } var tempType; + startSMSService(type) { tempType = type; new SMSOTP( @@ -510,9 +509,12 @@ class _ConfirmLogin extends State { GifLoaderDialogUtils.showMyDialog(context); var request = this.getCommonRequest().toJson(); + dynamic res; + authService .checkActivationCode(request, value) .then((result) => { + res = result, if (result is Map) { result = CheckActivationCode.fromJson(result), @@ -530,7 +532,7 @@ class _ConfirmLogin extends State { // sharedPref.setString( // BLOOD_TYPE, result['PatientBloodType']), authenticatedUserObject.user = result.list, - + projectViewModel.setPrivilege(privilegeList: res), sharedPref.setObject(MAIN_USER, result.list), sharedPref.setObject(USER_PROFILE, result.list), loginTokenID = result.logInTokenID, diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index bcb91ee1..cf5d2505 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -224,7 +224,6 @@ class _Login extends State { } void validateForm() { - print("mobileNo:${mobileNo}"); if (util.validateIDBox(nationalIDorFile.text, loginType) == true && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { setState(() { isButtonDisabled = false; @@ -234,7 +233,6 @@ class _Login extends State { isButtonDisabled = true; }); } - print("isButtonDisabled:${isButtonDisabled}"); } checkUserAuthentication() { diff --git a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart index 2de8dc14..10c842ab 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; @@ -46,6 +47,12 @@ class _AskDoctorHomPageState extends State with SingleTickerPr showNewAppBar: true, showNewAppBarTitle: true, backgroundColor: Color(0xffF8F8F8), + isShowDecPage: true, + description: TranslationBase.of(context).infoAskDoc, + imagesInfo: [ + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/ask-doctor/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/ask-doctor/ar/0.png'), + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/ask-doctor/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/ask-doctor/ar/1.png') + ], body: Column( children: [ Row( diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index a06045ec..098f87ea 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -1,4 +1,4 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/service/medical/ask_doctor_services.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; @@ -6,14 +6,16 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/ask_doctor/request_type.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:rating_bar/rating_bar.dart'; class AskDoctorPage extends StatelessWidget { + AskDoctorService service = new AskDoctorService(); + @override Widget build(BuildContext context) { return BaseView( @@ -65,9 +67,10 @@ class AskDoctorPage extends StatelessWidget { doctor: doctorList, isLiveCareAppointment: false, onTap: () { - model.getCallInfoHoursResult(doctorId: _doctor.doctorID, projectId: _doctor.projectID).then((value) { - if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) { - // Navigator.pop(context); + GifLoaderDialogUtils.showMyDialog(context); + service.getCallInfoHoursResult(doctorId: _doctor.doctorID, projectId: _doctor.projectID).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['ErrorEndUserMessage'] == null) { Navigator.push( context, FadePage( @@ -75,8 +78,12 @@ class AskDoctorPage extends StatelessWidget { ), ); } else { - AppToast.showErrorToast(message: model.error); + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + if (err != null) AppToast.showErrorToast(message: err); + print(err); }); }, ); diff --git a/lib/pages/medical/ask_doctor/request_type.dart b/lib/pages/medical/ask_doctor/request_type.dart index 0195ee3b..66cd9344 100644 --- a/lib/pages/medical/ask_doctor/request_type.dart +++ b/lib/pages/medical/ask_doctor/request_type.dart @@ -3,9 +3,8 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_mod import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -32,6 +31,8 @@ class _RequestTypePageState extends State { isShowAppBar: true, appBarTitle: TranslationBase.of(context).requestType, baseViewModel: model, + showNewAppBar: true, + showNewAppBarTitle: true, body: SingleChildScrollView( child: Container( margin: EdgeInsets.all(10), @@ -99,22 +100,24 @@ class _RequestTypePageState extends State { ), bottomSheet: Container( width: double.maxFinite, - // height: MediaQuery.of(context).size.height * 0.1, height: 80.0, child: Padding( padding: const EdgeInsets.all(12.0), - child: SecondaryButton( - label: TranslationBase.of(context).submit, - loading: model.state == ViewState.BusyLocal, - textColor: Colors.white, - onTap: () { - model.sendRequestLOV(doctorList: widget.doctorList, requestType: parameterCode.toString(), remark: question).then((value) { - if (model.state != ViewState.ErrorLocal || model.state != ViewState.Error) { - Navigator.pop(context); - } - }); - }, - color: Colors.grey[800], + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + child: DefaultButton( + TranslationBase.of(context).submit, + () => { + model.sendRequestLOV(doctorList: widget.doctorList, requestType: parameterCode.toString(), remark: question).then((value) { + if (model.state != ViewState.ErrorLocal || model.state != ViewState.Error) { + Navigator.pop(context); + } + }) + }, + color: Color(0xffD02127), + textColor: Colors.white, + disabledColor: Color(0xffEAEAEA), + ), ), ), ), diff --git a/lib/pages/medical/eye/ClassesPage.dart b/lib/pages/medical/eye/ClassesPage.dart index 273a8088..563a7ce3 100644 --- a/lib/pages/medical/eye/ClassesPage.dart +++ b/lib/pages/medical/eye/ClassesPage.dart @@ -1,13 +1,7 @@ import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; -import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.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/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -135,7 +129,7 @@ class ClassesPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded(flex: 4, child: Text(title,style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4),)), + Expanded(flex: 4, child: Text(title,style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4))), Expanded( flex: 2, child: Row( @@ -143,11 +137,11 @@ class ClassesPage extends StatelessWidget { children: [ Text( val1 == 'null' ? '-' : val1, - style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), + style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4), ), Text( val2 != 'null' ? '-' : val2, - style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), + style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4), ), ], ), diff --git a/lib/pages/medical/eye/ContactLensPage.dart b/lib/pages/medical/eye/ContactLensPage.dart index ae00dbfd..feaabc8c 100644 --- a/lib/pages/medical/eye/ContactLensPage.dart +++ b/lib/pages/medical/eye/ContactLensPage.dart @@ -142,7 +142,7 @@ class ContactLensPage extends StatelessWidget { flex: 4, child: Text( title, - style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), + style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4), )), Expanded( flex: 2, @@ -152,7 +152,7 @@ class ContactLensPage extends StatelessWidget { children: [ Text( val1 == 'null' ? '-' : val1, - style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), + style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4), ), ], ), diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index de5c7cba..00111283 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -120,7 +120,7 @@ class _EyeHomePageState extends State with SingleTickerProviderStat TranslationBase.of(context).classes, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: 12, + // fontSize: 12, letterSpacing: -0.36, ), ), @@ -133,7 +133,7 @@ class _EyeHomePageState extends State with SingleTickerProviderStat TranslationBase.of(context).contactLens, style: TextStyle( fontWeight: FontWeight.w600, - fontSize: 12, + // fontSize: 12, letterSpacing: -0.36, ), ), diff --git a/lib/pages/medical/eye/EyeMeasurementsPage.dart b/lib/pages/medical/eye/EyeMeasurementsPage.dart index 0aa7b69c..8c1b656a 100644 --- a/lib/pages/medical/eye/EyeMeasurementsPage.dart +++ b/lib/pages/medical/eye/EyeMeasurementsPage.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -31,6 +32,12 @@ class EyeMeasurementsPage extends StatelessWidget { showNewAppBar: true, showNewAppBarTitle: true, backgroundColor: CustomColors.appBackgroudGreyColor, + description: TranslationBase.of(context).infoEye, + imagesInfo: [ + ImagesInfo( + imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/eye-measurements/ar/0.png', + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/eye-measurements/en/0.png') + ], appBarTitle: TranslationBase.of(context).eyeMeasurements, body: SingleChildScrollView( child: Column( diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 3c426a3d..1d933530 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -37,7 +37,7 @@ class _MedicalProfilePageState extends State { builder: (_, model, widget) => AppScaffold( isShowDecPage: false, baseViewModel: model, - isHelp: true, + isHelp: false, body: Container( child: SingleChildScrollView( child: Column( diff --git a/lib/pages/medical/my_invoices/my_invoice_page.dart b/lib/pages/medical/my_invoices/my_invoice_page.dart index 2af80adc..b49879bc 100644 --- a/lib/pages/medical/my_invoices/my_invoice_page.dart +++ b/lib/pages/medical/my_invoices/my_invoice_page.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart' as DoctorListResponse; @@ -24,21 +25,28 @@ class _MyInvoicesState extends State { GetDentalAppointmentsResponse getDentalAppointmentsResponse; DentalInvoiceDetailResponse dentalInvoiceDetailResponse; + ProjectViewModel projectViewModel; + List imagesInfo = List(); + @override void initState() { + imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-invoice/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-invoice/ar/0.png')); + WidgetsBinding.instance.addPostFrameCallback((_) { - getDentalAppointments(); + if(projectViewModel.isLogin) + getDentalAppointments(); }); super.initState(); } @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).myInvoice, isShowAppBar: true, isShowDecPage: true, + imagesInfo: imagesInfo, body: Container( child: SingleChildScrollView( physics: BouncingScrollPhysics(), diff --git a/lib/pages/medical/my_trackers/my_trackers.dart b/lib/pages/medical/my_trackers/my_trackers.dart index c133c67a..b9450fd5 100644 --- a/lib/pages/medical/my_trackers/my_trackers.dart +++ b/lib/pages/medical/my_trackers/my_trackers.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/model/ImagesInfo.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'; @@ -15,7 +16,11 @@ class MyTrackers extends StatelessWidget { return AppScaffold( appBarTitle: TranslationBase.of(context).myTracker, isShowAppBar: true, - isShowDecPage: false, + isShowDecPage: true, + description: TranslationBase.of(context).infoTrackers, + imagesInfo: [ + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-trackers/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-trackers/ar/0.png') + ], body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(12), @@ -33,8 +38,7 @@ class MyTrackers extends StatelessWidget { margin: EdgeInsets.all(5), width: MediaQuery.of(context).size.width * 0.35, height: MediaQuery.of(context).size.width * 0.35, - decoration: BoxDecoration( - shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), + decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, @@ -59,8 +63,7 @@ class MyTrackers extends StatelessWidget { margin: EdgeInsets.all(5), width: MediaQuery.of(context).size.width * 0.35, height: MediaQuery.of(context).size.width * 0.35, - decoration: BoxDecoration( - shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), + decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, @@ -90,8 +93,7 @@ class MyTrackers extends StatelessWidget { margin: EdgeInsets.all(5), width: MediaQuery.of(context).size.width * 0.35, height: MediaQuery.of(context).size.width * 0.35, - decoration: BoxDecoration( - shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), + decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white), child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 29ed02f5..ac9a4ea8 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -37,24 +37,28 @@ class _PatientSickLeavePageState extends State { appBarTitle: TranslationBase.of(context).sickLeaves, description: TranslationBase.of(context).infoSickLeaves, infoList: TranslationBase.of(context).infoSickLeavePoints, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF7F7F7), imagesInfo: imagesInfo, baseViewModel: model, - body: Container( - margin: EdgeInsets.all(12), - child: ListView.builder( - itemCount: model.sickLeaveList.length, - itemBuilder: (context, index) => DoctorCard( - isLiveCareAppointment: model.sickLeaveList[index].isLiveCareAppointment, - name: model.sickLeaveList[index].doctorName, - date: model.sickLeaveList[index].appointmentDate, - profileUrl: model.sickLeaveList[index].doctorImageURL, - rating: model.sickLeaveList[index].actualDoctorRate.toDouble(), - subName: model.sickLeaveList[index].projectName, - isInOutPatient: model.sickLeaveList[index].isInOutPatient, - onEmailTap: () { - showConfirmMessage(model, index); - }, - ), + body: ListView.separated( + physics: BouncingScrollPhysics(), + itemCount: model.sickLeaveList.length, + padding: EdgeInsets.all(21), + separatorBuilder: (context, index) => SizedBox(height: 14), + itemBuilder: (context, index) => DoctorCard( + isLiveCareAppointment: model.sickLeaveList[index].isLiveCareAppointment, + name: model.sickLeaveList[index].doctorName, + date: model.sickLeaveList[index].appointmentDate, + profileUrl: model.sickLeaveList[index].doctorImageURL, + rating: model.sickLeaveList[index].actualDoctorRate.toDouble(), + subName: model.sickLeaveList[index].clinicName, + isSortByClinic: false, + isInOutPatient: model.sickLeaveList[index].isInOutPatient, + onEmailTap: () { + showConfirmMessage(model, index); + }, ), ), ), diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 951c9709..9779df1b 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -86,12 +86,6 @@ class RadiologyDetailsPage extends StatelessWidget { '${finalRadiology.reportData}', style: TextStyle(fontSize: 12, letterSpacing: -0.48), ), - // Texts( - // '${finalRadiology.reportData}', - // textAlign: TextAlign.start, - // fontSize: 12, - // - // ), mHeight(16), (projectViewModel.havePrivilege(9) || projectViewModel.havePrivilege(8)) ? (finalRadiology.dIAPACSURL != "" && projectViewModel.havePrivilege(9)) diff --git a/lib/pages/medical/reports/monthly_reports.dart b/lib/pages/medical/reports/monthly_reports.dart index 80f6ac76..f1c1aa08 100644 --- a/lib/pages/medical/reports/monthly_reports.dart +++ b/lib/pages/medical/reports/monthly_reports.dart @@ -1,16 +1,15 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/reports_monthly_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.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:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/input/custom_switch.dart'; -import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; class MonthlyReportsPage extends StatefulWidget { @@ -24,6 +23,17 @@ class _MonthlyReportsPageState extends State { String email; final formKey = GlobalKey(); + List imagesInfo = List(); + + @override + void initState() { + imagesInfo.add(ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/monthly-reports/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/monthly-reports/ar/0.png')); + imagesInfo.add(ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/monthly-reports/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/monthly-reports/ar/1.png')); + super.initState(); + } + @override Widget build(BuildContext context) { return BaseView(builder: (_, model, w) { @@ -39,153 +49,197 @@ class _MonthlyReportsPageState extends State { return AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).monthlyReports, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF7F7F7), + imagesInfo: imagesInfo, + description: TranslationBase.of(context).infoMonthReport, body: SingleChildScrollView( - child: Container( - padding: EdgeInsets.all(12), - child: Form( - key: formKey, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.all(9), - height: 55, - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(8)), shape: BoxShape.rectangle, border: Border.all(color: Colors.grey)), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts( - TranslationBase.of(context).patientHealthSummaryReport, - bold: true, - ), - CustomSwitch( - value: isSummary, - activeColor: Colors.red, - inactiveColor: Colors.grey, - onChanged: () async { - setState(() { - isSummary = !isSummary; - }); - if (!isSummary) { - GifLoaderDialogUtils.showMyDialog(context); - await model.updatePatientHealthSummaryReport(message: TranslationBase.of(context).updateSuccessfully, isSummary: isSummary); - model.receiveHealthSummaryReport = isSummary; - isAgree = isSummary; - model.user.emailAddress = ""; - GifLoaderDialogUtils.hideDialog(context); - } - }, - ) - ], - ), - ), - SizedBox( - height: 15, - ), - Container( - margin: EdgeInsets.all(8), - child: TextFields( - fillColor: Colors.red, - hintText: 'email@email.com', - fontSize: 20, - initialValue: email, - fontWeight: FontWeight.w600, - onChanged: (text) { - email = text; - }, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context).enterEmail; - else - return null; - }, - ), - ), - Divider( - height: 10.4, - thickness: 1.0, - ), - SizedBox( - height: 15, - ), - Container( - margin: EdgeInsets.all(8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Texts(TranslationBase.of(context).toViewTheTermsAndConditions), + physics: BouncingScrollPhysics(), + padding: EdgeInsets.all(21), + child: Form( + key: formKey, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(right: 12, left: 12, top: 14, bottom: 14), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), ), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: UserAgreementContent(), - ), - ); - }, - child: Texts( - TranslationBase.of(context).clickHere, - color: Colors.blue, - ), - ) ], - ), - ), - SizedBox( - height: 5, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.start, + color: Colors.white), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Checkbox( - value: isAgree, - onChanged: (value) { + Expanded( + child: Text( + TranslationBase.of(context).patientHealthSummaryReport, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), + ), + ), + CustomSwitch( + value: isSummary, + activeColor: Color(0xffD02127), + inactiveColor: Color(0xff28323A).withOpacity(0.3), + onChanged: () async { setState(() { - isAgree = !isAgree; + isSummary = !isSummary; }); + if (!isSummary) { + GifLoaderDialogUtils.showMyDialog(context); + await model.updatePatientHealthSummaryReport(message: TranslationBase.of(context).updateSuccessfully, isSummary: isSummary); + model.receiveHealthSummaryReport = isSummary; + isAgree = isSummary; + model.user.emailAddress = ""; + GifLoaderDialogUtils.hideDialog(context); + } }, - activeColor: Colors.red, + ) + ], + ), + ), + SizedBox( + height: 15, + ), + Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).email, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextFormField( + scrollPadding: EdgeInsets.zero, + keyboardType: TextInputType.number, + // controller: _controller, + onChanged: (value) => {email = value}, + initialValue: email, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context).enterEmail; + else + return null; + }, + decoration: InputDecoration( + isDense: true, + hintText: "email@email.com", + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), ), - Texts(TranslationBase.of(context).iAgreeToTheTermsAndConditions), ], ), - Container( - margin: EdgeInsets.all(8), - width: double.infinity, - child: SecondaryButton( - textColor: Colors.white, - label: TranslationBase.of(context).save, - disabled: (!isAgree || !isSummary), - onTap: () async { - final form = formKey.currentState; - if (form.validate()) { - GifLoaderDialogUtils.showMyDialog(context); - await model.updatePatientHealthSummaryReport( - message: TranslationBase.of(context).updateSuccessfully, isSummary: isSummary, isUpdateEmail: true, email: email.isNotEmpty ? email : model.user.emailAddress); - model.receiveHealthSummaryReport = isSummary; - model.user.emailAddress = email.isNotEmpty ? email : model.user.emailAddress; - GifLoaderDialogUtils.hideDialog(context); - } + ), + SizedBox( + height: 12, + ), + RichText( + text: TextSpan( + text: TranslationBase.of(context).toViewTheTermsAndConditions + " ", + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + children: [ + TextSpan( + text: TranslationBase.of(context).clickHere, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.blue, letterSpacing: -0.64, height: 23 / 16), + recognizer: new TapGestureRecognizer() + ..onTap = () => Navigator.push( + context, + FadePage( + page: UserAgreementContent(), + ), + ), + ) + ]), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Checkbox( + value: isAgree, + onChanged: (value) { + setState(() { + isAgree = !isAgree; + }); }, + activeColor: Color(0xffD02127), ), - ), - Padding( - padding: const EdgeInsets.all(5.0), - child: Texts( - TranslationBase.of(context).instructionAgree, - fontWeight: FontWeight.normal, + Text( + TranslationBase.of(context).iAgreeToTheTermsAndConditions, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), ), - ), - SizedBox( - height: 12, - ), - Center(child: Image.asset('assets/images/report.jpg')) - ], - ), + ], + ), + DefaultButton( + TranslationBase.of(context).save, + () async { + final form = formKey.currentState; + if (form.validate()) { + GifLoaderDialogUtils.showMyDialog(context); + await model.updatePatientHealthSummaryReport( + message: TranslationBase.of(context).updateSuccessfully, isSummary: isSummary, isUpdateEmail: true, email: email.isNotEmpty ? email : model.user.emailAddress); + model.receiveHealthSummaryReport = isSummary; + model.user.emailAddress = email.isNotEmpty ? email : model.user.emailAddress; + GifLoaderDialogUtils.hideDialog(context); + } + }, + ), + SizedBox(height: 12), + Text( + TranslationBase.of(context).instructionAgree, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + ), + SizedBox(height: 12), + Center(child: Image.asset('assets/images/report.jpg')) + ], ), ), ), diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 69db0edb..e24e9ac7 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -56,6 +56,7 @@ class _HomeReportPageState extends State with SingleTickerProvid baseViewModel: model, showNewAppBar: true, showNewAppBarTitle: true, + backgroundColor: Color(0xffF7F7F7), imagesInfo: imagesInfo, body: Column( children: [ diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index c6dd5c4d..9e6994da 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; import 'package:diplomaticquarterapp/core/service/medical/reports_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -12,6 +13,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; class ReportListWidget extends StatelessWidget { @@ -20,8 +22,11 @@ class ReportListWidget extends StatelessWidget { ReportListWidget({@required this.reportList, this.emailAddress}); + ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return ListView.separated( physics: BouncingScrollPhysics(), padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), @@ -69,8 +74,8 @@ class ReportListWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - if (report.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", report.projectName), - if (report.clinicDescription != null) myRichText(TranslationBase.of(context).hospital + ":", report.clinicDescription), + if (report.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", report.projectName, projectViewModel.isArabic), + if (report.clinicDescription != null) myRichText(TranslationBase.of(context).hospital + ":", report.clinicDescription, projectViewModel.isArabic), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.max, diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart index 11d5fc82..2ba14006 100644 --- a/lib/pages/medical/reports/reports_page.dart +++ b/lib/pages/medical/reports/reports_page.dart @@ -5,26 +5,28 @@ import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:rating_bar/rating_bar.dart'; class MedicalReports extends StatelessWidget { @override Widget build(BuildContext context) { - void confirmBox( - AppointmentHistory model, ReportsViewModel reportsViewModel) { + void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) { showDialog( context: context, child: ConfirmDialog( appointmentHistory: model, - onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model,TranslationBase.of(context).successSendReport), + onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model, TranslationBase.of(context).successSendReport), ), ); } + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getPatentAppointmentHistory(), @@ -32,88 +34,175 @@ class MedicalReports extends StatelessWidget { baseViewModel: model, isShowAppBar: true, appBarTitle: TranslationBase.of(context).medReport, - body: ListView.builder( - itemCount: model.appointHistoryList.length, - itemBuilder: (context, index) => Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - width: double.infinity, - margin: EdgeInsets.only(left: 8, right: 8, top: 3), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.white, width: 2), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all( - Radius.circular(8.0), - )), - child: Row( - children: [ - Container( - margin: EdgeInsets.only(left: 5, right: 5), - child: LargeAvatar( - width: 50, - height: 50, - name: model.appointHistoryList[index].doctorNameObj, - url: model.appointHistoryList[index].doctorImageURL, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF7F7F7), + body: ListView.separated( + physics: BouncingScrollPhysics(), + itemCount: model.appointHistoryList.length, + padding: EdgeInsets.all(21), + separatorBuilder: (context, index) => SizedBox(height: 14), + itemBuilder: (context, index) { + AppointmentHistory _appointmenHistory = model.appointHistoryList[index]; + + return InkWell( + onTap: () => confirmBox(model.appointHistoryList[index], model), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + //spreadRadius: 5, + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + color: Colors.white), + child: Padding( + padding: const EdgeInsets.only(left: 12, right: 12, top: 12, bottom: 12), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) + Text( + (_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + Text( + DateUtil.formatDateToDate(_appointmenHistory.appointmentDate, projectViewModel.isArabic), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + ), + ], + ), + if ((_appointmenHistory.doctorName ?? _appointmenHistory.doctorNameObj) != null) SizedBox(height: 6), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + LargeAvatar( + name: _appointmenHistory.doctorName, + url: _appointmenHistory.doctorImageURL, + width: 48, + height: 48, + ), + SizedBox(width: 11), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + if (_appointmenHistory.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", _appointmenHistory.projectName, projectViewModel.isArabic), + if (_appointmenHistory.clinicName != null) myRichText(TranslationBase.of(context).hospital + ":", _appointmenHistory.clinicName, projectViewModel.isArabic), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RatingBar.readOnly( + initialRating: _appointmenHistory.actualDoctorRate.toDouble(), + size: 16.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, + ), + Icon(Icons.email, color: Color(0xff2B353E)) + ], + ), + ], + ), + ), + ], + ), + ], ), ), - Expanded( - flex: 4, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 12, - ), - Texts(model.appointHistoryList[index].projectName), - Texts(model.appointHistoryList[index].clinicName), - Texts(projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.appointHistoryList[index].appointmentDate):DateUtil.getMonthDayYearDateFormatted(model.appointHistoryList[index].appointmentDate)), - StarRating( - totalAverage: model - .appointHistoryList[index].actualDoctorRate - .toDouble(), - forceStars: true), - SizedBox( - height: 12, - ), - ], + ), + ); + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + blurRadius: 27, + offset: Offset(0, -3), + ), + ], + color: Colors.white), + child: Row( + children: [ + Container( + margin: EdgeInsets.only(left: 5, right: 5), + child: LargeAvatar( + width: 50, + height: 50, + name: model.appointHistoryList[index].doctorNameObj, + url: model.appointHistoryList[index].doctorImageURL, ), ), - ), - InkWell( - onTap: () => - confirmBox(model.appointHistoryList[index], model), - child: Container( - width: 120, - height: 50, - decoration: BoxDecoration( - color: Colors.black54, - border: - Border.all(color: Colors.transparent, width: 2), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all( - Radius.circular(8.0), + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 12, + ), + Texts(model.appointHistoryList[index].projectName), + Texts(model.appointHistoryList[index].clinicName), + Texts(projectViewModel.isArabic + ? DateUtil.getMonthDayYearDateFormattedAr(model.appointHistoryList[index].appointmentDate) + : DateUtil.getMonthDayYearDateFormatted(model.appointHistoryList[index].appointmentDate)), + StarRating(totalAverage: model.appointHistoryList[index].actualDoctorRate.toDouble(), forceStars: true), + SizedBox( + height: 12, + ), + ], ), ), - child: Center( - child: Texts( - TranslationBase.of(context).requestReport, - fontSize: 12, - color: Colors.white, + ), + InkWell( + onTap: () => confirmBox(model.appointHistoryList[index], model), + child: Container( + width: 120, + height: 50, + decoration: BoxDecoration( + color: Colors.black54, + border: Border.all(color: Colors.transparent, width: 2), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).requestReport, + fontSize: 12, + color: Colors.white, + ), ), ), ), - ), - SizedBox( - width: 12, - ), - ], - ), - ), - ), - ), + SizedBox( + width: 12, + ), + ], + ), + ); + }), ), ); } diff --git a/lib/pages/medical/reports/user_agreement_page.dart b/lib/pages/medical/reports/user_agreement_page.dart index 9bb886e3..d48ff16d 100644 --- a/lib/pages/medical/reports/user_agreement_page.dart +++ b/lib/pages/medical/reports/user_agreement_page.dart @@ -13,11 +13,13 @@ class UserAgreementContent extends StatelessWidget { builder: (_, model, w) => AppScaffold( isShowAppBar: true, baseViewModel: model, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF7F7F7), appBarTitle: TranslationBase.of(context).userAgreement, body: SingleChildScrollView( - child: Html( - data: model.userAgreementContent, - ), + physics: BouncingScrollPhysics(), + child: Html(data: model.userAgreementContent), ), ), ); 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 977b99df..057c6be6 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 @@ -1,9 +1,13 @@ import 'dart:io'; import 'package:carousel_slider/carousel_slider.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; +import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; +import 'package:diplomaticquarterapp/locator.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/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -19,10 +23,13 @@ class _SmartWatchInstructionsState extends State { bool hasAlreadySynced = false; + AuthenticatedUserObject authenticatedUserObject = + locator(); + @override void initState() { WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - getLastPatientRecord(context); + if(authenticatedUserObject.isLogin) getLastPatientRecord(context); }); super.initState(); } @@ -32,6 +39,12 @@ class _SmartWatchInstructionsState extends State { return AppScaffold( appBarTitle: "Sync Health Data", isShowAppBar: true, + isShowDecPage: true, + description: TranslationBase.of(context).infoHealthData, + imagesInfo: [ + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/ar/0.png'), + ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/health-data/ar/1.png') + ], body: Container( child: Platform.isIOS ? _getAppleWatchInstructions() diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index d1d3388f..15c040ab 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.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/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.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'; @@ -14,15 +15,13 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; -import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class RateAppointmentClinic extends StatefulWidget { final AppointmentDetails appointmentDetails; final String doctorNote; final int doctorRate; - RateAppointmentClinic( - {this.appointmentDetails, this.doctorRate, this.doctorNote}); + RateAppointmentClinic({this.appointmentDetails, this.doctorRate, this.doctorNote}); @override _RateAppointmentClinicState createState() => _RateAppointmentClinicState(); @@ -43,8 +42,7 @@ class _RateAppointmentClinicState extends State { appBar: AppBar( elevation: 0, textTheme: TextTheme( - headline6: - TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), title: Text('Rate'), leading: Builder( @@ -91,11 +89,7 @@ class _RateAppointmentClinicState extends State { height: 8, ), LargeAvatar( - url: - 'https://hmgwebservices.com/Images/Hospitals/' + - model.appointmentDetails.projectID - .toString() + - '.jpg', + url: 'https://hmgwebservices.com/Images/Hospitals/' + model.appointmentDetails.projectID.toString() + '.jpg', name: model.appointmentDetails.clinicName, width: 110, height: 110, @@ -112,9 +106,7 @@ class _RateAppointmentClinicState extends State { height: 4, ), Texts( - DateUtil.getMonthDayYearDateFormatted( - DateUtil.convertStringToDate( - model.appointmentDetails.appointmentDate)), + DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointmentDetails.appointmentDate)), ), SizedBox( height: 8, @@ -146,10 +138,8 @@ class _RateAppointmentClinicState extends State { duration: Duration(milliseconds: 1000), switchInCurve: Curves.elasticOut, switchOutCurve: Curves.elasticIn, - transitionBuilder: - (Widget child, Animation animation) { - return ScaleTransition( - child: child, scale: animation); + transitionBuilder: (Widget child, Animation animation) { + return ScaleTransition(child: child, scale: animation); }, child: Container( key: ValueKey(rating), @@ -162,9 +152,7 @@ class _RateAppointmentClinicState extends State { }, iconSize: rating == (index + 1) ? 60 : 40, // Theme.of(context).hintColor, - icon: Image.asset('assets/images/' + - (index + 1).toString() + - '.png')), + icon: Image.asset('assets/images/' + (index + 1).toString() + '.png')), ), ), ) @@ -192,25 +180,33 @@ class _RateAppointmentClinicState extends State { if (rating > 0) { model .sendAppointmentRate( - rating, - widget.appointmentDetails.appointmentNo, - widget.appointmentDetails.projectID, - widget.appointmentDetails.doctorID, - widget.appointmentDetails.clinicID, - note) + rating, widget.appointmentDetails.appointmentNo, widget.appointmentDetails.projectID, widget.appointmentDetails.doctorID, widget.appointmentDetails.clinicID, note) .then( (value) => { - Navigator.pushReplacement( - context, - FadePage( - page: LandingPage(), - ), - ) + model + .sendDoctorRate( + widget.doctorRate, + widget.appointmentDetails.appointmentNo, + widget.appointmentDetails.projectID, + widget.appointmentDetails.doctorID, + widget.appointmentDetails.clinicID, + note, + widget.appointmentDetails.appointmentDate, + widget.appointmentDetails.doctorName, + widget.appointmentDetails.projectName, + widget.appointmentDetails.clinicName) + .then((value) { + Navigator.pushReplacement( + context, + FadePage( + page: LandingPage(), + ), + ); + }), }, ); } else { - AppToast.showErrorToast( - message: 'please rate the clinic'); + AppToast.showErrorToast(message: 'please rate the clinic'); } }, label: TranslationBase.of(context).submit, diff --git a/lib/pages/vaccine/my_vaccines_screen.dart b/lib/pages/vaccine/my_vaccines_screen.dart index 27ce8399..4b71b0b7 100644 --- a/lib/pages/vaccine/my_vaccines_screen.dart +++ b/lib/pages/vaccine/my_vaccines_screen.dart @@ -1,19 +1,19 @@ +import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.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/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; -import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../base/base_view.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart'; -import 'package:diplomaticquarterapp/widgets/others/rounded_container.dart'; -import 'package:popup_box/popup_box.dart'; +import '../base/base_view.dart'; import 'my_vaccines_item_screen.dart'; //TODO fix by jammal we have a static data @@ -28,192 +28,164 @@ class _MyVaccinesState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getVaccine(), - builder: (BuildContext context, VaccineViewModel model, Widget child) => - AppScaffold( - isShowAppBar: true, - baseViewModel: model, - appBarTitle: TranslationBase.of(context).myVaccines, - body: Container( - margin: EdgeInsets.only( - left: SizeConfig.screenWidth * 0.004, - right: SizeConfig.screenWidth * 0.004, - top: SizeConfig.screenWidth * 0.04, - ), - child: Column( - children: [ - RoundedContainer( - backgroundColor: Colors.white, - child: ExpansionTile( - title: Container( - height: 65.0, - child: Text('2018'), - ), - children: [ - Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.vaccineList == null - ? 0 - : model.vaccineList.length, - itemBuilder: (BuildContext context, int index) { - return Column( - children: [ - RoundedContainer( - child: Column( + builder: (BuildContext context, VaccineViewModel model, Widget child) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).myVaccines, + description: TranslationBase.of(context).infoVaccines, + imagesInfo: [ + ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vacceines/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vacceines/ar/0.png') + ], + body: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: Column( + children: [ + RoundedContainer( + backgroundColor: Colors.white, + child: ExpansionTile( + title: Container( + height: 65.0, + child: Text('2018'), + ), + children: [ + Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.vaccineList == null ? 0 : model.vaccineList.length, + itemBuilder: (BuildContext context, int index) { + return Column( + children: [ + RoundedContainer( + child: Column( + children: [ + Row( children: [ - Row( - children: [ - Expanded( - child: Column( - children: [ - Padding( - padding: EdgeInsets - .symmetric( - horizontal: - 20.0, - vertical: 20.0), - child: Image.network( - model - .vaccineList[ - index] - .doctorImageURL, - height: SizeConfig - .imageSizeMultiplier * - 23, - width: SizeConfig - .imageSizeMultiplier * - 20, - fit: BoxFit.fill, - ), - ), - ], - ), - flex: 2, - ), - Expanded( - child: Container( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Text( - model - .vaccineList[ - index] - .doctorTitle + - model - .vaccineList[ - index] - .doctorName, - style: TextStyle( - fontWeight: - FontWeight.w900, - fontSize: 16.6, - ), - ), - SizedBox(height: 7.0), - Text( - model - .vaccineList[ - index] - .projectName, - style: TextStyle( - fontSize: 17.0, - letterSpacing: 0.5, - ), - ), - SizedBox(height: 7.0), - Text( - model - .vaccineList[ - index] - .vaccineName, - style: TextStyle( - fontSize: 17.0, - ), - ), - SizedBox(height: 7.0), - Text( - 'Date Taken ' + - convertDateFormat(model - .vaccineList[ - index] - .invoiceDate), - style: TextStyle( - fontSize: 17.0), - ), - ], + Expanded( + child: Column( + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 20.0), + child: Image.network( + model.vaccineList[index].doctorImageURL, + height: SizeConfig.imageSizeMultiplier * 23, + width: SizeConfig.imageSizeMultiplier * 20, + fit: BoxFit.fill, ), ), - flex: 5, + ], + ), + flex: 2, + ), + Expanded( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + model.vaccineList[index].doctorTitle + model.vaccineList[index].doctorName, + style: TextStyle( + fontWeight: FontWeight.w900, + fontSize: 16.6, + ), + ), + SizedBox(height: 7.0), + Text( + model.vaccineList[index].projectName, + style: TextStyle( + fontSize: 17.0, + letterSpacing: 0.5, + ), + ), + SizedBox(height: 7.0), + Text( + model.vaccineList[index].vaccineName, + style: TextStyle( + fontSize: 17.0, + ), + ), + SizedBox(height: 7.0), + Text( + 'Date Taken ' + convertDateFormat(model.vaccineList[index].invoiceDate), + style: TextStyle(fontSize: 17.0), + ), + ], ), - ], + ), + flex: 5, ), ], ), - ), - ], - ); - }), - ) - ], - ), - ), - // SpaceBetweenTexts(space: 165.0), - ], + ], + ), + ), + ], + ); + }), + ) + ], + ), ), - ), - bottomSheet: model.state == ViewState.Busy?Container(height: 0,): model.vaccineList.length > 0 + // SpaceBetweenTexts(space: 165.0), + ], + ), + ), + bottomSheet: model.state == ViewState.Busy + ? Container( + height: 0, + ) + : model.vaccineList.length > 0 ? Container( - color: Theme.of(context).scaffoldBackgroundColor, - padding: EdgeInsets.all(12), - height: MediaQuery.of(context).size.height * 0.25, - width: double.infinity, - child: Column( - children: [ - Divider( - height: 2, - thickness: 1, - ), - SizedBox( - height: 6, - ), - Container( + color: Theme.of(context).scaffoldBackgroundColor, + padding: EdgeInsets.all(12), + height: MediaQuery.of(context).size.height * 0.25, width: double.infinity, - // height: 80.0, - child: Button( - disabled: true, - label: TranslationBase.of(context) - .checkVaccineAvailability, - backgroundColor: Color(0xff9EA3A4), - onTap: () => Navigator.push( - context, FadePage(page: MyVaccinesItemPage())), + child: Column( + children: [ + Divider( + height: 2, + thickness: 1, + ), + SizedBox( + height: 6, + ), + Container( + width: double.infinity, + // height: 80.0, + child: Button( + disabled: true, + label: TranslationBase.of(context).checkVaccineAvailability, + backgroundColor: Color(0xff9EA3A4), + onTap: () => Navigator.push(context, FadePage(page: MyVaccinesItemPage())), + ), + ), + if (projectViewModel.havePrivilege(27)) + Container( + width: double.infinity, + // height: 80.0, + child: SecondaryButton( + label: TranslationBase.of(context).sendEmail, + color: Color(0xffF62426), + textColor: Colors.white, + disabled: model.vaccineList.length == 0, + loading: model.state == ViewState.BusyLocal, + onTap: () async { + model.sendEmail(message: TranslationBase.of(context).emailSentSuccessfully); + }, + ), + ), + ], ), + ) + : Container( + height: 0, ), - if (projectViewModel.havePrivilege(27)) - Container( - width: double.infinity, - // height: 80.0, - child: SecondaryButton( - label: TranslationBase.of(context).sendEmail, - color: Color(0xffF62426), - textColor: Colors.white, - disabled: model.vaccineList.length == 0, - loading: model.state == ViewState.BusyLocal, - onTap: () async { - model.sendEmail( - message: TranslationBase.of(context) - .emailSentSuccessfully); - }, - ), - ), - ], - ), - ) - : Container(height: 0,), - ), + ), ); } @@ -224,13 +196,8 @@ class _MyVaccinesState extends State { final startIndex = Date.indexOf(start); final endIndex = Date.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(Date.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "-" + - date.month.toString().padLeft(2, '0') + - "-" + - date.day.toString().padLeft(2, '0'); + var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(Date.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + "-" + date.month.toString().padLeft(2, '0') + "-" + date.day.toString().padLeft(2, '0'); return newDate.toString(); } diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 40b7059d..cee36817 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -130,8 +130,8 @@ class DoctorsListService extends BaseService { "gender": authUser.gender != null ? authUser.gender : 0, "age": authUser.age != null ? authUser.age : 0, "IsGetNearAppointment": false, - "Latitude": lat, - "Longitude": long, + "Latitude": lat == null ? 0.0 : lat, + "Longitude": long == null ? 0.0 : long, "License": true }; diff --git a/lib/theme/colors.dart b/lib/theme/colors.dart index 5d67ec5c..9aca16ff 100644 --- a/lib/theme/colors.dart +++ b/lib/theme/colors.dart @@ -15,5 +15,6 @@ class CustomColors { static const Color pharmacyGreyColor = Color(0xFFDBDBDB); static const Color backgroudGreyColor = Color(0xFFEFEFEF); static const Color appBackgroudGreyColor = Color(0xFFF7F7F7); + static const Color appBackgroudGrey2Color = Color(0xFFF8F8F8); static const Color green = Color(0xFF359846); } diff --git a/lib/uitl/date_uitl.dart b/lib/uitl/date_uitl.dart index 35891e05..0ee09dd7 100644 --- a/lib/uitl/date_uitl.dart +++ b/lib/uitl/date_uitl.dart @@ -52,8 +52,8 @@ class DateUtil { return start + "$milliseconds" + end; } - static String formatDateToDate(DateTime date) { - return DateFormat('dd MMM yyy').format(date); + static String formatDateToDate(DateTime date, bool isArabic) { + return DateFormat('dd MMM yyy', isArabic ? "ar_SA" : "en_US").format(date); } static String formatDateToTime(DateTime date) { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index c42003cb..b7efad42 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2142,7 +2142,28 @@ class TranslationBase { String get aboutApp => localizedValues["about-app"][locale.languageCode]; String get aboutPointsLength => localizedValues["about-points"]['length'][locale.languageCode]; String get timeNeeded => localizedValues["time-needed"][locale.languageCode]; - String get totalTimeNeeded => localizedValues["total-time-needed"][locale.languageCode]; + String get totalTimeNeeded => + localizedValues["total-time-needed"][locale.languageCode]; + String get infoEye => + localizedValues["info-eye"][locale.languageCode]; + String get infoVaccines => + localizedValues["info-vaccines"][locale.languageCode]; + String get infoTrackers => + localizedValues["info-trackers"][locale.languageCode]; + String get infoHealthData => + localizedValues["info-health-data"][locale.languageCode]; + String get infoAskDoc => + localizedValues["info-ask-doc"][locale.languageCode]; + String get infoAutoWifi => + localizedValues["info-auto-wifi"][locale.languageCode]; + String get autoWifi => + localizedValues["auto-wifi"][locale.languageCode]; + String get childVaccineInfo => + localizedValues["child-vaccine-info"][locale.languageCode]; + String get h2oInfo => + localizedValues["h2o-info"][locale.languageCode]; + String get askDocEmpty => + localizedValues["ask-doc-empty"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index fe4e9cda..c9d3f548 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -7,6 +7,7 @@ import 'package:badges/badges.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:connectivity/connectivity.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart'; @@ -31,15 +32,16 @@ import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.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/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; import 'package:url_launcher/url_launcher.dart'; + import '../Constants.dart'; import 'app_shared_preferences.dart'; import 'app_toast.dart'; @@ -407,12 +409,12 @@ class Utils { ), )); - medical.add(MedicalProfileItem( - title: TranslationBase.of(context).patientCall, - imagePath: 'medical_history_icon.png', - subTitle: TranslationBase.of(context).patientCallSubtitle, - isEnable: projectViewModel.havePrivilege(61), - )); + // medical.add(MedicalProfileItem( + // title: TranslationBase.of(context).patientCall, + // imagePath: 'medical_history_icon.png', + // subTitle: TranslationBase.of(context).patientCallSubtitle, + // isEnable: projectViewModel.havePrivilege(61), + // )); medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null, @@ -766,21 +768,26 @@ class Utils { if (projectViewModel.havePrivilege(32) || true) { medical.add(InkWell( onTap: () { - userData().then((userData_) { - if (projectViewModel.isLogin && userData_ != null) { + if (projectViewModel.isLogin) { + userData().then((userData_) { String patientID = userData_.patientID.toString(); GifLoaderDialogUtils.showMyDialog(context); projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}); - } else { - AlertDialogBox( - context: context, - confirmMessage: "Please login with your account first to use this feature", - okText: "OK", - okFunction: () { - AlertDialogBox.closeAlertDialog(context); - }).showAlertDialog(context); - } - }); + }); + } else { + Navigator.push( + context, + FadePage( + page: NotAutPage( + title: TranslationBase.of(context).autoWifi, + description: TranslationBase.of(context).infoAutoWifi, + infoList: [], + imagesInfo: [ + ImagesInfo( + imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/connect-to/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/connect-to/ar/0.png'), + ], + ))); + } }, child: MedicalProfileItem( title: TranslationBase.of(context).internet, @@ -845,14 +852,14 @@ class Utils { ); } - static Widget tableColumnValue(String text, {bool isLast = false}) { + static Widget tableColumnValue(String text, {bool isLast = false, bool isCapitable = true}) { return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ SizedBox(height: 12), Text( - text.toLowerCase().capitalizeFirstofEach, + isCapitable ? text.toLowerCase().capitalizeFirstofEach : text, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 1cebdfb4..d2ff467e 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -15,16 +15,12 @@ import 'package:provider/provider.dart'; import '../../d_q_icons_icons.dart'; import 'bottom_navigation_item.dart'; -import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; class BottomNavBar extends StatefulWidget { final ValueChanged changeIndex; final int index; final bool showHomeIcon; - BottomNavBar( - {Key key, this.changeIndex, this.index, this.showHomeIcon = false}) - : super(key: key); + BottomNavBar({Key key, this.changeIndex, this.index, this.showHomeIcon = false}) : super(key: key); @override _BottomNavBarState createState() => _BottomNavBarState(); @@ -36,7 +32,7 @@ class _BottomNavBarState extends State { var event = RobotProvider(); _changeIndex(int index) async { widget.changeIndex(index); - if (index == 0) { + if (index == 5) { event.setValue({'isRobotVisible': 'true'}); } } @@ -114,8 +110,7 @@ class _BottomNavBarState extends State { // currentIndex: 2, // name: TranslationBase.of(context).bookAppo, // ), - if (/*widget.index == 0 && */ projectViewModel - .havePrivilege(34)) + if (/*widget.index == 0 && */ projectViewModel.havePrivilege(34)) BottomNavigationItem( icon: EvaIcons.calendar, activeIcon: EvaIcons.calendar, @@ -130,7 +125,7 @@ class _BottomNavBarState extends State { activeIcon: DQIcons.roboticon, changeIndex: _changeIndex, index: widget.index, - currentIndex: 0, + currentIndex: 5, name: TranslationBase.of(context).help, ) ], diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index 9a3bbafe..91aefc75 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -2,7 +2,6 @@ import 'package:badges/badges.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; -import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart index 6914554b..f9eb0427 100644 --- a/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart +++ b/lib/widgets/data_display/medical/LabResult/LabResultWidget.dart @@ -14,7 +14,6 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; - import '../../text.dart'; import 'FlowChartPage.dart'; @@ -116,7 +115,7 @@ class LabResultWidget extends StatelessWidget { openPassportUpdatePage(BuildContext context) { Navigator.push(context, FadePage(page: PassportUpdatePage())).then((value) { print(value); - if(value != null && value == true) { + if (value != null && value == true) { showConfirmMessage(context, projectViewModel.user.emailAddress, "yes"); } }); @@ -179,7 +178,7 @@ class LabResultWidget extends StatelessWidget { children: [ Utils.tableColumnValue(labResultList[i].description, isLast: i == (labResultList.length - 1)), Utils.tableColumnValue(labResultList[i].resultValue + " " + labResultList[i].uOM, isLast: i == (labResultList.length - 1)), - Utils.tableColumnValue(labResultList[i].referanceRange, isLast: i == (labResultList.length - 1)), + Utils.tableColumnValue(labResultList[i].referanceRange, isLast: i == (labResultList.length - 1), isCapitable: false), ], ), ); 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 bc83ae5f..71ebd36d 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 @@ -49,7 +49,7 @@ class _VitalSignDetailsWidgetState extends State { tableRow.add( TableRow( children: [ - Utils.tableColumnValue(DateUtil.formatDateToDate(DateUtil.convertStringToDate(labOrderResultList[i].verifiedOnDateTime)), isLast: i == (labOrderResultList.length - 1)), + Utils.tableColumnValue(DateUtil.formatDateToDate(DateUtil.convertStringToDate(labOrderResultList[i].verifiedOnDateTime), false), isLast: i == (labOrderResultList.length - 1)), Utils.tableColumnValue(labOrderResultList[i].resultValue, isLast: i == (labOrderResultList.length - 1)), ], ), diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index b4f6a92a..74031ce1 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -46,9 +46,11 @@ class DoctorCard extends StatelessWidget { this.remainingTimeInMinutes, this.isParentAppointment = false}); + ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return Container( height: 120, decoration: BoxDecoration( @@ -127,7 +129,7 @@ class DoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.formatDateToDate(date), + DateUtil.formatDateToDate(date, projectViewModel.isArabic), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), Text( @@ -155,11 +157,11 @@ class DoctorCard extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - myRichText(isSortByClinic ? TranslationBase.of(context).hospital : TranslationBase.of(context).clinic + ":", subName), + myRichText(isSortByClinic ? TranslationBase.of(context).hospital : TranslationBase.of(context).clinic + ":", subName, projectViewModel.isArabic), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - if (rating == null) myRichText(TranslationBase.of(context).invoiceNo, billNo ?? ""), + if (rating == null) myRichText(TranslationBase.of(context).invoiceNo, billNo ?? "", projectViewModel.isArabic), if (rating != null) Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -216,13 +218,13 @@ class DoctorCard extends StatelessWidget { } // todo 'sikander' move this widget to separate file -Widget myRichText(String title, String value) { +Widget myRichText(String title, String value, bool isArabic) { return RichText( maxLines: 1, - text: TextSpan(text: title, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10), children: [ + text: TextSpan(text: title, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10), children: [ TextSpan( text: " $value", - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ) ]), ); diff --git a/lib/widgets/data_display/medical/time_line_new_widget.dart b/lib/widgets/data_display/medical/time_line_new_widget.dart index 1679a8ef..aa43f537 100644 --- a/lib/widgets/data_display/medical/time_line_new_widget.dart +++ b/lib/widgets/data_display/medical/time_line_new_widget.dart @@ -13,7 +13,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/list/flexible_container.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart' as auth; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:equatable/equatable.dart'; import 'package:flutter/material.dart'; @@ -34,7 +34,7 @@ class _TimeLineViewState extends State { List tempList = []; List dateObjs = []; DateObj selectedDateObj = null; - + final authService = new auth.AuthProvider(); @override void initState() { super.initState(); @@ -277,9 +277,29 @@ class _TimeLineViewState extends State { } login() async { - Navigator.of(context).pushNamed( - WELCOME_LOGIN, - ); + var data = await sharedPref.getObject(IMEI_USER_DATA); + sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); + if (data != null) { + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + GifLoaderDialogUtils.showMyDialog(context); + authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) { + GifLoaderDialogUtils.hideDialog(context); + if (value != null) { + sharedPref.setObject(IMEI_USER_DATA, value); + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + }); + } } } diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 16bd98de..f5e633ec 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -1,23 +1,24 @@ import 'dart:io'; + import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; +import 'package:diplomaticquarterapp/core/service/privilege_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; +import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notifications_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; -import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -32,11 +33,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; + import '../../config/size_config.dart'; import '../../locator.dart'; import 'drawer_item_widget.dart'; -import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; class AppDrawer extends StatefulWidget { @override @@ -59,10 +59,12 @@ class _AppDrawerState extends State { AuthenticatedUserObject authenticatedUserObject = locator(); VitalSignService _vitalSignService = locator(); AppointmentRateViewModel appointmentRateViewModel = locator(); + PrivilegeService _privilegeService = locator(); ToDoCountProviderModel toDoProvider; String booldType; String notificationCount; final authService = new AuthProvider(); + @override Widget build(BuildContext context) { projectProvider = Provider.of(context); @@ -152,6 +154,7 @@ class _AppDrawerState extends State { Padding(child: Image.asset('assets/images/lang.png'), padding: EdgeInsets.all(3)), isImageIcon: true, bottomLine: false, + projectProvider: projectProvider, ), onTap: () { sharedPref.setBool(IS_ROBOT_INIT, null); @@ -179,6 +182,7 @@ class _AppDrawerState extends State { iconColor: Theme.of(context).textTheme.bodyText1.color, sideArrow: true, letterSpacing: -0.84, + projectProvider: projectProvider ), onTap: () { Navigator.of(context).pop(); @@ -310,8 +314,10 @@ class _AppDrawerState extends State { letterSpacing: -0.84, fontSize: 14, fontHeight: projectProvider.isArabic ? 1 : 0.8, + projectProvider: projectProvider ), onTap: () { + sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL); sharedPref.setBool(IS_ROBOT_INIT, null); if (projectProvider.isArabic) { projectProvider.changeLanguage('en'); @@ -330,6 +336,7 @@ class _AppDrawerState extends State { bottomLine: false, letterSpacing: -0.84, fontSize: 14, + projectProvider: projectProvider, count: notificationCount != null ? new Container( padding: EdgeInsets.all(4), @@ -371,6 +378,7 @@ class _AppDrawerState extends State { bottomLine: false, letterSpacing: -0.84, fontSize: 14, + projectProvider: projectProvider ), onTap: () { Navigator.of(context).pushNamed( @@ -385,6 +393,7 @@ class _AppDrawerState extends State { bottomLine: false, letterSpacing: -0.84, fontSize: 14, + projectProvider: projectProvider ), onTap: () { if (Platform.isIOS) { @@ -402,6 +411,7 @@ class _AppDrawerState extends State { bottomLine: false, letterSpacing: -0.84, fontSize: 14, + projectProvider: projectProvider ), onTap: () { logout(); @@ -417,6 +427,7 @@ class _AppDrawerState extends State { letterSpacing: -0.84, fontSize: 14, bottomLine: false, + projectProvider: projectProvider ), onTap: () { login(); @@ -496,9 +507,12 @@ class _AppDrawerState extends State { await authenticatedUserObject.getUser(); _vitalSignService.heightCm = ""; _vitalSignService.weightKg = ""; + await _privilegeService.getPrivilege(); + projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); var appLanguage = await sharedPref.getString(APP_LANGUAGE); await sharedPref.clear(); await sharedPref.setString(APP_LANGUAGE, appLanguage); + await sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL); this.user = null; Navigator.of(context).pushNamed(HOME); // projectProvider.platformBridge().unRegisterHmgGeofences(); diff --git a/lib/widgets/drawer/drawer_item_widget.dart b/lib/widgets/drawer/drawer_item_widget.dart index 18c24ba6..ea75455c 100644 --- a/lib/widgets/drawer/drawer_item_widget.dart +++ b/lib/widgets/drawer/drawer_item_widget.dart @@ -1,6 +1,7 @@ import 'dart:ui'; import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -19,9 +20,10 @@ class DrawerItem extends StatefulWidget { final double fontHeight; final double letterSpacing; final double fontSize; + final ProjectViewModel projectProvider; DrawerItem(this.title, this.icon, - {this.fontSize, this.letterSpacing, this.textColor, this.iconColor, this.subTitle = '', this.bottomLine = true, this.count, this.sideArrow = false, this.isImageIcon = false, this.fontHeight}); + {this.fontSize, this.letterSpacing, this.textColor, this.iconColor, this.subTitle = '', this.bottomLine = true, this.count, this.sideArrow = false, this.isImageIcon = false, this.fontHeight, this.projectProvider}); @override _DrawerItemState createState() => _DrawerItemState(); @@ -76,7 +78,7 @@ class _DrawerItemState extends State { ) : SizedBox(), ])), - widget.sideArrow == true ? Expanded(flex: 1, child: Icon(Icons.keyboard_arrow_right, color: Colors.black)) : Expanded(flex: 1, child: SizedBox()), + widget.sideArrow == true ? Expanded(flex: 1, child: Icon(widget.projectProvider.isArabic ? Icons.keyboard_arrow_left : Icons.keyboard_arrow_right, color: Colors.black)) : Expanded(flex: 1, child: SizedBox()), ], ), )); diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f2dc8e06..f3aed157 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -167,6 +167,8 @@ class MyInAppBrowser extends InAppBrowser { AuthenticatedUser authenticatedUser, InAppBrowser browser, bool isLiveCareAppo, + var servID, + var LiveServID, [var appoDate, var appoNo, var clinicID, @@ -185,6 +187,8 @@ class MyInAppBrowser extends InAppBrowser { patientID, authenticatedUser, isLiveCareAppo, + servID, + LiveServID, appoDate, appoNo, clinicID, @@ -232,13 +236,13 @@ class MyInAppBrowser extends InAppBrowser { dynamic patientID, AuthenticatedUser authUser, bool isLiveCareAppo, + var servID, + var LiveServID, [var appoDate, var appoNo, var clinicID, var doctorID, - var patientData, - var servID, - var LiveServID]) async { + var patientData]) async { getDeviceToken(); String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN'; String form = isLiveCareAppo ? getLiveCareForm() : getForm(); diff --git a/lib/widgets/input/custom_switch.dart b/lib/widgets/input/custom_switch.dart index ddd1d77b..a43079dc 100644 --- a/lib/widgets/input/custom_switch.dart +++ b/lib/widgets/input/custom_switch.dart @@ -13,32 +13,21 @@ class CustomSwitch extends StatefulWidget { final Color activeColor; final Color inactiveColor; - CustomSwitch( - {Key key, - this.value, - this.onChanged, - this.activeColor, - this.inactiveColor}) - : super(key: key); + CustomSwitch({Key key, this.value, this.onChanged, this.activeColor, this.inactiveColor}) : super(key: key); @override _CustomSwitchState createState() => _CustomSwitchState(); } -class _CustomSwitchState extends State - with SingleTickerProviderStateMixin { +class _CustomSwitchState extends State with SingleTickerProviderStateMixin { Animation _circleAnimation; AnimationController _animationController; @override void initState() { super.initState(); - _animationController = - AnimationController(vsync: this, duration: Duration(milliseconds: 500)); - _circleAnimation = Tween(begin: 0.0, end: 30.0).animate(CurvedAnimation( - parent: _animationController, - curve: Curves.easeOutQuint, - reverseCurve: Curves.easeInQuint)); + _animationController = AnimationController(vsync: this, duration: Duration(milliseconds: 500)); + _circleAnimation = Tween(begin: 0.0, end: 22.0).animate(CurvedAnimation(parent: _animationController, curve: Curves.easeOutQuint, reverseCurve: Curves.easeInQuint)); if (widget.value) _animationController.forward(); } @@ -47,6 +36,7 @@ class _CustomSwitchState extends State return AnimatedBuilder( animation: _animationController, builder: (context, child) { + bool _switchStatus = _circleAnimation.status == AnimationStatus.dismissed || _circleAnimation.status == AnimationStatus.reverse; return GestureDetector( onTap: Feedback.wrapForTap(() async { if (widget.value) { @@ -58,29 +48,18 @@ class _CustomSwitchState extends State }, context), child: AnimatedContainer( duration: Duration(milliseconds: 200), - width: 60.0, - height: 30.0, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20.0), - color: _circleAnimation.status == AnimationStatus.dismissed || - _circleAnimation.status == AnimationStatus.reverse - ? widget.inactiveColor - : widget.activeColor), + width: 50.0, + height: 25.0, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.0), color: _switchStatus ? widget.inactiveColor : widget.activeColor), child: Padding( - padding: - EdgeInsets.only(top: 6.0, bottom: 6.0, right: 6.0, left: 6.0), + padding: EdgeInsets.only(top: 4.0, bottom: 4.0, right: 6.0, left: 6.0), child: Row( children: [ Container(width: _circleAnimation.value), Container( width: 16.0, height: 16.0, - decoration: BoxDecoration(boxShadow: [ - BoxShadow( - color: Colors.grey[800].withOpacity(0.15), - offset: Offset(0, 4.0), - blurRadius: 5.0) - ], shape: BoxShape.circle, color: Colors.white), + decoration: BoxDecoration(boxShadow: [BoxShadow(color: Colors.grey[800].withOpacity(0.15), offset: Offset(0, 4.0), blurRadius: 5.0)], shape: BoxShape.circle, color: Colors.white), ) ], ), diff --git a/lib/widgets/mobile-no/mobile_no.dart b/lib/widgets/mobile-no/mobile_no.dart index 72509222..844f2e4e 100644 --- a/lib/widgets/mobile-no/mobile_no.dart +++ b/lib/widgets/mobile-no/mobile_no.dart @@ -83,7 +83,6 @@ class _PhoneNumberSelectorWidgetState extends State { _labelText, style: TextStyle( fontSize: 11, - fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.44, @@ -96,7 +95,6 @@ class _PhoneNumberSelectorWidgetState extends State { onChanged: (value) => widget.onNumberChange(value), style: TextStyle( fontSize: 14, - height: 21 / 14, fontWeight: FontWeight.w400, color: Color(0xff2B353E), @@ -107,7 +105,6 @@ class _PhoneNumberSelectorWidgetState extends State { hintText: _hintText, hintStyle: TextStyle( fontSize: 14, - height: 21 / 14, fontWeight: FontWeight.w400, color: Color(0xff575757), @@ -120,7 +117,6 @@ class _PhoneNumberSelectorWidgetState extends State { prefix, style: TextStyle( fontSize: 14, - height: 21 / 14, fontWeight: FontWeight.w500, color: Color(0xff2E303A), @@ -189,12 +185,12 @@ class _MobileNo extends State { Widget build(BuildContext context) { projectProvider = Provider.of(context); return Visibility( - child: Column(children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Container( + child: Column(children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Container( margin: EdgeInsets.only(bottom: 10.0), height: 60.0, decoration: BoxDecoration( @@ -207,70 +203,75 @@ class _MobileNo extends State { ), width: MediaQuery.of(context).size.width * 0.89, child: Padding( - padding: EdgeInsets.all(10), - child: DropdownButtonHideUnderline( - child: DropdownButton( - isExpanded: true, - value: _selectedType, - iconSize: 40, - elevation: 16, - onChanged: (value) => { - widget.onCountryChange(value), - setState(() { - countryCode = value; - _selectedType = value; - }) - }, - items: counties.map>((Countries value) { - return DropdownMenuItem( - value: value.code, - child: Text(projectProvider.isArabic == true ? value.nameAr : value.name), - ); - }).toList())))), - ), - ], - ), - Container( - padding: EdgeInsets.all(5), - decoration: BoxDecoration(color: Colors.white, border: Border.all(color: Colors.grey), borderRadius: BorderRadius.circular(10)), - child: Row(children: [ - Expanded( + padding: EdgeInsets.all(10), + child: DropdownButtonHideUnderline( + child: DropdownButton( + isExpanded: true, + value: _selectedType, + iconSize: 40, + elevation: 16, + onChanged: (value) => { + widget.onCountryChange(value), + setState(() { + countryCode = value; + _selectedType = value; + }) + }, + items: counties.map>((Countries value) { + return DropdownMenuItem( + value: value.code, + child: Text(projectProvider.isArabic == true ? value.nameAr : value.name), + ); + }).toList()), + ), + ), + ), + ), + ], + ), + Container( + padding: EdgeInsets.all(5), + decoration: BoxDecoration(color: Colors.white, border: Border.all(color: Colors.grey), borderRadius: BorderRadius.circular(10)), + child: Row(children: [ + Expanded( flex: 1, child: Icon( Icons.phone, color: secondaryColor, - )), - Expanded( + ), + ), + Expanded( flex: 1, child: Text( countryCode, overflow: TextOverflow.clip, - )), - Expanded( - flex: 4, - child: Container( - margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), - child: TextField( - controller: widget.controller, - keyboardType: TextInputType.number, - maxLength: 10, - inputFormatters: - [ - FilteringTextInputFormatter.allow(RegExp("[0-9]")), - ], - // maxLengthEnforced: true, - // onChanged: (value) { - // widget.controller.text = countryCode; - // }, - onChanged: (value) => widget.onNumberChange(value), - - decoration: InputDecoration(counterText: "", border: InputBorder.none, hintText: '5xxxxxxxx'), ), ), - ) - ]), - ) - ])); + Expanded( + flex: 4, + child: Container( + margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only(top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft), + child: TextField( + controller: widget.controller, + keyboardType: TextInputType.number, + maxLength: 10, + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp("[0-9]")), + ], + // maxLengthEnforced: true, + // onChanged: (value) { + // widget.controller.text = countryCode; + // }, + onChanged: (value) => widget.onNumberChange(value), + + decoration: InputDecoration(counterText: "", border: InputBorder.none, hintText: '5xxxxxxxx'), + ), + ), + ) + ]), + ) + ]), + ); } } diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 8e4a7c9a..85509abe 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -8,6 +9,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.d import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; class DoctorHeader extends StatelessWidget { @@ -30,10 +32,12 @@ class DoctorHeader extends StatelessWidget { this.onRatingAndReviewTap}) : super(key: key); + ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { String _speciality = (headerModel?.speciality ?? []).length > 0 ? headerModel.speciality.first : ""; - + projectViewModel = Provider.of(context); return Container( color: Colors.white, child: Column( @@ -62,8 +66,8 @@ class DoctorHeader extends StatelessWidget { _speciality, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), ), - headerModel.invoiceNo.isNotEmpty ? myRichText(TranslationBase.of(context).invoiceNo + ":", headerModel.invoiceNo) : Container(), - myRichText(TranslationBase.of(context).branch, headerModel.projectName), + headerModel.invoiceNo.isNotEmpty ? myRichText(TranslationBase.of(context).invoiceNo + ":", headerModel.invoiceNo, projectViewModel.isArabic) : Container(), + myRichText(TranslationBase.of(context).branch, headerModel.projectName, projectViewModel.isArabic), ], ), ), @@ -73,7 +77,7 @@ class DoctorHeader extends StatelessWidget { children: [ if (headerModel.date != null) Text( - DateUtil.formatDateToDate(headerModel.date), + DateUtil.formatDateToDate(headerModel.date, projectViewModel.isArabic), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), if (headerModel.time != null) @@ -84,7 +88,7 @@ class DoctorHeader extends StatelessWidget { if (headerModel?.nationalityFlagURL != null) Padding( padding: const EdgeInsets.only(top: 8.0), - child: Image.network(headerModel.nationalityFlagURL ?? "", height: 16), + child: Image.network(headerModel.nationalityFlagURL ?? "", height: 20), ), ], ) @@ -139,7 +143,7 @@ class DoctorHeader extends StatelessWidget { }, child: Container( padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15), - decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: BorderRadius.only(topLeft: Radius.circular(10))), + decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: projectViewModel.isArabic ? BorderRadius.only(topRight: Radius.circular(10)) : BorderRadius.only(topLeft: Radius.circular(10))), child: Row( mainAxisSize: MainAxisSize.min, children: [ @@ -147,7 +151,7 @@ class DoctorHeader extends StatelessWidget { SizedBox(width: 6), Text( buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 25 / 16), + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.64, height: 1), ), ], ), diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 9582ab8a..64980aad 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -279,6 +279,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget { } String _badgeText = "0"; + class AppBarWidgetState extends State { String badgeText = "0"; @override @@ -397,42 +398,42 @@ class _RobotIcon extends State { return Positioned( child: Column( children: [ - isAnimation - ? Container( - height: 150, - width: 200, - padding: EdgeInsets.all(5), - margin: EdgeInsets.only(right: 35.0, bottom: 0), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white, - boxShadow: [ - BoxShadow(color: Colors.black, spreadRadius: 1), - ], - ), - child: TyperAnimatedTextKit( - text: Provider.of(context, listen: false).isArabic == true - ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." - : "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", - textLength: Provider.of(context, listen: false).isArabic == true - ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي.".length - : "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file." - .length)) - : Container(), + // isAnimation + // ? Container( + // height: 150, + // width: 200, + // padding: EdgeInsets.all(5), + // margin: EdgeInsets.only(right: 35.0, bottom: 0), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.circular(10), + // color: Colors.white, + // boxShadow: [ + // BoxShadow(color: Colors.black, spreadRadius: 1), + // ], + // ), + // child: TyperAnimatedTextKit( + // text: Provider.of(context, listen: false).isArabic == true + // ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي." + // : "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file.", + // textLength: Provider.of(context, listen: false).isArabic == true + // ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي.".length + // : "Through this service, you will be able to link your family medical files to your medical file so that you can manage their records by login to your medical file." + // .length)) + // : Container(), Stack( children: [ - isAnimation - ? Positioned( - top: 0, - right: 40, - child: Container( - height: 0, - width: 0, - decoration: ShapeDecoration( - color: Colors.grey, - shape: MessageBorder(reverse: true), - ))) - : Container(), + // isAnimation + // ? Positioned( + // top: 0, + // right: 40, + // child: Container( + // height: 0, + // width: 0, + // decoration: ShapeDecoration( + // color: Colors.grey, + // shape: MessageBorder(reverse: true), + // ))) + // : Container(), FloatingSearchButton() ], ) diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 195b479b..01957fbb 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -78,7 +78,7 @@ class FloatingSearchButton extends StatefulWidget { class _FloatingSearchButton extends State with TickerProviderStateMixin { Offset position = Offset(250, 400); bool activeAnimation = false; - bool isShow = true; + bool isShow = false; SearchProvider searchProvider = new SearchProvider(); RobotProvider eventProvider = RobotProvider(); bool isLoading = false; @@ -115,18 +115,16 @@ class _FloatingSearchButton extends State with TickerProvi offset = Tween(begin: Offset(0.0, 1.0), end: Offset(0.0, 0.0)).animate(controller); if (IS_VOICE_COMMAND_CLOSED == true) { controller.reverse(from: -1); - } - if (mounted) { - //Future.delayed(const Duration(seconds: 2), () { - isArabic = Provider.of(context, listen: false).isArabic; - requestPermissions(); - getUserData(); - initialSpeak(); - setState(() { - if (IS_TEXT_COMPLETED) { - isAnimationEnable = false; - } - }); + } else { + if (mounted) { + //Future.delayed(const Duration(seconds: 2), () { + + setState(() { + if (IS_TEXT_COMPLETED) { + isAnimationEnable = false; + } + }); + } } event.controller.stream.listen((p) { @@ -190,7 +188,7 @@ class _FloatingSearchButton extends State with TickerProvi placeholder: (context, url) => Image.asset('assets/images/gif/robot-idle.gif'), errorWidget: (context, url, error) => Icon(Icons.error), ) - : Image.asset(isAnimationEnable == true ? 'assets/images/gif/robot-speaking.gif' : 'assets/images/gif/robot-idle.gif'), + : Image.asset('assets/images/gif/robot-idle.gif'), ), onTap: () { new RoboSearch(context: context).showAlertDialog(context); @@ -273,7 +271,7 @@ class _FloatingSearchButton extends State with TickerProvi // }); } - void requestPermissions() async { + requestPermissions() async { if (await Permission.microphone.isDenied || await Permission.microphone.isUndetermined) { Map statuses = await [ Permission.microphone, @@ -282,7 +280,6 @@ class _FloatingSearchButton extends State with TickerProvi } Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); //if (hasSpeech) { // _currentLocaleId = // _currentLocaleId == 'en' @@ -290,6 +287,13 @@ class _FloatingSearchButton extends State with TickerProvi // : 'ar-SA'; // systemLocale.localeId; // } + + isArabic = Provider.of(context, listen: false).isArabic; + await requestPermissions(); + getUserData(); + await speech.initialize(onError: errorListener, onStatus: statusListener); + //initialSpeak(); + if (!mounted) return; // setState(() { diff --git a/lib/widgets/others/not_auh_page.dart b/lib/widgets/others/not_auh_page.dart index dc383c14..3bd9ae64 100644 --- a/lib/widgets/others/not_auh_page.dart +++ b/lib/widgets/others/not_auh_page.dart @@ -1,9 +1,13 @@ import 'package:carousel_slider/carousel_slider.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart' as auth; +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'; @@ -30,6 +34,7 @@ class NotAutPage extends StatefulWidget { } class _NotAutPageState extends State { + final authService = new auth.AuthProvider(); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -64,7 +69,7 @@ class _NotAutPageState extends State { style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), ), Text( - widget.description??"", + widget.description ?? "", style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), ), SizedBox( @@ -329,9 +334,23 @@ class _NotAutPageState extends State { if (data != null) { Navigator.of(context).pushNamed(CONFIRM_LOGIN); } else { - Navigator.of(context).pushNamed( - WELCOME_LOGIN, - ); + GifLoaderDialogUtils.showMyDialog(context); + authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) { + GifLoaderDialogUtils.hideDialog(context); + if (value != null) { + sharedPref.setObject(IMEI_USER_DATA, value); + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + }); } } }