diff --git a/assets/images/Dr_Schedule_report.png b/assets/images/Dr_Schedule_report.png new file mode 100644 index 00000000..9519f719 Binary files /dev/null and b/assets/images/Dr_Schedule_report.png differ diff --git a/assets/images/al-habib_onlne_pharmacy_bg.png b/assets/images/al-habib_onlne_pharmacy_bg.png new file mode 100644 index 00000000..d8809570 Binary files /dev/null and b/assets/images/al-habib_onlne_pharmacy_bg.png differ diff --git a/assets/images/bg_graphic.png b/assets/images/bg_graphic.png new file mode 100644 index 00000000..01525404 Binary files /dev/null and b/assets/images/bg_graphic.png differ diff --git a/assets/images/contact_us_bg.png b/assets/images/contact_us_bg.png new file mode 100644 index 00000000..1a7cc71e Binary files /dev/null and b/assets/images/contact_us_bg.png differ diff --git a/assets/images/emergency_service_image.png b/assets/images/emergency_service_image.png new file mode 100644 index 00000000..4dbcb7d6 Binary files /dev/null and b/assets/images/emergency_service_image.png differ diff --git a/assets/images/hmg_services_bg .png b/assets/images/hmg_services_bg .png new file mode 100644 index 00000000..508f9a0d Binary files /dev/null and b/assets/images/hmg_services_bg .png differ diff --git a/assets/images/home_healthcare_service_bg.png b/assets/images/home_healthcare_service_bg.png new file mode 100644 index 00000000..2765b47e Binary files /dev/null and b/assets/images/home_healthcare_service_bg.png differ diff --git a/assets/images/offer_icon.png b/assets/images/offer_icon.png new file mode 100644 index 00000000..527fd5a2 Binary files /dev/null and b/assets/images/offer_icon.png differ diff --git a/assets/images/timeline_bg.png b/assets/images/timeline_bg.png new file mode 100644 index 00000000..d7afc4b1 Binary files /dev/null and b/assets/images/timeline_bg.png differ diff --git a/lib/config/config.dart b/lib/config/config.dart index 29fef686..55b44a34 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -49,6 +49,10 @@ const GET_PATIENT_VITAL_SIGN = '/Doctors.svc/REST/Doctor_GetPatientVitalSign'; const REPORTS = '/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; const INSERT_REQUEST_FOR_MEDICAL_REPORT = '/Doctors.svc/REST/InsertRequestForMedicalReport'; +///Rate +const IS_LAST_APPOITMENT_RATED = '/Doctors.svc/REST/IsLastAppoitmentRated'; +const GET_APPOINTMENT_DETAILS_BY_NO = '/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; + //const BASE_URL = 'https://hmgwebservices.com/'; // Production Environment //const BASE_URL = 'https://hmgwebservices.com/Services'; // Production Environment @@ -120,7 +124,7 @@ const SEND_LIVECARE_INVOICE_EMAIL = '/Notifications.svc/REST/SendInvoiceForLiveC const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; const IP_ADDRESS = '10.20.10.20'; -const VERSION_ID = 5.5; +const VERSION_ID = 5.6; const SETUP_ID = '91877'; const LANGUAGE = 1; const PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 9c33d98e..c8f59a84 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -11,7 +11,7 @@ const Map> localizedValues = { 'services': {'en': 'SERVICES', 'ar': 'الخدمات'}, 'mySchedule': {'en': 'My Schedule', 'ar': 'جدولي'}, 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, - 'respirationRate':{'en': 'Respiration Rate', 'ar': 'معدل التنفس'}, + 'respirationRate': {'en': 'Respiration Rate', 'ar': 'معدل التنفس'}, 'bookAppo': {'en': 'Book Appointment', 'ar': 'حجز موعد'}, 'searchBy': {'en': 'Search By:', 'ar': 'البحث عن طريق:'}, 'clinic': {'en': 'Clinic', 'ar': 'العيادة'}, @@ -58,15 +58,41 @@ const Map> localizedValues = { 'viewQR': {'en': 'View QR Code', 'ar': 'عرض رمز الاستجابة السريعة'}, 'instruction': {'en': 'Instructions', 'ar': 'تعليمات'}, 'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'}, - 'cancelAppoMsg': {'en': 'Are you sure you want to cancel this appointment?', 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'}, + 'cancelAppoMsg': { + 'en': 'Are you sure you want to cancel this appointment?', + 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟' + }, - 'upcoming-noAction': {'en': 'No Action Required', 'ar': 'لا يوجد إجراء مطلوب'}, - 'upcoming-confirm': {'en': 'Please confirm the appointment to avoid cancellation', 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء'}, - 'upcoming-payment-pending': {'en': 'Online Payment will be Activated before 24 Hours of Appointment Time', 'ar': 'سيتم تفعيل خدمة الدفع الالكتروني قبل 24 ساعة من موعد الحجز'}, - 'upcoming-payment-now': {'en': 'Pay Online now to avoid long waiting queue', 'ar': 'ادفع الآن لتفادي الانتظار'}, - 'upcoming-QR': {'en': 'Use the QR Code to Check-In in hospital', 'ar': 'استخدم الرمز لتسجيل الحضور في المستشفى'}, - 'upcoming-virtual': {'en': 'This is a virtual appointment, Please adhere to the instructions for a seamless experience.', 'ar': 'هذا موعد اتصال مرئي عن بعد ، يرجى اتباع تعليمات الخدمة.'}, - 'upcoming-livecare': {'en': 'This is a LiveCare appointment', 'ar': 'هذا موعد لايف كير'}, + 'upcoming-noAction': { + 'en': 'No Action Required', + 'ar': 'لا يوجد إجراء مطلوب' + }, + 'upcoming-confirm': { + 'en': 'Please confirm the appointment to avoid cancellation', + 'ar': 'يرجى تأكيد الموعد لتفادي الإلغاء' + }, + 'upcoming-payment-pending': { + 'en': + 'Online Payment will be Activated before 24 Hours of Appointment Time', + 'ar': 'سيتم تفعيل خدمة الدفع الالكتروني قبل 24 ساعة من موعد الحجز' + }, + 'upcoming-payment-now': { + 'en': 'Pay Online now to avoid long waiting queue', + 'ar': 'ادفع الآن لتفادي الانتظار' + }, + 'upcoming-QR': { + 'en': 'Use the QR Code to Check-In in hospital', + 'ar': 'استخدم الرمز لتسجيل الحضور في المستشفى' + }, + 'upcoming-virtual': { + 'en': + 'This is a virtual appointment, Please adhere to the instructions for a seamless experience.', + 'ar': 'هذا موعد اتصال مرئي عن بعد ، يرجى اتباع تعليمات الخدمة.' + }, + 'upcoming-livecare': { + 'en': 'This is a LiveCare appointment', + 'ar': 'هذا موعد لايف كير' + }, 'upcoming-details': {'en': 'More Details', 'ar': 'المزيد'}, 'reschedule': {'en': 'Reschedule', 'ar': 'إعادة جدولة'}, 'raise': {'en': 'Raise', 'ar': 'رفع'}, @@ -161,27 +187,67 @@ const Map> localizedValues = { "before": {"en": "Before", "ar": "قبل"}, "minute": {"en": "Minutes", "ar": "دقيقة"}, "hour": {"en": "Hour", "ar": "ساعة"}, - "reminderSuccess": {"en": "The reminder has been added successfully", "ar": "يضاف التذكير بنجاح"}, - "patientShareToDo": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"}, + "reminderSuccess": { + "en": "The reminder has been added successfully", + "ar": "يضاف التذكير بنجاح" + }, + "patientShareToDo": { + "en": "Amount before tax: ", + "ar": "المبلغ قبل الضريبة:" + }, "patientTaxToDo": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"}, - "patientShareTotalToDo": {"en": "Total amount Due: ", "ar": "المبلغ الإجمالي المستحق:"}, + "patientShareTotalToDo": { + "en": "Total amount Due: ", + "ar": "المبلغ الإجمالي المستحق:" + }, 'paymentMethod': {'en': 'Payment Method', 'ar': 'طريقة الدفع او السداد'}, - 'noNeedToWaitInLine': {'en': 'No need to stand in line.', 'ar': 'لا داعي للوقوف في الطابور.'}, - 'useQRAppoAttend': {'en': 'Use the QR code to register the appointment attendance.', 'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.'}, - 'passQRAppoAttend': {'en': 'Pass the QR code through the attendance devices available in the Hospital.', 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.'}, - 'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'}, - 'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'}, - 'scanQRHospital': {'en': 'Scan above QR Code to Check-In on the Machine in Hospital', 'ar': 'مسح فوق رمز الاستجابة السريعة للتحقق في الجهاز في المستشفى'}, + 'noNeedToWaitInLine': { + 'en': 'No need to stand in line.', + 'ar': 'لا داعي للوقوف في الطابور.' + }, + 'useQRAppoAttend': { + 'en': 'Use the QR code to register the appointment attendance.', + 'ar': 'استخدم الكود لتسجيل الحضور في المستشفى.' + }, + 'passQRAppoAttend': { + 'en': + 'Pass the QR code through the attendance devices available in the Hospital.', + 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.' + }, + 'sitWaitingQR': { + 'en': 'Sit in the waiting rooms until called by the nurse.', + 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.' + }, + 'attendRegisterCode': { + 'en': 'Attendance registration code', + 'ar': 'رمز تسجيل الحضور' + }, + 'scanQRHospital': { + 'en': 'Scan above QR Code to Check-In on the Machine in Hospital', + 'ar': 'مسح فوق رمز الاستجابة السريعة للتحقق في الجهاز في المستشفى' + }, "sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"}, "close": {"en": "Close", "ar": "مغلق"}, "booked": {"en": "Booked", "ar": "محجوز"}, "confirmed": {"en": "Confirmed", "ar": "مؤكد"}, "arrived": {"en": "Arrived", "ar": "تم الحضور"}, - "payNowBookSuccess": {"en": "Pay now via Al Habib App", "ar": "ادفع الآن عبر تطبيق الحبيب"}, - "payNowBookSuccesstext1": {"en": "Pay Now using online payment service From secure payment gateways", "ar": "ادفع الآن باستخدام خدمة الدفع عبر الإنترنت من بوابات الدفع الآمنة"}, - "payNowBookSuccesstext2": {"en": "You can also Pay Later via online payment Or in Hospital", "ar": "يمكنك أيضًا الدفع لاحقًا عبر الدفع عبر الإنترنت أو في المستشفى"}, + "payNowBookSuccess": { + "en": "Pay now via Al Habib App", + "ar": "ادفع الآن عبر تطبيق الحبيب" + }, + "payNowBookSuccesstext1": { + "en": "Pay Now using online payment service From secure payment gateways", + "ar": "ادفع الآن باستخدام خدمة الدفع عبر الإنترنت من بوابات الدفع الآمنة" + }, + "payNowBookSuccesstext2": { + "en": "You can also Pay Later via online payment Or in Hospital", + "ar": "يمكنك أيضًا الدفع لاحقًا عبر الدفع عبر الإنترنت أو في المستشفى" + }, 'payLater': {'en': 'Pay Later', 'ar': 'ادفع لاحقا'}, - 'askDocNotAllowed': {'en': 'This service will be available for last 15 days doctor Visit only', 'ar': 'هذه الخدمة متاحة للزيارات خلال اخر 15 يوم فقط'}, + 'askDocNotAllowed': { + 'en': 'This service will be available for last 15 days doctor Visit only', + 'ar': 'هذه الخدمة متاحة للزيارات خلال اخر 15 يوم فقط' + }, "more-verify": { "en": "More Verification Options", "ar": "المزيد من خيارات التحقق" @@ -221,9 +287,9 @@ const Map> localizedValues = { 'respiration': {'en': 'Respiration', 'ar': 'التنفس'}, 'bloodPressure': {'en': 'Blood Pressure', 'ar': 'ضغط الدم'}, 'painScale': {'en': 'Pain Scale', 'ar': 'مقياس الألم'}, - 'weight' : {'en':'Weight','ar':'الوزن'}, - 'height' : {'en':'Height','ar':'الطول'}, - 'heart' :{'en':'Heart','ar':'قلب'}, + 'weight': {'en': 'Weight', 'ar': 'الوزن'}, + 'height': {'en': 'Height', 'ar': 'الطول'}, + 'heart': {'en': 'Heart', 'ar': 'قلب'}, "request": {"en": "Request", "ar": "طلبات الاضافة"}, "member-name": {"en": "Member Name", "ar": "اسم العضو"}, @@ -253,6 +319,21 @@ const Map> localizedValues = { "seeDetails": {"en": "SEE DETAILS", "ar": "منافعك التامينية"}, "insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"}, "requestType": {"en": "Request Type", "ar": "نوع الاستفسار"}, + "MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي الالكتروني'}, + "myMedicalFileSubTitle": {"en": "All your medical records", 'ar': 'جميع سجلاتك البية'}, + "viewMore": {"en": "View More", 'ar': 'عرض المزيد'}, + "homeHealthCareService": {"en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية'}, + "OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدلايات الحبيب'}, + "EmergencyService": {"en": "Emergency Service", 'ar': 'الفحص الطبي الشامل'}, + "OnlinePaymentService": {"en": "Online Payment Service", 'ar': 'خدمة الدفع عبر الإلكتدوني'}, + "OffersAndPackages": {"en": "Offers and Packages", 'ar': 'العروض والباقات'}, + "ComprehensiveMedicalCheckup": {"en": "Comprehensive Medical Check up", 'ar': 'فحص طبي شامل'}, + "HMGService": {"en": "HMG Service", 'ar': 'جميع خدمات الحبيب'}, + "ViewAllHabibMedicalService": {"en": "View All Habib Medical Service", 'ar': 'عرض خدمات الحبيب الطبية'}, + "viewAll": {"en": "View All", 'ar': 'عرض الكل'}, + "ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'}, + "ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'}, + "medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'}, "consultation": {"en": "Consultation", "ar": "استشارة"}, "logs": {"en": "Logs", "ar": "السجلات"} diff --git a/lib/core/model/rate/appointment_details.dart b/lib/core/model/rate/appointment_details.dart new file mode 100644 index 00000000..30280b4a --- /dev/null +++ b/lib/core/model/rate/appointment_details.dart @@ -0,0 +1,64 @@ +class AppointmentDetails { + String setupID; + int projectID; + int patientID; + int appointmentNo; + int clinicID; + int doctorID; + String startTime; + String endTime; + String appointmentDate; + String clinicName; + String doctorImageURL; + String doctorName; + String projectName; + + AppointmentDetails( + {this.setupID, + this.projectID, + this.patientID, + this.appointmentNo, + this.clinicID, + this.doctorID, + this.startTime, + this.endTime, + this.appointmentDate, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.projectName}); + + AppointmentDetails.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + appointmentNo = json['AppointmentNo']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + startTime = json['StartTime']; + endTime = json['EndTime']; + appointmentDate = json['AppointmentDate']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + projectName = json['ProjectName']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['AppointmentNo'] = this.appointmentNo; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['StartTime'] = this.startTime; + data['EndTime'] = this.endTime; + data['AppointmentDate'] = this.appointmentDate; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['ProjectName'] = this.projectName; + return data; + } +} diff --git a/lib/core/model/rate/appointment_rate.dart b/lib/core/model/rate/appointment_rate.dart new file mode 100644 index 00000000..abb249f4 --- /dev/null +++ b/lib/core/model/rate/appointment_rate.dart @@ -0,0 +1,100 @@ +class AppointmentRate { + int rate; + int appointmentNo; + int projectID; + int doctorID; + int clinicID; + String note; + String mobileNumber; + int createdBy; + int editedBy; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + AppointmentRate( + {this.rate, + this.appointmentNo, + this.projectID, + this.doctorID, + this.clinicID, + this.note, + this.mobileNumber, + this.createdBy, + this.editedBy, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + AppointmentRate.fromJson(Map json) { + rate = json['Rate']; + appointmentNo = json['AppointmentNo']; + projectID = json['ProjectID']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + note = json['Note']; + mobileNumber = json['MobileNumber']; + createdBy = json['CreatedBy']; + editedBy = json['EditedBy']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['Rate'] = this.rate; + data['AppointmentNo'] = this.appointmentNo; + data['ProjectID'] = this.projectID; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['Note'] = this.note; + data['MobileNumber'] = this.mobileNumber; + data['CreatedBy'] = this.createdBy; + data['EditedBy'] = this.editedBy; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/rate/appoitment_rated.dart b/lib/core/model/rate/appoitment_rated.dart new file mode 100644 index 00000000..95358b23 --- /dev/null +++ b/lib/core/model/rate/appoitment_rated.dart @@ -0,0 +1,160 @@ +class AppoitmentRated { + String setupID; + int projectID; + int appointmentNo; + String appointmentDate; + String appointmentDateN; + int appointmentType; + String bookDate; + int patientType; + int patientID; + int clinicID; + int doctorID; + String endDate; + String startTime; + String endTime; + int status; + int visitType; + int visitFor; + int patientStatusType; + int companyID; + int bookedBy; + String bookedOn; + int confirmedBy; + String confirmedOn; + int arrivalChangedBy; + String arrivedOn; + int editedBy; + String editedOn; + Null doctorName; + String doctorNameN; + String statusDesc; + String statusDescN; + bool vitalStatus; + Null vitalSignAppointmentNo; + int episodeID; + String doctorTitle; + bool isAppoitmentLiveCare; + + AppoitmentRated( + {this.setupID, + this.projectID, + this.appointmentNo, + this.appointmentDate, + this.appointmentDateN, + this.appointmentType, + this.bookDate, + this.patientType, + this.patientID, + this.clinicID, + this.doctorID, + this.endDate, + this.startTime, + this.endTime, + this.status, + this.visitType, + this.visitFor, + this.patientStatusType, + this.companyID, + this.bookedBy, + this.bookedOn, + this.confirmedBy, + this.confirmedOn, + this.arrivalChangedBy, + this.arrivedOn, + this.editedBy, + this.editedOn, + this.doctorName, + this.doctorNameN, + this.statusDesc, + this.statusDescN, + this.vitalStatus, + this.vitalSignAppointmentNo, + this.episodeID, + this.doctorTitle, + this.isAppoitmentLiveCare}); + + AppoitmentRated.fromJson(Map json) { + try { + setupID = json['SetupID']; + projectID = json['ProjectID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + appointmentDateN = json['AppointmentDateN']; + appointmentType = json['AppointmentType']; + bookDate = json['BookDate']; + patientType = json['PatientType']; + patientID = json['PatientID']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + endDate = json['EndDate']; + startTime = json['StartTime']; + endTime = json['EndTime']; + status = json['Status']; + visitType = json['VisitType']; + visitFor = json['VisitFor']; + patientStatusType = json['PatientStatusType']; + companyID = json['CompanyID']; + bookedBy = json['BookedBy']; + bookedOn = json['BookedOn']; + confirmedBy = json['ConfirmedBy']; + confirmedOn = json['ConfirmedOn']; + arrivalChangedBy = json['ArrivalChangedBy']; + arrivedOn = json['ArrivedOn']; + editedBy = json['EditedBy']; + editedOn = json['EditedOn']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + statusDesc = json['StatusDesc']; + statusDescN = json['StatusDescN']; + vitalStatus = json['VitalStatus']; + vitalSignAppointmentNo = json['VitalSignAppointmentNo']; + episodeID = json['EpisodeID']; + doctorTitle = json['DoctorTitle']; + isAppoitmentLiveCare = json['IsAppoitmentLiveCare']; + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentDateN'] = this.appointmentDateN; + data['AppointmentType'] = this.appointmentType; + data['BookDate'] = this.bookDate; + data['PatientType'] = this.patientType; + data['PatientID'] = this.patientID; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['EndDate'] = this.endDate; + data['StartTime'] = this.startTime; + data['EndTime'] = this.endTime; + data['Status'] = this.status; + data['VisitType'] = this.visitType; + data['VisitFor'] = this.visitFor; + data['PatientStatusType'] = this.patientStatusType; + data['CompanyID'] = this.companyID; + data['BookedBy'] = this.bookedBy; + data['BookedOn'] = this.bookedOn; + data['ConfirmedBy'] = this.confirmedBy; + data['ConfirmedOn'] = this.confirmedOn; + data['ArrivalChangedBy'] = this.arrivalChangedBy; + data['ArrivedOn'] = this.arrivedOn; + data['EditedBy'] = this.editedBy; + data['EditedOn'] = this.editedOn; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['StatusDesc'] = this.statusDesc; + data['StatusDescN'] = this.statusDescN; + data['VitalStatus'] = this.vitalStatus; + data['VitalSignAppointmentNo'] = this.vitalSignAppointmentNo; + data['EpisodeID'] = this.episodeID; + data['DoctorTitle'] = this.doctorTitle; + data['IsAppoitmentLiveCare'] = this.isAppoitmentLiveCare; + return data; + } +} diff --git a/lib/core/service/appointment_rate_service.dart b/lib/core/service/appointment_rate_service.dart new file mode 100644 index 00000000..a0c2b208 --- /dev/null +++ b/lib/core/service/appointment_rate_service.dart @@ -0,0 +1,71 @@ +import 'package:diplomaticquarterapp/config/config.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 { + List appointmentRatedList = List(); + AppointmentDetails appointmentDetails; + + Future getIsLastAppointmentRatedList() async { + hasError = false; + await baseAppClient.post(IS_LAST_APPOITMENT_RATED, + onSuccess: (dynamic response, int statusCode) { + appointmentRatedList.clear(); + response['IsLastAppoitmentRatedList'].forEach((appoint) { + appointmentRatedList.add(AppoitmentRated.fromJson(appoint)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + Future getAppointmentDetails() async { + hasError = false; + 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']); + }, 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 { + hasError = false; + AppointmentRate appointmentRate = AppointmentRate(); + appointmentRate.rate = rate; + appointmentRate.appointmentNo = appointmentNo; + appointmentRate.projectID = projectID; + appointmentRate.doctorID = doctorID; + appointmentRate.clinicID = clinicID; + appointmentRate.note = note; + + await baseAppClient.post(GET_APPOINTMENT_DETAILS_BY_NO, + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: appointmentRate.toJson()); + } + + AppoitmentRated get lastAppointmentRated { + if (appointmentRatedList.length > 0) + return appointmentRatedList[appointmentRatedList.length - 1]; + return null; + } + + deleteAppointmentRated(AppoitmentRated appointmentRated) { + appointmentRatedList.remove(appointmentRated); + } + + deleteAllAppAppointmentRate() => appointmentRatedList.clear(); +} diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 8e139aa1..ad8754e8 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -2,10 +2,16 @@ import 'dart:convert'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; +import '../../../locator.dart'; +import '../../../routes.dart'; + AppSharedPreferences sharedPref = new AppSharedPreferences(); ///Example @@ -15,6 +21,7 @@ AppSharedPreferences sharedPref = new AppSharedPreferences(); /// body: null); class BaseAppClient { + post(String endPoint, {Map body, Function(dynamic response, int statusCode) onSuccess, @@ -24,19 +31,32 @@ class BaseAppClient { try { //Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en'); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var user = await sharedPref.getObject(USER_PROFILE); - body['SetupID'] = body.containsKey('SetupID') ? body['SetupID']!=null? body['SetupID'] :SETUP_ID :SETUP_ID; - body['VersionID'] = body.containsKey('VersionID') ? body['VersionID']!=null? body['VersionID'] :VERSION_ID :VERSION_ID; + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null ? body['SetupID'] : SETUP_ID + : SETUP_ID; + body['VersionID'] = body.containsKey('VersionID') + ? body['VersionID'] != null ? body['VersionID'] : VERSION_ID + : VERSION_ID; body['Channel'] = CHANNEL; body['LanguageID'] = languageID == 'ar' ? 1 : 2; body['IPAdress'] = IP_ADDRESS; body['generalid'] = GENERAL_ID; - body['PatientOutSA'] = body.containsKey('PatientOutSA') ? body['PatientOutSA']!=null? body['PatientOutSA'] :PATIENT_OUT_SA :PATIENT_OUT_SA; + body['PatientOutSA'] = body.containsKey('PatientOutSA') + ? body['PatientOutSA'] != null ? body['PatientOutSA'] : PATIENT_OUT_SA + : PATIENT_OUT_SA; body['isDentalAllowedBackend'] = IS_DENTAL_ALLOWED_BACKEND; body['DeviceTypeID'] = DeviceTypeID; - body['PatientType'] = body.containsKey('PatientType') ? body['PatientType']!=null? body['PatientType'] :PATIENT_TYPE :PATIENT_TYPE; - body['PatientTypeID'] = body.containsKey('PatientTypeID') ? body['PatientTypeID']!=null? body['PatientTypeID'] :PATIENT_TYPE_ID :PATIENT_TYPE_ID; + body['PatientType'] = body.containsKey('PatientType') + ? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE + : PATIENT_TYPE; + body['PatientTypeID'] = body.containsKey('PatientTypeID') + ? body['PatientTypeID'] != null + ? body['PatientTypeID'] + : PATIENT_TYPE_ID + : PATIENT_TYPE_ID; if (user != null) { body['TokenID'] = token; body['PatientID'] = user['PatientID']; @@ -101,6 +121,8 @@ class BaseAppClient { logout() async { await sharedPref.remove(LOGIN_TOKEN_ID); + Navigator.of(AppGlobal.context).pushReplacementNamed(LOGIN_TYPE); + } String getSessionId(String id) { diff --git a/lib/core/service/dashboard_service.dart b/lib/core/service/dashboard_service.dart new file mode 100644 index 00000000..a15a4b39 --- /dev/null +++ b/lib/core/service/dashboard_service.dart @@ -0,0 +1,7 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart'; +import 'package:diplomaticquarterapp/core/service/base_service.dart'; + +class DashboardService extends BaseService { + +} diff --git a/lib/core/viewModels/appointment_rate_view_model.dart b/lib/core/viewModels/appointment_rate_view_model.dart new file mode 100644 index 00000000..23d00366 --- /dev/null +++ b/lib/core/viewModels/appointment_rate_view_model.dart @@ -0,0 +1,68 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +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(); + bool isHaveAppointmentNotRate = false; + + AppointmentDetails get appointmentDetails => _appointmentRateService.appointmentDetails; + + + Future getIsLastAppointmentRatedList() async { + isHaveAppointmentNotRate = false; + setState(ViewState.Busy); + await _appointmentRateService.getIsLastAppointmentRatedList(); + if (_appointmentRateService.hasError) { + error = _appointmentRateService.error; + setState(ViewState.Error); + } else { + if(_appointmentRateService.appointmentRatedList.length>0) + await getAppointmentDetails(); + } + } + + getAppointmentDetails() async { + await _appointmentRateService.getAppointmentDetails(); + if (_appointmentRateService.hasError) { + error = _appointmentRateService.error; + setState(ViewState.Error); + } else { + if (_appointmentRateService.appointmentDetails != null) + isHaveAppointmentNotRate = true; + setState(ViewState.Idle); + } + } + + Future sendAppointmentRate(int rate, int appointmentNo, int projectID, + int doctorID, int clinicID, String note) async { + setState(ViewState.BusyLocal); + await _appointmentRateService.sendAppointmentRate( + rate, appointmentNo, projectID, doctorID, clinicID, note); + if (_appointmentRateService.hasError) { + error = _appointmentRateService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + _appointmentRateService.deleteAllAppAppointmentRate(); + } + } + + AppoitmentRated get lastAppointmentRated => + _appointmentRateService.lastAppointmentRated; + + deleteAppointmentRated(AppoitmentRated appointmentRated) => + _appointmentRateService.deleteAppointmentRated(appointmentRated); + + deleteAppAppointmentRate() => + _appointmentRateService.deleteAllAppAppointmentRate(); + + setIsRated(bool isRated) { + this.isHaveAppointmentNotRate = isRated; + notifyListeners(); + } +} diff --git a/lib/core/viewModels/dashboard_view_model.dart b/lib/core/viewModels/dashboard_view_model.dart new file mode 100644 index 00000000..647d92b7 --- /dev/null +++ b/lib/core/viewModels/dashboard_view_model.dart @@ -0,0 +1,8 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/service/dashboard_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import '../../locator.dart'; + +class DashboardViewModel extends BaseViewModel { + +} diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index e91ea4f2..ed752b50 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -43,10 +43,10 @@ class ProjectViewModel with ChangeNotifier { void loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getString(APP_LANGUAGE); - _appLocale = Locale(currentLanguage ?? 'en'); + _appLocale = Locale(currentLanguage ?? 'ar'); _isArabic = currentLanguage != null ? currentLanguage == 'ar' ? true : false - : false; + : true; notifyListeners(); } diff --git a/lib/locator.dart b/lib/locator.dart index 7e6494fa..66face42 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,6 +1,9 @@ +import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:get_it/get_it.dart'; +import 'core/service/appointment_rate_service.dart'; +import 'core/service/dashboard_service.dart'; import 'core/service/feedback/feedback_service.dart'; import 'core/service/hospital_service.dart'; import 'core/service/medical/labs_service.dart'; @@ -9,6 +12,7 @@ import 'core/service/medical/my_doctor_service.dart'; import 'core/service/medical/prescriptions_service.dart'; import 'core/service/medical/radiology_service.dart'; import 'core/service/medical/vital_sign_service.dart'; +import 'core/viewModels/appointment_rate_view_model.dart'; import 'core/viewModels/feedback/feedback_view_model.dart'; import 'core/service/medical/reports_service.dart'; import 'core/viewModels/hospital_view_model.dart'; @@ -41,6 +45,8 @@ void setupLocator() { locator.registerLazySingleton(() => MedicalService()); locator.registerLazySingleton(() => NavigationService()); locator.registerLazySingleton(() => ReportsService()); + locator.registerLazySingleton(() => DashboardService()); + locator.registerLazySingleton(() => AppointmentRateService()); /// View Model locator.registerFactory(() => HospitalViewModel()); @@ -54,4 +60,7 @@ void setupLocator() { locator.registerFactory(() => VitalSignViewModel()); locator.registerFactory(() => InsuranceViewModel()); locator.registerFactory(() => MedicalViewModel()); + locator.registerFactory(() => DashboardViewModel()); + locator.registerFactory(() => AppointmentRateViewModel()); + } diff --git a/lib/main.dart b/lib/main.dart index 8c2b7808..ca2e7a82 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import 'config/size_config.dart'; @@ -57,7 +58,7 @@ class MyApp extends StatelessWidget { hintColor: Colors.grey[400], disabledColor: Colors.grey[300], errorColor: Color.fromRGBO(235, 80, 60, 1.0), - scaffoldBackgroundColor: Colors.grey[100], + scaffoldBackgroundColor:Hexcolor('#E0E0E0'),// Colors.grey[100], textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), textSelectionHandleColor: Color.fromRGBO(80, 100, 253, 1.0), canvasColor: Colors.white, diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 57a88991..3ab31dec 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -37,6 +37,7 @@ class _SearchResultsState extends State { itemCount: widget.doctorsList.length, itemBuilder: (context, index) { return DoctorView( + //AJ note doctor: widget.doctorsList[index], ); }, diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index edfa9cd1..03370d82 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -8,6 +9,7 @@ import 'package:flutter/material.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart'; import '../SearchResults.dart'; +import "dart:collection"; class SearchByClinic extends StatefulWidget { @override @@ -21,8 +23,7 @@ class _SearchByClinicState extends State { @override void initState() { - WidgetsBinding.instance - .addPostFrameCallback((_) => getClinicsList()); + WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList()); super.initState(); } @@ -97,11 +98,19 @@ class _SearchByClinicState extends State { } else {} }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } getDoctorsList(BuildContext context) { List doctorsList = []; + //======================== + + List arr = []; + var distinctIds; + List result; + int numAll; + //========================= DoctorsListService service = new DoctorsListService(); service.getDoctorsList(int.parse(dropdownValue), 0, context).then((res) { if (res['MessageStatus'] == 1) { @@ -110,22 +119,38 @@ class _SearchByClinicState extends State { doctorsList.clear(); res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); + + arr.add(new DoctorList.fromJson(v).projectName); + // print(DoctorList.fromJson(v).projectName); + // print(DoctorList.fromJson(v).projectDistanceInKiloMeters); + // distinctIds = result.toSet().toList(); }); } else {} }); - navigateToSearchResults(context, doctorsList); + + result = LinkedHashSet.from(arr).toList(); + numAll = result.length; + // print(result); + print("numAll=" + numAll.toString()); + + navigateToSearchResults(context, doctorsList, result, numAll); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { print(err); - }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); + }).showProgressBar( + text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); } - Future navigateToSearchResults(context, docList) async { + Future navigateToSearchResults(context, docList, result, numAll) async { Navigator.push( - context, - MaterialPageRoute( - builder: (context) => SearchResults(doctorsList: docList))); + context, + MaterialPageRoute( + builder: (context) => + BranchView(doctorsList: docList, result: result, num: numAll), + ), + ); + //builder: (context) => SearchResults(doctorsList: docList))); } } diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart new file mode 100644 index 00000000..82c38cb2 --- /dev/null +++ b/lib/pages/BookAppointment/widgets/BranchView.dart @@ -0,0 +1,173 @@ +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; + +import 'DoctorView.dart'; + +class BranchView extends StatefulWidget { + final List doctorsList; + + final List result; + final int num; + + const BranchView({Key key, this.doctorsList, this.result, this.num}) + : super(key: key); + + @override + _BranchViewState createState() => _BranchViewState(); +} + +class _BranchViewState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).bookAppo, + isShowAppBar: true, + body: new ListView.builder( + itemBuilder: (BuildContext context, int index) { + return new ExpandableListView( + + result2: widget.result, + val: index, + doctorsList2: widget.doctorsList); + }, + itemCount: widget.num, //5, + ), + ); + } +} + +class ExpandableListView extends StatefulWidget { + + final List result2; + final List doctorsList2; + final val; + + const ExpandableListView( + {Key key, this.result2, this.val, this.doctorsList2}) + : super(key: key); + + @override + _ExpandableListViewState createState() => new _ExpandableListViewState(); +} + +class _ExpandableListViewState extends State { + bool expandFlag = false; + + @override + Widget build(BuildContext context) { + return new Container( + // margin: new EdgeInsets.symmetric(vertical: 1.0), + width: MediaQuery.of(context).size.width * 0.6, + margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0), + child: Card( + // margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + child: Container( + decoration: BoxDecoration(), + padding: EdgeInsets.all(5.0), + width: MediaQuery.of(context).size.width, + child: new Column( + children: [ + new Container( + color: Colors.white, + // padding: new EdgeInsets.symmetric(horizontal: 5.0), + child: new Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + new Text( + widget.result2[widget.val].toString()+" "+ "22 كم", + style: new TextStyle( + fontWeight: FontWeight.bold, color: Colors.black), + ), + new IconButton( + icon: new Container( + height: 30.0, + width: 30.0, + decoration: new BoxDecoration( + color: Colors.red, + shape: BoxShape.circle, + ), + child: new Center( + child: new Icon( + expandFlag + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + size: 30.0, + ), + ), + ), + onPressed: () { + setState(() { + expandFlag = !expandFlag; + }); + }), + ], + ), + ), + // SizedBox(height: 15), + new ExpandableContainer( + expanded: expandFlag, + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: widget.doctorsList2.length, + itemBuilder: (context, index) { + return widget.result2[widget.val].toString() == + widget.doctorsList2[index].projectName.toString()? DoctorView( + //AJ note + doctor: + widget.doctorsList2[index] + + // widget.doctorsList2[index] + ):Container(); + }, + ), + ) + ], + ), + ), + ), + ); + } +} + +class ExpandableContainer extends StatelessWidget { + final bool expanded; + final double collapsedHeight; + final double expandedHeight; + final Widget child; + + ExpandableContainer({ + @required this.child, + this.collapsedHeight = 0.0, + this.expandedHeight = 300.0, + this.expanded = true, + }); + + @override + Widget build(BuildContext context) { + double screenWidth = MediaQuery.of(context).size.width; + return new AnimatedContainer( + duration: new Duration(milliseconds: 500), + curve: Curves.easeInOut, + width: screenWidth, + height: expanded ? expandedHeight : collapsedHeight, + child: new Container( + child: child, + decoration: new BoxDecoration( + border: new Border.all(width: 1.0, color: Colors.white)), + ), + ); + } +} diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 38838917..35068bd7 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -11,6 +11,7 @@ import '../DoctorProfile.dart'; class DoctorView extends StatelessWidget { DoctorList doctor; + DoctorView({@required this.doctor}); @override @@ -139,6 +140,8 @@ class DoctorView extends StatelessWidget { context, MaterialPageRoute( builder: (context) => - DoctorProfile(doctor: docObject, docProfileList: docProfile))); + DoctorProfile(doctor: docObject, docProfileList: docProfile) + + )); } } diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 6219f282..ad1bb32c 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -1,17 +1,14 @@ -import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/hospital_view_model.dart'; +import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.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 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacies_view_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_list_model.dart'; - -import '../base/base_view.dart'; -import '../feedback/feedback_home_page.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class HomePage extends StatefulWidget { @override @@ -21,54 +18,436 @@ class HomePage extends StatefulWidget { class _HomePageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( body: Container( width: double.infinity, - child: FractionallySizedBox( - widthFactor: 0.95, + child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - InkWell( - onTap: ()=>Navigator.push(context, FadePage(page: FeedbackHomePage())), - child: Container( - margin: EdgeInsets.only(top: 12), - width: double.infinity, - height: 180, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.circular(12.0), - border: Border.all( - color: Colors.grey[400], - width: 1.0, - ), + Stack( + children: [ + Column( + children: [ + Container( + width: double.infinity, + height: 210, + decoration: BoxDecoration( + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/timeline_bg.png'), + fit: BoxFit.cover), + ), + child: Stack( + children: [ + Positioned( + top: 30, + left: 15, + right: 15, + child: Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Row( + children: [ + Expanded( + child: InkWell( + onTap: ()=>Navigator.push(context, FadePage(page: LiveCareHome())), + child: Container( + height: 110, + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.transparent + .withOpacity(0.3), + ), + child: Center(child: Texts('Live care ',color: Colors.white,),), + ), + ), + ), + Expanded( + child: Container( + height: 110, + margin: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.transparent + .withOpacity(0.3), + )), + ), + ], + ), + ), + ) + ], + ), + ), + Container(width: double.infinity, height: 80) + ], ), - child: Center( - child: Texts('Feedback'), + Positioned( + top: 155, + left: MediaQuery.of(context).size.width * + (MediaQuery.of(context).orientation == + Orientation.landscape + ? 0.02 + : 0.03), + right: MediaQuery.of(context).size.width * + (MediaQuery.of(context).orientation == + Orientation.landscape + ? 0.02 + : 0.03), + child: Container( + width: double.infinity, + height: 125, + decoration: BoxDecoration( + color: Hexcolor('#A59E9E'), + shape: BoxShape.rectangle, + border: + Border.all(color: Colors.transparent, width: 0.5), + borderRadius: BorderRadius.all(Radius.circular(9)), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover)), + child: Container( + margin: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, + ), + Texts( + TranslationBase.of(context).myMedicalFile, + color: Colors.black87, + bold: true, + fontSize: 23, + ), + SizedBox( + height: 5, + ), + Texts( + TranslationBase.of(context).myMedicalFileSubTitle, + color: Colors.black, + fontSize: 16, + ), + Align( + alignment: projectViewModel.isArabic? Alignment.bottomLeft: Alignment.bottomRight, + child: InkWell( + onTap: () {}, + child: Container( + margin: EdgeInsets.all(2), + width: 90, + height: 30, + decoration: BoxDecoration( + color: Hexcolor('#D81A2E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), + ), + child: Center( + child: Texts( + TranslationBase.of(context).viewMore, + color: Colors.white, + fontSize: 12, + ), + ), + ), + ), + ) + ], + ), + ), + ), ), + ], + ), + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + DashboardItem( + 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: 15, + ), + Texts( + TranslationBase.of(context).homeHealthCareService, + textAlign: TextAlign.center, + color: Colors.white, + bold: true, + fontSize: 14, + ) + ], + ), + ), + ), + height: 150, + imageName: 'home_healthcare_service_bg.png', + opacity: 0.5, + ), + DashboardItem( + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/new-design/pharmacy_icon.png', + width: 40, + height: 40, + ), + SizedBox( + height: 15, + ), + Texts( + TranslationBase.of(context).onlinePharmacy, + textAlign: TextAlign.center, + color: Colors.white, + bold: true, + + ) + ], + ), + ), + ), + height: 150, + imageName: 'al-habib_onlne_pharmacy_bg.png', + ), + DashboardItem( + 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: 15, + ), + Texts( + TranslationBase.of(context).emergencyService, + textAlign: TextAlign.center, + color: Colors.white, + bold: true, + fontSize: 14, + ) + ], + ), + ), + ), + height: 150, + color: Hexcolor("#747C80"), + imageName: 'emergency_service_image.png', + ), + ], ), ), - InkWell( - onTap: ()=>Navigator.push(context, FadePage(page: LiveCareHome())), - child: Container( - margin: EdgeInsets.only(top: 12), - width: double.infinity, - height: 180, - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.circular(12.0), - border: Border.all( - color: Colors.grey[400], - width: 1.0, + SizedBox( + height: 8, + ), + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.29, + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/new-design/online_payment_icon.png', + width: 80, + height: 50, + ), + SizedBox( + height: 15, + ), + Texts( + TranslationBase.of(context).onlinePaymentService, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 2, + ) + ], + ), + ), + ), + height: 150, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + ), ), - ), - child: Center( - child: Texts('LiveCare'), - ), + Container( + child: Center( + child: Padding( + padding: const EdgeInsets.all(15.0), + child: Column( + children: [ + Image.asset( + 'assets/images/offer_icon.png', + width: 50, + height: 50, + ), + SizedBox( + height: 15, + ), + Texts( + TranslationBase.of(context).offersAndPackages, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 2, + ) + ], + ), + ), + ), + width: MediaQuery.of(context).size.width * 0.29, + height: 150, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + )), + Container( + width: MediaQuery.of(context).size.width * 0.29, + 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: 15, + ), + Texts( + TranslationBase.of(context).comprehensiveMedicalCheckup, + textAlign: TextAlign.center, + color: Colors.black87, + bold: false, + fontSize: SizeConfig.textMultiplier * 1.60, + ) + ], + ), + ), + ), + height: 150, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Colors.white, + ), + ), + ], ), ), + SizedBox( + height: 8, + ), + Container( + margin: EdgeInsets.only(left: 15, right: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + DashboardItem( + child: Container( + width: double.infinity, + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).hMGService, + color: Colors.white, + fontWeight: FontWeight.normal, + ), + + Texts( + TranslationBase.of(context).viewAllHabibMedicalService, + color: Colors.white, + fontWeight: FontWeight.normal, + fontSize: 10, + ), + Expanded( + child: Container(), + ), + Text( + TranslationBase.of(context).viewMore, + //color: Colors.white, + //fontWeight: FontWeight.normal, + ) + ], + ), + ), + height: 100, + imageName: 'hmg_services_bg .png', + opacity: 0.5, + color: Colors.grey[700], + width: MediaQuery.of(context).size.width * 0.45, + ), + DashboardItem( + child: Container( + width: double.infinity, + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).contactUs, + color: Colors.white, + fontWeight: FontWeight.normal, + ), + + Texts( + TranslationBase.of(context).viewAllWaysReachUs, + color: Colors.white, + fontWeight: FontWeight.normal, + fontSize: 10, + ), + Expanded( + child: Container(), + ), + Texts( + TranslationBase.of(context).viewMore, + color: Colors.white, + fontWeight: FontWeight.normal, + ) + ], + ), + ), + height: 100, + imageName: 'contact_us_bg.png', + opacity: 0.5, + color: Colors.grey[700], + width: MediaQuery.of(context).size.width * 0.45, + ), + ], + ), + ), + SizedBox( + height: 80, + ) ], ), ), @@ -76,3 +455,60 @@ class _HomePageState extends State { ); } } + +class DashboardItem extends StatelessWidget { + const DashboardItem( + {this.hasBorder = false, + this.imageName, + @required this.child, + this.onTap, + Key key, + this.width, + this.height, + this.color, + this.opacity = 0.4}) + : super(key: key); + final bool hasBorder; + final String imageName; + final Widget child; + final Function onTap; + final double width; + final double height; + final Color color; + final double opacity; + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + child: Container( + width: width != null ? width : MediaQuery.of(context).size.width * 0.29, + height: height != null + ? height + : MediaQuery.of(context).orientation == Orientation.portrait + ? MediaQuery.of(context).size.height * 0.19 + : MediaQuery.of(context).size.height * 0.35, + decoration: BoxDecoration( + color: !hasBorder + ? color != null ? color : Hexcolor('#050705').withOpacity(opacity) + : Colors.white, + borderRadius: BorderRadius.circular(6.0), + border: hasBorder + ? Border.all(width: 1.0, color: const Color(0xffcccccc)) + : Border.all(width: 0.0, color: Colors.transparent), + image: imageName != null + ? DecorationImage( + image: AssetImage('assets/images/$imageName'), + fit: BoxFit.cover, + colorFilter: new ColorFilter.mode( + Colors.black.withOpacity(0.2), BlendMode.dstIn), + ) + : null, + ), + child: Center( + child: child, + ), + ), + ); + } +} diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 7c32b212..99a5f10e 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/LiveCare/IncomingCallData.dart'; @@ -17,8 +18,10 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; import 'home_page.dart'; @@ -305,7 +308,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { case 0: return TranslationBase.of(context).home; case 1: - return 'Search Medicine'; + return 'Medical Profile'; case 2: return TranslationBase.of(context).mySchedule; case 3: diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index f72c7c6a..f223f91f 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -1,21 +1,32 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_request.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; +import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart'; -import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; class Login extends StatefulWidget { @override @@ -32,19 +43,14 @@ class _Login extends State { final authService = new AuthProvider(); var sharedPref = new AppSharedPreferences(); bool isLoading = false; + AppointmentRateViewModel appointmentRateViewModel = + locator(); @override void initState() { -// getDeviceToken(); super.initState(); } - getDeviceToken() async { - setState(() async { - nationalIDorFile.text = await sharedPref.getString(PUSH_TOKEN); - }); - } - @override Widget build(BuildContext context) { return AppScaffold( @@ -190,10 +196,30 @@ class _Login extends State { this.sharedPref.setObject(USER_PROFILE, result.list), this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), this.sharedPref.setString(TOKEN, result.authenticationTokenID), - //this.checkIfUserAgreedBefore(result), - Navigator.of(context).pushNamed( - HOME, - ) + + appointmentRateViewModel + .getIsLastAppointmentRatedList() + .then((value) => { + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.pushReplacement( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + ) + } + else + { + Navigator.pushReplacement( + context, + FadePage( + page: LandingPage(), + ), + ) + } + }) + // SMSOTP.showLoadingDialog(context, false), }); } diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 1e6a3b61..87486ce5 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -45,18 +45,34 @@ class _MedicalProfilePageState extends State { children: [ Container( width: double.infinity, - color: Colors.grey, height: 210, - child: ListView.builder( - itemBuilder: (context, index) => TimeLineWidget( - isUp: index % 2 == 1, - appoitmentAllHistoryResul: - model.appoitmentAllHistoryResultList[index], + decoration: BoxDecoration( + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/timeline_bg.png'), + fit: BoxFit.cover ), - itemCount: - model.appoitmentAllHistoryResultList.length, - scrollDirection: Axis.horizontal, - reverse: true, + + ), + child: Stack( + children: [ + Image.asset( + 'assets/images/timeline_bg.png', + fit: BoxFit.cover, + width: double.infinity, + ), + ListView.builder( + itemBuilder: (context, index) => TimeLineWidget( + isUp: index % 2 == 1, + appoitmentAllHistoryResul: model + .appoitmentAllHistoryResultList[index], + ), + itemCount: + model.appoitmentAllHistoryResultList.length, + scrollDirection: Axis.horizontal, + reverse: true, + ), + ], ), ), Padding( @@ -417,6 +433,11 @@ class _MedicalProfilePageState extends State { border: Border.all( color: Colors.transparent, width: 0.5), borderRadius: BorderRadius.all(Radius.circular(9)), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover + ) ), child: Column( crossAxisAlignment: CrossAxisAlignment.center, @@ -441,9 +462,15 @@ class _MedicalProfilePageState extends State { ), ), ), - - Positioned(top: 10,left: 10, - child: Texts('Time Line ',color: Colors.white,fontSize: 14,fontWeight: FontWeight.normal,), + Positioned( + top: 2, + left: 10, + child: Texts( + 'Time Line ', + color: Colors.white, + fontSize: 14, + fontWeight: FontWeight.normal, + ), ) ], ), diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart new file mode 100644 index 00000000..74f134ae --- /dev/null +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -0,0 +1,240 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +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/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.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:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class RateAppointmentClinic extends StatefulWidget { + final AppointmentDetails appointmentDetails; + final String doctorNote; + final int doctorRate; + + RateAppointmentClinic( + {this.appointmentDetails, this.doctorRate, this.doctorNote}); + + @override + _RateAppointmentClinicState createState() => _RateAppointmentClinicState(); +} + +class _RateAppointmentClinicState extends State { + final formKey = GlobalKey(); + String note = ""; + int rating = 0; + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + body: Scaffold( + backgroundColor: Colors.grey[200], + appBar: AppBar( + elevation: 0, + textTheme: TextTheme( + headline6: + TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + ), + title: Text('Rate'), + leading: Builder( + builder: (BuildContext context) { + return IconButton( + icon: Icon(Icons.menu), + color: Colors.white, + onPressed: () => Scaffold.of(context).openDrawer(), + ); + }, + ), + centerTitle: true, + ), + drawer: SafeArea(child: AppDrawer()), + body: FractionallySizedBox( + widthFactor: 1, + child: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(12), + child: Column( + children: [ + SizedBox( + height: 25, + ), + Texts( + 'How would you rate your last visit to the Clinic', + bold: true, + color: Colors.black, + ), + SizedBox( + height: 25, + ), + Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + ), + child: Column( + children: [ + SizedBox( + height: 8, + ), + LargeAvatar( + name: model.appointmentDetails.clinicName, + width: 110, + height: 110, + ), + SizedBox( + height: 22, + ), + Texts( + model.appointmentDetails.projectName, + bold: true, + ), + SizedBox( + height: 4, + ), + Texts( + model.appointmentDetails.clinicName, + bold: true, + ), + SizedBox( + height: 8, + ) + ], + ), + ), + SizedBox( + height: 12, + ), + Center( + child: Texts( + 'Please rate the Clinic', + textAlign: TextAlign.center, + )), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ...List.generate( + 5, + (index) => AnimatedSwitcher( + duration: Duration(milliseconds: 1000), + switchInCurve: Curves.elasticOut, + switchOutCurve: Curves.elasticIn, + transitionBuilder: + (Widget child, Animation animation) { + return ScaleTransition( + child: child, scale: animation); + }, + child: Container( + key: ValueKey(rating), + child: IconButton( + iconSize: 55.0, + onPressed: () { + setState(() { + rating = index + 1; + }); + }, + color: rating >= (index + 1) + ? Color.fromRGBO(255, 186, 0, 1.0) + : Colors.grey[400], + // Theme.of(context).hintColor, + icon: Icon(rating >= (index + 1) + ? EvaIcons.star + : EvaIcons.star)), + ), + ), + ) + ], + ), + SizedBox(height: 12), + SizedBox( + height: 12, + ), + ], + ), + ), + ), + ), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.15, + width: double.infinity, + color: Colors.grey[200], + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () async { + if (rating > 0) { + model + .sendAppointmentRate( + rating, + widget.appointmentDetails.appointmentNo, + widget.appointmentDetails.projectID, + widget.appointmentDetails.doctorID, + widget.appointmentDetails.clinicID, + note) + .then( + (value) => { + Navigator.pushReplacement( + context, + FadePage( + page: LandingPage(), + ), + ) + }, + ); + } else { + AppToast.showErrorToast( + message: 'please rate the clinic'); + } + }, + label: "Rate", + disabled: model.state == ViewState.BusyLocal, + loading: model.state == ViewState.BusyLocal, + textColor: Theme.of(context).backgroundColor), + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () { + Navigator.pushReplacement( + context, + FadePage( + page: LandingPage(), + ), + ); + }, + child: Texts( + 'Later', + decoration: TextDecoration.underline, + color: Hexcolor('#151DFE'), + fontSize: 18, + ), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart new file mode 100644 index 00000000..1583f033 --- /dev/null +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -0,0 +1,241 @@ +import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +import 'package:diplomaticquarterapp/core/model/rate/appointment_details.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_clinic.dart'; +import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.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:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class RateAppointmentDoctor extends StatefulWidget { + @override + _RateAppointmentDoctorState createState() => _RateAppointmentDoctorState(); +} + +class _RateAppointmentDoctorState extends State { + final formKey = GlobalKey(); + String note = ""; + int rating = 0; + + @override + Widget build(BuildContext context) { + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + body: Scaffold( + backgroundColor: Colors.grey[200], + appBar: AppBar( + elevation: 0, + textTheme: TextTheme( + headline6: + TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + ), + title: Text('Rate'), + leading: Builder( + builder: (BuildContext context) { + return IconButton( + icon: Icon(Icons.menu), + color: Colors.white, + onPressed: () => Scaffold.of(context).openDrawer(), + ); + }, + ), + centerTitle: true, + ), + drawer: SafeArea(child: AppDrawer()), + body: FractionallySizedBox( + widthFactor: 1, + child: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(12), + child: Column( + children: [ + SizedBox( + height: 25, + ), + Texts( + 'How would you rate your last visit to the doctor', + bold: true, + color: Colors.black, + ), + SizedBox( + height: 25, + ), + Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + shape: BoxShape.rectangle, + border: Border.all(color: Colors.white, width: 0.5), + ), + child: Column( + children: [ + SizedBox( + height: 8, + ), + LargeAvatar( + name: model.appointmentDetails.doctorName, + url: model.appointmentDetails.doctorImageURL, + width: 110, + height: 110, + ), + SizedBox( + height: 22, + ), + Texts( + model.appointmentDetails.doctorName, + bold: true, + ), + SizedBox( + height: 4, + ), + Texts( + model.appointmentDetails.clinicName, + bold: true, + ), + SizedBox( + height: 8, + ) + ], + ), + ), + SizedBox( + height: 12, + ), + Center( + child: Texts( + 'Please rate the doctor', + textAlign: TextAlign.center, + )), + SizedBox( + height: 12, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ...List.generate( + 5, + (index) => AnimatedSwitcher( + duration: Duration(milliseconds: 1000), + switchInCurve: Curves.elasticOut, + switchOutCurve: Curves.elasticIn, + transitionBuilder: + (Widget child, Animation animation) { + return ScaleTransition( + child: child, scale: animation); + }, + child: Container( + key: ValueKey(rating), + child: IconButton( + iconSize: 55.0, + onPressed: () { + setState(() { + rating = index + 1; + }); + }, + color: rating >= (index + 1) + ? Color.fromRGBO(255, 186, 0, 1.0) + : Colors.grey[400], + // Theme.of(context).hintColor, + icon: Icon(rating >= (index + 1) + ? EvaIcons.star + : EvaIcons.star)), + ), + ), + ) + ], + ), + SizedBox( + height: 12, + ), + Form( + key: formKey, + child: TextFields( + hintText: "Notes", + minLines: 4, + maxLines: 4, + validator: (value) { + if (value.isEmpty) + return 'Please enter your note'; + else if (rating == 0) return 'Rating cannot be \"0\"'; + return null; + }, + onChanged: (value) { + setState(() { + note = value; + }); + }, + ), + ), + SizedBox(height: 12,), + Container( + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () async { + final form = formKey.currentState; + if (form.validate()) { + form.save(); + Navigator.push( + context, + FadePage( + page: RateAppointmentClinic( + appointmentDetails: + model.appointmentDetails, + doctorNote: note, + doctorRate: rating, + ), + ), + ); + } + }, + label: "Next", + disabled: model.state == ViewState.BusyLocal, + loading: model.state == ViewState.BusyLocal, + textColor: Theme.of(context).backgroundColor), + ), + SizedBox( + height: 12, + ), + InkWell( + onTap: () { + Navigator.pushReplacement( + context, + FadePage( + page: LandingPage(), + ), + ); + }, + child: Texts( + 'Later', + decoration: TextDecoration.underline, + color: Hexcolor('#151DFE'), + fontSize: 18, + ), + ) + ], + ), + ) + ], + ), + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/routes.dart b/lib/routes.dart index eb9721df..b1f216e8 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -8,10 +8,8 @@ import 'package:diplomaticquarterapp/pages/login/welcome.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/pages/login/login.dart'; import 'package:diplomaticquarterapp/pages/login/register.dart'; -import 'package:flutter/material.dart'; const String INIT_ROUTE = '/'; -const String ROOT = 'root'; const String HOME = '/'; const String LOGIN = 'login'; const String WELCOME_LOGIN = 'welcome-login'; @@ -24,7 +22,6 @@ const String REGISTER_INFO = 'register-info'; const String MY_FAMILIY = 'my-family'; const String LIVE_CARE = 'live-care'; var routes = { - // ROOT: (_) => RootPage(), HOME: (_) => LandingPage(), WELCOME_LOGIN: (_) => WelcomeLogin(), LOGIN_TYPE: (_) => LoginType(), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 53a82426..13681a86 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -405,6 +405,23 @@ class TranslationBase { String get requestType => localizedValues['requestType'][locale.languageCode]; + String get myMedicalFile =>localizedValues['MyMedicalFile'][locale.languageCode]; + String get myMedicalFileSubTitle =>localizedValues['myMedicalFileSubTitle'][locale.languageCode]; + String get viewMore =>localizedValues['viewMore'][locale.languageCode]; + String get homeHealthCareService =>localizedValues['homeHealthCareService'][locale.languageCode]; + String get onlinePharmacy =>localizedValues['OnlinePharmacy'][locale.languageCode]; + String get emergencyService =>localizedValues['EmergencyService'][locale.languageCode]; + String get onlinePaymentService =>localizedValues['OnlinePaymentService'][locale.languageCode]; + String get offersAndPackages =>localizedValues['OffersAndPackages'][locale.languageCode]; + String get comprehensiveMedicalCheckup =>localizedValues['ComprehensiveMedicalCheckup'][locale.languageCode]; + String get hMGService =>localizedValues['HMGService'][locale.languageCode]; + String get viewAllHabibMedicalService =>localizedValues['ViewAllHabibMedicalService'][locale.languageCode]; + String get viewAll =>localizedValues['viewAll'][locale.languageCode]; + String get contactUs =>localizedValues['ContactUs'][locale.languageCode]; + String get viewAllWaysReachUs =>localizedValues['ViewAllWaysReachUs'][locale.languageCode]; + String get medicalProfile =>localizedValues['medicalProfile'][locale.languageCode]; + + String get consultation => localizedValues['consultation'][locale.languageCode]; String get logs => diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index dd186c56..890558dc 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -58,7 +58,7 @@ class _BottomNavBarState extends State { changeIndex: _changeIndex, index: _index, currentIndex: 1, - name: TranslationBase.of(context).replay2, + name: TranslationBase.of(context).medicalProfile, ), // Expanded( // child: SizedBox( diff --git a/lib/widgets/buttons/secondary_button.dart b/lib/widgets/buttons/secondary_button.dart index a63f027f..d805fc94 100644 --- a/lib/widgets/buttons/secondary_button.dart +++ b/lib/widgets/buttons/secondary_button.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; /// SecondaryButton widget /// [label] button label @@ -17,7 +18,7 @@ class SecondaryButton extends StatefulWidget { this.label = "", this.icon, this.iconOnly = false, - this.color, + this.color: const Color.fromRGBO(63, 72, 74, 1), this.textColor, this.onTap, this.loading: false, @@ -215,7 +216,8 @@ class _SecondaryButtonState extends State width: 19.0, child: CircularProgressIndicator( backgroundColor: Colors.white, - valueColor: AlwaysStoppedAnimation( + valueColor: + AlwaysStoppedAnimation( Colors.grey[300], ), ), @@ -224,12 +226,14 @@ class _SecondaryButtonState extends State : Padding( padding: EdgeInsets.only( bottom: widget.small ? 4.0 : 3.0), - child: Text(widget.label, - style: TextStyle( - color: widget.textColor, - fontSize: 17.0, - fontWeight: FontWeight.w800, - fontFamily: "WorkSans")), + child: Text( + widget.label, + style: TextStyle( + color: widget.textColor, + fontSize: 17.0, + fontWeight: FontWeight.w800, + fontFamily: "WorkSans"), + ), ) ], ) diff --git a/lib/widgets/data_display/medical/time_line_widget.dart b/lib/widgets/data_display/medical/time_line_widget.dart index 18887bd2..bbbbfeb2 100644 --- a/lib/widgets/data_display/medical/time_line_widget.dart +++ b/lib/widgets/data_display/medical/time_line_widget.dart @@ -20,7 +20,7 @@ class TimeLineWidget extends StatelessWidget { Container( width: 140, height: 190, - color: Colors.grey, + color: Colors.transparent, child: Center( child: Divider( color: Colors.white, diff --git a/lib/widgets/data_display/text.dart b/lib/widgets/data_display/text.dart index 4357b291..17ddf05b 100644 --- a/lib/widgets/data_display/text.dart +++ b/lib/widgets/data_display/text.dart @@ -21,6 +21,7 @@ class Texts extends StatefulWidget { final double marginRight; final double marginBottom; final double marginLeft; + final TextDecoration decoration; Texts(this.text, {Key key, @@ -42,7 +43,8 @@ class Texts extends StatefulWidget { this.marginBottom, this.marginLeft, this.marginRight, - this.marginTop}) + this.marginTop, + this.decoration}) : super(key: key); @override @@ -198,34 +200,35 @@ class _TextsState extends State { Stack( children: [ Text( - !hidden - ? text - : (text.substring( - 0, - text.length > widget.maxLength - ? widget.maxLength - : text.length)), - textAlign: widget.textAlign, - overflow: widget.maxLines != null - ? ((widget.maxLines > 1) - ? TextOverflow.fade - : TextOverflow.ellipsis) - : null, - maxLines: widget.maxLines ?? null, - style: widget.style != null - ? _getFontStyle().copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.color != null ? widget.color : null, - fontWeight: widget.fontWeight?? _getFontWeight(), - ) - : TextStyle( - fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.color ?? Colors.black, - fontSize: widget.fontSize ?? _getFontSize(), - letterSpacing: - widget.variant == "overline" ? 1.5 : null, - fontWeight: widget.fontWeight?? _getFontWeight(), - )), + !hidden + ? text + : (text.substring( + 0, + text.length > widget.maxLength + ? widget.maxLength + : text.length)), + textAlign: widget.textAlign, + overflow: widget.maxLines != null + ? ((widget.maxLines > 1) + ? TextOverflow.fade + : TextOverflow.ellipsis) + : null, + maxLines: widget.maxLines ?? null, + style: widget.style != null + ? _getFontStyle().copyWith( + fontStyle: widget.italic ? FontStyle.italic : null, + color: widget.color != null ? widget.color : null, + fontWeight: widget.fontWeight ?? _getFontWeight(), + ) + : TextStyle( + decoration: widget.decoration, + fontStyle: widget.italic ? FontStyle.italic : null, + color: widget.color ?? Colors.black, + fontSize: widget.fontSize ?? _getFontSize(), + letterSpacing: widget.variant == "overline" ? 1.5 : null, + fontWeight: widget.fontWeight ?? _getFontWeight(), + ), + ), if (widget.readMore && text.length > widget.maxLength && hidden) Positioned( bottom: 0,