Merge branch 'development_new_design_2.0' into mirza_home_page

# Conflicts:
#	lib/pages/insurance/insurance_card_screen.dart
#	lib/pages/medical/balance/advance_payment_page.dart
#	lib/pages/medical/balance/confirm_payment_page.dart
merge-requests/390/head
Mirza.Shafique 5 years ago
commit 3af1676730

@ -163,13 +163,11 @@ const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalRe
///Rate ///Rate
const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated';
const GET_APPOINTMENT_DETAILS_BY_NO = 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; 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 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 //URL to get clinic list
const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";

@ -303,11 +303,11 @@ const Map localizedValues = {
"gate": {"en": "Gate:", "ar": "بوابة"}, "gate": {"en": "Gate:", "ar": "بوابة"},
"building": {"en": "Building:", "ar": "المبنى"}, "building": {"en": "Building:", "ar": "المبنى"},
"branch": {"en": "Branch:", "ar": "الفرع"}, "branch": {"en": "Branch:", "ar": "الفرع"},
"emergencyServices": {"en": "Emergency Services:", "ar": "خدمات الطوارئ"}, "emergencyServices": {"en": "Emergency Services", "ar": "خدمات الطوارئ"},
"nearester": {"en": "Nearest ER:", "ar": "أقرب طوارى"}, "nearester": {"en": "Nearest ER", "ar": "أقرب طوارى"},
"locationa": {"en": "location:", "ar": "الموقع"}, "locationa": {"en": "location", "ar": "الموقع"},
"ambulancerequest": {"en": "Ambulance :", "ar": "طلب نقل "}, "ambulancerequest": {"en": "Ambulance", "ar": "طلب نقل "},
"requestA": {"en": "Request:", "ar": "اسعاف"}, "requestA": {"en": "Request", "ar": "اسعاف"},
"MyAppointments": {"en": "My", "ar": "مواعيدي"}, "MyAppointments": {"en": "My", "ar": "مواعيدي"},
"NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"}, "NoBookedAppointments": {"en": "No Booked Appointments", "ar": "لا توجد مواعيد محجوزة"},
"NoConfirmedAppointments": {"en": "No Confirmed 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": "الرجاء إدخال رمز التحقق المرسل إلى"}, "PleaseEnterTheVerificationCode": {"en": "Please enter the verification code send to", "ar": "الرجاء إدخال رمز التحقق المرسل إلى"},
"EyeMeasurements": {"en": "Eye Measurements", "ar": "قياسات النظر"}, "EyeMeasurements": {"en": "Eye Measurements", "ar": "قياسات النظر"},
"Measurements": {"en": "Measurements", "ar": "قياسات"}, "Measurements": {"en": "Measurements", "ar": "قياسات"},
"Classes": {"en": "Classes", "ar": "نظارات"}, "Classes": {"en": "Glasses", "ar": "نظارات"},
"ContactLens": {"en": "Contact Lens", "ar": "العدسات اللاصقة"}, "ContactLens": {"en": "Contact Lens", "ar": "العدسات اللاصقة"},
"RightEye": {"en": "Right Eye", "ar": "العين اليمين"}, "RightEye": {"en": "Right Eye", "ar": "العين اليمين"},
"Sphere": {"en": "Sphere", "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"}, "YouCanPayByTheFollowingOptions": {"en": "You can pay by the following options:", "ar": "I Accept the Terms And Conditions"},
"RRTDDetails": { "RRTDDetails": {
"en": "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": "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"}, "rrtService": {"en": "RRT Service", "ar": "خدمة RRT"},
"bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"}, "bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"},
@ -1417,5 +1417,48 @@ const Map localizedValues = {
}, },
"dental-procedure-list": {"en": "Dental Procedures for this Appointment: ", "ar": "إجراءات الأسنان لهذا الموعد:"}, "dental-procedure-list": {"en": "Dental Procedures for this Appointment: ", "ar": "إجراءات الأسنان لهذا الموعد:"},
"time-needed": {"en": "Time Needed:", "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 childs 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 يوم الماضية"
},
}; };

@ -33,3 +33,4 @@ const H2O_UNIT = 'H2O_UNIT';
const H2O_REMINDER = 'H2O_REMINDER'; const H2O_REMINDER = 'H2O_REMINDER';
const LIVECARE_CLINIC_DATA = 'LIVECARE_CLINIC_DATA'; const LIVECARE_CLINIC_DATA = 'LIVECARE_CLINIC_DATA';
const DOCTOR_SCHEDULE_DATE_SEL = 'DOCTOR_SCHEDULE_DATE_SEL'; const DOCTOR_SCHEDULE_DATE_SEL = 'DOCTOR_SCHEDULE_DATE_SEL';
const APPOINTMENT_HISTORY_MEDICAL = 'APPOINTMENT_HISTORY_MEDICAL';

@ -1,7 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart'; 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/appointment_rate.dart';
import 'package:diplomaticquarterapp/core/model/rate/appoitment_rated.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'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
class AppointmentRateService extends BaseService { class AppointmentRateService extends BaseService {
@ -10,8 +10,7 @@ class AppointmentRateService extends BaseService {
Future getIsLastAppointmentRatedList() async { Future getIsLastAppointmentRatedList() async {
hasError = false; hasError = false;
await baseAppClient.post(IS_LAST_APPOITMENT_RATED, await baseAppClient.post(IS_LAST_APPOITMENT_RATED, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
appointmentRatedList.clear(); appointmentRatedList.clear();
response['IsLastAppoitmentRatedList'].forEach((appoint) { response['IsLastAppoitmentRatedList'].forEach((appoint) {
appointmentRatedList.add(AppoitmentRated.fromJson(appoint)); appointmentRatedList.add(AppoitmentRated.fromJson(appoint));
@ -27,19 +26,15 @@ class AppointmentRateService extends BaseService {
Map<String, dynamic> bodyData = Map(); Map<String, dynamic> bodyData = Map();
bodyData['AppointmentNumber'] = appointmentRatedList[0].appointmentNo; bodyData['AppointmentNumber'] = appointmentRatedList[0].appointmentNo;
bodyData['ProjectID'] = appointmentRatedList[0].projectID; bodyData['ProjectID'] = appointmentRatedList[0].projectID;
await baseAppClient.post(GET_APPOINTMENT_DETAILS_BY_NO, await baseAppClient.post(GET_APPOINTMENT_DETAILS_BY_NO, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { if (response['AppointmentDetails'] != null) appointmentDetails = AppointmentDetails.fromJson(response['AppointmentDetails']);
if (response['AppointmentDetails'] != null)
appointmentDetails =
AppointmentDetails.fromJson(response['AppointmentDetails']);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: bodyData); }, body: bodyData);
} }
Future sendAppointmentRate(int rate, int appointmentNo, int projectID, Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async {
int doctorID, int clinicID, String note) async {
hasError = false; hasError = false;
AppointmentRate appointmentRate = AppointmentRate(); AppointmentRate appointmentRate = AppointmentRate();
appointmentRate.rate = rate; appointmentRate.rate = rate;
@ -48,18 +43,45 @@ class AppointmentRateService extends BaseService {
appointmentRate.doctorID = doctorID; appointmentRate.doctorID = doctorID;
appointmentRate.clinicID = clinicID; appointmentRate.clinicID = clinicID;
appointmentRate.note = note; appointmentRate.note = note;
appointmentRate.createdBy = 2;
appointmentRate.editedBy = 2;
await baseAppClient.post(GET_APPOINTMENT_DETAILS_BY_NO, await baseAppClient.post(NEW_RATE_APPOINTMENT_URL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: appointmentRate.toJson()); }, 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<String, dynamic> 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 { AppoitmentRated get lastAppointmentRated {
if (appointmentRatedList.length > 0) if (appointmentRatedList.length > 0) return appointmentRatedList[appointmentRatedList.length - 1];
return appointmentRatedList[appointmentRatedList.length - 1];
return null; return null;
} }

@ -7,9 +7,6 @@ class ErService extends BaseService {
List<ProjectAvgERWaitingTime> projectAvgERWaitingTimeModelList = List(); List<ProjectAvgERWaitingTime> projectAvgERWaitingTimeModelList = List();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
String Latitude = "";
String Longitude = "";
String PhoneNumber = "";
Future getProjectAvgERWaitingTimeOrders({int id, int projectID}) async { Future getProjectAvgERWaitingTimeOrders({int id, int projectID}) async {
hasError = false; hasError = false;
@ -23,21 +20,15 @@ class ErService extends BaseService {
body['Latitude'] = lat ?? 0; body['Latitude'] = lat ?? 0;
body['Longitude'] = long ?? 0; body['Longitude'] = long ?? 0;
dynamic localRes;
await baseAppClient.post(GET_NEAREST_HOSPITAL, await baseAppClient.post(GET_NEAREST_HOSPITAL,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
projectAvgERWaitingTimeModelList.clear(); localRes = response;
response['List_ProjectAvgERWaitingTime'].forEach((vital) {
projectAvgERWaitingTimeModelList
.add(ProjectAvgERWaitingTime.fromJson(vital));
});
projectAvgERWaitingTimeModelList.forEach((element) {
Latitude = '${element.latitude}';
Longitude = '${element.longitude}';
PhoneNumber = '${element.phoneNumber}';
});
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
return Future.value(localRes);
} }
} }

@ -16,14 +16,16 @@ class AskDoctorService extends BaseService {
body['DoctorID'] = doctorId; body['DoctorID'] = doctorId;
body['ProjectID'] = projectId; body['ProjectID'] = projectId;
dynamic localRes;
await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT, await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
///OKAY localRes = response;
var asd="";
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
return Future.value(localRes);
} }
Future getCallRequestTypeLOV() async { Future getCallRequestTypeLOV() async {

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart';
@ -18,16 +19,24 @@ class MedicalService extends BaseService {
body['IsActiveAppointment'] = true; body['IsActiveAppointment'] = true;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
} }
var appoHistory = await sharedPref.getObject(APPOINTMENT_HISTORY_MEDICAL);
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async { if (appoHistory != null) {
appoitmentAllHistoryResultList.clear(); appoitmentAllHistoryResultList.clear();
response['AppoimentAllHistoryResultList'].forEach((appoitment) { appoHistory.forEach((appoitment) {
appoitmentAllHistoryResultList.add(AppoitmentAllHistoryResultList.fromJson(appoitment)); appoitmentAllHistoryResultList.add(AppoitmentAllHistoryResultList.fromJson(appoitment));
}); });
}, onFailure: (String error, int statusCode) { } else {
hasError = true; await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async {
super.error = error; appoitmentAllHistoryResultList.clear();
}, body: body); 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 { addAmbulanceRequest({@required PatientER patientER}) async {

@ -17,7 +17,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class MyBalanceService extends BaseService { class MyBalanceService extends BaseService {
List<PatientAdvanceBalanceAmount> patientAdvanceBalanceAmountList = List(); List<PatientAdvanceBalanceAmount> patientAdvanceBalanceAmountList = List();
double totalAdvanceBalanceAmount; dynamic totalAdvanceBalanceAmount;
List<PatientInfo> patientInfoList = List(); List<PatientInfo> patientInfoList = List();
GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse =
GetAllSharedRecordsByStatusResponse(); GetAllSharedRecordsByStatusResponse();

@ -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/model/rate/appoitment_rated.dart';
import 'package:diplomaticquarterapp/core/service/appointment_rate_service.dart'; import 'package:diplomaticquarterapp/core/service/appointment_rate_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../locator.dart'; import '../../locator.dart';
class AppointmentRateViewModel extends BaseViewModel { class AppointmentRateViewModel extends BaseViewModel {
AppointmentRateService _appointmentRateService = AppointmentRateService _appointmentRateService = locator<AppointmentRateService>();
locator<AppointmentRateService>();
bool isHaveAppointmentNotRate = false; bool isHaveAppointmentNotRate = false;
AppointmentDetails get appointmentDetails => _appointmentRateService.appointmentDetails; AppointmentDetails get appointmentDetails => _appointmentRateService.appointmentDetails;
Future getIsLastAppointmentRatedList() async { Future getIsLastAppointmentRatedList() async {
isHaveAppointmentNotRate = false; isHaveAppointmentNotRate = false;
setState(ViewState.Busy); setState(ViewState.Busy);
@ -21,8 +20,7 @@ class AppointmentRateViewModel extends BaseViewModel {
error = _appointmentRateService.error; error = _appointmentRateService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
if(_appointmentRateService.appointmentRatedList.length>0) if (_appointmentRateService.appointmentRatedList.length > 0) await getAppointmentDetails();
await getAppointmentDetails();
} }
} }
@ -32,17 +30,14 @@ class AppointmentRateViewModel extends BaseViewModel {
error = _appointmentRateService.error; error = _appointmentRateService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
if (_appointmentRateService.appointmentDetails != null) if (_appointmentRateService.appointmentDetails != null) isHaveAppointmentNotRate = true;
isHaveAppointmentNotRate = true;
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future sendAppointmentRate(int rate, int appointmentNo, int projectID, Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async {
int doctorID, int clinicID, String note) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _appointmentRateService.sendAppointmentRate( await _appointmentRateService.sendAppointmentRate(rate, appointmentNo, projectID, doctorID, clinicID, note);
rate, appointmentNo, projectID, doctorID, clinicID, note);
if (_appointmentRateService.hasError) { if (_appointmentRateService.hasError) {
error = _appointmentRateService.error; error = _appointmentRateService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -52,14 +47,23 @@ class AppointmentRateViewModel extends BaseViewModel {
} }
} }
AppoitmentRated get lastAppointmentRated => Future sendDoctorRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, String appoDate, String docName, String projectName, String clinicName) async {
_appointmentRateService.lastAppointmentRated; 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) => AppoitmentRated get lastAppointmentRated => _appointmentRateService.lastAppointmentRated;
_appointmentRateService.deleteAppointmentRated(appointmentRated);
deleteAppAppointmentRate() => deleteAppointmentRated(AppoitmentRated appointmentRated) => _appointmentRateService.deleteAppointmentRated(appointmentRated);
_appointmentRateService.deleteAllAppAppointmentRate();
deleteAppAppointmentRate() => _appointmentRateService.deleteAllAppAppointmentRate();
setIsRated(bool isRated) { setIsRated(bool isRated) {
this.isHaveAppointmentNotRate = isRated; this.isHaveAppointmentNotRate = isRated;

@ -12,11 +12,10 @@ class DashboardViewModel extends BaseViewModel {
String get heightCm => _vitalSignService.heightCm; String get heightCm => _vitalSignService.heightCm;
String booldType = "-"; String booldType = "-";
DashboardViewModel() { DashboardViewModel() {
this.getPatientRadOrders(); // this.getPatientRadOrders();
} }
// ToDoCountProviderModel toDoProvider =
// Provider.of<ToDoCountProviderModel>(AppGlobal.context);
getPatientRadOrders() async { getPatientRadOrders() async {
if (isLogin && _vitalSignService.weightKg.isEmpty) { 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);
// });
// }
} }

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/ask_doctor/AskDoctorReqTypes.dart'; import 'package:diplomaticquarterapp/core/model/ask_doctor/AskDoctorReqTypes.dart';
import 'package:diplomaticquarterapp/core/model/ask_doctor/DoctorResponse.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/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.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/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class AskDoctorViewModel extends BaseViewModel { class AskDoctorViewModel extends BaseViewModel {
AskDoctorService _askDoctorService = locator<AskDoctorService>(); AskDoctorService _askDoctorService = locator<AskDoctorService>();
MyDoctorService _myDoctorService = locator<MyDoctorService>(); MyDoctorService _myDoctorService = locator<MyDoctorService>();
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital = List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital = List();
List();
List<AskDoctorReqTypes> get askDoctorReqTypes => List<AskDoctorReqTypes> get askDoctorReqTypes => _askDoctorService.askDoctorReqTypes;
_askDoctorService.askDoctorReqTypes;
List<DoctorResponse> get doctorResponseList => List<DoctorResponse> get doctorResponseList => _askDoctorService.doctorResponseList;
_askDoctorService.doctorResponseList;
Future getMyDoctor() async { Future getMyDoctor() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _myDoctorService.getPatientDoctorAppointmentList( await _myDoctorService.getPatientDoctorAppointmentList(top: 25, beforeDays: 15);
top: 25, beforeDays: 15);
if (_myDoctorService.hasError) { if (_myDoctorService.hasError) {
error = _myDoctorService.error; error = _myDoctorService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else if (_myDoctorService.patientDoctorAppointmentList.length != 0) {
var asd = ""; _myDoctorService.patientDoctorAppointmentList.forEach((element) {
_myDoctorService.patientDoctorAppointmentList.forEach((element) { List<PatientDoctorAppointmentList> doctorByClinic = patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
List<PatientDoctorAppointmentList> 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));
}
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); setState(ViewState.Idle);
}); AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).askDocEmpty);
}
} }
Future getCallRequestTypeLOVs() async { Future getCallRequestTypeLOVs() async {
@ -66,8 +56,7 @@ class AskDoctorViewModel extends BaseViewModel {
Future getCallInfoHoursResult({int projectId, int doctorId}) async { Future getCallInfoHoursResult({int projectId, int doctorId}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _askDoctorService.getCallInfoHoursResult( await _askDoctorService.getCallInfoHoursResult(projectId: projectId, doctorId: doctorId);
projectId: projectId, doctorId: doctorId);
if (_askDoctorService.hasError) { if (_askDoctorService.hasError) {
error = _askDoctorService.error; error = _askDoctorService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -95,11 +84,9 @@ class AskDoctorViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future sendRequestLOV( Future sendRequestLOV({DoctorList doctorList, String requestType, String remark}) async {
{DoctorList doctorList, String requestType, String remark}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _askDoctorService.sendRequestLOV( await _askDoctorService.sendRequestLOV(doctorList: doctorList, requestType: requestType, remark: remark);
doctorList: doctorList, requestType: requestType, remark: remark);
if (_askDoctorService.hasError) { if (_askDoctorService.hasError) {
error = _askDoctorService.error; error = _askDoctorService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -38,7 +38,7 @@ class MyBalanceViewModel extends BaseViewModel {
//=========================== //===========================
double get totalAdvanceBalanceAmount => dynamic get totalAdvanceBalanceAmount =>
_myBalanceService.totalAdvanceBalanceAmount; _myBalanceService.totalAdvanceBalanceAmount;
String get updatedRegisterBloodMessage => String get updatedRegisterBloodMessage =>

@ -43,9 +43,8 @@ class _CMCPageState extends State<CMCPage> with SingleTickerProviderStateMixin {
description: TranslationBase.of(context).infoCMC, description: TranslationBase.of(context).infoCMC,
imagesInfo: [ imagesInfo: [
ImagesInfo( ImagesInfo(
imageAr: 'assets/images/Wifi-AR.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/CMC/ar/0.png',
imageEn: 'assets/images/wifi-EN.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/CMC/en/0.png')
isAsset: true)
], ],
appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup, appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup,
body: Scaffold( body: Scaffold(

@ -2,7 +2,6 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.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/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -46,9 +45,8 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage>
appBarTitle: TranslationBase.of(context).homeHealthCare, appBarTitle: TranslationBase.of(context).homeHealthCare,
imagesInfo: [ imagesInfo: [
ImagesInfo( ImagesInfo(
imageAr: 'assets/images/Wifi-AR.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/HHC/ar/0.png',
imageEn: 'assets/images/wifi-EN.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/HHC/en/0.png')
isAsset: true)
], ],
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,

@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/child_vaccines_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_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/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.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/landing/landing_page_pharmcy.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.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/paymentService/payment_service.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
@ -226,7 +228,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage(), FadePage(page: CovidDrivethruLocation()),
), ),
imageLocation: 'assets/images/al-habib_online_payment_service_icon.png', imageLocation: 'assets/images/al-habib_online_payment_service_icon.png',
title: TranslationBase.of(context).covid19_driveThrueTest, title: TranslationBase.of(context).covid19_driveThrueTest,
@ -247,12 +249,6 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
), ),
ServicesContainer( ServicesContainer(
onTap: () => getPharmacyToken(), onTap: () => getPharmacyToken(),
// Navigator.push(
// context,
// FadePage(
// page: ParkingPage(),
// ),
// ),
imageLocation: 'assets/images/pharmacy_logo.png', imageLocation: 'assets/images/pharmacy_logo.png',
title: TranslationBase.of(context).pharmacy), title: TranslationBase.of(context).pharmacy),
ServicesContainer( ServicesContainer(
@ -300,14 +296,14 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
imageLocation: 'assets/images/new-design/upcoming_icon_bottom_bar.png', imageLocation: 'assets/images/new-design/upcoming_icon_bottom_bar.png',
title: TranslationBase.of(context).todoList, title: TranslationBase.of(context).todoList,
), ),
if (projectViewModel.havePrivilege(42)) // if (projectViewModel.havePrivilege(42))
ServicesContainer( // ServicesContainer(
onTap: () => Navigator.push( // onTap: () => Navigator.push(
context, // context,
FadePage(page: SymptomInfo()), // FadePage(page: SymptomInfo()),
), // ),
imageLocation: 'assets/images/new-design/body_icon.png', // imageLocation: 'assets/images/new-design/body_icon.png',
title: TranslationBase.of(context).symptomCheckerTitle), // title: TranslationBase.of(context).symptomCheckerTitle),
if (projectViewModel.havePrivilege(36)) if (projectViewModel.havePrivilege(36))
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
@ -340,12 +336,6 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
if (projectViewModel.havePrivilege(38)) if (projectViewModel.havePrivilege(38))
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push(context, FadePage(page: H2OPage())), onTap: () => Navigator.push(context, FadePage(page: H2OPage())),
// Navigator.push(
// context,
// FadePage(
// page: H2OPageIndexPage(),
// ),
// ),
imageLocation: 'assets/images/new-design/water_icon.png', imageLocation: 'assets/images/new-design/water_icon.png',
title: TranslationBase.of(context).h2o, title: TranslationBase.of(context).h2o,
), ),
@ -353,7 +343,9 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage(), FadePage(
page: SmartWatchInstructions()
),
), ),
imageLocation: 'assets/images/new-design/smartwatch_icon.png', imageLocation: 'assets/images/new-design/smartwatch_icon.png',
title: TranslationBase.of(context).smartWatches, title: TranslationBase.of(context).smartWatches,

@ -1,12 +1,12 @@
import 'dart:ui'; import 'dart:ui';
import 'package:diplomaticquarterapp/config/config.dart'; 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/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.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/month_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/today_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/week_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/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
@ -49,22 +49,29 @@ class _H2OPageState extends State<H2OPage> with SingleTickerProviderStateMixin {
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).waterTracker, 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, showHomeAppBarIcon: false,
baseViewModel: model, baseViewModel: model,
isHelp: true, isHelp: true,
appBarIcons: [ appBarIcons: [
IconButton( model.isLogin
icon: Image.asset("assets/images/new-design/setting_gear_icon.png"), ? IconButton(
color: Colors.white, icon: Image.asset("assets/images/new-design/setting_gear_icon.png"),
onPressed: () { color: Colors.white,
Navigator.push( onPressed: () {
context, Navigator.push(
FadePage( context,
page: H2oSetting(userDetailModel: model.userDetail, viewModel: model), FadePage(
), page: H2oSetting(userDetailModel: model.userDetail, viewModel: model),
); ),
}, );
), },
)
: Container(),
], ],
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,

@ -56,28 +56,28 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
GetAllSharedRecordsByStatusList selectedPatientFamily; GetAllSharedRecordsByStatusList selectedPatientFamily;
AdvanceModel advanceModel = AdvanceModel(); AdvanceModel advanceModel = AdvanceModel();
List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-");
List_BloodGroupDetailsModel(bloodGroup: "A-");
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; AuthenticatedUser authUser;
var checkedValue = false; var checkedValue = false;
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
ProjectViewModel projectProvider;
@override @override
void initState() { 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(); super.initState();
getAuthUser();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
imagesInfo.add( projectProvider = Provider.of(context);
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);
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) => model.getCities(), //model.getHospitals(), onModelReady: (model) => model.getCities(), //model.getHospitals(),
@ -102,22 +102,16 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
height: 12, height: 12,
), ),
InkWell( InkWell(
onTap: () => onTap: () => confirmSelectHospitalDialog(model.CitiesModelList),
confirmSelectHospitalDialog(model.CitiesModelList),
//model.hospitals //model.hospitals
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Theme.of(context).primaryColor),
borderRadius: BorderRadius.circular(12),
color: Theme.of(context).primaryColor),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [Texts(getHospitalName(projectProvider, context)), Icon(Icons.arrow_drop_down)],
Texts(getHospitalName(projectProvider, context)),
Icon(Icons.arrow_drop_down)
],
), ),
), ),
), ),
@ -132,9 +126,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Theme.of(context).primaryColor),
borderRadius: BorderRadius.circular(12),
color: Theme.of(context).primaryColor),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -156,9 +148,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Theme.of(context).primaryColor),
borderRadius: BorderRadius.circular(12),
color: Theme.of(context).primaryColor),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -175,16 +165,14 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
Row( Row(
children: [ children: [
Container( Container(
child: Text( child: Text(TranslationBase.of(context).viewTermsConditions),
TranslationBase.of(context).viewTermsConditions),
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.height * 0.10, width: MediaQuery.of(context).size.height * 0.10,
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.of(context) Navigator.of(context).push(FadePage(page: UserAgreementPage()));
.push(FadePage(page: UserAgreementPage()));
}, },
child: Container( child: Container(
child: Texts( child: Texts(
@ -220,12 +208,8 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
width: 10, width: 10,
), ),
Text( Text(
TranslationBase.of(context) TranslationBase.of(context).iAgreeToTheTermsAndConditions,
.iAgreeToTheTermsAndConditions, style: Theme.of(context).textTheme.subtitle1.copyWith(color: checkedValue ? Color(0xFFc5272d) : Colors.black),
style: Theme.of(context).textTheme.subtitle1.copyWith(
color: checkedValue
? Color(0xFFc5272d)
: Colors.black),
), ),
], ],
), ),
@ -247,23 +231,15 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
builder: (_) => AssetGiffyDialog( builder: (_) => AssetGiffyDialog(
title: Text( title: Text(
"", "",
style: TextStyle( style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.w600),
fontSize: 22.0,
fontWeight: FontWeight.w600),
), ),
image: Image.asset( image: Image.asset('assets/images/BloodChrt_EN.png'),
'assets/images/BloodChrt_EN.png'), buttonCancelText: Text(TranslationBase.of(context).cancel),
buttonCancelText: Text(
TranslationBase.of(context).cancel),
buttonCancelColor: Colors.grey, buttonCancelColor: Colors.grey,
onlyCancelButton: true, onlyCancelButton: true,
)); ));
}, },
child: Container( child: Container(width: 250, height: 200, child: Image.asset('assets/images/BloodChrt_EN.png')),
width: 250,
height: 200,
child: Image.asset(
'assets/images/BloodChrt_EN.png')),
), ),
), ),
), ),
@ -293,19 +269,15 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
label: TranslationBase.of(context).save, label: TranslationBase.of(context).save,
onTap: () async { onTap: () async {
if (_selectedHospital == null) { if (_selectedHospital == null) {
AppToast.showErrorToast( AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
message: TranslationBase.of(context).selectCity);
return; return;
} }
bloodDetails.city = projectProvider.isArabic bloodDetails.city = projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description;
? _selectedHospital.descriptionN
: _selectedHospital.description;
bloodDetails.cityCode = _selectedHospital.iD.toString(); bloodDetails.cityCode = _selectedHospital.iD.toString();
bloodDetails.gender = gender == Gender.Male ? 1 : 2; bloodDetails.gender = gender == Gender.Male ? 1 : 2;
await model.updateBloodGroup(bloodDetails); await model.updateBloodGroup(bloodDetails);
if (model.state == ViewState.Idle) { if (model.state == ViewState.Idle) {
AppToast.showSuccessToast( AppToast.showSuccessToast(message: model.updatedRegisterBloodMessage);
message: model.updatedRegisterBloodMessage);
} else { } else {
AppToast.showErrorToast(message: model.error); AppToast.showErrorToast(message: model.error);
} }
@ -325,8 +297,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
setState(() { setState(() {
if (value == BeneficiaryType.MyAccount) { if (value == BeneficiaryType.MyAccount) {
_fileTextController.text = model.user.patientID.toString(); _fileTextController.text = model.user.patientID.toString();
advanceModel.depositorName = advanceModel.depositorName = model.user.firstName + " " + model.user.lastName;
model.user.firstName + " " + model.user.lastName;
} else } else
_fileTextController.text = ""; _fileTextController.text = "";
@ -453,8 +424,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
); );
} }
void confirmSelectFamilyDialog( void confirmSelectFamilyDialog(List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) {
List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) {
showDialog( showDialog(
context: context, context: context,
child: SelectPatientFamilyDialog( child: SelectPatientFamilyDialog(
@ -463,8 +433,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
onValueSelected: (value) { onValueSelected: (value) {
setState(() { setState(() {
selectedPatientFamily = value; selectedPatientFamily = value;
_fileTextController.text = _fileTextController.text = selectedPatientFamily.patientID.toString();
selectedPatientFamily.patientID.toString();
advanceModel.depositorName = value.patientName; advanceModel.depositorName = value.patientName;
}); });
}, },
@ -538,12 +507,9 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary; return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary;
} }
String getHospitalName( String getHospitalName(ProjectViewModel projectProvider, BuildContext context) {
ProjectViewModel projectProvider, BuildContext context) {
if (_selectedHospital != null) if (_selectedHospital != null)
return projectProvider.isArabic return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description;
? _selectedHospital.descriptionN
: _selectedHospital.description;
else else
return TranslationBase.of(context).selectCity; return TranslationBase.of(context).selectCity;
// return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital; // return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital;
@ -558,8 +524,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
getAuthUser() async { getAuthUser() async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
setState(() { setState(() {
authUser = data; authUser = data;
}); });

@ -218,7 +218,9 @@ class ConfirmPaymentPage extends StatelessWidget {
authenticatedUser.patientID, authenticatedUser.patientID,
authenticatedUser, authenticatedUser,
browser, browser,
false); false,
null,
null);
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {

@ -509,6 +509,8 @@ class _BookSuccessState extends State<BookSuccess> {
authenticatedUser, authenticatedUser,
widget.browser, widget.browser,
widget.patientShareResponse.isLiveCareAppointment, widget.patientShareResponse.isLiveCareAppointment,
null,
null,
widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo, widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID, widget.patientShareResponse.clinicID,

@ -53,6 +53,7 @@ class _DentalComplaintsState extends State<DentalComplaints> {
appBarTitle: "Symptoms", appBarTitle: "Symptoms",
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
isShowDecPage: false,
backgroundColor: CustomColors.appBackgroudGreyColor, backgroundColor: CustomColors.appBackgroudGreyColor,
body: Container( body: Container(
child: !hasDentalPlan child: !hasDentalPlan

@ -115,6 +115,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
widget.doctor.noOfPatientsRate, widget.doctor.noOfPatientsRate,
"", "",
), ),
buttonIcon: 'assets/images/new/Boo_ Appointment.svg',
showConfirmMessageDialog: false, showConfirmMessageDialog: false,
onTap: () { onTap: () {
Navigator.push( Navigator.push(

@ -173,7 +173,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
), ),
), ),
Text( Text(
"30", projectViewModel.isLogin ? projectViewModel.user.age.toString() : "",
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15,
letterSpacing: -0.59, letterSpacing: -0.59,
@ -251,6 +251,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
height: 18, height: 18,
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<String>(
onTap: () {
print("Clicked");
},
key: clinicDropdownKey, key: clinicDropdownKey,
hint: new Text( hint: new Text(
TranslationBase.of(context).selectClinic, TranslationBase.of(context).selectClinic,
@ -270,6 +273,9 @@ class _SearchByClinicState extends State<SearchByClinic> {
item.liveCareServiceID.toString(), item.liveCareServiceID.toString(),
child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ child: Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Text(item.clinicDescription), 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(), }).toList(),
@ -448,8 +454,10 @@ class _SearchByClinicState extends State<SearchByClinic> {
page: LiveCareBookAppointment(clinicName: "Family Medicine", liveCareClinicID: dropdownValue.split("-")[2], liveCareServiceID: dropdownValue.split("-")[3]), page: LiveCareBookAppointment(clinicName: "Family Medicine", liveCareClinicID: dropdownValue.split("-")[2], liveCareServiceID: dropdownValue.split("-")[3]),
), ),
).then((value) { ).then((value) {
print(value); setState(() {
if (value == "false") dropdownValue = ""; print(value);
if (value == "false") dropdownValue = null;
});
if (value == "livecare") { if (value == "livecare") {
Navigator.push(context, FadePage(page: LiveCareHome())); Navigator.push(context, FadePage(page: LiveCareHome()));
} }
@ -517,13 +525,20 @@ class _SearchByClinicState extends State<SearchByClinic> {
FadePage( FadePage(
page: DentalComplaints(searchInfo: searchInfo), page: DentalComplaints(searchInfo: searchInfo),
), ),
); ).then((value) {
setState(() {
dropdownValue = null;
});
});
} }
Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async { Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async {
isProjectLoaded = false; isProjectLoaded = false;
Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital))) Navigator.push(context, FadePage(page: SearchResults(isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)))
.then((value) { .then((value) {
setState(() {
dropdownValue = null;
});
getProjectsList(); getProjectsList();
}); });
} }

@ -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/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import '../DoctorProfile.dart'; import '../DoctorProfile.dart';
@ -21,8 +23,11 @@ class DoctorView extends StatelessWidget {
DoctorView({@required this.doctor, @required this.isLiveCareAppointment, this.isShowFlag = true, this.onTap}); DoctorView({@required this.doctor, @required this.isLiveCareAppointment, this.isShowFlag = true, this.onTap});
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return InkWell( return InkWell(
onTap: onTap ?? onTap: onTap ??
() { () {
@ -69,8 +74,8 @@ class DoctorView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
if (doctor.clinicName != null) myRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName), if (doctor.clinicName != null) myRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName, projectViewModel.isArabic),
if (doctor.projectName != null) myRichText(TranslationBase.of(context).hospital + ":", doctor.projectName), if (doctor.projectName != null) myRichText(TranslationBase.of(context).hospital + ":", doctor.projectName, projectViewModel.isArabic),
if (doctor.speciality != null) if (doctor.speciality != null)
Text( Text(
getDoctorSpeciality(this.doctor.speciality).trim(), getDoctorSpeciality(this.doctor.speciality).trim(),
@ -135,6 +140,8 @@ class DoctorView extends StatelessWidget {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err); print(err);
}); });
} }

@ -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/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/ChildVaccines/child_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -18,8 +17,7 @@ class ChildVaccinesPage extends StatefulWidget {
_ChildVaccinesPageState createState() => _ChildVaccinesPageState(); _ChildVaccinesPageState createState() => _ChildVaccinesPageState();
} }
class _ChildVaccinesPageState extends State<ChildVaccinesPage> class _ChildVaccinesPageState extends State<ChildVaccinesPage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TextEditingController titleController = TextEditingController(); TextEditingController titleController = TextEditingController();
var checkedValue = false; var checkedValue = false;
String addEmail = ""; String addEmail = "";
@ -30,9 +28,17 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
onModelReady: (model) => model.getUserInformationRequestOrders(), onModelReady: (model) => model.getUserInformationRequestOrders(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, 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, appBarTitle: TranslationBase.of(context).vaccination,
//TranslationBase.of(context).advancePayment,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Column( child: Column(
@ -80,16 +86,14 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
fillColor: Colors.red, fillColor: Colors.red,
hintText: model.user.emailAddress, hintText: model.user != null ? model.user.emailAddress : "",
controller: titleController, controller: titleController,
fontSize: 20, fontSize: 20,
hintColor: Colors.black, hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
onChanged: (text) { onChanged: (text) {
addEmail = text; addEmail = text;
model.user.emailAddress == addEmail model.user.emailAddress == addEmail ? checkedValue = false : checkedValue = true;
? checkedValue = false
: checkedValue = true;
}, },
validator: (value) { validator: (value) {
if (value == null) { if (value == null) {
@ -119,8 +123,7 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
// //
onTap: () { onTap: () {
model.user.emailAddress = addEmail.toString(); model.user.emailAddress = addEmail.toString();
AppToast.showSuccessToast( AppToast.showSuccessToast(message: TranslationBase.of(context).updateEmailMsg);
message: TranslationBase.of(context).updateEmailMsg);
// bloodDetails.city=_selectedHospital.toString(); // bloodDetails.city=_selectedHospital.toString();
// bloodDetails. // bloodDetails.

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -37,182 +38,89 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowDecPage: false, isShowDecPage: false,
body: SingleChildScrollView( body: Column(
child: Container( children: [
child: Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: SingleChildScrollView(
children: [ physics: BouncingScrollPhysics(),
Stack( padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [ children: [
Column( Text(
crossAxisAlignment: CrossAxisAlignment.start, TranslationBase.of(context).instructions,
children: [ textAlign: TextAlign.center,
SizedBox( style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
height: 70, ),
), SizedBox(height: 20),
Container( Text(
width: double.infinity, TranslationBase.of(context).selectHospitalDec + " :",
height: 230, 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( decoration: BoxDecoration(
image: DecorationImage( borderRadius: BorderRadius.all(
image: ExactAssetImage( Radius.circular(10.0),
'assets/images/dashboard_top_bg.png'), ),
fit: BoxFit.cover), boxShadow: [
), BoxShadow(
child: Padding( color: Color(0xff000000).withOpacity(.05),
padding: const EdgeInsets.all(8.0), blurRadius: 27,
child: Column( offset: Offset(0, -3),
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,
), ),
], ],
), color: tappedIndex == index ? Color(0xff28323A).withOpacity(.7) : Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
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: <Widget>[
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: <Widget>[
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,
)
],
), ),
), Container(
), color: Colors.white,
bottomSheet: Container( padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
height: MediaQuery.of(context).size.height * 0.10, child: DefaultButton(
width: double.infinity, TranslationBase.of(context).start,
padding: EdgeInsets.all(8.0), chat.isEmpty ? null : () => {launch(chat)},
child: Center( color: Color(0xffD02127),
child: Container( textColor: chat.isEmpty ? Color(0xff000000) : Colors.white,
height: MediaQuery.of(context).size.height * 0.07, disabledColor: Color(0xffEAEAEA),
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);
},
), ),
), ),
), ],
), ),
), ),
); );

@ -2,6 +2,7 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/pharmaciesLivechat_page.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -15,17 +16,19 @@ class LiveChatPage extends StatefulWidget {
_LiveChatPageState createState() => _LiveChatPageState(); _LiveChatPageState createState() => _LiveChatPageState();
} }
class _LiveChatPageState extends State<LiveChatPage> class _LiveChatPageState extends State<LiveChatPage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
@override @override
void initState() { void initState() {
super.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
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')); .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/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/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); _tabController = TabController(length: 2, vsync: this);
} }
@ -44,84 +47,42 @@ class _LiveChatPageState extends State<LiveChatPage>
title: TranslationBase.of(context).liveChat, title: TranslationBase.of(context).liveChat,
description: TranslationBase.of(context).infoChat, description: TranslationBase.of(context).infoChat,
appBarTitle: TranslationBase.of(context).service, appBarTitle: TranslationBase.of(context).service,
body: Scaffold( showNewAppBar: true,
extendBodyBehindAppBar: true, showNewAppBarTitle: true,
appBar: PreferredSize( backgroundColor: CustomColors.appBackgroudGrey2Color,
preferredSize: Size.fromHeight(65.0), body: Column(
child: Stack( children: <Widget>[
children: <Widget>[ TabBar(
Positioned( controller: _tabController,
bottom: 1, indicatorWeight: 3.0,
left: 0, indicatorSize: TabBarIndicatorSize.tab,
right: 0, labelColor: Color(0xff2B353E),
child: BackdropFilter( unselectedLabelColor: Color(0xff575757),
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
child: Container( labelStyle: TextStyle(
color: Theme.of(context) fontSize: 16,
.scaffoldBackgroundColor fontWeight: FontWeight.w600,
.withOpacity(0.8), letterSpacing: -0.48,
height: 70.0, ),
), unselectedLabelStyle: TextStyle(
), fontSize: 16,
), fontWeight: FontWeight.w600,
Center( letterSpacing: -0.48,
child: Container( ),
height: 60.0, tabs: [Text(TranslationBase.of(context).hospitals), Text(TranslationBase.of(context).pharmacies)],
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),
),
),
],
),
),
),
),
],
), ),
), Expanded(
body: Column( child: TabBarView(
children: <Widget>[ physics: BouncingScrollPhysics(),
Expanded( controller: _tabController,
child: TabBarView( children: <Widget>[
physics: BouncingScrollPhysics(), HospitalsLiveChatPage(), //SendFeedbackPage(),
controller: _tabController, PharmaciesLiveChatPage()
children: <Widget>[ //StatusFeedbackPage()
HospitalsLiveChatPage(), //SendFeedbackPage(), ],
PhamaciesLiveChatPage() ),
//StatusFeedbackPage() )
], ],
),
)
],
),
), ),
); );
} }

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -13,21 +14,8 @@ import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class PhamaciesLiveChatPage extends StatefulWidget { class PharmaciesLiveChatPage extends StatelessWidget {
@override PharmaciesLiveChatPage({Key key}) : super(key: key);
_PhamaciesLiveChatPageState createState() => _PhamaciesLiveChatPageState();
}
class _PhamaciesLiveChatPageState extends State<PhamaciesLiveChatPage> {
int tappedIndex;
String chat;
@override
void initState() {
super.initState();
tappedIndex = -1;
chat = "";
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -36,53 +24,43 @@ class _PhamaciesLiveChatPageState extends State<PhamaciesLiveChatPage> {
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowDecPage: false, isShowDecPage: false,
body: SingleChildScrollView( body: Column(
child: Container( children: [
margin: EdgeInsets.only(left: 15, right: 15), Expanded(
child: Column( child: SingleChildScrollView(
children: [ physics: BouncingScrollPhysics(),
SizedBox( padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
height: 20, 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,
),
],
), ),
), Container(
), color: Colors.white,
bottomSheet: Container( padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
height: MediaQuery.of(context).size.height * 0.11, child: DefaultButton(
width: double.infinity, TranslationBase.of(context).start,
padding: EdgeInsets.all(8.0), () {
child: Center( String chat;
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);
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); launch(chat);
}, },
color: Color(0xffD02127),
textColor: Colors.white,
disabledColor: Color(0xffEAEAEA),
), ),
), ),
), ],
), ),
), ),
); );

@ -195,178 +195,5 @@ class _HospitalsPageState extends State<HospitalsPage> {
], ],
), ),
); );
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: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
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");
});
},
),
],
),
),
],
),
),
),
);
} }
} }

@ -38,7 +38,12 @@ class CardCommonContact extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
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(
text + "${subText.isEmpty ? "" : "\n$subText"}", text + "${subText.isEmpty ? "" : "\n$subText"}",
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16),

@ -152,6 +152,7 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID).then((res) { service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(

@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'covid-dirvethru-questions.dart'; import 'covid-dirvethru-questions.dart';
@ -34,15 +33,14 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
String projectID = ""; String projectID = "";
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
DriveThroughTestingCenterModel selectedProject;
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
imagesInfo.add( imagesInfo.add(
ImagesInfo( ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'),
imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'),
); );
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin) { if (projectViewModel.isLogin) {
@ -56,9 +54,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'));
imageEn: 'https://hmgwebservices.com/Images/MobileApp/covid/en/0.png',
imageAr: 'https://hmgwebservices.com/Images/MobileApp/covid/ar/0.png'));
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
@ -72,31 +68,17 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( Container(
alignment: projectViewModel.isArabic alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
? Alignment.centerRight child: Text(TranslationBase.of(context).resultHeader, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 22.0, color: Colors.black)),
: Alignment.centerLeft,
child: Text(TranslationBase.of(context).resultHeader,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 22.0,
color: Colors.black)),
), ),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).covidInfo, child: Text(TranslationBase.of(context).covidInfo, style: TextStyle(fontSize: 16.0, color: Colors.black)),
style: TextStyle(fontSize: 16.0, color: Colors.black)),
), ),
Container( Container(
margin: EdgeInsets.only(top: 20.0), margin: EdgeInsets.only(top: 20.0),
alignment: projectViewModel.isArabic alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
? Alignment.centerRight child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.grey[700])),
: Alignment.centerLeft,
child: Text(TranslationBase.of(context).selectLocation,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
letterSpacing: 0.8,
color: Colors.grey[700])),
), ),
Container( Container(
height: 60.0, height: 60.0,
@ -112,18 +94,18 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(top: 15.0), margin: EdgeInsets.only(top: 15.0),
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton<String>( child: DropdownButton<DriveThroughTestingCenterModel>(
hint: new Text(TranslationBase.of(context).selectAddress), hint: new Text(TranslationBase.of(context).selectAddress),
value: projectDropdownValue, value: selectedProject,
items: projectsList.map((item) { items: projectsList.map((DriveThroughTestingCenterModel item) {
return new DropdownMenuItem<String>( return new DropdownMenuItem<DriveThroughTestingCenterModel>(
value: item.iD.toString(), value: item,
child: new Text(item.projectName), child: new Text(item.projectName),
); );
}).toList(), }).toList(),
onChanged: (newValue) { onChanged: (newValue) {
setState(() { setState(() {
projectDropdownValue = newValue; selectedProject = newValue;
setProjectLocation(newValue); setProjectLocation(newValue);
}); });
}, },
@ -132,15 +114,8 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
isLocationSelected isLocationSelected
? Container( ? Container(
margin: EdgeInsets.only(top: 15.0), margin: EdgeInsets.only(top: 15.0),
alignment: projectViewModel.isArabic alignment: projectViewModel.isArabic ? Alignment.centerRight : Alignment.centerLeft,
? Alignment.centerRight child: Text(TranslationBase.of(context).selectLocation, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18.0, letterSpacing: 0.8, color: Colors.black)),
: Alignment.centerLeft,
child: Text(TranslationBase.of(context).selectLocation,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
letterSpacing: 0.8,
color: Colors.black)),
) )
: Container(), : Container(),
isLocationSelected isLocationSelected
@ -149,16 +124,15 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey[400], width: 1.0), border: Border.all(color: Colors.grey[400], width: 1.0),
), ),
child: Image.network( child: Image.network("https://maps.googleapis.com/maps/api/staticmap?center=" +
"https://maps.googleapis.com/maps/api/staticmap?center=" + this.projectLat +
this.projectLat + "," +
"," + this.projectLong +
this.projectLong + "&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" +
"&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" + this.projectLat +
this.projectLat + "," +
"," + this.projectLong +
this.projectLong + "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"),
"&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"),
) )
: SizedBox( : SizedBox(
height: MediaQuery.of(context).size.height * 0.35, height: MediaQuery.of(context).size.height * 0.35,
@ -184,8 +158,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
onPressed: () { onPressed: () {
getDirections(); getDirections();
}, },
child: Text(TranslationBase.of(context).getDirections, child: Text(TranslationBase.of(context).getDirections, style: TextStyle(fontSize: 18.0)),
style: TextStyle(fontSize: 18.0)),
), ),
), ),
), ),
@ -202,8 +175,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: minWidth: MediaQuery.of(context).size.width * 0.7,
MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFF60686b), color: new Color(0xFF60686b),
@ -213,8 +185,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
onPressed: () { onPressed: () {
back(); back();
}, },
child: Text(TranslationBase.of(context).back, child: Text(TranslationBase.of(context).back, style: TextStyle(fontSize: 18.0)),
style: TextStyle(fontSize: 18.0)),
), ),
), ),
), ),
@ -227,8 +198,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: minWidth: MediaQuery.of(context).size.width * 0.7,
MediaQuery.of(context).size.width * 0.7,
height: 45.0, height: 45.0,
child: RaisedButton( child: RaisedButton(
color: new Color(0xFF60686b), color: new Color(0xFF60686b),
@ -238,8 +208,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
onPressed: () { onPressed: () {
next(); next();
}, },
child: Text(TranslationBase.of(context).next, child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)),
style: TextStyle(fontSize: 18.0)),
), ),
), ),
), ),
@ -259,22 +228,17 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
getDirections() { getDirections() {
if (isLocationSelected) { if (isLocationSelected) {
MapsLauncher.launchCoordinates(double.parse(projectLat), MapsLauncher.launchCoordinates(double.parse(projectLat), double.parse(projectLong), this.projectName);
double.parse(projectLong), this.projectName);
} else { } else {
Utils.showErrorToast( Utils.showErrorToast("Please select address from the dropdown menu to get directions");
"Please select address from the dropdown menu to get directions");
} }
} }
next() { next() {
if (isLocationSelected) { if (isLocationSelected) {
Navigator.push( Navigator.push(context, FadePage(page: CovidDirveThruQuestions(projectId: projectID, proceduresList: proceduresList)));
context,
FadePage(page: CovidDirveThruQuestions(projectId: projectID, proceduresList: proceduresList,)));
} else { } else {
Utils.showErrorToast( Utils.showErrorToast("Please select address from the dropdown menu to continue");
"Please select address from the dropdown menu to continue");
} }
} }
@ -282,34 +246,25 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
Navigator.of(context).popAndPushNamed(HOME); Navigator.of(context).popAndPushNamed(HOME);
} }
setProjectLocation(newValue) { setProjectLocation(DriveThroughTestingCenterModel newValue) {
print(newValue);
setState(() { setState(() {
this.projectLat = this.projectLat = newValue.latitude.toString();
projectsList[(int.parse(newValue) - 1)].latitude.toString(); this.projectLong = newValue.longitude.toString();
this.projectLong = this.projectName = newValue.projectName;
projectsList[(int.parse(newValue) - 1)].longitude.toString(); this.projectID = newValue.projectID.toString();
this.projectName = projectsList[(int.parse(newValue) - 1)].projectName;
this.projectID =
projectsList[(int.parse(newValue) - 1)].projectID.toString();
isLocationSelected = true; isLocationSelected = true;
}); });
} }
getPaymentInfo(BuildContext context, String projectID) { getPaymentInfo(BuildContext context, String projectID) {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
CovidPaymentInfoResponse covidPaymentInfoResponse = CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse();
new CovidPaymentInfoResponse();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service.getCovidPaymentInformation(context, int.parse(projectID), proceduresList[0].procedureID).then((res) {
.getCovidPaymentInformation(
context, int.parse(projectID), proceduresList[0].procedureID)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
covidPaymentInfoResponse = covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
}); });
Navigator.push( Navigator.push(
context, context,
@ -329,8 +284,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
CovidTestProceduresResponse covidTestProceduresResponse = CovidTestProceduresResponse covidTestProceduresResponse = new CovidTestProceduresResponse();
new CovidTestProceduresResponse();
service.getCovidTestProceduresList(context).then((res) { service.getCovidTestProceduresList(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {

@ -30,7 +30,6 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
@override @override
void initState() { void initState() {
print(widget.proceduresList[0].procedureName);
widget.selectedProcedure = widget.proceduresList[0]; widget.selectedProcedure = widget.proceduresList[0];
super.initState(); super.initState();
} }
@ -336,14 +335,6 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
widget.covidPaymentInfoResponse = widget.covidPaymentInfoResponse =
CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']); CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
}); });
// Navigator.push(
// context,
// FadePage(
// page: CovidPaymentDetails(
// covidPaymentInfoResponse: covidPaymentInfoResponse,
// projectID: int.parse(projectID),
// proceduresList: proceduresList,
// )));
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -191,6 +191,8 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
authenticatedUser, authenticatedUser,
widget.browser, widget.browser,
widget.patientShareResponse.isLiveCareAppointment, widget.patientShareResponse.isLiveCareAppointment,
null,
null,
widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo, widget.patientShareResponse.appointmentNo,
widget.patientShareResponse.clinicID, widget.patientShareResponse.clinicID,

@ -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/er/TriageQuestionsModel.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -44,36 +45,39 @@ class _DdServicesPageState extends State<DdServicesPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return Scaffold( return AppScaffold(
appBar: AppBar( appBarTitle: 'ED Online',
elevation: 0, isShowDecPage: true,
textTheme: TextTheme( isShowAppBar: true,
headline6: TextStyle( // appBarTitle: AppBar(
color: Theme.of(context).textTheme.headline1.color, // elevation: 0,
fontWeight: FontWeight.bold), // textTheme: TextTheme(
), // headline6: TextStyle(
title: Text( // color: Theme.of(context).textTheme.headline1.color,
'ED Online', // fontWeight: FontWeight.bold),
style: TextStyle( // ),
fontWeight: FontWeight.bold, // title: Text(
color: Theme.of(context).textTheme.headline1.color, // 'ED Online',
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), // style: TextStyle(
// bold: true, // fontWeight: FontWeight.bold,
// color: Colors.white, // color: Theme.of(context).textTheme.headline1.color,
), // fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
leading: Builder( // // bold: true,
builder: (BuildContext context) { // // color: Colors.white,
return IconButton( // ),
icon: Icon(Icons.arrow_back), // leading: Builder(
color: Theme.of(context).textTheme.headline1.color, // builder: (BuildContext context) {
onPressed: () { // return IconButton(
showConfirmMessage(context); // icon: Icon(Icons.arrow_back),
}, // color: Theme.of(context).textTheme.headline1.color,
); // onPressed: () {
}, // showConfirmMessage(context);
), // },
centerTitle: true, // );
), // },
// ),
// centerTitle: true,
// ),
body: PageView( body: PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: pageController, controller: pageController,

@ -44,7 +44,7 @@ class _ErOptionsState extends State<ErOptions> {
return AppScaffold( return AppScaffold(
isShowAppBar: widget.isAppbar, isShowAppBar: widget.isAppbar,
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).emergencyServices,
isShowDecPage: false, isShowDecPage: false,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,

@ -1,16 +1,15 @@
import 'package:diplomaticquarterapp/core/viewModels/er/near_hospital_view_model.dart'; import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/core/service/er/er_service.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../uitl/translations_delegate_base.dart'; import '../../uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart';
import 'widgets/card_position.dart'; import 'widgets/card_position.dart';
class NearestEr extends StatelessWidget { class NearestEr extends StatefulWidget {
static const String _url = "assets/images/"; static const String _url = "assets/images/";
int appointmentNo; int appointmentNo;
@ -18,92 +17,89 @@ class NearestEr extends StatelessWidget {
NearestEr({this.appointmentNo, this.projectID}); NearestEr({this.appointmentNo, this.projectID});
@override
_NearestErState createState() => _NearestErState();
}
class _NearestErState extends State<NearestEr> {
List<ProjectAvgERWaitingTime> projectAvgERWaitingTimeModelList = List();
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getERList());
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var size = MediaQuery.of(context).size; var size = MediaQuery.of(context).size;
final double itemHeight = (size.height - kToolbarHeight - 24) / 2; final double itemHeight = (size.height - kToolbarHeight - 24) / 2;
final double itemWidth = size.width / 2; final double itemWidth = size.width / 2;
return BaseView<NearHospitalViewModel>( return AppScaffold(
onModelReady: appointmentNo != null && projectID != null isShowAppBar: true,
? (model) => model.getProjectAvgERWaitingTimeOrders( isShowDecPage: false,
id: appointmentNo, projectID: projectID) appBarTitle: TranslationBase.of(context).NearestEr,
: (model) => model.getProjectAvgERWaitingTimeOrders(), body: projectAvgERWaitingTimeModelList.length > 0
builder: (_, mode, widget) => AppScaffold( ? Container(
isShowAppBar: true, child: ListView(
isShowDecPage: false, children: <Widget>[
appBarTitle: TranslationBase.of(context).NearestEr, Text("${TranslationBase.of(context).NearestErDesc}",
baseViewModel: mode, textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, letterSpacing: 1.0, fontWeight: FontWeight.w900, color: new Color(0xFF60686b))),
body: mode.ProjectAvgERWaitingTimeModeList.length > 0 Container(
? Container( margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0),
child: ListView( child: GridView.count(
children: <Widget>[ crossAxisCount: 2,
Text( childAspectRatio: (itemWidth / itemWidth),
"${TranslationBase.of(context).NearestErDesc}", crossAxisSpacing: 10,
textAlign: TextAlign.center, mainAxisSpacing: 10,
style: TextStyle( controller: new ScrollController(keepScrollOffset: false),
fontSize: 18.0, shrinkWrap: true,
letterSpacing: 1.0, padding: const EdgeInsets.all(4.0),
fontWeight: FontWeight.w900, children: List.generate(7, (index) {
color: new Color(0xFF60686b))), return Container(
Container( child: CardPosition(
margin: EdgeInsets.fromLTRB(2.0, 10.0, 0.0, 10.0), waitingTime: projectAvgERWaitingTimeModelList[index].avgTimeInHHMM.toString(),
child: GridView.count( text: projectAvgERWaitingTimeModelList[index].projectName.toString(),
crossAxisCount: 2, image: 'assets/images/new-design/find_us_icon.png',
childAspectRatio: (itemWidth / itemWidth), subText: '${projectAvgERWaitingTimeModelList[index].distanceInKilometers ?? 0.0} ${TranslationBase.of(context).km_}',
crossAxisSpacing: 10, type: projectAvgERWaitingTimeModelList[index].iD.toString(),
mainAxisSpacing: 10, telephone: projectAvgERWaitingTimeModelList[index].phoneNumber.toString(),
controller: networkImage: projectAvgERWaitingTimeModelList[index].projectImageURL.toString(),
new ScrollController(keepScrollOffset: false), latitude: projectAvgERWaitingTimeModelList[index].latitude,
shrinkWrap: true, longitude: projectAvgERWaitingTimeModelList[index].longitude,
padding: const EdgeInsets.all(4.0), projectname: projectAvgERWaitingTimeModelList[index].projectName,
children: List.generate(7, (index) { cardSize: itemWidth,
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,
),
);
}),
),
), ),
], ),
), ],
)
: 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);
});
}
} }

@ -1,4 +1,4 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.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-logs-page.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-request-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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class RRTMainScreen extends StatefulWidget{ class RRTMainScreen extends StatefulWidget {
@override @override
State<StatefulWidget> createState() => RRTMainScreenState(); State<StatefulWidget> createState() => RRTMainScreenState();
} }
class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProviderStateMixin{ class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProviderStateMixin {
int currentIndex = 0; int currentIndex = 0;
TabController tabController; TabController tabController;
PageController pageController = PageController(initialPage: 0, keepPage: true); PageController pageController = PageController(initialPage: 0, keepPage: true);
@ -22,84 +21,85 @@ class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProvider
RRTViewModel viewModel; RRTViewModel viewModel;
bool loadingData; bool loadingData;
List<ImagesInfo> imagesInfo = List();
@override @override
void initState() { void initState() {
super.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); tabController = TabController(length: 2, vsync: this);
} }
TranslationBase localize; TranslationBase localize;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
localize = TranslationBase.of(context); localize = TranslationBase.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: localize.rapidResponseTeam, appBarTitle: localize.rapidResponseTeam,
isShowAppBar: true, isShowAppBar: true,
body: BaseView<RRTViewModel>( description: TranslationBase.of(context).rrtDDetails,
onModelReady: (vm) async { imagesInfo: imagesInfo,
viewModel = vm; body: BaseView<RRTViewModel>(
loadingData = true; onModelReady: (vm) async {
await vm.loadRequiredData().then((value){ viewModel = vm;
}).whenComplete(() => setState(() => loadingData = false)); loadingData = true;
}, await vm.loadRequiredData().then((value) {}).whenComplete(() => setState(() => loadingData = false));
builder: (ctx, vm, widget) => content(), },
) builder: (ctx, vm, widget) => content(),
); ));
} }
Widget content(){ Widget content() {
if(loadingData == true){ if (loadingData == true) {
return Center(child: CircularProgressIndicator()); return Center(child: CircularProgressIndicator());
// else if(viewModel.state == ViewState.Error) // 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( return Column(
children: [ children: [tabBar(), Expanded(child: contentPager())],
tabBar(),
Expanded(
child: contentPager()
)
],
); );
}else{ } else {
return Container( return Container(
alignment: Alignment.center, 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( Widget tabBar() => Container(
margin: EdgeInsets.all(15), margin: EdgeInsets.all(15),
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)), decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)),
child: TabBar( child: TabBar(onTap: onPageChanged, indicatorWeight: 3, indicatorColor: Color(0xFFc5272d), isScrollable: false, controller: tabController, indicatorSize: TabBarIndicatorSize.label, tabs: [
onTap: onPageChanged,
indicatorWeight: 3,
indicatorColor: Color(0xFFc5272d),
isScrollable: false,
controller: tabController,
indicatorSize: TabBarIndicatorSize.label,
tabs: [
Tab( 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( 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( Widget contentPager() => PageView(
onPageChanged: onPageChanged, onPageChanged: onPageChanged,
controller: pageController, controller: pageController,
children: [ children: [
RRTRequestPage(servicePrice: viewModel.rrtServiceData.servicePrice, pendingOrders: viewModel.rrtServiceData.pendingOrders), RRTRequestPage(servicePrice: viewModel.rrtServiceData.servicePrice, pendingOrders: viewModel.rrtServiceData.pendingOrders),
RRTLogPage(orders: viewModel.rrtServiceData.completedOrders), RRTLogPage(orders: viewModel.rrtServiceData.completedOrders),
], ],
); );
void onPageChanged(int index) { void onPageChanged(int index) {
pageController.animateToPage(index, duration: Duration(milliseconds: 200), curve: Curves.easeInOut); pageController.animateToPage(index, duration: Duration(milliseconds: 200), curve: Curves.easeInOut);

@ -45,6 +45,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
List<DoctorRateDetails> doctorDetailsList = List(); List<DoctorRateDetails> doctorDetailsList = List();
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
ProjectViewModel projectViewModel;
DoctorList doctorList = new DoctorList(); DoctorList doctorList = new DoctorList();
@ -73,7 +74,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context); toDoProvider = Provider.of<ToDoCountProviderModel>(context);
@ -158,7 +159,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
child: TabBarView( child: TabBarView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
children: [ 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) DocAvailableAppointments(doctor: getDoctorObject(), doctorSchedule: widget.doctorSchedule, isLiveCareAppointment: widget.appo.isLiveCareAppointment)
], ],
controller: _tabController, controller: _tabController,
@ -533,8 +534,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
setTab() async { setTab() async {
var scheduleDoctor = await sharedPref.getObject(DOCTOR_SCHEDULE_DATE_SEL); var scheduleDoctor = await sharedPref.getObject(DOCTOR_SCHEDULE_DATE_SEL);
if (scheduleDoctor != null) widget.appo.appointmentDate = scheduleDoctor['Date'];
widget.appo.appointmentDate = scheduleDoctor['Date'];
} }
confirmAppointment() { confirmAppointment() {

@ -64,6 +64,8 @@ class _SchedulePageState extends State<SchedulePage> {
} }
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).schedule, appBarTitle: TranslationBase.of(context).schedule,
showNewAppBar: true,
showNewAppBarTitle: true,
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model2, baseViewModel: model2,
isShowDecPage: false, isShowDecPage: false,

@ -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/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.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/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart'; import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.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/models/ConfirmedButtonsAllowCheckIn.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/PrescriptionReport.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/PrescriptionReport.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.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/feedback/feedback_home_page.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.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/labs/laboratory_result_page.dart';
import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_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/pages/medical/vital_sign/vital_sign_details_screen.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.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/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/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/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -45,8 +37,9 @@ class AppointmentActions extends StatefulWidget {
TabController tabController; TabController tabController;
final Function enableFooterButton; final Function enableFooterButton;
MyInAppBrowser browser; 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 @override
_AppointmentActionsState createState() => _AppointmentActionsState(); _AppointmentActionsState createState() => _AppointmentActionsState();
@ -74,86 +67,25 @@ class _AppointmentActionsState extends State<AppointmentActions> {
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
bool shouldEnable = (widget.appo.clinicID == 17 && appoButtonsList[index].caller == "openReschedule");
return InkWell( return InkWell(
onTap: () { onTap: shouldEnable
_handleButtonClicks(appoButtonsList[index]); ? null
}, : () {
_handleButtonClicks(appoButtonsList[index]);
},
child: MedicalProfileItem( child: MedicalProfileItem(
title: appoButtonsList[index].title, title: appoButtonsList[index].title,
imagePath: appoButtonsList[index].icon, imagePath: appoButtonsList[index].icon,
subTitle: appoButtonsList[index].subtitle, subTitle: appoButtonsList[index].subtitle,
hasBadge: true, hasBadge: true,
isEnable: projectViewModel.havePrivilege(5), isEnable: !shouldEnable,
imgColor: Color(0xff28323A), imgColor: Color(0xff28323A),
), ),
); );
}, },
itemCount: appoButtonsList.length, itemCount: appoButtonsList.length,
); );
return Container(
margin: EdgeInsets.all(5.0),
child: CustomScrollView(
primary: false,
physics: NeverScrollableScrollPhysics(),
slivers: <Widget>[
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: <Widget>[
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) { _handleButtonClicks(AppoDetailsButton) {
@ -164,65 +96,40 @@ class _AppointmentActionsState extends State<AppointmentActions> {
widget.enableFooterButton(); widget.enableFooterButton();
}); });
break; 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": case "navigateToProject":
openMap(double.parse(widget.appo.latitude), double.parse(widget.appo.longitude)); openMap(double.parse(widget.appo.latitude), double.parse(widget.appo.longitude));
break; break;
case "addReminder": case "addReminder":
// showReminderDialog(widget.appo);
showReminderDialog( showReminderDialog(
context, context,
DateUtil.convertStringToDate(widget.appo.appointmentDate), DateUtil.convertStringToDate(widget.appo.appointmentDate),
widget.appo.doctorNameObj, 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)), DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.appo.appointmentDate)),
onSuccess: () { onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
}, },
); );
break; break;
case "goToTodoList": case "goToTodoList":
Navigator.of(context).pop(); Navigator.of(context).pop();
break; break;
case "askDoc": case "askDoc":
askYourDoc(); askYourDoc();
break; break;
case "radiology": case "radiology":
openAppointmentRadiology(); openAppointmentRadiology();
break; break;
case "labResult": case "labResult":
openAppointmentLabResults(); openAppointmentLabResults();
break; break;
case "prescriptions": case "prescriptions":
openPrescriptionReport(); openPrescriptionReport();
break; break;
case "Survey": case "Survey":
rateAppointment(); rateAppointment();
break; break;
case "Insurance": case "Insurance":
navigateToInsuranceApprovals(widget.appo.appointmentNo); navigateToInsuranceApprovals(widget.appo.appointmentNo);
break; break;
@ -438,7 +345,17 @@ class _AppointmentActionsState extends State<AppointmentActions> {
patientLabOrders.orderNo = res['ListLabResultsByAppNo'][0]['OrderNo'].toString(); patientLabOrders.orderNo = res['ListLabResultsByAppNo'][0]['OrderNo'].toString();
patientLabOrders.invoiceNo = res['ListLabResultsByAppNo'][0]['InvoiceNo'].toString(); patientLabOrders.invoiceNo = res['ListLabResultsByAppNo'][0]['InvoiceNo'].toString();
patientLabOrders.clinicID = widget.appo.clinicID; patientLabOrders.clinicID = widget.appo.clinicID;
patientLabOrders.clinicDescription = widget.appo.clinicName;
patientLabOrders.projectID = widget.appo.projectID.toString(); 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.invoiceNo);
print(patientLabOrders.orderNo); print(patientLabOrders.orderNo);
navigateToLabResults(patientLabOrders); navigateToLabResults(patientLabOrders);
@ -516,36 +433,6 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
} }
// 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() { askYourDoc() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();

@ -612,6 +612,8 @@ class _ToDoState extends State<ToDo> {
authenticatedUser, authenticatedUser,
widget.browser, widget.browser,
appo.isLiveCareAppointment, appo.isLiveCareAppointment,
null,
null,
appo.appointmentDate, appo.appointmentDate,
appo.appointmentNo, appo.appointmentNo,
appo.clinicID, appo.clinicID,

@ -3,6 +3,7 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/feedback/send_feedback_page.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -14,14 +15,13 @@ import 'status_feedback_page.dart';
class FeedbackHomePage extends StatefulWidget { class FeedbackHomePage extends StatefulWidget {
final AppoitmentAllHistoryResultList appointment; final AppoitmentAllHistoryResultList appointment;
final MessageType messageType; 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 @override
_FeedbackHomePageState createState() => _FeedbackHomePageState(); _FeedbackHomePageState createState() => _FeedbackHomePageState();
} }
class _FeedbackHomePageState extends State<FeedbackHomePage> class _FeedbackHomePageState extends State<FeedbackHomePage> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
@override @override
@ -43,79 +43,44 @@ class _FeedbackHomePageState extends State<FeedbackHomePage>
isBottomBar: false, isBottomBar: false,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).feedbackTitle, appBarTitle: TranslationBase.of(context).feedbackTitle,
body: Scaffold( showNewAppBar: true,
extendBodyBehindAppBar: true, showNewAppBarTitle: true,
appBar: PreferredSize( backgroundColor: CustomColors.appBackgroudGrey2Color,
preferredSize: Size.fromHeight(65.0), body: Column(
child: Stack( children: <Widget>[
children: <Widget>[ TabBar(
Positioned( controller: _tabController,
bottom: 1, indicatorWeight: 3.0,
left: 0, indicatorSize: TabBarIndicatorSize.tab,
right: 0, labelColor: Color(0xff2B353E),
child: BackdropFilter( unselectedLabelColor: Color(0xff575757),
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
child: Container( labelStyle: TextStyle(
color: Theme.of(context) fontSize: 16,
.scaffoldBackgroundColor fontWeight: FontWeight.w600,
.withOpacity(0.8), letterSpacing: -0.48,
height: 70.0, ),
), unselectedLabelStyle: TextStyle(
), fontSize: 16,
), fontWeight: FontWeight.w600,
Center( letterSpacing: -0.48,
child: Container( ),
height: 60.0, tabs: [Text(TranslationBase.of(context).send), Text(TranslationBase.of(context).status)],
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),
),
),
],
),
),
),
),
],
), ),
), Expanded(
body: Column( child: TabBarView(
children: <Widget>[ physics: BouncingScrollPhysics(),
Expanded( controller: _tabController,
child: TabBarView( children: <Widget>[
physics: BouncingScrollPhysics(), SendFeedbackPage(
controller: _tabController, appointment: widget.appointment,
children: <Widget>[SendFeedbackPage(appointment: widget.appointment,messageType: widget.messageType,), StatusFeedbackPage()], messageType: widget.messageType,
), ),
) StatusFeedbackPage()
], ],
), ),
)
],
), ),
); );
} }

@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
@ -102,447 +103,447 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowDecPage: false, isShowDecPage: false,
body: Container( body: Column(
height: MediaQuery.of(context).size.height * 0.8, children: [
child: SingleChildScrollView( Expanded(
child: Form( child: SingleChildScrollView(
key: formKey, physics: BouncingScrollPhysics(),
child: Column( padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
crossAxisAlignment: CrossAxisAlignment.start, child: Form(
children: <Widget>[ key: formKey,
SizedBox( child: Column(
height: 65, crossAxisAlignment: CrossAxisAlignment.start,
), children: <Widget>[
Container( Text(
margin: EdgeInsets.only(left: 20, right: 20, top: 8), TranslationBase.of(context).likeToHear,
child: Texts( textAlign: TextAlign.center,
TranslationBase.of(context).likeToHear, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
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,
), ),
child: Row( SizedBox(height: 21),
mainAxisAlignment: MainAxisAlignment.spaceBetween, InkWell(
children: <Widget>[ onTap: () {
Container( confirmBox(model);
child: Texts( },
getSelected(context), child: Container(
variant: 'bodyText', 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( child: Row(
Icons.arrow_drop_down, mainAxisAlignment: MainAxisAlignment.spaceBetween,
size: 22, children: <Widget>[
color: Colors.grey, Text(
) getSelected(context),
], style: TextStyle(
), fontSize: 16,
), fontWeight: FontWeight.w600,
), letterSpacing: -0.48,
if (appointHistory != null && color: Color(0xff2B353E),
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: <Widget>[
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: RotatedBox( Icon(
quarterTurns: 3, Icons.keyboard_arrow_down,
child: Center( size: 22,
child: Text( color: Colors.grey,
appointHistory.isLiveCareAppointment )
? TranslationBase.of(context).liveCare.toUpperCase() ],
: !appointHistory.isInOutPatient ),
? TranslationBase.of(context) ),
.inPatient ),
.toUpperCase() SizedBox(height: 12),
: TranslationBase.of(context) if (appointHistory != null && messageType == MessageType.ComplaintOnAnAppointment)
.outpatient InkWell(
.toUpperCase(), onTap: () {
style: TextStyle(color: Colors.white,fontSize: 12), setState(() {
isShowListAppointHistory = true;
});
},
child: Container(
// margin: EdgeInsets.all(8.0),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
child: Row(
children: <Widget>[
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: RotatedBox(
Expanded( quarterTurns: 3,
flex: 4, child: Center(
child: Column( child: Text(
crossAxisAlignment: CrossAxisAlignment.start, appointHistory.isLiveCareAppointment
children: <Widget>[ ? TranslationBase.of(context).liveCare.toUpperCase()
Padding( : !appointHistory.isInOutPatient
padding: const EdgeInsets.all(10.0), ? TranslationBase.of(context).inPatient.toUpperCase()
child: Row( : TranslationBase.of(context).outpatient.toUpperCase(),
children: <Widget>[ style: TextStyle(color: Colors.white, fontSize: 12),
Expanded(
flex: 1,
child: LargeAvatar(
name: appointHistory.doctorNameObj,
url: appointHistory.doctorImageURL,
),
), ),
Expanded( )),
flex: 4, ),
child: Container( Expanded(
margin: EdgeInsets.all(10), flex: 4,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ Padding(
Texts( padding: const EdgeInsets.all(10.0),
appointHistory.doctorNameObj, child: Row(
bold: true, children: <Widget>[
), Expanded(
Texts( flex: 1,
DateUtil child: LargeAvatar(
.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointHistory.appointmentDate)), name: appointHistory.doctorNameObj,
variant: 'caption3', url: appointHistory.doctorImageURL,
),
),
Expanded(
flex: 4,
child: Container(
margin: EdgeInsets.all(10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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(
if (messageType == MessageType.ComplaintOnAnAppointment && height: model.appointHistoryList.length > 2 ? MediaQuery.of(context).size.height * 0.25 : MediaQuery.of(context).size.height * 0.15,
model.appointHistoryList.length != 0 && child: ListView.builder(
isShowListAppointHistory) itemCount: model.appointHistoryList.length,
Container( itemBuilder: (context, index) => InkWell(
height: model.appointHistoryList.length > 2 onTap: () {
? MediaQuery.of(context).size.height * 0.25 setState(() {
: MediaQuery.of(context).size.height * 0.15, appointHistory = model.appointHistoryList[index];
child: ListView.builder( isShowListAppointHistory = false;
itemCount: model.appointHistoryList.length, });
itemBuilder: (context, index) => InkWell( },
onTap: () { child: Container(
setState(() { margin: EdgeInsets.only(left: 8, right: 8),
appointHistory = model.appointHistoryList[index]; color: Colors.white,
isShowListAppointHistory = false; child: Column(
});
},
child: Container(
margin: EdgeInsets.only(left: 8, right: 8),
color: Colors.white,
child: Column(
children: <Widget>[
Row(
children: <Widget>[ children: <Widget>[
Expanded( Row(
flex: 4, children: <Widget>[
child: Column( Expanded(
crossAxisAlignment: flex: 4,
CrossAxisAlignment.start, child: Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
Padding( children: <Widget>[
padding: const EdgeInsets.all(10.0), Padding(
child: Row( padding: const EdgeInsets.all(10.0),
children: <Widget>[ child: Row(
Expanded( children: <Widget>[
flex: 1, Expanded(
child: LargeAvatar( flex: 1,
name: model child: LargeAvatar(
.appointHistoryList[ name: model.appointHistoryList[index].doctorNameObj,
index] url: model.appointHistoryList[index].doctorImageURL,
.doctorNameObj, ),
url: model ),
.appointHistoryList[ Expanded(
index] flex: 4,
.doctorImageURL, child: Container(
), margin: EdgeInsets.all(10),
), child: Column(
Expanded( crossAxisAlignment: CrossAxisAlignment.start,
flex: 4, children: <Widget>[
child: Container( Texts(
margin: EdgeInsets.all(10), model.appointHistoryList[index].doctorNameObj,
child: Column( bold: true,
crossAxisAlignment: ),
CrossAxisAlignment Texts(
.start, DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)),
children: <Widget>[ variant: 'caption3',
Texts( ),
model StarRating(totalAverage: model.appointHistoryList[index].doctorRate.toDouble(), forceStars: true),
.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),
],
), ),
), ],
), ),
], ),
],
),
),
Expanded(
flex: 1,
child: Center(
child: Icon(
Icons.arrow_forward_ios,
size: 15,
), ),
), ),
], )
), ],
), ),
Expanded( SizedBox(
flex: 1, height: 5,
child: Center( ),
child: Icon( Divider(
Icons.arrow_forward_ios, height: 0.5,
size: 15, color: Colors.grey[400],
),
),
) )
], ],
), ),
SizedBox( ),
height: 5,
),
Divider(
height: 0.5,
color: Colors.grey[400],
)
],
), ),
), ),
), ),
), inputWidget(TranslationBase.of(context).subject, "xxxxxxxx", titleController),
), SizedBox(height: 12),
Container( inputWidget(TranslationBase.of(context).message, "xxxxxxxx", messageController, lines: 11, suffixTap: () {
margin: EdgeInsets.only(left: 10, right: 10, top: 15), openSpeechReco();
child: TextFields( }),
hintText: TranslationBase.of(context).subject, SizedBox(height: 12),
controller: titleController, InkWell(
fontSize: 13.5, onTap: () {
hintColor: Colors.black, ImageOptions.showImageOptions(context, (String image, File file) {
fontWeight: FontWeight.w600, setState(() {
onChanged: (v) { images.add(image);
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(() {});
}, },
validator: (value) { child: Container(
if (value.isEmpty) padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
return TranslationBase.of(context).emptyMessage; alignment: Alignment.center,
else decoration: BoxDecoration(
return null; borderRadius: BorderRadius.circular(15),
}), color: Colors.white,
), border: Border.all(
InkWell( color: Color(0xffefefef),
onTap: () { width: 1,
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: <Widget>[
Icon(Icons.attach_file),
Texts(
TranslationBase.of(context).selectAttachment,
variant: 'bodyText',
textAlign: TextAlign.center,
), ),
], ),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
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,
...List.generate( (index) => Container(
images.length, margin: EdgeInsets.all(10),
(index) => Container( padding: EdgeInsets.all(8.0),
margin: EdgeInsets.all(10), child: Row(
padding: EdgeInsets.all(8.0), mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Icon(FontAwesomeIcons.paperclip), Row(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
width: 8, children: <Widget>[
), Icon(FontAwesomeIcons.paperclip),
Texts( SizedBox(
'image ${index + 1}.png', 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( Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines}) {
child: Container( return Container(
height: MediaQuery.of(context).size.height * 0.1, padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
child: SecondaryButton( alignment: Alignment.center,
label: TranslationBase.of(context).send, decoration: BoxDecoration(
textColor: Colors.white, borderRadius: BorderRadius.circular(15),
disabled: (titleController.text.toString().isEmpty || color: Colors.white,
messageController.text.toString().isEmpty), border: Border.all(
onTap: () { color: Color(0xffefefef),
final form = formKey.currentState; width: 1,
if (form.validate()) { ),
GifLoaderDialogUtils.showMyDialog(context); ),
model child: InkWell(
.sendCOCItem( onTap: hasSelection ? () {} : null,
title: titleController.text, child: Row(
attachment: images.length > 0 ? images[0] : "", children: [
details: messageController.text, Expanded(
cOCTypeName: getCOCName(), child: Column(
appointHistory: messageType == mainAxisSize: MainAxisSize.min,
MessageType.ComplaintOnAnAppointment crossAxisAlignment: CrossAxisAlignment.start,
? appointHistory children: [
: null) Text(
.then((value) { _labelText,
if (value) { style: TextStyle(
setState(() { fontSize: 11,
titleController.text = ""; fontWeight: FontWeight.w600,
messageController.text = ""; color: Color(0xff2B353E),
images = []; letterSpacing: -0.44,
}); ),
setMessageType(MessageType.NON); ),
GifLoaderDialogUtils.hideDialog(context); TextField(
AppToast.showSuccessToast( enabled: isEnable,
message: TranslationBase.of(context).yourFeedback); scrollPadding: EdgeInsets.zero,
} else { keyboardType: TextInputType.number,
AppToast.showErrorToast(message: model.error); controller: _controller,
GifLoaderDialogUtils.hideDialog(context); 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<SendFeedbackPage> {
openSpeechReco() async { openSpeechReco() async {
new RoboSearch(context: context).showAlertDialog(context); new RoboSearch(context: context).showAlertDialog(context);
_currentLocaleId = _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode;
TranslationBase.of(AppGlobal.context).locale.languageCode; bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
bool available = await speech.initialize(
onStatus: statusListener, onError: errorListener);
if (available) { if (available) {
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,
@ -641,8 +640,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
} }
Future<void> initSpeechState() async { Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize( bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
onError: errorListener, onStatus: statusListener);
print(hasSpeech); print(hasSpeech);
if (!mounted) return; if (!mounted) return;
} }
@ -652,9 +650,7 @@ class FeedbackTypeDialog extends StatefulWidget {
final Function(MessageType) onValueSelected; final Function(MessageType) onValueSelected;
final MessageType messageTypeDialog; final MessageType messageTypeDialog;
const FeedbackTypeDialog( const FeedbackTypeDialog({Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON}) : super(key: key);
{Key key, this.onValueSelected, this.messageTypeDialog = MessageType.NON})
: super(key: key);
@override @override
State createState() => new FeedbackTypeDialogState(); State createState() => new FeedbackTypeDialogState();
@ -699,14 +695,12 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
child: InkWell( child: InkWell(
onTap: () => setMessageDialogType(MessageType.NON), onTap: () => setMessageDialogType(MessageType.NON),
child: ListTile( child: ListTile(
title: title: Texts(TranslationBase.of(context).notClassified),
Texts(TranslationBase.of(context).notClassified),
leading: Radio( leading: Radio(
value: MessageType.NON, value: MessageType.NON,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: Theme.of(context).primaryColor,
onChanged: (MessageType value) => onChanged: (MessageType value) => setMessageDialogType(value),
setMessageDialogType(value),
), ),
), ),
), ),
@ -721,17 +715,14 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => setMessageDialogType( onTap: () => setMessageDialogType(MessageType.ComplaintOnAnAppointment),
MessageType.ComplaintOnAnAppointment),
child: ListTile( child: ListTile(
title: title: Texts(TranslationBase.of(context).complainAppo),
Texts(TranslationBase.of(context).complainAppo),
leading: Radio( leading: Radio(
value: MessageType.ComplaintOnAnAppointment, value: MessageType.ComplaintOnAnAppointment,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: Theme.of(context).primaryColor,
onChanged: (MessageType value) => onChanged: (MessageType value) => setMessageDialogType(value),
setMessageDialogType(value),
), ),
), ),
), ),
@ -746,17 +737,14 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => setMessageDialogType( onTap: () => setMessageDialogType(MessageType.ComplaintWithoutAppointment),
MessageType.ComplaintWithoutAppointment),
child: ListTile( child: ListTile(
title: Texts( title: Texts(TranslationBase.of(context).complainWithoutAppo),
TranslationBase.of(context).complainWithoutAppo),
leading: Radio( leading: Radio(
value: MessageType.ComplaintWithoutAppointment, value: MessageType.ComplaintWithoutAppointment,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: Theme.of(context).primaryColor,
onChanged: (MessageType value) => onChanged: (MessageType value) => setMessageDialogType(value),
setMessageDialogType(value),
), ),
), ),
), ),
@ -778,8 +766,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
value: MessageType.Question, value: MessageType.Question,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: Theme.of(context).primaryColor,
onChanged: (MessageType value) => onChanged: (MessageType value) => setMessageDialogType(value),
setMessageDialogType(value),
), ),
), ),
), ),
@ -794,16 +781,14 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => onTap: () => setMessageDialogType(MessageType.Compliment),
setMessageDialogType(MessageType.Compliment),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).compliment), title: Texts(TranslationBase.of(context).compliment),
leading: Radio( leading: Radio(
value: MessageType.Compliment, value: MessageType.Compliment,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: Theme.of(context).primaryColor,
onChanged: (MessageType value) => onChanged: (MessageType value) => setMessageDialogType(value),
setMessageDialogType(value),
), ),
), ),
), ),
@ -818,16 +803,14 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => onTap: () => setMessageDialogType(MessageType.Suggestion),
setMessageDialogType(MessageType.Suggestion),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).suggestion), title: Texts(TranslationBase.of(context).suggestion),
leading: Radio( leading: Radio(
value: MessageType.Suggestion, value: MessageType.Suggestion,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
activeColor: Theme.of(context).primaryColor, activeColor: Theme.of(context).primaryColor,
onChanged: (MessageType value) => onChanged: (MessageType value) => setMessageDialogType(value),
setMessageDialogType(value),
), ),
), ),
), ),

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.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/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -24,120 +25,116 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowDecPage: false, isShowDecPage: false,
body: model.cOCItemList.isNotEmpty body: Column(
? Container( children: [
margin: EdgeInsets.only( Expanded(
top: 8.0, left: 8.0, right: 8.0, bottom: 80), child: model.cOCItemList.isNotEmpty
padding: EdgeInsets.all(15.0), ? Container(
child: ListView.builder( margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0, bottom: 80),
itemCount: model.cOCItemList.length, padding: EdgeInsets.all(15.0),
itemBuilder: (context, index) => InkWell( child: ListView.builder(
onTap: () { itemCount: model.cOCItemList.length,
gotodetails(model.cOCItemList[index]); itemBuilder: (context, index) => InkWell(
}, onTap: () {
child: Container( gotodetails(model.cOCItemList[index]);
decoration: BoxDecoration( },
shape: BoxShape.rectangle, child: Container(
border: Border.all(color: Colors.white, width: 0.5), decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5)), shape: BoxShape.rectangle,
color: Colors.white, border: Border.all(color: Colors.white, width: 0.5),
), borderRadius: BorderRadius.all(Radius.circular(5)),
margin: EdgeInsets.all(4), color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 8,
), ),
Row( margin: EdgeInsets.all(4),
mainAxisAlignment: child: Padding(
MainAxisAlignment.spaceBetween, padding: const EdgeInsets.all(8.0),
children: <Widget>[ child: Column(
Expanded( crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: <Widget>[
crossAxisAlignment: SizedBox(
CrossAxisAlignment.start, height: 8,
children: <Widget>[
Texts(
'${model.cOCItemList[index].cOCTitle}'),
Texts(
TranslationBase.of(context).number +
' : ${model.cOCItemList[index].itemID}',
variant: 'overline',
),
],
), ),
), Row(
Expanded( mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts( Expanded(
'${model.cOCItemList[index].status}'), child: Column(
Texts( crossAxisAlignment: CrossAxisAlignment.start,
'${model.cOCItemList[index].date}', children: <Widget>[
variant: 'overline', Texts('${model.cOCItemList[index].cOCTitle}'),
Texts(
TranslationBase.of(context).number + ' : ${model.cOCItemList[index].itemID}',
variant: 'overline',
),
],
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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, : Center(
color: Colors.grey[500], 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, ),
), Container(
Texts(TranslationBase.of(context).noSearchResult), color: Colors.white,
], padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
), child: DefaultButton(
), TranslationBase.of(context).search,
), () => {},
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: () {},
), ),
), ),
), ],
), ),
), ),
); );
} }
gotodetails(item) { gotodetails(item) {
Navigator.pushReplacement( Navigator.pushReplacement(context, FadePage(page: FeedbackDetails(items: item)));
context, FadePage(page: FeedbackDetails(items: item)));
} }
} }

@ -36,7 +36,7 @@ class _HomePageFragmentState extends State<HomePageFragment> {
hmgServices.add(new HmgServices(2, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); 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(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(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 @override

@ -26,9 +26,9 @@ import 'dart:math' as math;
class HomePageFragment2 extends StatefulWidget { class HomePageFragment2 extends StatefulWidget {
DashboardViewModel model; 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 @override
_HomePageFragment2State createState() => _HomePageFragment2State(); _HomePageFragment2State createState() => _HomePageFragment2State();
@ -55,7 +55,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/visa.png", isLogin)); 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(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(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(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(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)); 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<HomePageFragment2> {
FlatButton( FlatButton(
onPressed: () { onPressed: () {
widget.onMedicalFileClick(); widget.onMedicalFileClick();
// navigateTo(context, MedicalProfilePageNew()); // navigateTo(context, MedicalProfilePageNew());
}, },
child: Text( child: Text(
TranslationBase.of(context).viewMedicalFile, TranslationBase.of(context).viewMedicalFile,

@ -61,7 +61,7 @@ class _HomePageFragmentState extends State<LoggedHomePageFragment> {
hmgServices.add(new HmgServices(2, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); 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(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(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<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async { Future<GetAllSharedRecordsByStatusResponse> getFamilyFiles() async {
@ -93,7 +93,8 @@ class _HomePageFragmentState extends State<LoggedHomePageFragment> {
child: LoggedSliderView( child: LoggedSliderView(
widget.projectViewModel, widget.projectViewModel,
new SliderData(TranslationBase.of(context).fileno + ": " + widget.projectViewModel.user.patientID.toString(), 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 appoCountProvider.count == 0

@ -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/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_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/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.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/HomeHealthCare/home_health_care_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
@ -42,6 +40,12 @@ class HomePage extends StatefulWidget {
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>(); PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -603,14 +607,14 @@ class _HomePageState extends State<HomePage> {
SizedBox( SizedBox(
height: 8, height: 8,
), ),
InkWell( Container(
onTap: () => Navigator.push(context, FadePage(page: PaymentService())), margin: EdgeInsets.only(left: 15, right: 15),
child: Container( child: Row(
margin: EdgeInsets.only(left: 15, right: 15), mainAxisAlignment: MainAxisAlignment.spaceBetween,
child: Row( children: <Widget>[
mainAxisAlignment: MainAxisAlignment.spaceBetween, InkWell(
children: <Widget>[ onTap: () => Navigator.push(context, FadePage(page: PaymentService())),
Container( child: Container(
width: MediaQuery.of(context).size.width * 0.29, width: MediaQuery.of(context).size.width * 0.29,
child: Center( child: Center(
child: Padding( child: Padding(
@ -641,7 +645,12 @@ class _HomePageState extends State<HomePage> {
color: Colors.white, color: Colors.white,
), ),
), ),
Container( ),
InkWell(
onTap: () {
Navigator.push(context, FadePage(page: EReferralPage()));
},
child: Container(
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
@ -656,7 +665,7 @@ class _HomePageState extends State<HomePage> {
height: 10, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context).offersAndPackages, TranslationBase.of(context).ereferral,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
@ -672,51 +681,52 @@ class _HomePageState extends State<HomePage> {
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
color: Colors.white, color: Colors.white,
)), )),
if (projectViewModel.havePrivilege(60)) ),
Container( if (projectViewModel.havePrivilege(60))
width: MediaQuery.of(context).size.width * 0.29, Container(
child: InkWell( width: MediaQuery.of(context).size.width * 0.29,
onTap: () => Navigator.push( child: InkWell(
context, onTap: () => Navigator.push(
FadePage( context,
page: ErOptions( FadePage(
isAppbar: true, page: ErOptions(
))), isAppbar: true,
child: Center( ))),
child: Padding( child: Center(
padding: const EdgeInsets.all(15.0), child: Padding(
child: Column( padding: const EdgeInsets.all(15.0),
children: <Widget>[ child: Column(
Image.asset( children: <Widget>[
'assets/images/Dr_Schedule_report.png', Image.asset(
width: 50, 'assets/images/Dr_Schedule_report.png',
height: 50, width: 50,
), height: 50,
SizedBox( ),
height: 10, SizedBox(
), height: 10,
Texts( ),
TranslationBase.of(context).emergencyServices, Texts(
textAlign: TextAlign.center, TranslationBase.of(context).emergencyServices,
color: Colors.black87, textAlign: TextAlign.center,
bold: false, color: Colors.black87,
fontSize: SizeConfig.textMultiplier * 1.7, 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( SizedBox(
height: 5, height: 5,
), ),

@ -157,21 +157,28 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return; return;
} }
} }
setState(() { setState(() {
if (currentTab > 0 && tab == 2) if (tab == 5) {
pageController.jumpToPage(0); IS_VOICE_COMMAND_CLOSED = false;
else if (tab != 0) { triggerRobot();
if (tab == 4 && model.count == 0) {
AppToast.showErrorToast(message: TranslationBase.of(context).noBookedAppo); // 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 { } else {
pageController.jumpToPage(tab); pageController.jumpToPage(tab);
} }
} else {
IS_VOICE_COMMAND_CLOSED = false;
pageController.jumpToPage(tab); currentTab = tab;
} }
currentTab = tab;
}); });
} }
@ -225,7 +232,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
// locationUtils.getCurrentLocation();
if (projectViewModel.isLogin) { if (projectViewModel.isLogin) {
familyFileProvider.getSharedRecordByStatus(); familyFileProvider.getSharedRecordByStatus();
} }
@ -242,6 +248,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
requestPermissions().then((results) { requestPermissions().then((results) {
locationUtils.getCurrentLocation();
_firebaseMessaging.getToken().then((String token) { _firebaseMessaging.getToken().then((String token) {
print("Firebase Token: " + token); print("Firebase Token: " + token);
sharedPref.setString(PUSH_TOKEN, token); sharedPref.setString(PUSH_TOKEN, token);
@ -259,7 +266,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// if (results[Permission.calendar].isGranted) ; // if (results[Permission.calendar].isGranted) ;
}); });
requestPermissions(); // requestPermissions();
// }); // });
// //
@ -608,7 +615,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
onLoginClick: () { onLoginClick: () {
login(); login();
}, },
onMedicalFileClick: (){ onMedicalFileClick: () {
changeCurrentTab(1); changeCurrentTab(1);
}, },
), ),
@ -634,7 +641,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
triggerRobot() { triggerRobot() {
event.setValue({"isRobot": 'true'}); event.setValue({"isRobotVisible": 'true'});
} }
getText(currentTab) { getText(currentTab) {

@ -148,7 +148,7 @@ class LoggedSliderView extends StatelessWidget {
), ),
mWidth(6), mWidth(6),
Texts( Texts(
"Height: ${model.heightCm} ${TranslationBase.of(context).cm}", "${TranslationBase.of(context).height}: ${model.heightCm} ${TranslationBase.of(context).cm}",
color: Colors.white, color: Colors.white,
fontSize: 10, fontSize: 10,
) )
@ -167,7 +167,7 @@ class LoggedSliderView extends StatelessWidget {
height: 12, height: 12,
), ),
mWidth(6), 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, height: 12,
), ),
mWidth(6), mWidth(6),
Texts('Blood: ${model.booldType}', color: Colors.white, fontSize: 10) Texts('${TranslationBase.of(context).bloodD}: ${model.booldType}', color: Colors.white, fontSize: 10)
], ],
), ),
), ),

@ -39,7 +39,7 @@ class _State extends State<ClinicCard> {
children: <Widget>[ children: <Widget>[
Card( Card(
margin: EdgeInsets.fromLTRB(15.0, 10.0, 8.0, 8.0), 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( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
), ),

@ -256,7 +256,7 @@ class _clinic_listState extends State<ClinicList> {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); 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, 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) { onBrowserLoadStart(String url) {

@ -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/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_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/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.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/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.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/otp/sms-popup.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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/auth_strings.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
class ConfirmLogin extends StatefulWidget { class ConfirmLogin extends StatefulWidget {
@override @override
@ -161,9 +159,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
Text( Text(
user.editedOn != null user.editedOn != null
? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.editedOn)) ? DateUtil.formatDateToDate(DateUtil.convertStringToDate(user.editedOn), projectViewModel.isArabic)
: user.createdOn != null : 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), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
), ),
@ -375,6 +373,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
var tempType; var tempType;
startSMSService(type) { startSMSService(type) {
tempType = type; tempType = type;
new SMSOTP( new SMSOTP(
@ -510,9 +509,12 @@ class _ConfirmLogin extends State<ConfirmLogin> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
var request = this.getCommonRequest().toJson(); var request = this.getCommonRequest().toJson();
dynamic res;
authService authService
.checkActivationCode(request, value) .checkActivationCode(request, value)
.then((result) => { .then((result) => {
res = result,
if (result is Map) if (result is Map)
{ {
result = CheckActivationCode.fromJson(result), result = CheckActivationCode.fromJson(result),
@ -530,7 +532,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
// sharedPref.setString( // sharedPref.setString(
// BLOOD_TYPE, result['PatientBloodType']), // BLOOD_TYPE, result['PatientBloodType']),
authenticatedUserObject.user = result.list, authenticatedUserObject.user = result.list,
projectViewModel.setPrivilege(privilegeList: res),
sharedPref.setObject(MAIN_USER, result.list), sharedPref.setObject(MAIN_USER, result.list),
sharedPref.setObject(USER_PROFILE, result.list), sharedPref.setObject(USER_PROFILE, result.list),
loginTokenID = result.logInTokenID, loginTokenID = result.logInTokenID,

@ -224,7 +224,6 @@ class _Login extends State<Login> {
} }
void validateForm() { void validateForm() {
print("mobileNo:${mobileNo}");
if (util.validateIDBox(nationalIDorFile.text, loginType) == true && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { if (util.validateIDBox(nationalIDorFile.text, loginType) == true && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) {
setState(() { setState(() {
isButtonDisabled = false; isButtonDisabled = false;
@ -234,7 +233,6 @@ class _Login extends State<Login> {
isButtonDisabled = true; isButtonDisabled = true;
}); });
} }
print("isButtonDisabled:${isButtonDisabled}");
} }
checkUserAuthentication() { checkUserAuthentication() {

@ -1,5 +1,6 @@
import 'dart:ui'; import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/enum/filter_type.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/ask_doctor_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
@ -46,6 +47,12 @@ class _AskDoctorHomPageState extends State<AskDoctorHomPage> with SingleTickerPr
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: Color(0xffF8F8F8), 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( body: Column(
children: [ children: [
Row( Row(

@ -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/core/viewModels/medical/ask_doctor_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.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/pages/medical/ask_doctor/request_type.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
class AskDoctorPage extends StatelessWidget { class AskDoctorPage extends StatelessWidget {
AskDoctorService service = new AskDoctorService();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<AskDoctorViewModel>( return BaseView<AskDoctorViewModel>(
@ -65,9 +67,10 @@ class AskDoctorPage extends StatelessWidget {
doctor: doctorList, doctor: doctorList,
isLiveCareAppointment: false, isLiveCareAppointment: false,
onTap: () { onTap: () {
model.getCallInfoHoursResult(doctorId: _doctor.doctorID, projectId: _doctor.projectID).then((value) { GifLoaderDialogUtils.showMyDialog(context);
if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) { service.getCallInfoHoursResult(doctorId: _doctor.doctorID, projectId: _doctor.projectID).then((res) {
// Navigator.pop(context); GifLoaderDialogUtils.hideDialog(context);
if (res['ErrorEndUserMessage'] == null) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -75,8 +78,12 @@ class AskDoctorPage extends StatelessWidget {
), ),
); );
} else { } 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);
}); });
}, },
); );

@ -3,9 +3,8 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_mod
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.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/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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -32,6 +31,8 @@ class _RequestTypePageState extends State<RequestTypePage> {
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).requestType, appBarTitle: TranslationBase.of(context).requestType,
baseViewModel: model, baseViewModel: model,
showNewAppBar: true,
showNewAppBarTitle: true,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
@ -99,22 +100,24 @@ class _RequestTypePageState extends State<RequestTypePage> {
), ),
bottomSheet: Container( bottomSheet: Container(
width: double.maxFinite, width: double.maxFinite,
// height: MediaQuery.of(context).size.height * 0.1,
height: 80.0, height: 80.0,
child: Padding( child: Padding(
padding: const EdgeInsets.all(12.0), padding: const EdgeInsets.all(12.0),
child: SecondaryButton( child: Container(
label: TranslationBase.of(context).submit, width: MediaQuery.of(context).size.width * 0.8,
loading: model.state == ViewState.BusyLocal, child: DefaultButton(
textColor: Colors.white, TranslationBase.of(context).submit,
onTap: () { () => {
model.sendRequestLOV(doctorList: widget.doctorList, requestType: parameterCode.toString(), remark: question).then((value) { model.sendRequestLOV(doctorList: widget.doctorList, requestType: parameterCode.toString(), remark: question).then((value) {
if (model.state != ViewState.ErrorLocal || model.state != ViewState.Error) { if (model.state != ViewState.ErrorLocal || model.state != ViewState.Error) {
Navigator.pop(context); Navigator.pop(context);
} }
}); })
}, },
color: Colors.grey[800], color: Color(0xffD02127),
textColor: Colors.white,
disabledColor: Color(0xffEAEAEA),
),
), ),
), ),
), ),

@ -1,13 +1,7 @@
import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; 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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -135,7 +129,7 @@ class ClassesPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ 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( Expanded(
flex: 2, flex: 2,
child: Row( child: Row(
@ -143,11 +137,11 @@ class ClassesPage extends StatelessWidget {
children: [ children: [
Text( Text(
val1 == 'null' ? '-' : val1, val1 == 'null' ? '-' : val1,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4),
), ),
Text( Text(
val2 != 'null' ? '-' : val2, val2 != 'null' ? '-' : val2,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4),
), ),
], ],
), ),

@ -142,7 +142,7 @@ class ContactLensPage extends StatelessWidget {
flex: 4, flex: 4,
child: Text( child: Text(
title, title,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4),
)), )),
Expanded( Expanded(
flex: 2, flex: 2,
@ -152,7 +152,7 @@ class ContactLensPage extends StatelessWidget {
children: [ children: [
Text( Text(
val1 == 'null' ? '-' : val1, val1 == 'null' ? '-' : val1,
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, letterSpacing: -0.4), style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: -0.4),
), ),
], ],
), ),

@ -120,7 +120,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
TranslationBase.of(context).classes, TranslationBase.of(context).classes,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, // fontSize: 12,
letterSpacing: -0.36, letterSpacing: -0.36,
), ),
), ),
@ -133,7 +133,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
TranslationBase.of(context).contactLens, TranslationBase.of(context).contactLens,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 12, // fontSize: 12,
letterSpacing: -0.36, letterSpacing: -0.36,
), ),
), ),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -31,6 +32,12 @@ class EyeMeasurementsPage extends StatelessWidget {
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor, 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, appBarTitle: TranslationBase.of(context).eyeMeasurements,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(

@ -37,7 +37,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowDecPage: false, isShowDecPage: false,
baseViewModel: model, baseViewModel: model,
isHelp: true, isHelp: false,
body: Container( body: Container(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart' import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'
as DoctorListResponse; as DoctorListResponse;
@ -24,21 +25,28 @@ class _MyInvoicesState extends State<MyInvoices> {
GetDentalAppointmentsResponse getDentalAppointmentsResponse; GetDentalAppointmentsResponse getDentalAppointmentsResponse;
DentalInvoiceDetailResponse dentalInvoiceDetailResponse; DentalInvoiceDetailResponse dentalInvoiceDetailResponse;
ProjectViewModel projectViewModel;
List<ImagesInfo> imagesInfo = List();
@override @override
void initState() { 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((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
getDentalAppointments(); if(projectViewModel.isLogin)
getDentalAppointments();
}); });
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).myInvoice, appBarTitle: TranslationBase.of(context).myInvoice,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: true, isShowDecPage: true,
imagesInfo: imagesInfo,
body: Container( body: Container(
child: SingleChildScrollView( child: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -15,7 +16,11 @@ class MyTrackers extends StatelessWidget {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).myTracker, appBarTitle: TranslationBase.of(context).myTracker,
isShowAppBar: true, 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( body: SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
@ -33,8 +38,7 @@ class MyTrackers extends StatelessWidget {
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
height: MediaQuery.of(context).size.width * 0.35, height: MediaQuery.of(context).size.width * 0.35,
decoration: BoxDecoration( decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -59,8 +63,7 @@ class MyTrackers extends StatelessWidget {
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
height: MediaQuery.of(context).size.width * 0.35, height: MediaQuery.of(context).size.width * 0.35,
decoration: BoxDecoration( decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -90,8 +93,7 @@ class MyTrackers extends StatelessWidget {
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
width: MediaQuery.of(context).size.width * 0.35, width: MediaQuery.of(context).size.width * 0.35,
height: MediaQuery.of(context).size.width * 0.35, height: MediaQuery.of(context).size.width * 0.35,
decoration: BoxDecoration( decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,

@ -37,24 +37,28 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
appBarTitle: TranslationBase.of(context).sickLeaves, appBarTitle: TranslationBase.of(context).sickLeaves,
description: TranslationBase.of(context).infoSickLeaves, description: TranslationBase.of(context).infoSickLeaves,
infoList: TranslationBase.of(context).infoSickLeavePoints, infoList: TranslationBase.of(context).infoSickLeavePoints,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF7F7F7),
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
baseViewModel: model, baseViewModel: model,
body: Container( body: ListView.separated(
margin: EdgeInsets.all(12), physics: BouncingScrollPhysics(),
child: ListView.builder( itemCount: model.sickLeaveList.length,
itemCount: model.sickLeaveList.length, padding: EdgeInsets.all(21),
itemBuilder: (context, index) => DoctorCard( separatorBuilder: (context, index) => SizedBox(height: 14),
isLiveCareAppointment: model.sickLeaveList[index].isLiveCareAppointment, itemBuilder: (context, index) => DoctorCard(
name: model.sickLeaveList[index].doctorName, isLiveCareAppointment: model.sickLeaveList[index].isLiveCareAppointment,
date: model.sickLeaveList[index].appointmentDate, name: model.sickLeaveList[index].doctorName,
profileUrl: model.sickLeaveList[index].doctorImageURL, date: model.sickLeaveList[index].appointmentDate,
rating: model.sickLeaveList[index].actualDoctorRate.toDouble(), profileUrl: model.sickLeaveList[index].doctorImageURL,
subName: model.sickLeaveList[index].projectName, rating: model.sickLeaveList[index].actualDoctorRate.toDouble(),
isInOutPatient: model.sickLeaveList[index].isInOutPatient, subName: model.sickLeaveList[index].clinicName,
onEmailTap: () { isSortByClinic: false,
showConfirmMessage(model, index); isInOutPatient: model.sickLeaveList[index].isInOutPatient,
}, onEmailTap: () {
), showConfirmMessage(model, index);
},
), ),
), ),
), ),

@ -86,12 +86,6 @@ class RadiologyDetailsPage extends StatelessWidget {
'${finalRadiology.reportData}', '${finalRadiology.reportData}',
style: TextStyle(fontSize: 12, letterSpacing: -0.48), style: TextStyle(fontSize: 12, letterSpacing: -0.48),
), ),
// Texts(
// '${finalRadiology.reportData}',
// textAlign: TextAlign.start,
// fontSize: 12,
//
// ),
mHeight(16), mHeight(16),
(projectViewModel.havePrivilege(9) || projectViewModel.havePrivilege(8)) (projectViewModel.havePrivilege(9) || projectViewModel.havePrivilege(8))
? (finalRadiology.dIAPACSURL != "" && projectViewModel.havePrivilege(9)) ? (finalRadiology.dIAPACSURL != "" && projectViewModel.havePrivilege(9))

@ -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/core/viewModels/medical/reports_monthly_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/medical/reports/user_agreement_page.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/input/custom_switch.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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class MonthlyReportsPage extends StatefulWidget { class MonthlyReportsPage extends StatefulWidget {
@ -24,6 +23,17 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
String email; String email;
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
List<ImagesInfo> 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<ReportsMonthlyViewModel>(builder: (_, model, w) { return BaseView<ReportsMonthlyViewModel>(builder: (_, model, w) {
@ -39,153 +49,197 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).monthlyReports, appBarTitle: TranslationBase.of(context).monthlyReports,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF7F7F7),
imagesInfo: imagesInfo,
description: TranslationBase.of(context).infoMonthReport,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( physics: BouncingScrollPhysics(),
padding: EdgeInsets.all(12), padding: EdgeInsets.all(21),
child: Form( child: Form(
key: formKey, key: formKey,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
padding: EdgeInsets.all(9), padding: EdgeInsets.only(right: 12, left: 12, top: 14, bottom: 14),
height: 55, decoration: BoxDecoration(
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(8)), shape: BoxShape.rectangle, border: Border.all(color: Colors.grey)), borderRadius: BorderRadius.all(
child: Row( Radius.circular(10.0),
mainAxisAlignment: MainAxisAlignment.spaceBetween, ),
children: [ boxShadow: [
Texts( BoxShadow(
TranslationBase.of(context).patientHealthSummaryReport, color: Color(0xff000000).withOpacity(.05),
bold: true, //spreadRadius: 5,
), blurRadius: 27,
CustomSwitch( offset: Offset(0, -3),
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),
), ),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: UserAgreementContent(),
),
);
},
child: Texts(
TranslationBase.of(context).clickHere,
color: Colors.blue,
),
)
], ],
), color: Colors.white),
), child: Row(
SizedBox( mainAxisAlignment: MainAxisAlignment.spaceBetween,
height: 5,
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Checkbox( Expanded(
value: isAgree, child: Text(
onChanged: (value) { 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(() { 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), SizedBox(
width: double.infinity, height: 12,
child: SecondaryButton( ),
textColor: Colors.white, RichText(
label: TranslationBase.of(context).save, text: TextSpan(
disabled: (!isAgree || !isSummary), text: TranslationBase.of(context).toViewTheTermsAndConditions + " ",
onTap: () async { style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16),
final form = formKey.currentState; children: [
if (form.validate()) { TextSpan(
GifLoaderDialogUtils.showMyDialog(context); text: TranslationBase.of(context).clickHere,
await model.updatePatientHealthSummaryReport( style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.blue, letterSpacing: -0.64, height: 23 / 16),
message: TranslationBase.of(context).updateSuccessfully, isSummary: isSummary, isUpdateEmail: true, email: email.isNotEmpty ? email : model.user.emailAddress); recognizer: new TapGestureRecognizer()
model.receiveHealthSummaryReport = isSummary; ..onTap = () => Navigator.push(
model.user.emailAddress = email.isNotEmpty ? email : model.user.emailAddress; context,
GifLoaderDialogUtils.hideDialog(context); FadePage(
} page: UserAgreementContent(),
),
),
)
]),
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Checkbox(
value: isAgree,
onChanged: (value) {
setState(() {
isAgree = !isAgree;
});
}, },
activeColor: Color(0xffD02127),
), ),
), Text(
Padding( TranslationBase.of(context).iAgreeToTheTermsAndConditions,
padding: const EdgeInsets.all(5.0), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14),
child: Texts(
TranslationBase.of(context).instructionAgree,
fontWeight: FontWeight.normal,
), ),
), ],
SizedBox( ),
height: 12, DefaultButton(
), TranslationBase.of(context).save,
Center(child: Image.asset('assets/images/report.jpg')) () 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'))
],
), ),
), ),
), ),

@ -56,6 +56,7 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
baseViewModel: model, baseViewModel: model,
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: Color(0xffF7F7F7),
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
body: Column( body: Column(
children: [ children: [

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/reports/Reports.dart'; import 'package:diplomaticquarterapp/core/model/reports/Reports.dart';
import 'package:diplomaticquarterapp/core/service/medical/reports_service.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/locator.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.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:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
class ReportListWidget extends StatelessWidget { class ReportListWidget extends StatelessWidget {
@ -20,8 +22,11 @@ class ReportListWidget extends StatelessWidget {
ReportListWidget({@required this.reportList, this.emailAddress}); ReportListWidget({@required this.reportList, this.emailAddress});
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return ListView.separated( return ListView.separated(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
@ -69,8 +74,8 @@ class ReportListWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
if (report.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", report.projectName), if (report.projectName != null) myRichText(TranslationBase.of(context).clinic + ":", report.projectName, projectViewModel.isArabic),
if (report.clinicDescription != null) myRichText(TranslationBase.of(context).hospital + ":", report.clinicDescription), if (report.clinicDescription != null) myRichText(TranslationBase.of(context).hospital + ":", report.clinicDescription, projectViewModel.isArabic),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,

@ -5,26 +5,28 @@ import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
class MedicalReports extends StatelessWidget { class MedicalReports extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
void confirmBox( void confirmBox(AppointmentHistory model, ReportsViewModel reportsViewModel) {
AppointmentHistory model, ReportsViewModel reportsViewModel) {
showDialog( showDialog(
context: context, context: context,
child: ConfirmDialog( child: ConfirmDialog(
appointmentHistory: model, 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); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<ReportsViewModel>( return BaseView<ReportsViewModel>(
onModelReady: (model) => model.getPatentAppointmentHistory(), onModelReady: (model) => model.getPatentAppointmentHistory(),
@ -32,88 +34,175 @@ class MedicalReports extends StatelessWidget {
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).medReport, appBarTitle: TranslationBase.of(context).medReport,
body: ListView.builder( showNewAppBar: true,
itemCount: model.appointHistoryList.length, showNewAppBarTitle: true,
itemBuilder: (context, index) => Padding( backgroundColor: Color(0xffF7F7F7),
padding: const EdgeInsets.all(8.0), body: ListView.separated(
child: Container( physics: BouncingScrollPhysics(),
width: double.infinity, itemCount: model.appointHistoryList.length,
margin: EdgeInsets.only(left: 8, right: 8, top: 3), padding: EdgeInsets.all(21),
decoration: BoxDecoration( separatorBuilder: (context, index) => SizedBox(height: 14),
color: Colors.white, itemBuilder: (context, index) {
border: Border.all(color: Colors.white, width: 2), AppointmentHistory _appointmenHistory = model.appointHistoryList[index];
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all( return InkWell(
Radius.circular(8.0), onTap: () => confirmBox(model.appointHistoryList[index], model),
)), child: Container(
child: Row( decoration: BoxDecoration(
children: <Widget>[ borderRadius: BorderRadius.all(
Container( Radius.circular(10.0),
margin: EdgeInsets.only(left: 5, right: 5), ),
child: LargeAvatar( boxShadow: [
width: 50, BoxShadow(
height: 50, color: Color(0xff000000).withOpacity(.05),
name: model.appointHistoryList[index].doctorNameObj, //spreadRadius: 5,
url: model.appointHistoryList[index].doctorImageURL, 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: <Widget>[
LargeAvatar(
name: _appointmenHistory.doctorName,
url: _appointmenHistory.doctorImageURL,
width: 48,
height: 48,
),
SizedBox(width: 11),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
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: <Widget>[
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( Container(
padding: const EdgeInsets.all(8.0), decoration: BoxDecoration(
child: Column( borderRadius: BorderRadius.all(
crossAxisAlignment: CrossAxisAlignment.start, Radius.circular(10.0),
children: <Widget>[ ),
SizedBox( boxShadow: [
height: 12, BoxShadow(
), color: Color(0xff000000).withOpacity(.05),
Texts(model.appointHistoryList[index].projectName), blurRadius: 27,
Texts(model.appointHistoryList[index].clinicName), offset: Offset(0, -3),
Texts(projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.appointHistoryList[index].appointmentDate):DateUtil.getMonthDayYearDateFormatted(model.appointHistoryList[index].appointmentDate)), ),
StarRating( ],
totalAverage: model color: Colors.white),
.appointHistoryList[index].actualDoctorRate child: Row(
.toDouble(), children: <Widget>[
forceStars: true), Container(
SizedBox( margin: EdgeInsets.only(left: 5, right: 5),
height: 12, child: LargeAvatar(
), width: 50,
], height: 50,
name: model.appointHistoryList[index].doctorNameObj,
url: model.appointHistoryList[index].doctorImageURL,
), ),
), ),
), Expanded(
InkWell( flex: 4,
onTap: () => child: Padding(
confirmBox(model.appointHistoryList[index], model), padding: const EdgeInsets.all(8.0),
child: Container( child: Column(
width: 120, crossAxisAlignment: CrossAxisAlignment.start,
height: 50, children: <Widget>[
decoration: BoxDecoration( SizedBox(
color: Colors.black54, height: 12,
border: ),
Border.all(color: Colors.transparent, width: 2), Texts(model.appointHistoryList[index].projectName),
shape: BoxShape.rectangle, Texts(model.appointHistoryList[index].clinicName),
borderRadius: BorderRadius.all( Texts(projectViewModel.isArabic
Radius.circular(8.0), ? 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( InkWell(
TranslationBase.of(context).requestReport, onTap: () => confirmBox(model.appointHistoryList[index], model),
fontSize: 12, child: Container(
color: Colors.white, 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(
SizedBox( width: 12,
width: 12, ),
), ],
], ),
), );
), }),
),
),
), ),
); );
} }

@ -13,11 +13,13 @@ class UserAgreementContent extends StatelessWidget {
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: Color(0xffF7F7F7),
appBarTitle: TranslationBase.of(context).userAgreement, appBarTitle: TranslationBase.of(context).userAgreement,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Html( physics: BouncingScrollPhysics(),
data: model.userAgreementContent, child: Html(data: model.userAgreementContent),
),
), ),
), ),
); );

@ -1,9 +1,13 @@
import 'dart:io'; import 'dart:io';
import 'package:carousel_slider/carousel_slider.dart'; 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/pages/medical/smart_watch_health_data/health_data_list.dart';
import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -19,10 +23,13 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
bool hasAlreadySynced = false; bool hasAlreadySynced = false;
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
getLastPatientRecord(context); if(authenticatedUserObject.isLogin) getLastPatientRecord(context);
}); });
super.initState(); super.initState();
} }
@ -32,6 +39,12 @@ class _SmartWatchInstructionsState extends State<SmartWatchInstructions> {
return AppScaffold( return AppScaffold(
appBarTitle: "Sync Health Data", appBarTitle: "Sync Health Data",
isShowAppBar: true, 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( body: Container(
child: Platform.isIOS child: Platform.isIOS
? _getAppleWatchInstructions() ? _getAppleWatchInstructions()

@ -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/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class RateAppointmentClinic extends StatefulWidget { class RateAppointmentClinic extends StatefulWidget {
final AppointmentDetails appointmentDetails; final AppointmentDetails appointmentDetails;
final String doctorNote; final String doctorNote;
final int doctorRate; final int doctorRate;
RateAppointmentClinic( RateAppointmentClinic({this.appointmentDetails, this.doctorRate, this.doctorNote});
{this.appointmentDetails, this.doctorRate, this.doctorNote});
@override @override
_RateAppointmentClinicState createState() => _RateAppointmentClinicState(); _RateAppointmentClinicState createState() => _RateAppointmentClinicState();
@ -43,8 +42,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
textTheme: TextTheme( textTheme: TextTheme(
headline6: headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
), ),
title: Text('Rate'), title: Text('Rate'),
leading: Builder( leading: Builder(
@ -91,11 +89,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
height: 8, height: 8,
), ),
LargeAvatar( LargeAvatar(
url: url: 'https://hmgwebservices.com/Images/Hospitals/' + model.appointmentDetails.projectID.toString() + '.jpg',
'https://hmgwebservices.com/Images/Hospitals/' +
model.appointmentDetails.projectID
.toString() +
'.jpg',
name: model.appointmentDetails.clinicName, name: model.appointmentDetails.clinicName,
width: 110, width: 110,
height: 110, height: 110,
@ -112,9 +106,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
height: 4, height: 4,
), ),
Texts( Texts(
DateUtil.getMonthDayYearDateFormatted( DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointmentDetails.appointmentDate)),
DateUtil.convertStringToDate(
model.appointmentDetails.appointmentDate)),
), ),
SizedBox( SizedBox(
height: 8, height: 8,
@ -146,10 +138,8 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
duration: Duration(milliseconds: 1000), duration: Duration(milliseconds: 1000),
switchInCurve: Curves.elasticOut, switchInCurve: Curves.elasticOut,
switchOutCurve: Curves.elasticIn, switchOutCurve: Curves.elasticIn,
transitionBuilder: transitionBuilder: (Widget child, Animation<double> animation) {
(Widget child, Animation<double> animation) { return ScaleTransition(child: child, scale: animation);
return ScaleTransition(
child: child, scale: animation);
}, },
child: Container( child: Container(
key: ValueKey<int>(rating), key: ValueKey<int>(rating),
@ -162,9 +152,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
}, },
iconSize: rating == (index + 1) ? 60 : 40, iconSize: rating == (index + 1) ? 60 : 40,
// Theme.of(context).hintColor, // Theme.of(context).hintColor,
icon: Image.asset('assets/images/' + icon: Image.asset('assets/images/' + (index + 1).toString() + '.png')),
(index + 1).toString() +
'.png')),
), ),
), ),
) )
@ -192,25 +180,33 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
if (rating > 0) { if (rating > 0) {
model model
.sendAppointmentRate( .sendAppointmentRate(
rating, rating, widget.appointmentDetails.appointmentNo, widget.appointmentDetails.projectID, widget.appointmentDetails.doctorID, widget.appointmentDetails.clinicID, note)
widget.appointmentDetails.appointmentNo,
widget.appointmentDetails.projectID,
widget.appointmentDetails.doctorID,
widget.appointmentDetails.clinicID,
note)
.then( .then(
(value) => { (value) => {
Navigator.pushReplacement( model
context, .sendDoctorRate(
FadePage( widget.doctorRate,
page: LandingPage(), 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 { } else {
AppToast.showErrorToast( AppToast.showErrorToast(message: 'please rate the clinic');
message: 'please rate the clinic');
} }
}, },
label: TranslationBase.of(context).submit, label: TranslationBase.of(context).submit,

@ -1,19 +1,19 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.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/project_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_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: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/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.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'; import 'my_vaccines_item_screen.dart';
//TODO fix by jammal we have a static data //TODO fix by jammal we have a static data
@ -28,192 +28,164 @@ class _MyVaccinesState extends State<MyVaccines> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<VaccineViewModel>( return BaseView<VaccineViewModel>(
onModelReady: (model) => model.getVaccine(), onModelReady: (model) => model.getVaccine(),
builder: (BuildContext context, VaccineViewModel model, Widget child) => builder: (BuildContext context, VaccineViewModel model, Widget child) => AppScaffold(
AppScaffold( isShowAppBar: true,
isShowAppBar: true, baseViewModel: model,
baseViewModel: model, appBarTitle: TranslationBase.of(context).myVaccines,
appBarTitle: TranslationBase.of(context).myVaccines, description: TranslationBase.of(context).infoVaccines,
body: Container( imagesInfo: [
margin: EdgeInsets.only( ImagesInfo(
left: SizeConfig.screenWidth * 0.004, 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')
right: SizeConfig.screenWidth * 0.004, ],
top: SizeConfig.screenWidth * 0.04, body: Container(
), margin: EdgeInsets.only(
child: Column( left: SizeConfig.screenWidth * 0.004,
children: <Widget>[ right: SizeConfig.screenWidth * 0.004,
RoundedContainer( top: SizeConfig.screenWidth * 0.04,
backgroundColor: Colors.white, ),
child: ExpansionTile( child: Column(
title: Container( children: <Widget>[
height: 65.0, RoundedContainer(
child: Text('2018'), backgroundColor: Colors.white,
), child: ExpansionTile(
children: <Widget>[ title: Container(
Container( height: 65.0,
child: ListView.builder( child: Text('2018'),
scrollDirection: Axis.vertical, ),
shrinkWrap: true, children: <Widget>[
itemCount: model.vaccineList == null Container(
? 0 child: ListView.builder(
: model.vaccineList.length, scrollDirection: Axis.vertical,
itemBuilder: (BuildContext context, int index) { shrinkWrap: true,
return Column( itemCount: model.vaccineList == null ? 0 : model.vaccineList.length,
children: <Widget>[ itemBuilder: (BuildContext context, int index) {
RoundedContainer( return Column(
child: Column( children: <Widget>[
RoundedContainer(
child: Column(
children: <Widget>[
Row(
children: <Widget>[ children: <Widget>[
Row( Expanded(
children: <Widget>[ child: Column(
Expanded( children: <Widget>[
child: Column( Padding(
children: <Widget>[ padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 20.0),
Padding( child: Image.network(
padding: EdgeInsets model.vaccineList[index].doctorImageURL,
.symmetric( height: SizeConfig.imageSizeMultiplier * 23,
horizontal: width: SizeConfig.imageSizeMultiplier * 20,
20.0, fit: BoxFit.fill,
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: <Widget>[
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, ],
),
flex: 2,
),
Expanded(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
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), ),
],
), ),
), // SpaceBetweenTexts(space: 165.0),
bottomSheet: model.state == ViewState.Busy?Container(height: 0,): model.vaccineList.length > 0 ],
),
),
bottomSheet: model.state == ViewState.Busy
? Container(
height: 0,
)
: model.vaccineList.length > 0
? Container( ? Container(
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
height: MediaQuery.of(context).size.height * 0.25, height: MediaQuery.of(context).size.height * 0.25,
width: double.infinity,
child: Column(
children: [
Divider(
height: 2,
thickness: 1,
),
SizedBox(
height: 6,
),
Container(
width: double.infinity, width: double.infinity,
// height: 80.0, child: Column(
child: Button( children: [
disabled: true, Divider(
label: TranslationBase.of(context) height: 2,
.checkVaccineAvailability, thickness: 1,
backgroundColor: Color(0xff9EA3A4), ),
onTap: () => Navigator.push( SizedBox(
context, FadePage(page: MyVaccinesItemPage())), 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<MyVaccines> {
final startIndex = Date.indexOf(start); final startIndex = Date.indexOf(start);
final endIndex = Date.indexOf(end, startIndex + start.length); final endIndex = Date.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch( var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(Date.substring(startIndex + start.length, endIndex)));
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');
String newDate = date.year.toString() +
"-" +
date.month.toString().padLeft(2, '0') +
"-" +
date.day.toString().padLeft(2, '0');
return newDate.toString(); return newDate.toString();
} }

@ -130,8 +130,8 @@ class DoctorsListService extends BaseService {
"gender": authUser.gender != null ? authUser.gender : 0, "gender": authUser.gender != null ? authUser.gender : 0,
"age": authUser.age != null ? authUser.age : 0, "age": authUser.age != null ? authUser.age : 0,
"IsGetNearAppointment": false, "IsGetNearAppointment": false,
"Latitude": lat, "Latitude": lat == null ? 0.0 : lat,
"Longitude": long, "Longitude": long == null ? 0.0 : long,
"License": true "License": true
}; };

@ -15,5 +15,6 @@ class CustomColors {
static const Color pharmacyGreyColor = Color(0xFFDBDBDB); static const Color pharmacyGreyColor = Color(0xFFDBDBDB);
static const Color backgroudGreyColor = Color(0xFFEFEFEF); static const Color backgroudGreyColor = Color(0xFFEFEFEF);
static const Color appBackgroudGreyColor = Color(0xFFF7F7F7); static const Color appBackgroudGreyColor = Color(0xFFF7F7F7);
static const Color appBackgroudGrey2Color = Color(0xFFF8F8F8);
static const Color green = Color(0xFF359846); static const Color green = Color(0xFF359846);
} }

@ -52,8 +52,8 @@ class DateUtil {
return start + "$milliseconds" + end; return start + "$milliseconds" + end;
} }
static String formatDateToDate(DateTime date) { static String formatDateToDate(DateTime date, bool isArabic) {
return DateFormat('dd MMM yyy').format(date); return DateFormat('dd MMM yyy', isArabic ? "ar_SA" : "en_US").format(date);
} }
static String formatDateToTime(DateTime date) { static String formatDateToTime(DateTime date) {

@ -2142,7 +2142,28 @@ class TranslationBase {
String get aboutApp => localizedValues["about-app"][locale.languageCode]; String get aboutApp => localizedValues["about-app"][locale.languageCode];
String get aboutPointsLength => localizedValues["about-points"]['length'][locale.languageCode]; String get aboutPointsLength => localizedValues["about-points"]['length'][locale.languageCode];
String get timeNeeded => localizedValues["time-needed"][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<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -7,6 +7,7 @@ import 'package:badges/badges.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:connectivity/connectivity.dart'; import 'package:connectivity/connectivity.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.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/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.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/smart_watch_health_data/smart_watch_instructions.dart';
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.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/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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.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:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import '../Constants.dart'; import '../Constants.dart';
import 'app_shared_preferences.dart'; import 'app_shared_preferences.dart';
import 'app_toast.dart'; import 'app_toast.dart';
@ -407,12 +409,12 @@ class Utils {
), ),
)); ));
medical.add(MedicalProfileItem( // medical.add(MedicalProfileItem(
title: TranslationBase.of(context).patientCall, // title: TranslationBase.of(context).patientCall,
imagePath: 'medical_history_icon.png', // imagePath: 'medical_history_icon.png',
subTitle: TranslationBase.of(context).patientCallSubtitle, // subTitle: TranslationBase.of(context).patientCallSubtitle,
isEnable: projectViewModel.havePrivilege(61), // isEnable: projectViewModel.havePrivilege(61),
)); // ));
medical.add(InkWell( medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null, onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null,
@ -766,21 +768,26 @@ class Utils {
if (projectViewModel.havePrivilege(32) || true) { if (projectViewModel.havePrivilege(32) || true) {
medical.add(InkWell( medical.add(InkWell(
onTap: () { onTap: () {
userData().then((userData_) { if (projectViewModel.isLogin) {
if (projectViewModel.isLogin && userData_ != null) { userData().then((userData_) {
String patientID = userData_.patientID.toString(); String patientID = userData_.patientID.toString();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)}); projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)});
} else { });
AlertDialogBox( } else {
context: context, Navigator.push(
confirmMessage: "Please login with your account first to use this feature", context,
okText: "OK", FadePage(
okFunction: () { page: NotAutPage(
AlertDialogBox.closeAlertDialog(context); title: TranslationBase.of(context).autoWifi,
}).showAlertDialog(context); 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( child: MedicalProfileItem(
title: TranslationBase.of(context).internet, 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( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
SizedBox(height: 12), SizedBox(height: 12),
Text( 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), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
), ),
SizedBox(height: 12), SizedBox(height: 12),

@ -15,16 +15,12 @@ import 'package:provider/provider.dart';
import '../../d_q_icons_icons.dart'; import '../../d_q_icons_icons.dart';
import 'bottom_navigation_item.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 { class BottomNavBar extends StatefulWidget {
final ValueChanged<int> changeIndex; final ValueChanged<int> changeIndex;
final int index; final int index;
final bool showHomeIcon; final bool showHomeIcon;
BottomNavBar( BottomNavBar({Key key, this.changeIndex, this.index, this.showHomeIcon = false}) : super(key: key);
{Key key, this.changeIndex, this.index, this.showHomeIcon = false})
: super(key: key);
@override @override
_BottomNavBarState createState() => _BottomNavBarState(); _BottomNavBarState createState() => _BottomNavBarState();
@ -36,7 +32,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
var event = RobotProvider(); var event = RobotProvider();
_changeIndex(int index) async { _changeIndex(int index) async {
widget.changeIndex(index); widget.changeIndex(index);
if (index == 0) { if (index == 5) {
event.setValue({'isRobotVisible': 'true'}); event.setValue({'isRobotVisible': 'true'});
} }
} }
@ -114,8 +110,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
// currentIndex: 2, // currentIndex: 2,
// name: TranslationBase.of(context).bookAppo, // name: TranslationBase.of(context).bookAppo,
// ), // ),
if (/*widget.index == 0 && */ projectViewModel if (/*widget.index == 0 && */ projectViewModel.havePrivilege(34))
.havePrivilege(34))
BottomNavigationItem( BottomNavigationItem(
icon: EvaIcons.calendar, icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendar, activeIcon: EvaIcons.calendar,
@ -130,7 +125,7 @@ class _BottomNavBarState extends State<BottomNavBar> {
activeIcon: DQIcons.roboticon, activeIcon: DQIcons.roboticon,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: widget.index, index: widget.index,
currentIndex: 0, currentIndex: 5,
name: TranslationBase.of(context).help, name: TranslationBase.of(context).help,
) )
], ],

@ -2,7 +2,6 @@ import 'package:badges/badges.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.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:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';

@ -14,7 +14,6 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import '../../text.dart'; import '../../text.dart';
import 'FlowChartPage.dart'; import 'FlowChartPage.dart';
@ -116,7 +115,7 @@ class LabResultWidget extends StatelessWidget {
openPassportUpdatePage(BuildContext context) { openPassportUpdatePage(BuildContext context) {
Navigator.push(context, FadePage(page: PassportUpdatePage())).then((value) { Navigator.push(context, FadePage(page: PassportUpdatePage())).then((value) {
print(value); print(value);
if(value != null && value == true) { if (value != null && value == true) {
showConfirmMessage(context, projectViewModel.user.emailAddress, "yes"); showConfirmMessage(context, projectViewModel.user.emailAddress, "yes");
} }
}); });
@ -179,7 +178,7 @@ class LabResultWidget extends StatelessWidget {
children: [ children: [
Utils.tableColumnValue(labResultList[i].description, isLast: i == (labResultList.length - 1)), 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].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),
], ],
), ),
); );

@ -49,7 +49,7 @@ class _VitalSignDetailsWidgetState extends State<LabResultDetailsWidget> {
tableRow.add( tableRow.add(
TableRow( TableRow(
children: [ 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)), Utils.tableColumnValue(labOrderResultList[i].resultValue, isLast: i == (labOrderResultList.length - 1)),
], ],
), ),

@ -46,9 +46,11 @@ class DoctorCard extends StatelessWidget {
this.remainingTimeInMinutes, this.remainingTimeInMinutes,
this.isParentAppointment = false}); this.isParentAppointment = false});
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return Container( return Container(
height: 120, height: 120,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -127,7 +129,7 @@ class DoctorCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( 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), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
), ),
Text( Text(
@ -155,11 +157,11 @@ class DoctorCard extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
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( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
if (rating == null) myRichText(TranslationBase.of(context).invoiceNo, billNo ?? ""), if (rating == null) myRichText(TranslationBase.of(context).invoiceNo, billNo ?? "", projectViewModel.isArabic),
if (rating != null) if (rating != null)
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -216,13 +218,13 @@ class DoctorCard extends StatelessWidget {
} }
// todo 'sikander' move this widget to separate file // todo 'sikander' move this widget to separate file
Widget myRichText(String title, String value) { Widget myRichText(String title, String value, bool isArabic) {
return RichText( return RichText(
maxLines: 1, maxLines: 1,
text: TextSpan(text: title, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10), children: <TextSpan>[ 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>[
TextSpan( TextSpan(
text: " $value", 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),
) )
]), ]),
); );

@ -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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.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:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:equatable/equatable.dart'; import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -34,7 +34,7 @@ class _TimeLineViewState extends State<TimeLineView> {
List<AppoitmentAllHistoryResultList> tempList = []; List<AppoitmentAllHistoryResultList> tempList = [];
List<DateObj> dateObjs = []; List<DateObj> dateObjs = [];
DateObj selectedDateObj = null; DateObj selectedDateObj = null;
final authService = new auth.AuthProvider();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -277,9 +277,29 @@ class _TimeLineViewState extends State<TimeLineView> {
} }
login() async { login() async {
Navigator.of(context).pushNamed( var data = await sharedPref.getObject(IMEI_USER_DATA);
WELCOME_LOGIN, 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,
);
});
}
} }
} }

@ -1,23 +1,24 @@
import 'dart:io'; import 'dart:io';
import 'package:diplomaticquarterapp/config/config.dart'; 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/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.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/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/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.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/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notifications_page.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/notifications/notifications_page.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/routes.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/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_notifier.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'drawer_item_widget.dart'; import 'drawer_item_widget.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
class AppDrawer extends StatefulWidget { class AppDrawer extends StatefulWidget {
@override @override
@ -59,10 +59,12 @@ class _AppDrawerState extends State<AppDrawer> {
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
VitalSignService _vitalSignService = locator<VitalSignService>(); VitalSignService _vitalSignService = locator<VitalSignService>();
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>(); AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
PrivilegeService _privilegeService = locator<PrivilegeService>();
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
String booldType; String booldType;
String notificationCount; String notificationCount;
final authService = new AuthProvider(); final authService = new AuthProvider();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectProvider = Provider.of(context); projectProvider = Provider.of(context);
@ -152,6 +154,7 @@ class _AppDrawerState extends State<AppDrawer> {
Padding(child: Image.asset('assets/images/lang.png'), padding: EdgeInsets.all(3)), Padding(child: Image.asset('assets/images/lang.png'), padding: EdgeInsets.all(3)),
isImageIcon: true, isImageIcon: true,
bottomLine: false, bottomLine: false,
projectProvider: projectProvider,
), ),
onTap: () { onTap: () {
sharedPref.setBool(IS_ROBOT_INIT, null); sharedPref.setBool(IS_ROBOT_INIT, null);
@ -179,6 +182,7 @@ class _AppDrawerState extends State<AppDrawer> {
iconColor: Theme.of(context).textTheme.bodyText1.color, iconColor: Theme.of(context).textTheme.bodyText1.color,
sideArrow: true, sideArrow: true,
letterSpacing: -0.84, letterSpacing: -0.84,
projectProvider: projectProvider
), ),
onTap: () { onTap: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -310,8 +314,10 @@ class _AppDrawerState extends State<AppDrawer> {
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
fontHeight: projectProvider.isArabic ? 1 : 0.8, fontHeight: projectProvider.isArabic ? 1 : 0.8,
projectProvider: projectProvider
), ),
onTap: () { onTap: () {
sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL);
sharedPref.setBool(IS_ROBOT_INIT, null); sharedPref.setBool(IS_ROBOT_INIT, null);
if (projectProvider.isArabic) { if (projectProvider.isArabic) {
projectProvider.changeLanguage('en'); projectProvider.changeLanguage('en');
@ -330,6 +336,7 @@ class _AppDrawerState extends State<AppDrawer> {
bottomLine: false, bottomLine: false,
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
projectProvider: projectProvider,
count: notificationCount != null count: notificationCount != null
? new Container( ? new Container(
padding: EdgeInsets.all(4), padding: EdgeInsets.all(4),
@ -371,6 +378,7 @@ class _AppDrawerState extends State<AppDrawer> {
bottomLine: false, bottomLine: false,
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
projectProvider: projectProvider
), ),
onTap: () { onTap: () {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
@ -385,6 +393,7 @@ class _AppDrawerState extends State<AppDrawer> {
bottomLine: false, bottomLine: false,
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
projectProvider: projectProvider
), ),
onTap: () { onTap: () {
if (Platform.isIOS) { if (Platform.isIOS) {
@ -402,6 +411,7 @@ class _AppDrawerState extends State<AppDrawer> {
bottomLine: false, bottomLine: false,
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
projectProvider: projectProvider
), ),
onTap: () { onTap: () {
logout(); logout();
@ -417,6 +427,7 @@ class _AppDrawerState extends State<AppDrawer> {
letterSpacing: -0.84, letterSpacing: -0.84,
fontSize: 14, fontSize: 14,
bottomLine: false, bottomLine: false,
projectProvider: projectProvider
), ),
onTap: () { onTap: () {
login(); login();
@ -496,9 +507,12 @@ class _AppDrawerState extends State<AppDrawer> {
await authenticatedUserObject.getUser(); await authenticatedUserObject.getUser();
_vitalSignService.heightCm = ""; _vitalSignService.heightCm = "";
_vitalSignService.weightKg = ""; _vitalSignService.weightKg = "";
await _privilegeService.getPrivilege();
projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList);
var appLanguage = await sharedPref.getString(APP_LANGUAGE); var appLanguage = await sharedPref.getString(APP_LANGUAGE);
await sharedPref.clear(); await sharedPref.clear();
await sharedPref.setString(APP_LANGUAGE, appLanguage); await sharedPref.setString(APP_LANGUAGE, appLanguage);
await sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL);
this.user = null; this.user = null;
Navigator.of(context).pushNamed(HOME); Navigator.of(context).pushNamed(HOME);
// projectProvider.platformBridge().unRegisterHmgGeofences(); // projectProvider.platformBridge().unRegisterHmgGeofences();

@ -1,6 +1,7 @@
import 'dart:ui'; import 'dart:ui';
import 'package:diplomaticquarterapp/config/size_config.dart'; 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/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -19,9 +20,10 @@ class DrawerItem extends StatefulWidget {
final double fontHeight; final double fontHeight;
final double letterSpacing; final double letterSpacing;
final double fontSize; final double fontSize;
final ProjectViewModel projectProvider;
DrawerItem(this.title, this.icon, 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 @override
_DrawerItemState createState() => _DrawerItemState(); _DrawerItemState createState() => _DrawerItemState();
@ -76,7 +78,7 @@ class _DrawerItemState extends State<DrawerItem> {
) )
: SizedBox(), : 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()),
], ],
), ),
)); ));

@ -167,6 +167,8 @@ class MyInAppBrowser extends InAppBrowser {
AuthenticatedUser authenticatedUser, AuthenticatedUser authenticatedUser,
InAppBrowser browser, InAppBrowser browser,
bool isLiveCareAppo, bool isLiveCareAppo,
var servID,
var LiveServID,
[var appoDate, [var appoDate,
var appoNo, var appoNo,
var clinicID, var clinicID,
@ -185,6 +187,8 @@ class MyInAppBrowser extends InAppBrowser {
patientID, patientID,
authenticatedUser, authenticatedUser,
isLiveCareAppo, isLiveCareAppo,
servID,
LiveServID,
appoDate, appoDate,
appoNo, appoNo,
clinicID, clinicID,
@ -232,13 +236,13 @@ class MyInAppBrowser extends InAppBrowser {
dynamic patientID, dynamic patientID,
AuthenticatedUser authUser, AuthenticatedUser authUser,
bool isLiveCareAppo, bool isLiveCareAppo,
var servID,
var LiveServID,
[var appoDate, [var appoDate,
var appoNo, var appoNo,
var clinicID, var clinicID,
var doctorID, var doctorID,
var patientData, var patientData]) async {
var servID,
var LiveServID]) async {
getDeviceToken(); getDeviceToken();
String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN'; String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN';
String form = isLiveCareAppo ? getLiveCareForm() : getForm(); String form = isLiveCareAppo ? getLiveCareForm() : getForm();

@ -13,32 +13,21 @@ class CustomSwitch extends StatefulWidget {
final Color activeColor; final Color activeColor;
final Color inactiveColor; final Color inactiveColor;
CustomSwitch( CustomSwitch({Key key, this.value, this.onChanged, this.activeColor, this.inactiveColor}) : super(key: key);
{Key key,
this.value,
this.onChanged,
this.activeColor,
this.inactiveColor})
: super(key: key);
@override @override
_CustomSwitchState createState() => _CustomSwitchState(); _CustomSwitchState createState() => _CustomSwitchState();
} }
class _CustomSwitchState extends State<CustomSwitch> class _CustomSwitchState extends State<CustomSwitch> with SingleTickerProviderStateMixin {
with SingleTickerProviderStateMixin {
Animation _circleAnimation; Animation _circleAnimation;
AnimationController _animationController; AnimationController _animationController;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_animationController = _animationController = AnimationController(vsync: this, duration: Duration(milliseconds: 500));
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));
_circleAnimation = Tween(begin: 0.0, end: 30.0).animate(CurvedAnimation(
parent: _animationController,
curve: Curves.easeOutQuint,
reverseCurve: Curves.easeInQuint));
if (widget.value) _animationController.forward(); if (widget.value) _animationController.forward();
} }
@ -47,6 +36,7 @@ class _CustomSwitchState extends State<CustomSwitch>
return AnimatedBuilder( return AnimatedBuilder(
animation: _animationController, animation: _animationController,
builder: (context, child) { builder: (context, child) {
bool _switchStatus = _circleAnimation.status == AnimationStatus.dismissed || _circleAnimation.status == AnimationStatus.reverse;
return GestureDetector( return GestureDetector(
onTap: Feedback.wrapForTap(() async { onTap: Feedback.wrapForTap(() async {
if (widget.value) { if (widget.value) {
@ -58,29 +48,18 @@ class _CustomSwitchState extends State<CustomSwitch>
}, context), }, context),
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 200), duration: Duration(milliseconds: 200),
width: 60.0, width: 50.0,
height: 30.0, height: 25.0,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.0), color: _switchStatus ? widget.inactiveColor : widget.activeColor),
borderRadius: BorderRadius.circular(20.0),
color: _circleAnimation.status == AnimationStatus.dismissed ||
_circleAnimation.status == AnimationStatus.reverse
? widget.inactiveColor
: widget.activeColor),
child: Padding( child: Padding(
padding: padding: EdgeInsets.only(top: 4.0, bottom: 4.0, right: 6.0, left: 6.0),
EdgeInsets.only(top: 6.0, bottom: 6.0, right: 6.0, left: 6.0),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Container(width: _circleAnimation.value), Container(width: _circleAnimation.value),
Container( Container(
width: 16.0, width: 16.0,
height: 16.0, height: 16.0,
decoration: BoxDecoration(boxShadow: [ 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),
BoxShadow(
color: Colors.grey[800].withOpacity(0.15),
offset: Offset(0, 4.0),
blurRadius: 5.0)
], shape: BoxShape.circle, color: Colors.white),
) )
], ],
), ),

@ -83,7 +83,6 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
_labelText, _labelText,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: Color(0xff2B353E), color: Color(0xff2B353E),
letterSpacing: -0.44, letterSpacing: -0.44,
@ -96,7 +95,6 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
onChanged: (value) => widget.onNumberChange(value), onChanged: (value) => widget.onNumberChange(value),
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
height: 21 / 14, height: 21 / 14,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Color(0xff2B353E), color: Color(0xff2B353E),
@ -107,7 +105,6 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
hintText: _hintText, hintText: _hintText,
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 14, fontSize: 14,
height: 21 / 14, height: 21 / 14,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: Color(0xff575757), color: Color(0xff575757),
@ -120,7 +117,6 @@ class _PhoneNumberSelectorWidgetState extends State<PhoneNumberSelectorWidget> {
prefix, prefix,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
height: 21 / 14, height: 21 / 14,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Color(0xff2E303A), color: Color(0xff2E303A),
@ -189,12 +185,12 @@ class _MobileNo extends State<MobileNo> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectProvider = Provider.of(context); projectProvider = Provider.of(context);
return Visibility( return Visibility(
child: Column(children: <Widget>[ child: Column(children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.only(bottom: 10.0), margin: EdgeInsets.only(bottom: 10.0),
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
@ -207,70 +203,75 @@ class _MobileNo extends State<MobileNo> {
), ),
width: MediaQuery.of(context).size.width * 0.89, width: MediaQuery.of(context).size.width * 0.89,
child: Padding( child: Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: DropdownButtonHideUnderline( child: DropdownButtonHideUnderline(
child: DropdownButton( child: DropdownButton(
isExpanded: true, isExpanded: true,
value: _selectedType, value: _selectedType,
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
onChanged: (value) => { onChanged: (value) => {
widget.onCountryChange(value), widget.onCountryChange(value),
setState(() { setState(() {
countryCode = value; countryCode = value;
_selectedType = value; _selectedType = value;
}) })
}, },
items: counties.map<DropdownMenuItem<String>>((Countries value) { items: counties.map<DropdownMenuItem<String>>((Countries value) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: value.code, value: value.code,
child: Text(projectProvider.isArabic == true ? value.nameAr : value.name), child: Text(projectProvider.isArabic == true ? value.nameAr : value.name),
); );
}).toList())))), }).toList()),
), ),
], ),
), ),
Container( ),
padding: EdgeInsets.all(5), ],
decoration: BoxDecoration(color: Colors.white, border: Border.all(color: Colors.grey), borderRadius: BorderRadius.circular(10)), ),
child: Row(children: <Widget>[ Container(
Expanded( padding: EdgeInsets.all(5),
decoration: BoxDecoration(color: Colors.white, border: Border.all(color: Colors.grey), borderRadius: BorderRadius.circular(10)),
child: Row(children: <Widget>[
Expanded(
flex: 1, flex: 1,
child: Icon( child: Icon(
Icons.phone, Icons.phone,
color: secondaryColor, color: secondaryColor,
)), ),
Expanded( ),
Expanded(
flex: 1, flex: 1,
child: Text( child: Text(
countryCode, countryCode,
overflow: TextOverflow.clip, 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: <TextInputFormatter>
[
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: <TextInputFormatter>[
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'),
),
),
)
]),
)
]),
);
} }
} }

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; 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/models/header_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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:flutter/material.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
class DoctorHeader extends StatelessWidget { class DoctorHeader extends StatelessWidget {
@ -30,10 +32,12 @@ class DoctorHeader extends StatelessWidget {
this.onRatingAndReviewTap}) this.onRatingAndReviewTap})
: super(key: key); : super(key: key);
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
String _speciality = (headerModel?.speciality ?? []).length > 0 ? headerModel.speciality.first : ""; String _speciality = (headerModel?.speciality ?? []).length > 0 ? headerModel.speciality.first : "";
projectViewModel = Provider.of(context);
return Container( return Container(
color: Colors.white, color: Colors.white,
child: Column( child: Column(
@ -62,8 +66,8 @@ class DoctorHeader extends StatelessWidget {
_speciality, _speciality,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 18 / 12), 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(), headerModel.invoiceNo.isNotEmpty ? myRichText(TranslationBase.of(context).invoiceNo + ":", headerModel.invoiceNo, projectViewModel.isArabic) : Container(),
myRichText(TranslationBase.of(context).branch, headerModel.projectName), myRichText(TranslationBase.of(context).branch, headerModel.projectName, projectViewModel.isArabic),
], ],
), ),
), ),
@ -73,7 +77,7 @@ class DoctorHeader extends StatelessWidget {
children: [ children: [
if (headerModel.date != null) if (headerModel.date != null)
Text( 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), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
), ),
if (headerModel.time != null) if (headerModel.time != null)
@ -84,7 +88,7 @@ class DoctorHeader extends StatelessWidget {
if (headerModel?.nationalityFlagURL != null) if (headerModel?.nationalityFlagURL != null)
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), 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( child: Container(
padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15), 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( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
@ -147,7 +151,7 @@ class DoctorHeader extends StatelessWidget {
SizedBox(width: 6), SizedBox(width: 6),
Text( Text(
buttonTitle == null ? TranslationBase.of(context).sendEmail : buttonTitle, 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),
), ),
], ],
), ),

@ -279,6 +279,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget {
} }
String _badgeText = "0"; String _badgeText = "0";
class AppBarWidgetState extends State<AppBarWidget> { class AppBarWidgetState extends State<AppBarWidget> {
String badgeText = "0"; String badgeText = "0";
@override @override
@ -397,42 +398,42 @@ class _RobotIcon extends State<RobotIcon> {
return Positioned( return Positioned(
child: Column( child: Column(
children: [ children: [
isAnimation // isAnimation
? Container( // ? Container(
height: 150, // height: 150,
width: 200, // width: 200,
padding: EdgeInsets.all(5), // padding: EdgeInsets.all(5),
margin: EdgeInsets.only(right: 35.0, bottom: 0), // margin: EdgeInsets.only(right: 35.0, bottom: 0),
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), // borderRadius: BorderRadius.circular(10),
color: Colors.white, // color: Colors.white,
boxShadow: [ // boxShadow: [
BoxShadow(color: Colors.black, spreadRadius: 1), // BoxShadow(color: Colors.black, spreadRadius: 1),
], // ],
), // ),
child: TyperAnimatedTextKit( // child: TyperAnimatedTextKit(
text: Provider.of<ProjectViewModel>(context, listen: false).isArabic == true // text: Provider.of<ProjectViewModel>(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.", // : "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<ProjectViewModel>(context, listen: false).isArabic == true // textLength: Provider.of<ProjectViewModel>(context, listen: false).isArabic == true
? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي.".length // ? "هذه الخدمة تم تصميمها لتتمكن من ربط الملفات الطبية للعائلة بملفك الطبي حتى تتمكن من إدارة سجلاتهم عن طريق تسجيل الدخول إلى ملفك الطبي.".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." // : "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)) // .length))
: Container(), // : Container(),
Stack( Stack(
children: [ children: [
isAnimation // isAnimation
? Positioned( // ? Positioned(
top: 0, // top: 0,
right: 40, // right: 40,
child: Container( // child: Container(
height: 0, // height: 0,
width: 0, // width: 0,
decoration: ShapeDecoration( // decoration: ShapeDecoration(
color: Colors.grey, // color: Colors.grey,
shape: MessageBorder(reverse: true), // shape: MessageBorder(reverse: true),
))) // )))
: Container(), // : Container(),
FloatingSearchButton() FloatingSearchButton()
], ],
) )

@ -78,7 +78,7 @@ class FloatingSearchButton extends StatefulWidget {
class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProviderStateMixin { class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProviderStateMixin {
Offset position = Offset(250, 400); Offset position = Offset(250, 400);
bool activeAnimation = false; bool activeAnimation = false;
bool isShow = true; bool isShow = false;
SearchProvider searchProvider = new SearchProvider(); SearchProvider searchProvider = new SearchProvider();
RobotProvider eventProvider = RobotProvider(); RobotProvider eventProvider = RobotProvider();
bool isLoading = false; bool isLoading = false;
@ -115,18 +115,16 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
offset = Tween<Offset>(begin: Offset(0.0, 1.0), end: Offset(0.0, 0.0)).animate(controller); offset = Tween<Offset>(begin: Offset(0.0, 1.0), end: Offset(0.0, 0.0)).animate(controller);
if (IS_VOICE_COMMAND_CLOSED == true) { if (IS_VOICE_COMMAND_CLOSED == true) {
controller.reverse(from: -1); controller.reverse(from: -1);
} } else {
if (mounted) { if (mounted) {
//Future.delayed(const Duration(seconds: 2), () { //Future.delayed(const Duration(seconds: 2), () {
isArabic = Provider.of<ProjectViewModel>(context, listen: false).isArabic;
requestPermissions(); setState(() {
getUserData(); if (IS_TEXT_COMPLETED) {
initialSpeak(); isAnimationEnable = false;
setState(() { }
if (IS_TEXT_COMPLETED) { });
isAnimationEnable = false; }
}
});
} }
event.controller.stream.listen((p) { event.controller.stream.listen((p) {
@ -190,7 +188,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
placeholder: (context, url) => Image.asset('assets/images/gif/robot-idle.gif'), placeholder: (context, url) => Image.asset('assets/images/gif/robot-idle.gif'),
errorWidget: (context, url, error) => Icon(Icons.error), 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: () { onTap: () {
new RoboSearch(context: context).showAlertDialog(context); new RoboSearch(context: context).showAlertDialog(context);
@ -273,7 +271,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
// }); // });
} }
void requestPermissions() async { requestPermissions() async {
if (await Permission.microphone.isDenied || await Permission.microphone.isUndetermined) { if (await Permission.microphone.isDenied || await Permission.microphone.isUndetermined) {
Map<Permission, PermissionStatus> statuses = await [ Map<Permission, PermissionStatus> statuses = await [
Permission.microphone, Permission.microphone,
@ -282,7 +280,6 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
} }
Future<void> initSpeechState() async { Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
//if (hasSpeech) { //if (hasSpeech) {
// _currentLocaleId = // _currentLocaleId =
// _currentLocaleId == 'en' // _currentLocaleId == 'en'
@ -290,6 +287,13 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
// : 'ar-SA'; // systemLocale.localeId; // : 'ar-SA'; // systemLocale.localeId;
// } // }
isArabic = Provider.of<ProjectViewModel>(context, listen: false).isArabic;
await requestPermissions();
getUserData();
await speech.initialize(onError: errorListener, onStatus: statusListener);
//initialSpeak();
if (!mounted) return; if (!mounted) return;
// setState(() { // setState(() {

@ -1,9 +1,13 @@
import 'package:carousel_slider/carousel_slider.dart'; import 'package:carousel_slider/carousel_slider.dart';
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/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/routes.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -30,6 +34,7 @@ class NotAutPage extends StatefulWidget {
} }
class _NotAutPageState extends State<NotAutPage> { class _NotAutPageState extends State<NotAutPage> {
final authService = new auth.AuthProvider();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -64,7 +69,7 @@ class _NotAutPageState extends State<NotAutPage> {
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24), style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 23 / 24),
), ),
Text( Text(
widget.description??"", widget.description ?? "",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56, height: 21 / 14),
), ),
SizedBox( SizedBox(
@ -329,9 +334,23 @@ class _NotAutPageState extends State<NotAutPage> {
if (data != null) { if (data != null) {
Navigator.of(context).pushNamed(CONFIRM_LOGIN); Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else { } else {
Navigator.of(context).pushNamed( GifLoaderDialogUtils.showMyDialog(context);
WELCOME_LOGIN, 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,
);
});
} }
} }
} }

Loading…
Cancel
Save