Merge branch 'development_new_design_2.0' into mirza_home_page

merge-requests/490/head
devmirza121 4 years ago
commit e13d64dbf7

@ -19,12 +19,15 @@ const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// // Pharmacy Production URLs // // Pharmacy Production URLs
// const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
// RC API URL
const RC_BASE_URL = 'https://livecare.hmg.com/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
@ -82,8 +85,11 @@ const SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmai
///Feedback ///Feedback
const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList';
const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC'; const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC';
// const GET_PATIENT_AppointmentHistory = 'Services'
// '/Doctors.svc/REST/PateintHasAppoimentHistory';
const GET_PATIENT_AppointmentHistory = 'Services' const GET_PATIENT_AppointmentHistory = 'Services'
'/Doctors.svc/REST/PateintHasAppoimentHistory'; '/Doctors.svc/REST/PateintHasAppoimentHistory_Async';
///VITAL SIGN ///VITAL SIGN
const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
@ -163,7 +169,8 @@ const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertReque
const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail'; const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail';
///Rate ///Rate
const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; // const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated';
const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated_Async';
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_APPOINTMENT_URL = "Services/Doctors.svc/REST/AppointmentsRating_InsertAppointmentRate";
const NEW_RATE_DOCTOR_URL = "Services/Doctors.svc/REST/DoctorsRating_InsertDoctorRate"; const NEW_RATE_DOCTOR_URL = "Services/Doctors.svc/REST/DoctorsRating_InsertDoctorRate";
@ -204,7 +211,8 @@ const SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescr
const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail"; const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail";
//URL to get patient appointment curfew history //URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew"; // const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew";
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew_Async";
//URL to confirm appointment //URL to confirm appointment
const CONFIRM_APPOINTMENT = "Services/MobileNotifications.svc/REST/ConfirmAppointment"; const CONFIRM_APPOINTMENT = "Services/MobileNotifications.svc/REST/ConfirmAppointment";
@ -462,6 +470,7 @@ const UPDATE_RRT_ORDER_RC = 'rc/api/rrt/update';
// PRESCRIPTION RC SERVICES // PRESCRIPTION RC SERVICES
const ADD_PRESCRIPTION_ORDER_RC = "rc/api/prescription/add"; const ADD_PRESCRIPTION_ORDER_RC = "rc/api/prescription/add";
const GET_ALL_PRESCRIPTION_ORDERS_RC = "rc/api/prescription/list"; const GET_ALL_PRESCRIPTION_ORDERS_RC = "rc/api/prescription/list";
const GET_ALL_PRESCRIPTION_INFO_RC = "rc/api/Prescription/info";
const UPDATE_PRESCRIPTION_ORDER_RC = 'rc/api/prescription/update'; const UPDATE_PRESCRIPTION_ORDER_RC = 'rc/api/prescription/update';

@ -494,7 +494,7 @@ const Map localizedValues = {
"lakumPoint": {"en": "Point", "ar": "نقطه"}, "lakumPoint": {"en": "Point", "ar": "نقطه"},
"wishlist": {"en": "Wishlist", "ar": "المفضلة"}, "wishlist": {"en": "Wishlist", "ar": "المفضلة"},
"products": {"en": "Products", "ar": "المنتجات"}, "products": {"en": "Products", "ar": "المنتجات"},
"reviews": {"en": "Reviews", "ar": "التقيمات"}, "reviews": {"en": "Reviews", "ar": "التقييمات"},
"brands": {"en": "Brands", "ar": "العلامات التجارية"}, "brands": {"en": "Brands", "ar": "العلامات التجارية"},
"productDetails": {"en": "Product Details", "ar": "تفاصيل المنتج"}, "productDetails": {"en": "Product Details", "ar": "تفاصيل المنتج"},
"medicationRefill": {"en": "Medication Refill", "ar": "تعبئة الأدوية"}, "medicationRefill": {"en": "Medication Refill", "ar": "تعبئة الأدوية"},
@ -625,7 +625,7 @@ const Map localizedValues = {
"select-gender": {"en": "Select Gender", "ar": "اختر الجنس"}, "select-gender": {"en": "Select Gender", "ar": "اختر الجنس"},
"i-am-a": {"en": "I am a ...", "ar": "أنا ..."}, "i-am-a": {"en": "I am a ...", "ar": "أنا ..."},
"select-age": {"en": "Select Your Age", "ar": "حدد العمر"}, "select-age": {"en": "Select Your Age", "ar": "حدد العمر"},
"select": {"en": "Select", "ar": "يختار"}, "select": {"en": "Select", "ar": "اختر"},
"i-am": {"en": "I am", "ar": "أنا"}, "i-am": {"en": "I am", "ar": "أنا"},
"years-old": {"en": "years old", "ar": "سنة"}, "years-old": {"en": "years old", "ar": "سنة"},
"drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"}, "drag-point": {"en": "Drag point to change your age", "ar": "اسحب لتغيير عمرك"},
@ -1626,4 +1626,8 @@ const Map localizedValues = {
"cholesTitle": {"en": "Blood Cholesterol", "ar": " الكولسترول في الدم"}, "cholesTitle": {"en": "Blood Cholesterol", "ar": " الكولسترول في الدم"},
"laserClinic": {"en": "Laser Clinic", "ar": "عيادة الليزر"}, "laserClinic": {"en": "Laser Clinic", "ar": "عيادة الليزر"},
"noImage": {"en": "No Image", "ar": "لا توجد صورة"}, "noImage": {"en": "No Image", "ar": "لا توجد صورة"},
"signoutMessage": {"en": "Are you sure you want to logout?", "ar": "هل أنت متأكد أنك تريد تسجيل الخروج؟"},
"RRTTitle": {"en": "RRT", "ar": "خدمة فريق"},
"RRTSubTitle": {"en": "Service", "ar": "الاستجابة السريع"},
"transportation": {"en": "Transportation", "ar": "النقل"},
}; };

@ -1,26 +1,27 @@
class AmbulanceRequestOrdersModel { class AmbulanceRequestOrdersModel {
String statusText; String statusText;
int paymentStatus; num paymentStatus;
dynamic clientRequestid; dynamic clientRequestid;
dynamic paymentStatusText; dynamic paymentStatusText;
dynamic projectName; dynamic projectName;
String nearestProjectName; String nearestProjectName;
double paymentAmount; num paymentAmount;
WFOrder wFOrder; WFOrder wFOrder;
String serviceText; String serviceText;
bool isSentForApproval; bool isSentForApproval;
int exaCartOrderId; num exaCartOrderId;
String exaCartGUID;
bool isTimer; bool isTimer;
int timeSeconds; num timeSeconds;
int totalPendingSeconds; num totalPendingSeconds;
int timeMinute; num timeMinute;
int timeHour; num timeHour;
int timeTotalSeconds; num timeTotalSeconds;
int timeTotalMinute; num timeTotalMinute;
int timeTotalHour; num timeTotalHour;
dynamic approvalStatus; dynamic approvalStatus;
bool isActive; bool isActive;
int clickButton; num clickButton;
dynamic orderHistory; dynamic orderHistory;
String pickupLocation; String pickupLocation;
String dropOffLocation; String dropOffLocation;
@ -28,22 +29,21 @@ class AmbulanceRequestOrdersModel {
String doctorName; String doctorName;
String branch; String branch;
String time; String time;
dynamic notes; String notes;
int id; num iD;
String patientId; num patientId;
int patientOutSa; num patientOutSa;
bool isOutPatient; bool isOutPatient;
int projectId; num projectId;
int nearestProjectId; num nearestProjectId;
dynamic longitude; dynamic longitude;
dynamic latitude; dynamic latitude;
dynamic appointmentNo; dynamic appointmentNo;
dynamic dischargeId; dynamic dischargeId;
int statusId; num statusId;
int serviceId; num serviceId;
int channel; num channel;
Orderpayment orderpayment; Orderpayment orderpayment;
dynamic orderselectedservice;
dynamic wforder; dynamic wforder;
dynamic orderapprovalobj; dynamic orderapprovalobj;
String created; String created;
@ -54,266 +54,293 @@ class AmbulanceRequestOrdersModel {
AmbulanceRequestOrdersModel( AmbulanceRequestOrdersModel(
{this.statusText, {this.statusText,
this.paymentStatus, this.paymentStatus,
this.clientRequestid, this.clientRequestid,
this.paymentStatusText, this.paymentStatusText,
this.projectName, this.projectName,
this.nearestProjectName, this.nearestProjectName,
this.paymentAmount, this.paymentAmount,
this.wFOrder, this.wFOrder,
this.serviceText, this.serviceText,
this.isSentForApproval, this.isSentForApproval,
this.exaCartOrderId, this.exaCartOrderId,
this.isTimer, this.exaCartGUID,
this.timeSeconds, this.isTimer,
this.totalPendingSeconds, this.timeSeconds,
this.timeMinute, this.totalPendingSeconds,
this.timeHour, this.timeMinute,
this.timeTotalSeconds, this.timeHour,
this.timeTotalMinute, this.timeTotalSeconds,
this.timeTotalHour, this.timeTotalMinute,
this.approvalStatus, this.timeTotalHour,
this.isActive, this.approvalStatus,
this.clickButton, this.isActive,
this.orderHistory, this.clickButton,
this.pickupLocation, this.orderHistory,
this.dropOffLocation, this.pickupLocation,
this.clinicName, this.dropOffLocation,
this.doctorName, this.clinicName,
this.branch, this.doctorName,
this.time, this.branch,
this.notes, this.time,
this.id, this.notes,
this.patientId, this.iD,
this.patientOutSa, this.patientId,
this.isOutPatient, this.patientOutSa,
this.projectId, this.isOutPatient,
this.nearestProjectId, this.projectId,
this.longitude, this.nearestProjectId,
this.latitude, this.longitude,
this.appointmentNo, this.latitude,
this.dischargeId, this.appointmentNo,
this.statusId, this.dischargeId,
this.serviceId, this.statusId,
this.channel, this.serviceId,
this.orderpayment, this.channel,
this.orderselectedservice, this.orderpayment,
this.wforder, this.wforder,
this.orderapprovalobj, this.orderapprovalobj,
this.created, this.created,
this.createdBy, this.createdBy,
this.modified, this.modified,
this.modifiedBy, this.modifiedBy,
this.isDeleted}); this.isDeleted});
AmbulanceRequestOrdersModel.fromJson(Map<String, dynamic> json) { AmbulanceRequestOrdersModel.fromJson(Map<String, dynamic> json) {
statusText = json['statusText']; statusText = json['StatusText'];
paymentStatus = json['paymentStatus']; paymentStatus = json['PaymentStatus'];
clientRequestid = json['clientRequestid']; clientRequestid = json['ClientRequestid'];
paymentStatusText = json['paymentStatusText']; paymentStatusText = json['PaymentStatusText'];
projectName = json['projectName']; projectName = json['ProjectName'];
nearestProjectName = json['nearestProjectName']; nearestProjectName = json['NearestProjectName'];
paymentAmount = json['paymentAmount']; paymentAmount = json['PaymentAmount'];
wFOrder = json['wF_order'] != null ? new WFOrder.fromJson(json['wF_order']) : null; wFOrder = json['WF_order'] != null
serviceText = json['serviceText']; ? new WFOrder.fromJson(json['WF_order'])
: null;
serviceText = json['ServiceText'];
isSentForApproval = json['isSentForApproval']; isSentForApproval = json['isSentForApproval'];
exaCartOrderId = json['exaCart_OrderId']; exaCartOrderId = json['ExaCart_OrderId'];
exaCartGUID = json['ExaCart_GUID'];
isTimer = json['isTimer']; isTimer = json['isTimer'];
timeSeconds = json['timeSeconds']; timeSeconds = json['TimeSeconds'];
totalPendingSeconds = json['totalPendingSeconds']; totalPendingSeconds = json['TotalPendingSeconds'];
timeMinute = json['timeMinute']; timeMinute = json['TimeMinute'];
timeHour = json['timeHour']; timeHour = json['TimeHour'];
timeTotalSeconds = json['timeTotalSeconds']; timeTotalSeconds = json['TimeTotalSeconds'];
timeTotalMinute = json['timeTotalMinute']; timeTotalMinute = json['TimeTotalMinute'];
timeTotalHour = json['timeTotalHour']; timeTotalHour = json['TimeTotalHour'];
approvalStatus = json['approvalStatus']; approvalStatus = json['ApprovalStatus'];
isActive = json['isActive']; isActive = json['isActive'];
clickButton = json['clickButton']; clickButton = json['ClickButton'];
orderHistory = json['orderHistory']; orderHistory = json['OrderHistory'];
pickupLocation = json['pickupLocation']; pickupLocation = json['PickupLocation'];
dropOffLocation = json['dropOffLocation']; dropOffLocation = json['DropOffLocation'];
clinicName = json['clinicName']; clinicName = json['clinicName'];
doctorName = json['doctorName']; doctorName = json['DoctorName'];
branch = json['branch']; branch = json['Branch'];
time = json['time']; time = json['Time'];
notes = json['notes']; notes = json['Notes'];
id = json['id']; iD = json['ID'];
patientId = json['patientId']; patientId = json['PatientId'];
patientOutSa = json['patientOutSa']; patientOutSa = json['PatientOutSa'];
isOutPatient = json['isOutPatient']; isOutPatient = json['IsOutPatient'];
projectId = json['projectId']; projectId = json['ProjectId'];
nearestProjectId = json['nearestProjectId']; nearestProjectId = json['NearestProjectId'];
longitude = json['longitude']; longitude = json['Longitude'];
latitude = json['latitude']; latitude = json['Latitude'];
appointmentNo = json['appointmentNo']; appointmentNo = json['AppointmentNo'];
dischargeId = json['dischargeId']; dischargeId = json['DischargeId'];
statusId = json['statusId']; statusId = json['StatusId'];
serviceId = json['serviceId']; serviceId = json['ServiceId'];
channel = json['channel']; channel = json['Channel'];
orderpayment = json['orderpayment'] != null ? new Orderpayment.fromJson(json['orderpayment']) : null; orderpayment = json['orderpayment'] != null
orderselectedservice = json['orderselectedservice']; ? new Orderpayment.fromJson(json['orderpayment'])
: null;
wforder = json['wforder']; wforder = json['wforder'];
orderapprovalobj = json['orderapprovalobj']; orderapprovalobj = json['orderapprovalobj'];
created = json['created']; created = json['Created'];
createdBy = json['createdBy']; createdBy = json['CreatedBy'];
modified = json['modified']; modified = json['Modified'];
modifiedBy = json['modifiedBy']; modifiedBy = json['ModifiedBy'];
isDeleted = json['isDeleted']; isDeleted = json['IsDeleted'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['statusText'] = this.statusText; data['StatusText'] = this.statusText;
data['paymentStatus'] = this.paymentStatus; data['PaymentStatus'] = this.paymentStatus;
data['clientRequestid'] = this.clientRequestid; data['ClientRequestid'] = this.clientRequestid;
data['paymentStatusText'] = this.paymentStatusText; data['PaymentStatusText'] = this.paymentStatusText;
data['projectName'] = this.projectName; data['ProjectName'] = this.projectName;
data['nearestProjectName'] = this.nearestProjectName; data['NearestProjectName'] = this.nearestProjectName;
data['paymentAmount'] = this.paymentAmount; data['PaymentAmount'] = this.paymentAmount;
if (this.wFOrder != null) { if (this.wFOrder != null) {
data['wF_order'] = this.wFOrder.toJson(); data['WF_order'] = this.wFOrder.toJson();
} }
data['serviceText'] = this.serviceText; data['ServiceText'] = this.serviceText;
data['isSentForApproval'] = this.isSentForApproval; data['isSentForApproval'] = this.isSentForApproval;
data['exaCart_OrderId'] = this.exaCartOrderId; data['ExaCart_OrderId'] = this.exaCartOrderId;
data['ExaCart_GUID'] = this.exaCartGUID;
data['isTimer'] = this.isTimer; data['isTimer'] = this.isTimer;
data['timeSeconds'] = this.timeSeconds; data['TimeSeconds'] = this.timeSeconds;
data['totalPendingSeconds'] = this.totalPendingSeconds; data['TotalPendingSeconds'] = this.totalPendingSeconds;
data['timeMinute'] = this.timeMinute; data['TimeMinute'] = this.timeMinute;
data['timeHour'] = this.timeHour; data['TimeHour'] = this.timeHour;
data['timeTotalSeconds'] = this.timeTotalSeconds; data['TimeTotalSeconds'] = this.timeTotalSeconds;
data['timeTotalMinute'] = this.timeTotalMinute; data['TimeTotalMinute'] = this.timeTotalMinute;
data['timeTotalHour'] = this.timeTotalHour; data['TimeTotalHour'] = this.timeTotalHour;
data['approvalStatus'] = this.approvalStatus; data['ApprovalStatus'] = this.approvalStatus;
data['isActive'] = this.isActive; data['isActive'] = this.isActive;
data['clickButton'] = this.clickButton; data['ClickButton'] = this.clickButton;
data['orderHistory'] = this.orderHistory; data['OrderHistory'] = this.orderHistory;
data['pickupLocation'] = this.pickupLocation; data['PickupLocation'] = this.pickupLocation;
data['dropOffLocation'] = this.dropOffLocation; data['DropOffLocation'] = this.dropOffLocation;
data['clinicName'] = this.clinicName; data['clinicName'] = this.clinicName;
data['doctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
data['branch'] = this.branch; data['Branch'] = this.branch;
data['time'] = this.time; data['Time'] = this.time;
data['notes'] = this.notes; data['Notes'] = this.notes;
data['id'] = this.id; data['ID'] = this.iD;
data['patientId'] = this.patientId; data['PatientId'] = this.patientId;
data['patientOutSa'] = this.patientOutSa; data['PatientOutSa'] = this.patientOutSa;
data['isOutPatient'] = this.isOutPatient; data['IsOutPatient'] = this.isOutPatient;
data['projectId'] = this.projectId; data['ProjectId'] = this.projectId;
data['nearestProjectId'] = this.nearestProjectId; data['NearestProjectId'] = this.nearestProjectId;
data['longitude'] = this.longitude; data['Longitude'] = this.longitude;
data['latitude'] = this.latitude; data['Latitude'] = this.latitude;
data['appointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
data['dischargeId'] = this.dischargeId; data['DischargeId'] = this.dischargeId;
data['statusId'] = this.statusId; data['StatusId'] = this.statusId;
data['serviceId'] = this.serviceId; data['ServiceId'] = this.serviceId;
data['channel'] = this.channel; data['Channel'] = this.channel;
if (this.orderpayment != null) { if (this.orderpayment != null) {
data['orderpayment'] = this.orderpayment.toJson(); data['orderpayment'] = this.orderpayment.toJson();
} }
data['orderselectedservice'] = this.orderselectedservice;
data['wforder'] = this.wforder; data['wforder'] = this.wforder;
data['orderapprovalobj'] = this.orderapprovalobj; data['orderapprovalobj'] = this.orderapprovalobj;
data['created'] = this.created; data['Created'] = this.created;
data['createdBy'] = this.createdBy; data['CreatedBy'] = this.createdBy;
data['modified'] = this.modified; data['Modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy; data['ModifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted; data['IsDeleted'] = this.isDeleted;
return data; return data;
} }
} }
class WFOrder { class WFOrder {
dynamic wfButtonsDTO; Null wfButtonsDTO;
int id; num iD;
int orderId; num orderId;
int previousStep; num previousStep;
int nextStep; num nextStep;
int serviceId; num serviceId;
dynamic order; Null order;
String created; String created;
dynamic createdBy; Null createdBy;
dynamic modified; Null modified;
dynamic modifiedBy; Null modifiedBy;
bool isDeleted; bool isDeleted;
WFOrder({this.wfButtonsDTO, this.id, this.orderId, this.previousStep, this.nextStep, this.serviceId, this.order, this.created, this.createdBy, this.modified, this.modifiedBy, this.isDeleted}); WFOrder(
{this.wfButtonsDTO,
this.iD,
this.orderId,
this.previousStep,
this.nextStep,
this.serviceId,
this.order,
this.created,
this.createdBy,
this.modified,
this.modifiedBy,
this.isDeleted});
WFOrder.fromJson(Map<String, dynamic> json) { WFOrder.fromJson(Map<String, dynamic> json) {
wfButtonsDTO = json['wf_ButtonsDTO']; wfButtonsDTO = json['wf_ButtonsDTO'];
id = json['id']; iD = json['ID'];
orderId = json['orderId']; orderId = json['OrderId'];
previousStep = json['previousStep']; previousStep = json['PreviousStep'];
nextStep = json['nextStep']; nextStep = json['NextStep'];
serviceId = json['serviceId']; serviceId = json['ServiceId'];
order = json['order']; order = json['Order'];
created = json['created']; created = json['Created'];
createdBy = json['createdBy']; createdBy = json['CreatedBy'];
modified = json['modified']; modified = json['Modified'];
modifiedBy = json['modifiedBy']; modifiedBy = json['ModifiedBy'];
isDeleted = json['isDeleted']; isDeleted = json['IsDeleted'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['wf_ButtonsDTO'] = this.wfButtonsDTO; data['wf_ButtonsDTO'] = this.wfButtonsDTO;
data['id'] = this.id; data['ID'] = this.iD;
data['orderId'] = this.orderId; data['OrderId'] = this.orderId;
data['previousStep'] = this.previousStep; data['PreviousStep'] = this.previousStep;
data['nextStep'] = this.nextStep; data['NextStep'] = this.nextStep;
data['serviceId'] = this.serviceId; data['ServiceId'] = this.serviceId;
data['order'] = this.order; data['Order'] = this.order;
data['created'] = this.created; data['Created'] = this.created;
data['createdBy'] = this.createdBy; data['CreatedBy'] = this.createdBy;
data['modified'] = this.modified; data['Modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy; data['ModifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted; data['IsDeleted'] = this.isDeleted;
return data; return data;
} }
} }
class Orderpayment { class Orderpayment {
int id; num iD;
int orderId; num orderId;
dynamic clientRequestId; Null clientRequestId;
double totalAmount; num totalAmount;
int paymentStatus; num paymentStatus;
dynamic order; Null order;
String created; String created;
dynamic createdBy; Null createdBy;
dynamic modified; Null modified;
dynamic modifiedBy; Null modifiedBy;
bool isDeleted; bool isDeleted;
Orderpayment({this.id, this.orderId, this.clientRequestId, this.totalAmount, this.paymentStatus, this.order, this.created, this.createdBy, this.modified, this.modifiedBy, this.isDeleted}); Orderpayment(
{this.iD,
this.orderId,
this.clientRequestId,
this.totalAmount,
this.paymentStatus,
this.order,
this.created,
this.createdBy,
this.modified,
this.modifiedBy,
this.isDeleted});
Orderpayment.fromJson(Map<String, dynamic> json) { Orderpayment.fromJson(Map<String, dynamic> json) {
id = json['id']; iD = json['ID'];
orderId = json['orderId']; orderId = json['OrderId'];
clientRequestId = json['clientRequestId']; clientRequestId = json['ClientRequestId'];
totalAmount = json['totalAmount']; totalAmount = json['TotalAmount'];
paymentStatus = json['paymentStatus']; paymentStatus = json['PaymentStatus'];
order = json['order']; order = json['Order'];
created = json['created']; created = json['Created'];
createdBy = json['createdBy']; createdBy = json['CreatedBy'];
modified = json['modified']; modified = json['Modified'];
modifiedBy = json['modifiedBy']; modifiedBy = json['ModifiedBy'];
isDeleted = json['isDeleted']; isDeleted = json['IsDeleted'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id; data['ID'] = this.iD;
data['orderId'] = this.orderId; data['OrderId'] = this.orderId;
data['clientRequestId'] = this.clientRequestId; data['ClientRequestId'] = this.clientRequestId;
data['totalAmount'] = this.totalAmount; data['TotalAmount'] = this.totalAmount;
data['paymentStatus'] = this.paymentStatus; data['PaymentStatus'] = this.paymentStatus;
data['order'] = this.order; data['Order'] = this.order;
data['created'] = this.created; data['Created'] = this.created;
data['createdBy'] = this.createdBy; data['CreatedBy'] = this.createdBy;
data['modified'] = this.modified; data['Modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy; data['ModifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted; data['IsDeleted'] = this.isDeleted;
return data; return data;
} }
} }

@ -10,7 +10,7 @@ class PatientER_RC {
String sessionID; String sessionID;
bool isDentalAllowedBackend; bool isDentalAllowedBackend;
int deviceTypeID; int deviceTypeID;
String patientID; int patientID;
String tokenID; String tokenID;
int patientTypeID; int patientTypeID;
int patientType; int patientType;

@ -1,5 +1,5 @@
class PatientERTransportationMethod { class PatientERTransportationMethod {
int id; int iD;
String serviceID; String serviceID;
int orderServiceID; int orderServiceID;
String text; String text;
@ -12,7 +12,7 @@ class PatientERTransportationMethod {
int quantity; int quantity;
PatientERTransportationMethod( PatientERTransportationMethod(
{this.id, {this.iD,
this.serviceID, this.serviceID,
this.orderServiceID, this.orderServiceID,
this.text, this.text,
@ -25,32 +25,32 @@ class PatientERTransportationMethod {
this.quantity}); this.quantity});
PatientERTransportationMethod.fromJson(Map<String, dynamic> json) { PatientERTransportationMethod.fromJson(Map<String, dynamic> json) {
id = json['id']; iD = json['ID'];
serviceID = json['serviceID']; serviceID = json['ServiceID'];
orderServiceID = json['orderServiceID']; orderServiceID = json['OrderServiceID'];
text = json['text']; text = json['Text'];
textN = json['textN']; textN = json['TextN'];
price = json['price']; price = json['Price'];
priceVAT = json['priceVAT']; priceVAT = json['PriceVAT'];
priceTotal = json['priceTotal']; priceTotal = json['PriceTotal'];
isEnabled = json['isEnabled']; isEnabled = json['IsEnabled'];
orderId = json['orderId']; orderId = json['OrderId'];
quantity = json['quantity']; quantity = json['Quantity'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id; data['ID'] = this.iD;
data['serviceID'] = this.serviceID; data['ServiceID'] = this.serviceID;
data['orderServiceID'] = this.orderServiceID; data['OrderServiceID'] = this.orderServiceID;
data['text'] = this.text; data['Text'] = this.text;
data['textN'] = this.textN; data['TextN'] = this.textN;
data['price'] = this.price; data['Price'] = this.price;
data['priceVAT'] = this.priceVAT; data['PriceVAT'] = this.priceVAT;
data['priceTotal'] = this.priceTotal; data['PriceTotal'] = this.priceTotal;
data['isEnabled'] = this.isEnabled; data['IsEnabled'] = this.isEnabled;
data['orderId'] = this.orderId; data['OrderId'] = this.orderId;
data['quantity'] = this.quantity; data['Quantity'] = this.quantity;
return data; return data;
} }
} }

@ -0,0 +1,52 @@
class PrescriptionInfoRCModel {
String itemDescription;
String image;
String sKU;
dynamic productId;
dynamic productName;
int quantity;
int orderId;
int totalPrice;
int dispenseQuantity;
dynamic itemhand;
PrescriptionInfoRCModel(
{this.itemDescription,
this.image,
this.sKU,
this.productId,
this.productName,
this.quantity,
this.orderId,
this.totalPrice,
this.dispenseQuantity,
this.itemhand});
PrescriptionInfoRCModel.fromJson(Map<String, dynamic> json) {
itemDescription = json['ItemDescription'];
image = json['image'];
sKU = json['SKU'];
productId = json['ProductId'];
productName = json['ProductName'];
quantity = json['Quantity'];
orderId = json['OrderId'];
totalPrice = json['TotalPrice'];
dispenseQuantity = json['DispenseQuantity'];
itemhand = json['itemhand'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ItemDescription'] = this.itemDescription;
data['image'] = this.image;
data['SKU'] = this.sKU;
data['ProductId'] = this.productId;
data['ProductName'] = this.productName;
data['Quantity'] = this.quantity;
data['OrderId'] = this.orderId;
data['TotalPrice'] = this.totalPrice;
data['DispenseQuantity'] = this.dispenseQuantity;
data['itemhand'] = this.itemhand;
return data;
}
}

@ -28,7 +28,7 @@ class CMCService extends BaseService {
hasError = false; hasError = false;
// RC IMPLEMENTATION // RC IMPLEMENTATION
await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + user.patientID.toString(), isAllowAny: true, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + user.patientID.toString(), isRCService: true, isAllowAny: true, onSuccess: (dynamic response, int statusCode) {
cmcAllServicesList.clear(); cmcAllServicesList.clear();
response['response'].forEach((data) { response['response'].forEach((data) {
cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data)); cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data));
@ -67,7 +67,7 @@ class CMCService extends BaseService {
Future getCmcAllPresOrdersRC() async { Future getCmcAllPresOrdersRC() async {
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel(); GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel();
hasError = false; hasError = false;
await baseAppClient.post(GET_ALL_CMC_ORDERS_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_CMC_ORDERS_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
cmcAllPresOrdersList.clear(); cmcAllPresOrdersList.clear();
cmcAllOrderDetail.clear(); cmcAllOrderDetail.clear();
@ -122,7 +122,7 @@ class CMCService extends BaseService {
Future updateCmcPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { Future updateCmcPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(UPDATE_CMC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(UPDATE_CMC_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true; isOrderUpdated = true;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -133,7 +133,7 @@ class CMCService extends BaseService {
Future<String> insertCMCOrderRC({CMCInsertPresOrderRequestModel order}) async { Future<String> insertCMCOrderRC({CMCInsertPresOrderRequestModel order}) async {
hasError = false; hasError = false;
String reqId = ""; String reqId = "";
await baseAppClient.post(ADD_CMC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(ADD_CMC_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true; isOrderUpdated = true;
reqId = response['response'].toString(); reqId = response['response'].toString();
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -38,7 +38,7 @@ class HomeHealthCareService extends BaseService {
Future getHHCAllServicesRC(HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async { Future getHHCAllServicesRC(HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(HHC_GET_ALL_SERVICES_RC + "?PatientID=" + user.patientID.toString(), onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(HHC_GET_ALL_SERVICES_RC + "?PatientID=" + user.patientID.toString(), isRCService: true, onSuccess: (dynamic response, int statusCode) {
hhcAllServicesList.clear(); hhcAllServicesList.clear();
response['response'].forEach((data) { response['response'].forEach((data) {
hhcAllServicesList.add(HHCGetAllServicesResponseModel.fromJson(data)); hhcAllServicesList.add(HHCGetAllServicesResponseModel.fromJson(data));
@ -52,7 +52,7 @@ class HomeHealthCareService extends BaseService {
Future getHHCAllPresOrdersRC() async { Future getHHCAllPresOrdersRC() async {
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel(); GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel();
hasError = false; hasError = false;
await baseAppClient.post(GET_ALL_HHC_ORDERS_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_HHC_ORDERS_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
hhcAllPresOrdersList.clear(); hhcAllPresOrdersList.clear();
hhcAllOrderDetail.clear(); hhcAllOrderDetail.clear();
response['response'].forEach((data) { response['response'].forEach((data) {
@ -106,7 +106,7 @@ class HomeHealthCareService extends BaseService {
Future updateHHCPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { Future updateHHCPresOrderRC(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(UPDATE_HHC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(UPDATE_HHC_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true; isOrderUpdated = true;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -127,7 +127,7 @@ class HomeHealthCareService extends BaseService {
Future insertHHCOrderRC({PatientERInsertPresOrderRequestModel order}) async { Future insertHHCOrderRC({PatientERInsertPresOrderRequestModel order}) async {
hasError = false; hasError = false;
await baseAppClient.post(ADD_HHC_ORDER_RC, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(ADD_HHC_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {
hhcResponse = response; hhcResponse = response;
requestNo = response["response"]; requestNo = response["response"];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -10,13 +10,13 @@ class BloodDonationService extends BaseService {
List<CitiesModel> CitiesModelList = List(); List<CitiesModel> CitiesModelList = List();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
Future getAllCitiesOrders() async { Future getAllCitiesOrders() async {
hasError = false; hasError = false;
body['ListCities'] = false; body['ListCities'] = false;
await baseAppClient.post(GET_CITIES_REQUEST, body["IsPublicRequest"] = true;
onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_CITIES_REQUEST, onSuccess: (dynamic response, int statusCode) {
CitiesModelList.clear(); CitiesModelList.clear();
response['ListCities'].forEach((vital) { response['ListCities'].forEach((vital) {
CitiesModelList.add(CitiesModel.fromJson(vital)); CitiesModelList.add(CitiesModel.fromJson(vital));
}); });
@ -25,16 +25,16 @@ class BloodDonationService extends BaseService {
super.error = error; super.error = error;
}, body: body); }, body: body);
} }
Future bloodDonationSave(request) async { Future bloodDonationSave(request) async {
var localRes; var localRes;
try { try {
await baseAppClient.post(SAVE_BLOOD_REQUEST, await baseAppClient.post(SAVE_BLOOD_REQUEST, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { localRes = error;
localRes = error; return Future.value(error);
return Future.value(error); }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
throw error; throw error;
@ -44,30 +44,27 @@ class BloodDonationService extends BaseService {
Future getAgreement() async { Future getAgreement() async {
var localRes; var localRes;
try { try {
await baseAppClient.post(GET_BLOOD_AGREEMENT, await baseAppClient.post(GET_BLOOD_AGREEMENT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { localRes = error;
localRes = error; return Future.value(error);
return Future.value(error); }, body: {});
}, body: {});
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
throw error; throw error;
} }
} }
Future saveAgreement(request) async { Future saveAgreement(request) async {
var localRes; var localRes;
try { try {
await baseAppClient.post(SAVE_BLOOD_AGREEMENT, await baseAppClient.post(SAVE_BLOOD_AGREEMENT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { localRes = error;
localRes = error; return Future.value(error);
return Future.value(error); }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} catch (error) { } catch (error) {
throw error; throw error;

@ -35,12 +35,20 @@ VitalSignService _vitalSignService = locator<VitalSignService>();
class BaseAppClient { class BaseAppClient {
post(String endPoint, post(String endPoint,
{Map<String, dynamic> body, Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, bool isAllowAny = false, bool isExternal = false}) async { {Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
bool isAllowAny = false,
bool isExternal = false,
bool isRCService = false}) async {
String url; String url;
if (isExternal) { if (isExternal) {
url = endPoint; url = endPoint;
} else { } else {
url = BASE_URL + endPoint; if (isRCService)
url = RC_BASE_URL + endPoint;
else
url = BASE_URL + endPoint;
} }
try { try {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE); //Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
@ -116,7 +124,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1009199553; // body['IdentificationNo'] = 1009199553;
// body['MobileNo'] = "966545156035"; // body['MobileNo'] = "966545156035";
// body['PatientID'] = 1018977; // body['PatientID'] = 1018977; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
body.removeWhere((key, value) => key == null || value == null); body.removeWhere((key, value) => key == null || value == null);
@ -376,12 +384,20 @@ class BaseAppClient {
Navigator.pushReplacement(context, FadePage(page: AppUpdatePage(appUpdateText: text))); Navigator.pushReplacement(context, FadePage(page: AppUpdatePage(appUpdateText: text)));
} }
get(String endPoint, {Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, Map<String, dynamic> queryParams, bool isExternal = false}) async { get(String endPoint,
{Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
Map<String, dynamic> queryParams,
bool isExternal = false,
bool isRCService = false}) async {
String url; String url;
if (isExternal) { if (isExternal) {
url = endPoint; url = endPoint;
} else { } else {
url = BASE_URL + endPoint; if (isRCService)
url = RC_BASE_URL + endPoint;
else
url = BASE_URL + endPoint;
} }
if (queryParams != null) { if (queryParams != null) {
String queryString = Uri(queryParameters: queryParams).query; String queryString = Uri(queryParameters: queryParams).query;

@ -28,9 +28,9 @@ class AmService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = user.patientIdentificationNo;
await baseAppClient.get(GET_ALL_TRANSPORTATIONS_RC + "?patientID=" + user.patientID.toString(), isExternal: false, onSuccess: (dynamic response, int statusCode) { await baseAppClient.get(GET_ALL_TRANSPORTATIONS_RC + "?patientID=" + user.patientID.toString(), isRCService: true, isExternal: false, onSuccess: (dynamic response, int statusCode) {
amModelList.clear(); amModelList.clear();
response['data']['transportationservices'].forEach((item) { response['response']['transportationservices'].forEach((item) {
amModelList.add(PatientERTransportationMethod.fromJson(item)); amModelList.add(PatientERTransportationMethod.fromJson(item));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -69,18 +69,18 @@ class AmService extends BaseService {
pickUpRequestPresOrder = null; pickUpRequestPresOrder = null;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['patientId'] = patientID.toString(); body['patientId'] = patientID;
body['PatientID'] = patientID.toString(); body['PatientID'] = patientID;
await baseAppClient.post(GET_ALL_TRANSPORTATIONS_ORDERS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_TRANSPORTATIONS_ORDERS, isRCService: true, onSuccess: (dynamic response, int statusCode) {
patientAmbulanceRequestOrdersList.clear(); patientAmbulanceRequestOrdersList.clear();
hasPendingOrder = false; hasPendingOrder = false;
pendingOrderID = 0; pendingOrderID = 0;
pendingAmbulanceRequestOrder = null; pendingAmbulanceRequestOrder = null;
response['data'].forEach((item) { response['response'].forEach((item) {
patientAmbulanceRequestOrdersList.add(AmbulanceRequestOrdersModel.fromJson(item)); patientAmbulanceRequestOrdersList.add(AmbulanceRequestOrdersModel.fromJson(item));
if (item['statusId'] == 1) { if (item['StatusId'] == 1) {
hasPendingOrder = true; hasPendingOrder = true;
pendingOrderID = item['orderpayment']['id']; pendingOrderID = item['orderpayment']['id'];
pendingOrderStatus = item['statusText']; pendingOrderStatus = item['statusText'];
@ -127,14 +127,14 @@ class AmService extends BaseService {
}, body: body); }, body: body);
} }
Future updatePressOrderRC({@required int presOrderID, @required String patientID}) async { Future updatePressOrderRC({@required int presOrderID, @required int patientID}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['Id'] = presOrderID; body['Id'] = presOrderID;
body['StatusId'] = 6; body['StatusId'] = 6;
body['ClickButton'] = 14; body['ClickButton'] = 14;
body['PatientID'] = patientID; body['PatientID'] = patientID;
await baseAppClient.post(CANCEL_AMBULANCE_REQUEST, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(CANCEL_AMBULANCE_REQUEST, isRCService: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
@ -146,7 +146,7 @@ class AmService extends BaseService {
var body = patientER.toJson(); var body = patientER.toJson();
print(body); print(body);
await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC, isRCService: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
@ -25,8 +26,8 @@ class HospitalService extends BaseService {
if(isResBasedOnLoc) if(isResBasedOnLoc)
await _getCurrentLocation(); await _getCurrentLocation();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['Latitude'] = isResBasedOnLoc?_latitude:0; body['Latitude'] = await this.sharedPref.getDouble(USER_LAT);
body['Longitude'] = isResBasedOnLoc?_longitude:0; body['Longitude'] = await this.sharedPref.getDouble(USER_LONG);
body['IsOnlineCheckIn'] = isResBasedOnLoc; body['IsOnlineCheckIn'] = isResBasedOnLoc;
body['PatientOutSA'] = 0; body['PatientOutSA'] = 0;

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_info_rc_model.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.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/prescriptions/prescription_report_inp.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart';
@ -18,6 +19,7 @@ class PrescriptionsService extends BaseService {
List<Prescriptions> prescriptionsList = List(); List<Prescriptions> prescriptionsList = List();
List<PrescriptionReportINP> prescriptionReportListINP = List(); List<PrescriptionReportINP> prescriptionReportListINP = List();
List<GetCMCAllOrdersResponseModel> prescriptionsOrderList = List(); List<GetCMCAllOrdersResponseModel> prescriptionsOrderList = List();
List<PrescriptionInfoRCModel> prescriptionsOrderListRC = List();
var isMedDeliveryAllowed; var isMedDeliveryAllowed;
Future getPrescriptions() async { Future getPrescriptions() async {
@ -49,6 +51,20 @@ class PrescriptionsService extends BaseService {
}, body: body); }, body: body);
} }
Future getPrescriptionsInfoRC(int orderID, dynamic patientID) async {
prescriptionsOrderListRC.clear();
Map<String, dynamic> body = Map();
body['ID'] = orderID;
await baseAppClient.post(GET_ALL_PRESCRIPTION_INFO_RC + "?PatientId=" + patientID.toString(), onSuccess: (dynamic response, int statusCode) {
response['response']['report'].forEach((prescriptionsOrder) {
prescriptionsOrderListRC.add(PrescriptionInfoRCModel.fromJson(prescriptionsOrder));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getPrescriptionsOrdersRC() async { Future getPrescriptionsOrdersRC() async {
prescriptionsOrderList.clear(); prescriptionsOrderList.clear();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -162,7 +178,6 @@ class PrescriptionsService extends BaseService {
List<PrescriptionReportEnh> prescriptionReportEnhList = List(); List<PrescriptionReportEnh> prescriptionReportEnhList = List();
Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async { Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async {
///This logic copy from the old app from class [order-history.component.ts] in line 45
bool isInPatient = false; bool isInPatient = false;
prescriptionsList.forEach((element) { prescriptionsList.forEach((element) {
if (prescriptionsOrder.appointmentNo == "0") { if (prescriptionsOrder.appointmentNo == "0") {
@ -184,8 +199,6 @@ class PrescriptionsService extends BaseService {
_requestPrescriptionReportEnh.setupID = element.setupID; _requestPrescriptionReportEnh.setupID = element.setupID;
_requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo;
isInPatient = element.isInOutPatient; isInPatient = element.isInOutPatient;
///call inpGetPrescriptionReport
} }
} }
}); });
@ -212,6 +225,19 @@ class PrescriptionsService extends BaseService {
}, body: _requestPrescriptionReportEnh.toJson()); }, body: _requestPrescriptionReportEnh.toJson());
} }
Future updatePressOrderRC({@required int presOrderID, @required String patientID}) async {
hasError = false;
Map<String, dynamic> body = Map();
body['Id'] = presOrderID;
body['StatusId'] = 6;
body['ClickButton'] = 14;
body['PatientID'] = patientID;
await baseAppClient.post(UPDATE_PRESCRIPTION_ORDER_RC, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future updatePressOrder({@required int presOrderID}) async { Future updatePressOrder({@required int presOrderID}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();

@ -106,7 +106,7 @@ class AmRequestViewModel extends BaseViewModel {
Future updatePressOrder({@required int presOrderID}) async { Future updatePressOrder({@required int presOrderID}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
// await _amService.updatePressOrder(presOrderID: presOrderID); // await _amService.updatePressOrder(presOrderID: presOrderID);
await _amService.updatePressOrderRC(presOrderID: presOrderID, patientID: authenticatedUserObject.user.patientID.toString()); await _amService.updatePressOrderRC(presOrderID: presOrderID, patientID: authenticatedUserObject.user.patientID);
if (_amService.hasError) { if (_amService.hasError) {
error = _amService.error; error = _amService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -62,7 +62,7 @@ class RRTViewModel extends BaseViewModel {
// body['OrderServiceID'] = 5; // body['OrderServiceID'] = 5;
var localRes; var localRes;
int requestNo; int requestNo;
await _service.baseAppClient.post(ADD_RRT_ORDER_RC, body: body, onSuccess: (response, statusCode) { await _service.baseAppClient.post(ADD_RRT_ORDER_RC, isRCService: true, body: body, onSuccess: (response, statusCode) {
requestNo = response['response']; requestNo = response['response'];
}, onFailure: (error, statusCode) { }, onFailure: (error, statusCode) {
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
@ -94,7 +94,7 @@ class RRTViewModel extends BaseViewModel {
} }
Future<_RRTServiceData> getAllOrdersRC() async { Future<_RRTServiceData> getAllOrdersRC() async {
await _service.baseAppClient.post(GET_ALL_RRT_ORDERS_RC, body: {}, onSuccess: (response, statusCode) { await _service.baseAppClient.post(GET_ALL_RRT_ORDERS_RC, isRCService: true, body: {}, onSuccess: (response, statusCode) {
var data = response["response"]; var data = response["response"];
rrtServiceData.completedOrders.clear(); rrtServiceData.completedOrders.clear();
rrtServiceData.pendingOrders.clear(); rrtServiceData.pendingOrders.clear();
@ -161,7 +161,7 @@ class RRTViewModel extends BaseViewModel {
Future<bool> cancelOrderRC(GetCMCAllOrdersResponseModel order, {String reason = ""}) async { Future<bool> cancelOrderRC(GetCMCAllOrdersResponseModel order, {String reason = ""}) async {
Map<String, dynamic> body = {"Id": order.iD, "ClickButton": 16}; Map<String, dynamic> body = {"Id": order.iD, "ClickButton": 16};
var success = false; var success = false;
await _service.baseAppClient.post(UPDATE_RRT_ORDER_RC, body: body, onSuccess: (response, statusCode) { await _service.baseAppClient.post(UPDATE_RRT_ORDER_RC, isRCService: true, body: body, onSuccess: (response, statusCode) {
success = true; success = true;
rrtServiceData.pendingOrders.remove(order); rrtServiceData.pendingOrders.remove(order);
}, onFailure: (error, statusCode) { }, onFailure: (error, statusCode) {

@ -81,13 +81,15 @@ class MyBalanceViewModel extends BaseViewModel {
} }
Future getCities() async { Future getCities() async {
setState(ViewState.Busy); if(isLogin) {
await _bloodDonationService.getAllCitiesOrders(); setState(ViewState.Busy);
if (_bloodDonationService.hasError) { await _bloodDonationService.getAllCitiesOrders();
error = _bloodDonationService.error; if (_bloodDonationService.hasError) {
setState(ViewState.Error); error = _bloodDonationService.error;
} else setState(ViewState.Error);
setState(ViewState.Idle); } else
setState(ViewState.Idle);
}
} }
Future getBlood() async { Future getBlood() async {

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_info_rc_model.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.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/prescriptions/prescription_report_inp.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart';
@ -31,6 +32,10 @@ class PrescriptionsViewModel extends BaseViewModel {
List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList; List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList;
List<PrescriptionInfoRCModel> get prescriptionsOrderListRC => _prescriptionsService.prescriptionsOrderListRC;
List<PrescriptionsList> get prescriptionsOrderList => filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital; List<PrescriptionsList> get prescriptionsOrderList => filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital;
List<PrescriptionsList> prescriptionsOrderListByValue(filterValue) { List<PrescriptionsList> prescriptionsOrderListByValue(filterValue) {
@ -131,8 +136,6 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
} }
List<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList;
getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async { getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder); await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder);
@ -144,9 +147,21 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
} }
getPrescriptionReportDetailsRC() async {
setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionsInfoRC(4, 2001273);
if (_prescriptionsService.hasError) {
error = _prescriptionsService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
Future updatePressOrder({@required int presOrderID}) async { Future updatePressOrder({@required int presOrderID}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.updatePressOrder(presOrderID: presOrderID); // await _prescriptionsService.updatePressOrder(presOrderID: presOrderID);
await _prescriptionsService.updatePressOrderRC(presOrderID: presOrderID);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -1,9 +1,11 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart';
import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart'; import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/brands_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/brands_service.dart';
import '../../../locator.dart'; import '../../../locator.dart';
class BrandsViewModel extends BaseViewModel{ class BrandsViewModel extends BaseViewModel{
@ -22,6 +24,7 @@ class BrandsViewModel extends BaseViewModel{
Future getBrandsData() async { Future getBrandsData() async {
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _brandsService.getBrands(); await _brandsService.getBrands();
if (_brandsService.hasError) { if (_brandsService.hasError) {
error = _brandsService.error; error = _brandsService.error;

@ -1,47 +1,47 @@
class DoctorProfileList { class DoctorProfileList {
int doctorID; num doctorID;
String doctorName; String doctorName;
Null doctorNameN; dynamic doctorNameN;
int clinicID; num clinicID;
String clinicDescription; String clinicDescription;
Null clinicDescriptionN; dynamic clinicDescriptionN;
Null licenseExpiry; dynamic licenseExpiry;
int employmentType; num employmentType;
Null setupID; dynamic setupID;
int projectID; num projectID;
String projectName; String projectName;
String nationalityID; String nationalityID;
String nationalityName; String nationalityName;
Null nationalityNameN; dynamic nationalityNameN;
int gender; num gender;
String genderDescription; String genderDescription;
Null genderDescriptionN; dynamic genderDescriptionN;
Null doctorTitle; dynamic doctorTitle;
Null projectNameN; dynamic projectNameN;
bool isAllowWaitList; bool isAllowWaitList;
String titleDescription; String titleDescription;
Null titleDescriptionN; dynamic titleDescriptionN;
Null isRegistered; dynamic isRegistered;
Null isDoctorDummy; dynamic isDoctorDummy;
bool isActive; bool isActive;
bool isDoctorHasPrePostImages; bool isDoctorHasPrePostImages;
Null isDoctorAppointmentDisplayed; dynamic isDoctorAppointmentDisplayed;
bool doctorClinicActive; bool doctorClinicActive;
Null isbookingAllowed; dynamic isbookingAllowed;
String doctorCases; String doctorCases;
Null doctorPicture; dynamic doctorPicture;
String doctorProfileInfo; String doctorProfileInfo;
List<String> specialty; List<String> specialty;
int actualDoctorRate; num actualDoctorRate;
String doctorImageURL; String doctorImageURL;
int doctorRate; num doctorRate;
double decimalDoctorRate; num decimalDoctorRate;
String doctorTitleForProfile; String doctorTitleForProfile;
bool isAppointmentAllowed; bool isAppointmentAllowed;
String nationalityFlagURL; String nationalityFlagURL;
int noOfPatientsRate; num noOfPatientsRate;
String qR; String qR;
int serviceID; num serviceID;
DoctorProfileList( DoctorProfileList(
{this.doctorID, {this.doctorID,

@ -170,7 +170,6 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
child: Container( child: Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
width: double.infinity, width: double.infinity,
// height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
color: Colors.white, color: Colors.white,

@ -56,7 +56,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: ListView.separated( body: model.cmcAllPresOrders.length > 0 ? ListView.separated(
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
@ -178,7 +178,7 @@ class OrdersLogDetailsPage extends StatelessWidget {
); );
}, },
separatorBuilder: (context, index) => SizedBox(height: 12), separatorBuilder: (context, index) => SizedBox(height: 12),
itemCount: model.cmcAllPresOrders.length), itemCount: model.cmcAllPresOrders.length) : getNoDataWidget(context),
); );
} }
} }

@ -149,23 +149,15 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Text(
TranslationBase.of(context).serviceName + ": ", TranslationBase.of(context).hospital + ": ",
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),
), ),
Column( Expanded(
children: [ child: Text(
...List.generate( widget.model.pendingOrder.nearestProjectName.toString(),
widget.model.hhcAllOrderDetail.length, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
(index) => Container( ),
child: Texts( ),
projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description.capitalize(),
fontSize: 13,
bold: false,
),
),
)
],
)
], ],
) )
], ],

@ -2,12 +2,8 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart'; import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_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/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart';
import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -34,8 +30,6 @@ class BloodDonationPage extends StatefulWidget {
} }
class _BloodDonationPageState extends State<BloodDonationPage> { class _BloodDonationPageState extends State<BloodDonationPage> {
TextEditingController _fileTextController = TextEditingController();
TextEditingController _notesTextController = TextEditingController();
BeneficiaryType beneficiaryType = BeneficiaryType.NON; BeneficiaryType beneficiaryType = BeneficiaryType.NON;
CitiesModel _selectedHospital; CitiesModel _selectedHospital;
@ -43,16 +37,13 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
int _selectedHospitalIndex = 0; int _selectedHospitalIndex = 0;
int _selectedGenderIndex = 1; int _selectedGenderIndex = 1;
int _selectedBloodTypeIndex = 0; int _selectedBloodTypeIndex = 0;
String _selectedBloodType = "O+";
String amount = ""; String amount = "";
String email; String email;
PatientInfo _selectedPatientInfo;
AuthenticatedUser authenticatedUser;
GetAllSharedRecordsByStatusList selectedPatientFamily;
AdvanceModel advanceModel = AdvanceModel();
List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-"); List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-");
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
var checkedValue = false; var checkedValue = false;
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
@ -63,15 +54,12 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
imagesInfo.add( 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'), 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((_) { WidgetsBinding.instance.addPostFrameCallback((_) {});
if (projectProvider.isLogin) authUser = projectProvider.user;
});
super.initState(); super.initState();
} }
int getSelectedCityID(MyBalanceViewModel model) { int getSelectedCityID(MyBalanceViewModel model) {
int cityID = 1; int cityID = 1;
model.CitiesModelList.forEach((element) { model.CitiesModelList.forEach((element) {
if (element.description == model.bloodModelList[0].city) { if (element.description == model.bloodModelList[0].city) {
cityID = element.iD; cityID = element.iD;
@ -85,24 +73,42 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
projectProvider = Provider.of(context); projectProvider = Provider.of(context);
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) { onModelReady: (model) => model.getCities().then((value) {
if (projectProvider.isLogin) { model.getBlood().then((value) {
model.getCities().then((value) { if (model.bloodModelList.length > 0) {
model.getBlood().then((value) { CitiesModel citiesModel = new CitiesModel();
if (model.bloodModelList.length > 0) { citiesModel.iD = getSelectedCityID(model);
CitiesModel citiesModel = new CitiesModel(); _selectedHospitalIndex = (citiesModel.iD - 1);
citiesModel.iD = getSelectedCityID(model); citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description;
_selectedHospitalIndex = (citiesModel.iD - 1); citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN;
citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description; _selectedHospital = citiesModel;
citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN; _selectedBloodType = model.bloodModelList[0].bloodGroup;
_selectedHospital = citiesModel; _selectedBloodTypeIndex = getBloodIndex(_selectedBloodType);
} else { } else {
_selectedHospital = model.CitiesModelList[0]; _selectedHospital = model.CitiesModelList[0];
} }
}); });
}); }),
} // {
}, // if (projectProvider.isLogin && projectProvider.user != null) {
// model.getCities().then((value) {
// model.getBlood().then((value) {
// if (model.bloodModelList.length > 0) {
// CitiesModel citiesModel = new CitiesModel();
// citiesModel.iD = getSelectedCityID(model);
// _selectedHospitalIndex = (citiesModel.iD - 1);
// citiesModel.description = model.CitiesModelList[_selectedHospitalIndex].description;
// citiesModel.descriptionN = model.CitiesModelList[_selectedHospitalIndex].descriptionN;
// _selectedHospital = citiesModel;
// _selectedBloodType = model.bloodModelList[0].bloodGroup;
// _selectedBloodTypeIndex = getBloodIndex(_selectedBloodType);
// } else {
// _selectedHospital = model.CitiesModelList[0];
// }
// });
// });
// }
// },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBar: true, showNewAppBar: true,
@ -168,7 +174,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
); );
}).withBorderedContainer, }).withBorderedContainer,
SizedBox(height: 12), SizedBox(height: 12),
CommonDropDownView(TranslationBase.of(context).bloodType, model.bloodModelList.isNotEmpty ? model.bloodModelList[0].bloodGroup : getBlood(_selectedBloodTypeIndex), () { CommonDropDownView(TranslationBase.of(context).bloodType, _selectedBloodType, () {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel("O+", 0), RadioSelectionDialogModel("O+", 0),
RadioSelectionDialogModel("O-", 1), RadioSelectionDialogModel("O-", 1),
@ -188,6 +194,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
isScrollable: true, isScrollable: true,
onValueSelected: (index) { onValueSelected: (index) {
_selectedBloodTypeIndex = index; _selectedBloodTypeIndex = index;
_selectedBloodType = getBlood(index);
setState(() {}); setState(() {});
}, },
), ),
@ -321,6 +328,41 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
} }
} }
int getBloodIndex(String type) {
switch (type) {
case "O+":
return 0;
break;
case "O-":
return 1;
break;
case "AB+":
return 2;
break;
case "AB-":
return 3;
break;
case "A+":
return 4;
break;
case "A-":
return 5;
break;
case "B-":
return 6;
break;
case "B-":
return 7;
break;
case "B+":
return 8;
break;
default:
return 0;
}
}
String getHospitalName(ProjectViewModel projectProvider, BuildContext context) { String getHospitalName(ProjectViewModel projectProvider, BuildContext context) {
if (_selectedHospital != null) if (_selectedHospital != null)
return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description; return projectProvider.isArabic ? _selectedHospital.descriptionN : _selectedHospital.description;

@ -47,6 +47,8 @@ class BookConfirm extends StatefulWidget {
class _BookConfirmState extends State<BookConfirm> { class _BookConfirmState extends State<BookConfirm> {
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
AppSharedPreferences sharedPref = new AppSharedPreferences();
@override @override
void initState() { void initState() {
widget.authUser = new AuthenticatedUser(); widget.authUser = new AuthenticatedUser();
@ -195,8 +197,8 @@ class _BookConfirmState extends State<BookConfirm> {
elevation: 0, elevation: 0,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
onPressed: () { onPressed: () async {
if (!widget.isLiveCareAppointment) { if (!await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
insertAppointment(context, widget.doctor); insertAppointment(context, widget.doctor);
} else { } else {
insertLiveCareScheduledAppointment(context, widget.doctor); insertLiveCareScheduledAppointment(context, widget.doctor);
@ -244,8 +246,8 @@ class _BookConfirmState extends State<BookConfirm> {
service.cancelAppointment(appo, context).then((res) { service.cancelAppointment(appo, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () { Future.delayed(new Duration(milliseconds: 1500), () async {
if (!widget.isLiveCareAppointment) { if (!await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) {
insertAppointment(context, widget.doctor); insertAppointment(context, widget.doctor);
} else { } else {
insertLiveCareScheduledAppointment(context, widget.doctor); insertLiveCareScheduledAppointment(context, widget.doctor);
@ -441,6 +443,7 @@ class _BookConfirmState extends State<BookConfirm> {
Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async { Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.sharedPref.remove(IS_LIVECARE_APPOINTMENT);
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(

@ -12,7 +12,6 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart'; import 'package:syncfusion_flutter_calendar/calendar.dart';
import '../../../uitl/date_uitl.dart'; import '../../../uitl/date_uitl.dart';
@ -79,7 +78,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
getCurrentLanguage(); getCurrentLanguage();
if (widget.isLiveCareAppointment) if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT))
getDoctorScheduledFreeSlots(context, widget.doctor); getDoctorScheduledFreeSlots(context, widget.doctor);
else { else {
getDoctorFreeSlots(context, widget.doctor); getDoctorFreeSlots(context, widget.doctor);
@ -351,22 +350,27 @@ class MeetingDataSource extends CalendarDataSource {
DateTime getStartTime(int index) { DateTime getStartTime(int index) {
return _getMeetingData(index).from; return _getMeetingData(index).from;
} }
@override @override
DateTime getEndTime(int index) { DateTime getEndTime(int index) {
return _getMeetingData(index).to; return _getMeetingData(index).to;
} }
@override @override
String getSubject(int index) { String getSubject(int index) {
return _getMeetingData(index).eventName; return _getMeetingData(index).eventName;
} }
@override @override
Color getColor(int index) { Color getColor(int index) {
return _getMeetingData(index).background; return _getMeetingData(index).background;
} }
@override @override
bool isAllDay(int index) { bool isAllDay(int index) {
return _getMeetingData(index).isAllDay; return _getMeetingData(index).isAllDay;
} }
Meeting _getMeetingData(int index) { Meeting _getMeetingData(int index) {
final dynamic meeting = appointments[index]; final dynamic meeting = appointments[index];
Meeting meetingData; Meeting meetingData;

@ -58,7 +58,6 @@ 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(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,

@ -55,51 +55,6 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// Container(
// height: 150.0,
// decoration: BoxDecoration(
// image: DecorationImage(
// image: AssetImage(
// "assets/images/new-design/covid-19-big-banner-bg.png"),
// fit: BoxFit.fill,
// ),
// color: Colors.white.withOpacity(0.3),
// borderRadius: BorderRadius.all(Radius.circular(10))),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Container(
// margin:
// EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
// child: SvgPicture.asset(
// 'assets/images/new-design/covid-19-car.svg',
// width: 90.0,
// height: 90.0),
// ),
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Container(
// margin: EdgeInsets.only(
// left: 20.0, right: 20.0, top: 20.0),
// child: Text(TranslationBase.of(context).covidTest,
// style: TextStyle(
// color: Colors.white,
// fontWeight: FontWeight.bold,
// fontSize: 24.0)),
// ),
// Container(
// margin: EdgeInsets.only(
// left: 20.0, right: 20.0, top: 10.0),
// child: Text(TranslationBase.of(context).driveThru,
// style: TextStyle(
// color: Colors.white, fontSize: 24.0)),
// ),
// ],
// ),
// ],
// ),
// ),
Text(TranslationBase.of(context).covidSelectProcedure, style: TextStyle(color: Colors.black, fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold)), Text(TranslationBase.of(context).covidSelectProcedure, style: TextStyle(color: Colors.black, fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.bold)),
...List.generate( ...List.generate(
widget.proceduresList.length, widget.proceduresList.length,
@ -144,29 +99,6 @@ class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
// ListTile(
// title: Text(
// projectViewModel.isArabic ? widget.proceduresList[index].procedureNameN : widget.proceduresList[index].procedureName,
// style: TextStyle(
// fontSize: 12.0,
// letterSpacing: -0.48,
// fontWeight: FontWeight.w600,
// ),
// ),
// leading: Radio(
// value: widget.proceduresList[index],
// groupValue: widget.selectedProcedure,
// activeColor: Colors.red[800],
// toggleable: true,
// onChanged: (value) {
// setState(() {
// widget.selectedProcedure = value;
// print(widget.selectedProcedure.procedureName);
// getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID);
// });
// },
// ),
// ),
], ],
), ),
), ),

@ -168,7 +168,10 @@ class _AddMember extends State<AddMember> {
request.regionID = 1; request.regionID = 1;
} }
loading(true); loading(true);
familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value)); familyFileProvider.insertNewMember(request).then((value) => sendActivationCode(value)).catchError((err){
loading(false);
AppToast.showErrorToast(message: err);
});
} }
sendActivationCode(result) { sendActivationCode(result) {

@ -34,70 +34,68 @@ class NotificationsDetailsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<NotificationViewModel>( return AppScaffold(
builder: (_, model, widget) => AppScaffold( isShowAppBar: true,
isShowAppBar: true, showNewAppBar: true,
showNewAppBar: true, showNewAppBarTitle: true,
showNewAppBarTitle: true, appBarTitle: TranslationBase.of(context).notificationDetails,
appBarTitle: TranslationBase.of(context).notificationDetails, body: SingleChildScrollView(
body: SingleChildScrollView( child: Center(
child: Center( child: FractionallySizedBox(
child: FractionallySizedBox( widthFactor: 0.9,
widthFactor: 0.9, child: Column(
child: Column( children: [
children: [ SizedBox(
SizedBox( height: 25,
height: 25, ),
), Container(
Container( width: double.infinity,
width: double.infinity, child: Padding(
child: Padding( padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0), child: Text(
child: Text( DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false),
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(notification.createdOn)) + " " + DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(notification.createdOn), false), style: TextStyle(
style: TextStyle(
fontSize: 18.0, fontSize: 18.0,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.w600 fontWeight: FontWeight.w600
),
), ),
), ),
), ),
SizedBox( ),
height: 15, SizedBox(
), height: 15,
if (notification.messageTypeData.length != 0) ),
FractionallySizedBox( if (notification.messageTypeData.length != 0)
widthFactor: 0.9, FractionallySizedBox(
child: Image.network(notification.messageTypeData, widthFactor: 0.9,
loadingBuilder: (BuildContext context, Widget child, child: Image.network(notification.messageTypeData,
ImageChunkEvent loadingProgress) { loadingBuilder: (BuildContext context, Widget child,
if (loadingProgress == null) return child; ImageChunkEvent loadingProgress) {
return Center( if (loadingProgress == null) return child;
child: SizedBox( return Center(
width: 40.0, child: SizedBox(
height: 40.0, width: 40.0,
child: AppCircularProgressIndicator(), height: 40.0,
), child: AppCircularProgressIndicator(),
); ),
}, );
fit: BoxFit },
.fill) //Image.network(notification.messageTypeData), fit: BoxFit
), .fill) //Image.network(notification.messageTypeData),
SizedBox(
height: 15,
), ),
Row( SizedBox(
children: [ height: 15,
Expanded( ),
child: Center( Row(
child: Text(notification.message), children: [
), Expanded(
child: Center(
child: Text(notification.message),
), ),
], ),
), ],
], ),
), ],
), ),
), ),
), ),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart'; import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/notifications_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -21,6 +22,7 @@ class NotificationsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
AppGlobal.context = context;
return BaseView<NotificationViewModel>( return BaseView<NotificationViewModel>(
onModelReady: (model) { onModelReady: (model) {
GetNotificationsRequestModel getNotificationsRequestModel = GetNotificationsRequestModel getNotificationsRequestModel =

@ -78,7 +78,7 @@ class _AmbulanceReqState extends State<AmbulanceReq> with SingleTickerProviderSt
), ),
Expanded( Expanded(
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: _tabController, controller: _tabController,
children: <Widget>[ children: <Widget>[
AmbulanceRequestIndexPage( AmbulanceRequestIndexPage(

@ -1,13 +1,22 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/AmbulanceRequestOrdersModel.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.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 'BillAmount.dart'; import 'BillAmount.dart';
import 'PickupLocation.dart'; import 'PickupLocation.dart';
@ -20,8 +29,7 @@ class AmbulanceRequestIndexPage extends StatefulWidget {
AmbulanceRequestIndexPage({Key key, this.amRequestViewModel}); AmbulanceRequestIndexPage({Key key, this.amRequestViewModel});
@override @override
_AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState();
_AmbulanceRequestIndexPageState();
} }
class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> { class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
@ -33,12 +41,15 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
TransportationDetails transportationDetails = new TransportationDetails(); TransportationDetails transportationDetails = new TransportationDetails();
int status;
String _statusDisp;
Color _color;
_changeCurrentTab(int tab) { _changeCurrentTab(int tab) {
setState(() { setState(() {
currentIndex = tab; currentIndex = tab;
}); });
pageController.animateToPage(tab, pageController.animateToPage(tab, duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
} }
@override @override
@ -50,79 +61,269 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
AmbulanceRequestOrdersModel order = widget.amRequestViewModel.pendingAmbulanceRequestOrder;
if(widget.amRequestViewModel.pendingAmbulanceRequestOrder != null) {
int status = order.statusId;
String _statusDisp = order.statusText;
Color _color;
if (status == 1) {
//pending
_color = Color(0xffCC9B14);
} else if (status == 2) {
//processing
_color = Color(0xff2E303A);
} else if (status == 3) {
//completed
_color = Color(0xff359846);
} else if (status == 4 || status == 6 || status == 7) {
//cancel // Rejected
_color = Color(0xffD02127);
}
}
return AppScaffold( return AppScaffold(
body: widget.amRequestViewModel.pendingAmbulanceRequestOrder != null body: widget.amRequestViewModel.pendingAmbulanceRequestOrder != null && order != null
? SingleChildScrollView( ? SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Container(
margin: EdgeInsets.only(left: 18, right: 18), margin: EdgeInsets.all(21),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: _color,
borderRadius: BorderRadius.circular(2), borderRadius: BorderRadius.all(
), Radius.circular(10.0),
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, boxShadow: [
children: [ BoxShadow(
OrderLogItem( color: Color(0xff000000).withOpacity(.05),
title: TranslationBase.of(context).reqId, blurRadius: 27,
value: widget.amRequestViewModel.pendingAmbulanceRequestOrder offset: Offset(0, -3),
.id
.toString(),
),
OrderLogItem(
title: TranslationBase.of(context).status,
value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.statusText,
),
OrderLogItem(
title: TranslationBase.of(context).pickupDate,
value: getDate(widget.amRequestViewModel.pendingAmbulanceRequestOrder.created),
),
OrderLogItem(
title: TranslationBase.of(context).pickupLocation,
value: widget.amRequestViewModel.pendingAmbulanceRequestOrder
.pickupLocation,
),
OrderLogItem(
title: TranslationBase.of(context).dropoffLocation,
value: widget.amRequestViewModel.pendingAmbulanceRequestOrder
.dropOffLocation,
), ),
OrderLogItem( ],
title: TranslationBase.of(context).transportMethod, ),
value: widget child: Container(
.amRequestViewModel.pendingAmbulanceRequestOrder.serviceText, margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only(
bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
), ),
Container( ),
padding: EdgeInsets.all(10), child: Column(
width: double.maxFinite, crossAxisAlignment: CrossAxisAlignment.start,
margin: EdgeInsets.only(bottom: 4, left: 4, right: 4), children: [
decoration: BoxDecoration( Row(
borderRadius: BorderRadius.only( crossAxisAlignment: CrossAxisAlignment.start,
bottomRight: Radius.circular(12), children: [
bottomLeft: Radius.circular(12), Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_statusDisp,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 6),
Text(
'${TranslationBase.of(context).requestID}: ${order.iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).pickupDate + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created)),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).transportMethod + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
order.serviceText,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10),
),
),
],
),
SizedBox(
height: 20.0,
),
],
),
), ),
color: Colors.white), Column(
child: SecondaryButton( mainAxisAlignment: MainAxisAlignment.spaceBetween,
color: Colors.red[900], crossAxisAlignment: CrossAxisAlignment.end,
textColor: Colors.white, children: [
label: TranslationBase.of(context).cancel, SizedBox(height: 12),
onTap: () { if (order.statusId == 1 || order.statusId == 2)
widget.amRequestViewModel.updatePressOrder( InkWell(
presOrderID: widget.amRequestViewModel onTap: () {
.pendingAmbulanceRequestOrder.id); showConfirmMessage(widget.amRequestViewModel, order.iD);
}, },
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: Color(0xffD02127),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(10),
),
child: Text(
TranslationBase.of(context).cancel_nocaps,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
],
),
],
), ),
) Row(
], children: [
Container(
margin: projectViewModel.isArabic ? EdgeInsets.only(left: 10.0) : EdgeInsets.only(right: 10.0),
width: 8,
height: 8,
decoration: containerRadius(
CustomColors.textColor,
100,
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).pickupLocation + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Text(
order.pickupLocation.trim().toString(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
],
),
],
),
Container(
height: 20.0,
width: 1.0,
color: CustomColors.grey2,
margin: const EdgeInsets.only(left: 3.0, right: 3.0),
),
Row(
children: [
Container(
margin: projectViewModel.isArabic ? EdgeInsets.only(left: 10.0) : EdgeInsets.only(right: 10.0),
width: 8,
height: 8,
decoration: containerRadius(
CustomColors.accentColor,
100,
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).dropoffLocation + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Text(
order.dropOffLocation.trim().toString(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
],
),
],
),
],
),
), ),
), ),
// Container(
// margin: EdgeInsets.only(left: 18, right: 18),
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(2),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// OrderLogItem(
// title: TranslationBase.of(context).reqId,
// value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.iD.toString(),
// ),
// OrderLogItem(
// title: TranslationBase.of(context).status,
// value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.statusText,
// ),
// OrderLogItem(
// title: TranslationBase.of(context).pickupDate,
// value: DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.amRequestViewModel.pendingAmbulanceRequestOrder.created)),
// ),
// OrderLogItem(
// title: TranslationBase.of(context).pickupLocation,
// value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.pickupLocation,
// ),
// OrderLogItem(
// title: TranslationBase.of(context).dropoffLocation,
// value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.dropOffLocation,
// ),
// OrderLogItem(
// title: TranslationBase.of(context).transportMethod,
// value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.serviceText,
// ),
// Container(
// padding: EdgeInsets.all(10),
// width: double.maxFinite,
// margin: EdgeInsets.only(bottom: 4, left: 4, right: 4),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.only(
// bottomRight: Radius.circular(12),
// bottomLeft: Radius.circular(12),
// ),
// color: Colors.white),
// child: SecondaryButton(
// color: Colors.red[900],
// textColor: Colors.white,
// label: TranslationBase.of(context).cancel,
// onTap: () {
// widget.amRequestViewModel.updatePressOrder(presOrderID: widget.amRequestViewModel.pendingAmbulanceRequestOrder.iD);
// },
// ),
// )
// ],
// ),
// ),
], ],
), ),
) )
: Column( : Column(
children: [ children: [
SizedBox( SizedBox(
@ -173,8 +374,25 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
); );
} }
String getDate(String date) { void showConfirmMessage(AmRequestViewModel model, int presOrderID) {
return date.split("T")[0]; showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg,
onTap: () {
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.updatePressOrder(presOrderID: presOrderID);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
GifLoaderDialogUtils.hideDialog(context);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
GifLoaderDialogUtils.hideDialog(context);
}
});
},
));
return;
} }
} }

@ -2,10 +2,9 @@ import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.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/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package: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';
@ -45,269 +44,229 @@ class _BillAmountState extends State<BillAmount> {
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.only(left: 12, right: 12), margin: EdgeInsets.only(left: 12, right: 12, top: 12),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).billAmount), Text(TranslationBase.of(context).billAmount, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Table( Container(
border: TableBorder.symmetric(inside: BorderSide(width: 1.0, color: Colors.grey[300]), outside: BorderSide(width: 1.0, color: Colors.grey[300])), decoration: cardRadius(12),
children: [ child: Padding(
TableRow( padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
// Text(TranslationBase.of(context).testFee,
// style: TextStyle(
// color: Colors.black,
// fontSize: 16.0,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.64,
// )),
Container( Container(
height: MediaQuery.of(context).size.height * 0.09, width: double.infinity,
decoration: BoxDecoration( padding: EdgeInsets.only(top: 10, bottom: 3),
color: Colors.white, child: Row(
borderRadius: BorderRadius.only( children: [
topLeft: Radius.circular(10.0), Expanded(
), child: _getNormalText(TranslationBase.of(context).patientShareToDo),
), ),
child: Padding( Expanded(
padding: const EdgeInsets.all(8.0), child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.price}', isBold: true),
child: Texts( )
TranslationBase.of(context).patientShareB, ],
textAlign: TextAlign.start,
color: Colors.black,
fontSize: 15,
),
), ),
), ),
mDivider(Colors.grey[200]),
Container( Container(
height: MediaQuery.of(context).size.height * 0.09, width: double.infinity,
decoration: BoxDecoration( padding: EdgeInsets.only(top: 3, bottom: 3),
color: Colors.white, child: Row(
borderRadius: BorderRadius.only( children: [
topRight: Radius.circular(10.0), Expanded(
), child: _getNormalText(TranslationBase.of(context).patientTaxToDo),
), ),
child: Padding( Expanded(
padding: const EdgeInsets.all(8.0), child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceVAT}', isBold: true),
child: Texts( )
TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.price}', ],
color: Colors.black,
textAlign: TextAlign.start,
fontSize: 15,
),
), ),
), ),
], mDivider(Colors.grey[200]),
),
TableRow(
children: [
Container( Container(
color: Colors.white, width: double.infinity,
height: MediaQuery.of(context).size.height * 0.09, padding: EdgeInsets.only(top: 3, bottom: 3),
child: Padding( child: Row(
padding: const EdgeInsets.all(8.0), children: [
child: Texts( Expanded(
TranslationBase.of(context).patientShareTax, child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo),
color: Colors.black, ),
fontSize: 15, Expanded(
textAlign: TextAlign.start, child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}', isBold: true, isTotal: true),
), )
), ],
),
Container(
height: MediaQuery.of(context).size.height * 0.09,
color: Colors.white,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceVAT}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
), ),
), ),
], ],
), ),
TableRow( ),
children: [
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).patientShareTotal,
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
bold: true,
),
),
),
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
),
),
],
),
],
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Texts( Text(TranslationBase.of(context).selectAmbulate, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
TranslationBase.of(context).selectAmbulate,
bold: false,
),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Row( Row(
children: [ children: [
Expanded( InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _ambulate = Ambulate.Wheelchair;
_ambulate = Ambulate.Wheelchair; });
}); },
}, child: Container(
child: Container( width: MediaQuery.of(context).size.width * 0.9,
decoration: BoxDecoration( child: ListTile(
shape: BoxShape.rectangle, contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
borderRadius: BorderRadius.circular(8), title: Row(
border: Border.all(color: Colors.grey, width: 0.5), children: [
color: Colors.white, Radio(
), value: Ambulate.Wheelchair,
child: ListTile( groupValue: _ambulate,
title: Text(TranslationBase.of(context).wheelchair, style: TextStyle( onChanged: (value) {
fontSize: 14.0 setState(() {
)), _ambulate = value;
leading: Radio( });
value: Ambulate.Wheelchair, },
groupValue: _ambulate, ),
onChanged: (value) { Text(
setState(() { TranslationBase.of(context).wheelchair,
_ambulate = value; style: TextStyle(
}); fontSize: 12.0,
}, letterSpacing: -0.48,
), fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
), ),
Expanded( ],
child: InkWell( ),
onTap: () { Row(
setState(() { children: [
_ambulate = Ambulate.Walker; InkWell(
}); onTap: () {
}, setState(() {
child: Container( _ambulate = Ambulate.Walker;
decoration: BoxDecoration( });
shape: BoxShape.rectangle, },
borderRadius: BorderRadius.circular(8), child: Container(
border: Border.all(color: Colors.grey, width: 0.5), width: MediaQuery.of(context).size.width * 0.9,
color: Colors.white, child: ListTile(
), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
child: ListTile( title: Row(
title: Text(TranslationBase.of(context).walker, style: TextStyle( children: [
fontSize: 14.0 Radio(
)), value: Ambulate.Walker,
leading: Radio( groupValue: _ambulate,
value: Ambulate.Walker, onChanged: (value) {
groupValue: _ambulate, setState(() {
onChanged: (value) { _ambulate = value;
setState(() { });
_ambulate = value; },
}); ),
}, Text(
), TranslationBase.of(context).walker,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
), ),
], ],
), ),
SizedBox(
height: 5,
),
Row( Row(
children: [ children: [
Expanded( InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _ambulate = Ambulate.Stretcher;
_ambulate = Ambulate.Stretcher; });
}); },
}, child: Container(
child: Container( width: MediaQuery.of(context).size.width * 0.9,
decoration: BoxDecoration( child: ListTile(
shape: BoxShape.rectangle, contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
borderRadius: BorderRadius.circular(8), title: Row(
border: Border.all(color: Colors.grey, width: 0.5), children: [
color: Colors.white, Radio(
), value: Ambulate.Stretcher,
child: ListTile( groupValue: _ambulate,
title: Text(TranslationBase.of(context).stretcher, style: TextStyle( onChanged: (value) {
fontSize: 14.0 setState(() {
)), _ambulate = value;
leading: Radio( });
value: Ambulate.Stretcher, },
groupValue: _ambulate, ),
onChanged: (value) { Text(
setState(() { TranslationBase.of(context).stretcher,
_ambulate = value; style: TextStyle(
}); fontSize: 12.0,
}, letterSpacing: -0.48,
), fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
), ),
Expanded( ],
child: InkWell( ),
onTap: () { Row(
setState(() { children: [
_ambulate = Ambulate.None; InkWell(
}); onTap: () {
}, setState(() {
child: Container( _ambulate = Ambulate.None;
decoration: BoxDecoration( });
shape: BoxShape.rectangle, },
borderRadius: BorderRadius.circular(8), child: Container(
border: Border.all(color: Colors.grey, width: 0.5), width: MediaQuery.of(context).size.width * 0.9,
color: Colors.white, child: ListTile(
), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
child: ListTile( title: Row(
title: Text(TranslationBase.of(context).none, style: TextStyle( children: [
fontSize: 14.0 Radio(
)), value: Ambulate.None,
leading: Radio( groupValue: _ambulate,
value: Ambulate.None, onChanged: (value) {
groupValue: _ambulate, setState(() {
onChanged: (value) { _ambulate = value;
setState(() { });
_ambulate = value; },
}); ),
}, Text(
), TranslationBase.of(context).none,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
@ -317,14 +276,21 @@ class _BillAmountState extends State<BillAmount> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
NewTextFields( Container(
hintText: TranslationBase.of(context).notes, decoration: cardRadius(10),
initialValue: note, child: Padding(
onChanged: (value) { padding: EdgeInsets.all(8.0),
setState(() { child: TextField(
note = value; maxLines: 5,
}); decoration: InputDecoration.collapsed(
}, hintText: TranslationBase.of(context).notes, hintStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16)),
onChanged: (value) {
setState(() {
note = value;
});
},
),
),
), ),
SizedBox( SizedBox(
height: 100, height: 100,
@ -352,4 +318,20 @@ class _BillAmountState extends State<BillAmount> {
), ),
); );
} }
_getNormalText(text, {bool isBold = false, bool isTotal = false}) {
return Text(
text,
style: TextStyle(
fontSize: isBold
? isTotal
? 16
: 12
: 10,
letterSpacing: -0.5,
color: isBold ? Colors.black : Colors.grey[700],
fontWeight: FontWeight.w600,
),
);
}
} }

@ -4,7 +4,6 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/Blood/dialogs/SelectHospitalDialog.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart';
import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart'; import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -13,12 +12,12 @@ 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/defaultButton.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/dialogs/radio_selection_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart'; import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.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:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart';
@ -51,9 +50,7 @@ class _PickupLocationState extends State<PickupLocation> {
void initState() { void initState() {
super.initState(); super.initState();
_getCurrentLocation(); _getCurrentLocation();
setState(() { setState(() {});
});
} }
_getCurrentLocation() async { _getCurrentLocation() async {
@ -64,7 +61,6 @@ class _PickupLocationState extends State<PickupLocation> {
_longitude = 0; _longitude = 0;
_latitude = 0; _latitude = 0;
}); });
} }
@override @override
@ -75,7 +71,7 @@ class _PickupLocationState extends State<PickupLocation> {
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.only(left: 12, right: 12), margin: EdgeInsets.only(left: 12, right: 12, top: 12),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -83,43 +79,66 @@ class _PickupLocationState extends State<PickupLocation> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).pickupLocation), Text(TranslationBase.of(context).pickupLocation, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 15, height: 15,
), ),
InkWell( Container(
onTap: () { padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
Navigator.push( alignment: Alignment.center,
context, decoration: BoxDecoration(
FadePage( borderRadius: BorderRadius.circular(15),
page: PickupLocationFromMap( color: Colors.white,
latitude: _latitude??0, border: Border.all(
longitude: _longitude??0, color: Color(0xffefefef),
onPick: (value) { width: 1,
setState(() {
_result = value;
});
},
)),
);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
), ),
),
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: PickupLocationFromMap(
latitude: _latitude ?? 0,
longitude: _longitude ?? 0,
onPick: (value) {
setState(() {
_result = value;
});
},
)),
);
},
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded(child: Texts(getSelectFromMapName(context))), Expanded(
Icon( child: Column(
FontAwesomeIcons.mapMarkerAlt, crossAxisAlignment: CrossAxisAlignment.start,
size: 24, children: [
color: Colors.black, Text(
) TranslationBase.of(context).selectMap,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
getSelectFromMapName(context),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon(Icons.arrow_drop_down),
], ],
), ),
), ),
@ -127,7 +146,7 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase.of(context).pickupSpot), Text(TranslationBase.of(context).pickupSpot, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -138,21 +157,27 @@ class _PickupLocationState extends State<PickupLocation> {
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).insideHome), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Checkbox( title: Row(
value: _isInsideHome, children: [
onChanged: (value) { Checkbox(
setState(() { value: _isInsideHome,
_isInsideHome = value; onChanged: (value) {
}); setState(() {
}, _isInsideHome = value;
});
},
),
Text(
TranslationBase.of(context).insideHome,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
@ -160,7 +185,7 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase.of(context).haveAppo), Text(TranslationBase.of(context).haveAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -177,25 +202,31 @@ class _PickupLocationState extends State<PickupLocation> {
} }
}, },
child: Container( child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).yes), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: HaveAppointment.YES, children: [
groupValue: _haveAppointment, Radio(
onChanged: (value) { value: HaveAppointment.YES,
if (myAppointment == null) { groupValue: _haveAppointment,
getAppointment(); onChanged: (value) {
setState(() { if (myAppointment == null) {
_haveAppointment = value; getAppointment();
}); setState(() {
} _haveAppointment = value;
}, });
}
},
),
Text(
TranslationBase.of(context).yes,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
@ -210,23 +241,29 @@ class _PickupLocationState extends State<PickupLocation> {
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).no), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: HaveAppointment.NO, children: [
groupValue: _haveAppointment, Radio(
onChanged: (value) { value: HaveAppointment.NO,
setState(() { groupValue: _haveAppointment,
_haveAppointment = value; onChanged: (value) {
myAppointment = null; setState(() {
}); _haveAppointment = value;
}, myAppointment = null;
});
},
),
Text(
TranslationBase.of(context).no,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
],
), ),
), ),
), ),
@ -249,31 +286,54 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase.of(context).dropoffLocation), Text(TranslationBase.of(context).dropoffLocation, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
InkWell( Container(
onTap: () { padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals); alignment: Alignment.center,
}, decoration: BoxDecoration(
child: Container( borderRadius: BorderRadius.circular(12),
padding: EdgeInsets.all(12), color: Colors.white,
decoration: BoxDecoration( border: Border.all(
shape: BoxShape.rectangle, color: Color(0xffefefef),
borderRadius: BorderRadius.circular(8), width: 1,
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
), ),
),
child: InkWell(
onTap: () {
confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals);
},
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName(TranslationBase.of(context).selectHospital)), Expanded(
Icon( child: Column(
Icons.arrow_drop_down, crossAxisAlignment: CrossAxisAlignment.start,
size: 24, children: [
color: Colors.black, Text(
) TranslationBase.of(context).selectHospital,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
getHospitalName(""),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon(Icons.arrow_drop_down),
], ],
), ),
), ),
@ -284,26 +344,54 @@ class _PickupLocationState extends State<PickupLocation> {
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).pickupLocation), Text(TranslationBase.of(context).pickupLocation, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 15, height: 15,
), ),
InkWell( Container(
onTap: () { padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals); alignment: Alignment.center,
}, decoration: BoxDecoration(
child: Container( borderRadius: BorderRadius.circular(12),
padding: EdgeInsets.all(12), color: Colors.white,
decoration: BoxDecoration( border: Border.all(
shape: BoxShape.rectangle, color: Color(0xffefefef),
borderRadius: BorderRadius.circular(8), width: 1,
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
), ),
),
child: InkWell(
onTap: () {
confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals);
},
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).selectHospital,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
getHospitalName(""),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon( Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
size: 24, size: 24,
@ -316,44 +404,67 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase.of(context).dropoffLocation), Text(TranslationBase.of(context).dropoffLocation, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
InkWell( Container(
onTap: () { padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
Navigator.push( alignment: Alignment.center,
context, decoration: BoxDecoration(
FadePage( borderRadius: BorderRadius.circular(12),
page: PickupLocationFromMap( color: Colors.white,
latitude: _latitude, border: Border.all(
longitude: _longitude, color: Color(0xffefefef),
onPick: (value) { width: 1,
setState(() {
_result = value;
});
},
),
),
);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
), ),
),
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: PickupLocationFromMap(
latitude: _latitude,
longitude: _longitude,
onPick: (value) {
setState(() {
_result = value;
});
},
),
),
);
},
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded(child: Texts(getSelectFromMapName(context))), Expanded(
Icon( child: Column(
FontAwesomeIcons.mapMarkerAlt, crossAxisAlignment: CrossAxisAlignment.start,
size: 24, children: [
color: Colors.black, Text(
) TranslationBase.of(context).selectMap,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
Text(
getSelectFromMapName(context),
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
],
),
),
Icon(Icons.arrow_drop_down),
], ],
), ),
), ),
@ -411,7 +522,7 @@ class _PickupLocationState extends State<PickupLocation> {
widget.patientER_RC.transportationDetails.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); widget.patientER_RC.transportationDetails.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now());
widget.patientER_RC.transportationDetails.pickupLocationName = widget.patientER.direction == 0 ? _selectedHospital.name : _result.formattedAddress; widget.patientER_RC.transportationDetails.pickupLocationName = widget.patientER.direction == 0 ? _selectedHospital.name : _result.formattedAddress;
widget.patientER_RC.projectID = widget.amRequestViewModel.user.projectID; widget.patientER_RC.projectID = widget.amRequestViewModel.user.projectID;
widget.patientER_RC.patientID = widget.amRequestViewModel.user.patientID.toString(); widget.patientER_RC.patientID = widget.amRequestViewModel.user.patientID;
widget.patientER_RC.transportationDetails.requesterIsOutSA = false; widget.patientER_RC.transportationDetails.requesterIsOutSA = false;
// widget.patientER.lineItemNo = 0; // widget.patientER.lineItemNo = 0;
widget.patientER_RC.transportationDetails.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber; widget.patientER_RC.transportationDetails.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber;
@ -442,16 +553,22 @@ class _PickupLocationState extends State<PickupLocation> {
); );
} }
int _selectedHospitalIndex = -1;
void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) { void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < hospitals.length; i++) RadioSelectionDialogModel(hospitals[i].name + ' ${hospitals[i].distanceInKilometers} ' + TranslationBase.of(context).km, i),
];
showDialog( showDialog(
context: context, context: context,
child: SelectHospitalDialog( child: RadioSelectionDialog(
hospitals: hospitals, listData: list,
selectedHospital: _selectedHospital, selectedIndex: _selectedHospitalIndex,
onValueSelected: (value) { isScrollable: true,
setState(() { onValueSelected: (index) {
_selectedHospital = value; _selectedHospitalIndex = index;
}); _selectedHospital = hospitals[index];
setState(() {});
}, },
), ),
); );
@ -462,7 +579,7 @@ class _PickupLocationState extends State<PickupLocation> {
} }
String getSelectFromMapName(context) { String getSelectFromMapName(context) {
return _result != null ? _result.formattedAddress : TranslationBase.of(context).selectMap; return _result != null ? _result.formattedAddress : "";
} }
getAppointment() { getAppointment() {

@ -5,8 +5,8 @@ import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package: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';
@ -71,56 +71,77 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase.of(context).transportHeading), Text(TranslationBase.of(context).transportHeading, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
...List.generate( Container(
widget.amRequestViewModel.amRequestModeList.length, margin: EdgeInsets.only(top: 12),
(index) => InkWell( decoration: cardRadius(12),
onTap: () { child: Column(
setState(() { crossAxisAlignment: CrossAxisAlignment.start,
_erTransportationMethod = widget.amRequestViewModel.amRequestModeList[index]; children: [
}); ...List.generate(
}, widget.amRequestViewModel.amRequestModeList.length,
child: Container( (index) => InkWell(
margin: EdgeInsets.all(5), onTap: () {
decoration: BoxDecoration( setState(() {
shape: BoxShape.rectangle, _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[index];
borderRadius: BorderRadius.circular(8), });
border: Border.all(color: Colors.grey, width: 0.5), },
color: Colors.white, child: Container(
), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
flex: 3, flex: 4,
child: ListTile( child: ListTile(
title: Texts(projectViewModel.isArabic ? widget.amRequestViewModel.amRequestModeList[index].textN : widget.amRequestViewModel.amRequestModeList[index].text), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: widget.amRequestViewModel.amRequestModeList[index], children: [
groupValue: _erTransportationMethod, Radio(
onChanged: (value) { value: widget.amRequestViewModel.amRequestModeList[index],
setState(() { groupValue: _erTransportationMethod,
_erTransportationMethod = value; onChanged: (value) {
}); setState(() {
}, _erTransportationMethod = value;
), });
},
),
Flexible(
child: Text(
projectViewModel.isArabic ? widget.amRequestViewModel.amRequestModeList[index].textN : widget.amRequestViewModel.amRequestModeList[index].text,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
),
],
),
),
),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context).sar + ' ${widget.amRequestViewModel.amRequestModeList[index].price}',
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
)
],
), ),
), ),
Expanded( ),
flex: 1,
child: Texts(TranslationBase.of(context).sar + ' ${widget.amRequestViewModel.amRequestModeList[index].price}'),
)
],
), ),
), ],
), ),
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts(TranslationBase.of(context).directionHeading), Text(TranslationBase.of(context).directionHeading, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox(
height: 5,
),
Container( Container(
width: double.maxFinite, width: double.maxFinite,
child: Row( child: Row(
@ -136,22 +157,26 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
}, },
child: Container( child: Container(
width: double.maxFinite, width: double.maxFinite,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).toHospital), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: Direction.ToHospital, children: [
groupValue: _direction, Radio(
onChanged: (value) { value: Direction.ToHospital,
setState(() { groupValue: _direction,
_direction = value; onChanged: (value) {
}); setState(() {
}, _direction = value;
});
},
),
Text(TranslationBase.of(context).toHospital,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
)),
],
), ),
), ),
), ),
@ -166,22 +191,26 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
}, },
child: Container( child: Container(
width: double.maxFinite, width: double.maxFinite,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).fromHospital), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: Direction.FromHospital, children: [
groupValue: _direction, Radio(
onChanged: (value) { value: Direction.FromHospital,
setState(() { groupValue: _direction,
_direction = value; onChanged: (value) {
}); setState(() {
}, _direction = value;
});
},
),
Text(TranslationBase.of(context).fromHospital,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
)),
],
), ),
), ),
), ),
@ -197,7 +226,7 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts(TranslationBase.of(context).wayHeading), Text(TranslationBase.of(context).wayHeading, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -213,22 +242,26 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).oneDirec), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: Way.OneWay, children: [
groupValue: _way, Radio(
onChanged: (value) { value: Way.OneWay,
setState(() { groupValue: _way,
_way = value; onChanged: (value) {
}); setState(() {
}, _way = value;
});
},
),
Text(TranslationBase.of(context).oneDirec,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
)),
],
), ),
), ),
), ),
@ -242,22 +275,26 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile( child: ListTile(
title: Texts(TranslationBase.of(context).twoDirec), contentPadding: EdgeInsets.only(left: 0.0, right: 0.0),
leading: Radio( title: Row(
value: Way.TwoWays, children: [
groupValue: _way, Radio(
onChanged: (value) { value: Way.TwoWays,
setState(() { groupValue: _way,
_way = value; onChanged: (value) {
}); setState(() {
}, _way = value;
});
},
),
Text(TranslationBase.of(context).twoDirec,
style: TextStyle(
fontSize: 12.0,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
)),
],
), ),
), ),
), ),
@ -302,7 +339,7 @@ class _SelectTransportationMethodState extends State<SelectTransportationMethod>
widget.patientER_RC.transportationDetails.direction = _direction == Direction.ToHospital ? 1 : 0; widget.patientER_RC.transportationDetails.direction = _direction == Direction.ToHospital ? 1 : 0;
widget.patientER_RC.transportationDetails.tripType = _way == Way.TwoWays ? 0 : 1; widget.patientER_RC.transportationDetails.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER_RC.transportationDetails.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1); widget.patientER_RC.transportationDetails.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER_RC.transportationDetails.transportationType = _erTransportationMethod.id.toString(); widget.patientER_RC.transportationDetails.transportationType = _erTransportationMethod.iD.toString();
widget.patientER_RC.patientERTransportationMethod = _erTransportationMethod; widget.patientER_RC.patientERTransportationMethod = _erTransportationMethod;
widget.patientER_RC.transportationDetails.pickupUrgency = 1; widget.patientER_RC.transportationDetails.pickupUrgency = 1;
// widget.patientER.orderServiceID = _orderService.getIdOrderService(); // widget.patientER.orderServiceID = _orderService.getIdOrderService();

@ -3,8 +3,8 @@ import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package: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';
@ -31,91 +31,73 @@ class _SummaryState extends State<Summary> {
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only(left: 12, right: 12), margin: EdgeInsets.only(left: 12, right: 12, top: 12),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).RRTSummary), Text(TranslationBase.of(context).RRTSummary, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Container( Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
decoration: BoxDecoration( // margin: EdgeInsets.only(top: 12),
color: Colors.white, decoration: cardRadius(12),
borderRadius: BorderRadius.circular(12),
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( _getNormalText(TranslationBase.of(context).transportMethod),
TranslationBase.of(context).transportMethod,
color: Colors.grey,
),
projectViewModel.isArabic projectViewModel.isArabic
? Texts( ? _getNormalText(
'${widget.patientER_RC.patientERTransportationMethod.textN}', '${widget.patientER_RC.patientERTransportationMethod.textN}',
bold: true, isBold: true,
) )
: Texts( : _getNormalText(
'${widget.patientER_RC.patientERTransportationMethod.text}', '${widget.patientER_RC.patientERTransportationMethod.text}',
bold: true, isBold: true,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts( _getNormalText(TranslationBase.of(context).directions),
TranslationBase.of(context).directions, _getNormalText(
color: Colors.grey,
),
Texts(
widget.patientER_RC.transportationDetails.direction == 0 ? TranslationBase.of(context).toHospital : TranslationBase.of(context).fromHospital, widget.patientER_RC.transportationDetails.direction == 0 ? TranslationBase.of(context).toHospital : TranslationBase.of(context).fromHospital,
bold: true, isBold: true,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts( _getNormalText(
TranslationBase.of(context).pickupLocation, TranslationBase.of(context).pickupLocation,
color: Colors.grey,
), ),
Texts( _getNormalText(
'${widget.patientER_RC.transportationDetails.pickupLocationName}', '${widget.patientER_RC.transportationDetails.pickupLocationName}',
bold: true, isBold: true,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts( _getNormalText(TranslationBase.of(context).dropoffLocation),
TranslationBase.of(context).dropoffLocation, _getNormalText(
color: Colors.grey,
),
Texts(
'${widget.patientER_RC.transportationDetails.dropoffLocationName}', '${widget.patientER_RC.transportationDetails.dropoffLocationName}',
bold: true, isBold: true,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts( _getNormalText(TranslationBase.of(context).selectAmbulate),
TranslationBase.of(context).selectAmbulate, _getNormalText(
color: Colors.grey,
),
Texts(
'${widget.patientER_RC.transportationDetails.ambulateTitle}', '${widget.patientER_RC.transportationDetails.ambulateTitle}',
bold: true, isBold: true,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Texts( _getNormalText(TranslationBase.of(context).notes),
TranslationBase.of(context).notes, _getNormalText(
color: Colors.grey,
),
Texts(
'${widget.patientER_RC.transportationDetails.notes ?? '---'}', '${widget.patientER_RC.transportationDetails.notes ?? '---'}',
bold: true, isBold: true,
), ),
SizedBox( SizedBox(
height: 8, height: 8,
@ -126,23 +108,26 @@ class _SummaryState extends State<Summary> {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Texts( Text(TranslationBase.of(context).billAmount, style: TextStyle(fontSize: 16.0, letterSpacing: -0.64, fontWeight: FontWeight.w600)),
TranslationBase.of(context).billAmount,
textAlign: TextAlign.start,
),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Container( Container(
height: 55, height: 55,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), decoration: cardRadius(12),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(TranslationBase.of(context).patientShareTotal + ':'), Texts(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}')], children: [
_getNormalText(TranslationBase.of(context).patientShareTotal + ':'),
Container(
padding: EdgeInsets.only(left: 20.0, right: 20.0),
child: _getNormalText(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}', isBold: true, isTotal: true)
),
],
), ),
), ),
SizedBox(height: 130), SizedBox(height: 50),
], ],
), ),
), ),
@ -156,4 +141,20 @@ class _SummaryState extends State<Summary> {
), ),
); );
} }
_getNormalText(text, {bool isBold = false, bool isTotal = false}) {
return Text(
text,
style: TextStyle(
fontSize: isBold
? isTotal
? 16
: 12
: 10,
letterSpacing: -0.5,
color: isBold ? Colors.black : Colors.grey[700],
fontWeight: FontWeight.w600,
),
);
}
} }

@ -9,7 +9,6 @@ import 'package:provider/provider.dart';
import '../../uitl/translations_delegate_base.dart'; import '../../uitl/translations_delegate_base.dart';
import 'AmbulanceReq.dart'; import 'AmbulanceReq.dart';
import 'EdOnline/DdServicesPage.dart';
import 'NearestEr.dart'; import 'NearestEr.dart';
class ErOptions extends StatefulWidget { class ErOptions extends StatefulWidget {
@ -75,26 +74,26 @@ class _ErOptionsState extends State<ErOptions> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
// Navigator.push(context, FadePage(page: DdServicesPage())); if (rrtLocked) Navigator.push(context, FadePage(page: RRTMainScreen()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: "ED", title: TranslationBase.of(context).RRTTitle,
imagePath: 'assets/images/new-design/AM.PNG', imagePath: 'assets/images/new-design/AM.PNG',
subTitle: TranslationBase.of(context).service, subTitle: TranslationBase.of(context).RRTSubTitle,
isPngImage: true, isPngImage: true,
isEnable: false, isEnable: rrtLocked,
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
if(rrtLocked) Navigator.push(context, FadePage(page: RRTMainScreen())); // Navigator.push(context, FadePage(page: DdServicesPage()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).rrtService, title: "ED",
imagePath: 'assets/images/new-design/AM.PNG', imagePath: 'assets/images/new-design/AM.PNG',
subTitle: TranslationBase.of(context).service, subTitle: TranslationBase.of(context).service,
isPngImage: true, isPngImage: true,
isEnable: rrtLocked, isEnable: false,
), ),
), ),
], ],

@ -1,9 +1,18 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/AmbulanceRequestOrdersModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/ConfirmWithMessageDialog.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';
class OrderLogPage extends StatelessWidget { class OrderLogPage extends StatelessWidget {
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
@ -12,64 +21,231 @@ class OrderLogPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
void showConfirmMessage(AmRequestViewModel model, int presOrderID) {
showDialog(
context: context,
child: ConfirmWithMessageDialog(
message: TranslationBase.of(context).cancelOrderMsg,
onTap: () {
Future.delayed(new Duration(milliseconds: 300)).then((value) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.updatePressOrder(presOrderID: presOrderID);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
GifLoaderDialogUtils.hideDialog(context);
} else {
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
GifLoaderDialogUtils.hideDialog(context);
}
});
},
));
return;
}
return Container( return Container(
margin: EdgeInsets.all(10), // margin: EdgeInsets.all(10),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
child: ListView.builder( child: amRequestViewModel.patientAmbulanceRequestOrdersList.length > 0
itemCount: amRequestViewModel.patientAmbulanceRequestOrdersList.length, ? ListView.builder(
itemBuilder: (context, index) => Container( padding: EdgeInsets.all(21),
margin: EdgeInsets.all(8), itemCount: amRequestViewModel.patientAmbulanceRequestOrdersList.length,
decoration: BoxDecoration( itemBuilder: (context, index) {
color: Colors.white, AmbulanceRequestOrdersModel order = amRequestViewModel.patientAmbulanceRequestOrdersList[index];
borderRadius: BorderRadius.circular(2),
), int status = order.statusId;
child: Column( String _statusDisp = order.statusText;
crossAxisAlignment: CrossAxisAlignment.start, Color _color;
children: [ if (status == 1) {
OrderLogItem( //pending
title: TranslationBase.of(context).reqId, _color = Color(0xffCC9B14);
value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].id.toString(), } else if (status == 2) {
), //processing
OrderLogItem( _color = Color(0xff2E303A);
title: TranslationBase.of(context).orderStatus, } else if (status == 3) {
value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].statusText, //completed
), _color = Color(0xff359846);
OrderLogItem( } else if (status == 4 || status == 6 || status == 7) {
title: TranslationBase.of(context).pickupDate, //cancel // Rejected
value: getDate(amRequestViewModel.patientAmbulanceRequestOrdersList[index].created), _color = Color(0xffD02127);
), }
OrderLogItem(
title: TranslationBase.of(context).pickupLocation, return Container(
value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].pickupLocation,
),
OrderLogItem(
title: TranslationBase.of(context).dropoffLocation,
value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].dropOffLocation,
),
if (amRequestViewModel.patientAmbulanceRequestOrdersList[index].statusId == 1)
Container(
padding: EdgeInsets.all(10),
width: double.maxFinite,
margin: EdgeInsets.only(bottom: 4, left: 4, right: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: _color,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
boxShadow: [
BoxShadow(
color: Color(0xff000000).withOpacity(.05),
blurRadius: 27,
offset: Offset(0, -3),
),
],
),
child: Container(
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomRight: Radius.circular(12), bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: Radius.circular(12), topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
), ),
color: Colors.white), ),
child: SecondaryButton( child: Column(
color: Colors.red[900], crossAxisAlignment: CrossAxisAlignment.start,
textColor: Colors.white, children: [
label: TranslationBase.of(context).cancel, Row(
onTap: () { crossAxisAlignment: CrossAxisAlignment.start,
amRequestViewModel.updatePressOrder(presOrderID: amRequestViewModel.pendingAmbulanceRequestOrder.id); children: [
}, Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_statusDisp,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 6),
Text(
'${TranslationBase.of(context).requestID}: ${order.iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).pickupDate + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(order.created)),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10),
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).transportMethod + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Expanded(
child: Text(
order.serviceText,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 16 / 10),
),
),
],
),
SizedBox(
height: 20.0,
),
],
),
),
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
SizedBox(height: 12),
if (order.statusId == 1 || order.statusId == 2)
InkWell(
onTap: () {
showConfirmMessage(amRequestViewModel, order.iD);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: Color(0xffD02127),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(10),
),
child: Text(
TranslationBase.of(context).cancel_nocaps,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
],
),
],
),
Row(
children: [
Container(
margin: projectViewModel.isArabic ? EdgeInsets.only(left: 10.0) : EdgeInsets.only(right: 10.0),
width: 8,
height: 8,
decoration: containerRadius(
CustomColors.textColor,
100,
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).pickupLocation + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Text(
order.pickupLocation.trim().toString(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
],
),
],
),
Container(
height: 20.0,
width: 1.0,
color: CustomColors.grey2,
margin: const EdgeInsets.only(left: 3.0, right: 3.0),
),
Row(
children: [
Container(
margin: projectViewModel.isArabic ? EdgeInsets.only(left: 10.0) : EdgeInsets.only(right: 10.0),
width: 8,
height: 8,
decoration: containerRadius(
CustomColors.accentColor,
100,
),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).dropoffLocation + ": ",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
Text(
order.dropOffLocation.trim().toString(),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48),
),
],
),
],
),
],
),
), ),
) );
], })
), : getNoDataWidget(context),
),
),
); );
} }

@ -1,15 +1,15 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.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-main-screen.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class RRTLogPage extends StatefulWidget { class RRTLogPage extends StatefulWidget {
final List<GetCMCAllOrdersResponseModel> orders; final List<GetCMCAllOrdersResponseModel> orders;
@ -36,13 +36,15 @@ class RRTLogPageState extends State<RRTLogPage> {
viewModel = vm, viewModel = vm,
}, },
builder: (ctx, vm, widgetState) { builder: (ctx, vm, widgetState) {
return ListView.builder( return widget.orders.length > 0
itemCount: widget.orders.length, ? ListView.builder(
padding: EdgeInsets.all(21), itemCount: widget.orders.length,
itemBuilder: (ctx, idx) { padding: EdgeInsets.all(21),
var order = widget.orders[idx]; itemBuilder: (ctx, idx) {
return RRTLogListItem(order, onCancel: deleteOrder); var order = widget.orders[idx];
}); return RRTLogListItem(order, onCancel: deleteOrder);
})
: getNoDataWidget(context);
}); });
} }

@ -103,21 +103,21 @@ class RRTLogListItemState extends State<RRTLogListItem> {
'${TranslationBase.of(context).requestID}: ${widget.order.iD}', '${TranslationBase.of(context).requestID}: ${widget.order.iD}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
Row( // Row(
crossAxisAlignment: CrossAxisAlignment.start, // crossAxisAlignment: CrossAxisAlignment.start,
children: [ // children: [
Text( // Text(
TranslationBase.of(context).locationa + ": ", // TranslationBase.of(context).locationa + ": ",
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),
), // ),
Expanded( // Expanded(
child: Text( // child: Text(
widget.order.projectName.toString(), // widget.order.projectName.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), // style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), // ),
), // ),
], // ],
), // ),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [

@ -43,7 +43,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
static CameraPosition cameraPosition = CameraPosition( static CameraPosition cameraPosition = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962), target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746, zoom: 17,
); );
LatLng currentPostion; LatLng currentPostion;
@ -71,7 +71,6 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
_updatePosition(camera); _updatePosition(camera);
}, },
onMapCreated: () { onMapCreated: () {
// goToCurrentLocation();
_getUserLocation(); _getUserLocation();
setState(() {}); setState(() {});
}, },
@ -97,8 +96,6 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
latitude = double.parse(latLongArr[0]); latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]); longitude = double.parse(latLongArr[1]);
print("sssss1 " + latitude.toString());
print("sssss2 " + longitude.toString());
currentPostion = LatLng(latitude, longitude); currentPostion = LatLng(latitude, longitude);
setMap(); setMap();
} }
@ -108,7 +105,7 @@ class RRTRequestPickupAddressPageState extends State<RRTRequestPickupAddressPage
setState(() { setState(() {
cameraPosition = CameraPosition( cameraPosition = CameraPosition(
target: currentPostion, target: currentPostion,
zoom: 14.4746, zoom: 16,
); );
appMap.moveTo(cameraPostion: cameraPosition); appMap.moveTo(cameraPostion: cameraPosition);
selectedAddress.latLong = currentPostion.latitude.toString() + "," + currentPostion.longitude.toString(); selectedAddress.latLong = currentPostion.latitude.toString() + "," + currentPostion.longitude.toString();

@ -63,7 +63,7 @@ class RRTPlaceOrderPage extends StatelessWidget {
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
child: Image.network( child: Image.network(
"https://maps.googleapis.com/maps/api/staticmap?center=$lat,$lng &zoom=16&size=800x600&maptype=roadmap&markers=color:red%7C$lat,$lng&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8", "https://maps.googleapis.com/maps/api/staticmap?center=$lat,$lng &zoom=17&size=800x600&maptype=roadmap&markers=color:red%7C$lat,$lng&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8",
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),

@ -1,5 +1,4 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; import 'package:diplomaticquarterapp/models/rrt/service_price.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart';
@ -10,6 +9,7 @@ import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.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/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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';
@ -65,7 +65,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
child: Text(TranslationBase.of(context).youCanPayByTheFollowingOptions, child: Text(TranslationBase.of(context).youCanPayByTheFollowingOptions,
style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2)), style: TextStyle(fontSize: 13, color: Theme.of(context).appBarTheme.color, fontWeight: FontWeight.w500), maxLines: 2)),
paymentOptions(), Container(margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0), child: getPaymentMethods())
], ],
), ),
), ),

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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';
@ -12,216 +14,331 @@ class StepsWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); return Container(
return projectViewModel.isArabic? width: double.infinity,
Stack( padding: EdgeInsets.only(left: 12, right: 12, bottom: 12),
children: [ child: Row(
Container( children: [
height: 50, Expanded(
width: MediaQuery.of(context).size.width, child: showProgress(
color: Colors.transparent, title: TranslationBase.of(context).transportation,
child: Center( status: index == 0
child: Divider( ? TranslationBase.of(context).inPrgress
color: Colors.grey, : index > 0
height: 0.75, ? TranslationBase.of(context).completed
thickness: 0.75, : TranslationBase.of(context).locked,
color: index == 0 ? CustomColors.orange : CustomColors.green,
), ),
), ),
), Expanded(
Positioned( child: showProgress(
top: 10, title: TranslationBase.of(context).locationa,
right: 0, status: index == 1
child: InkWell( ? TranslationBase.of(context).inPrgress
onTap: () => changeCurrentTab(0), : index > 1
child: Container( ? TranslationBase.of(context).completed
width: 35, : TranslationBase.of(context).locked,
height: 35, color: index == 1
decoration: BoxDecoration( ? CustomColors.orange
border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75), : index > 1
shape: BoxShape.circle, ? CustomColors.green
color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white, : CustomColors.grey2,
),
child: Center(
child: Texts(
'1',
color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800],
),
),
), ),
), ),
), Expanded(
Positioned( child: showProgress(
top: 10, title: TranslationBase.of(context).otherInfo,
right: MediaQuery.of(context).size.width * 0.3, status: index == 2
child: InkWell( ? TranslationBase.of(context).inPrgress
onTap: () => index >= 2 ? changeCurrentTab(1) : null, : index > 2
child: Container( ? TranslationBase.of(context).completed
width: 35, : TranslationBase.of(context).locked,
height: 35, color: index == 2
decoration: BoxDecoration( ? CustomColors.orange
border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75), : index > 2
shape: BoxShape.circle, ? CustomColors.green
color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white, : CustomColors.grey2,
),
child: Center(
child: Texts(
'2',
color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
),
),
), ),
), ),
), showProgress(
Positioned( title: TranslationBase.of(context).RRTSummary,
top: 10, status: index == 3 ? TranslationBase.of(context).inPrgress : TranslationBase.of(context).locked,
right: MediaQuery.of(context).size.width * 0.6, color: index == 3
child: InkWell( ? CustomColors.orange
onTap: () => index >= 3 ? changeCurrentTab(2) : null, : index > 4
child: Container( ? CustomColors.green
width: 35, : CustomColors.grey2,
height: 35, isNeedBorder: false,
decoration: BoxDecoration(
shape: BoxShape.circle,
border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75),
color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'3',
color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
),
),
),
), ),
), ],
Positioned( ),
top: 10, );
left: 0,
child: InkWell(
onTap: () => index == 2 ?changeCurrentTab(3):null,
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
border: Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle, // return projectViewModel.isArabic?
color: index == 3 ? Colors.grey[800] : Colors.white, // Stack(
), // children: [
child: Center( // Container(
child: Texts( // height: 50,
'4', // width: MediaQuery.of(context).size.width,
color: index == 3 ? Colors.white : Colors.grey[800], // color: Colors.transparent,
), // child: Center(
), // child: Divider(
), // color: Colors.grey,
), // height: 0.75,
), // thickness: 0.75,
], // ),
): // ),
Stack( // ),
// Positioned(
// top: 10,
// right: 0,
// child: InkWell(
// onTap: () => changeCurrentTab(0),
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75),
// shape: BoxShape.circle,
// color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white,
// ),
// child: Center(
// child: Texts(
// '1',
// color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// Positioned(
// top: 10,
// right: MediaQuery.of(context).size.width * 0.3,
// child: InkWell(
// onTap: () => index >= 2 ? changeCurrentTab(1) : null,
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75),
// shape: BoxShape.circle,
// color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
// ),
// child: Center(
// child: Texts(
// '2',
// color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// Positioned(
// top: 10,
// right: MediaQuery.of(context).size.width * 0.6,
// child: InkWell(
// onTap: () => index >= 3 ? changeCurrentTab(2) : null,
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75),
// color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
// ),
// child: Center(
// child: Texts(
// '3',
// color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// Positioned(
// top: 10,
// left: 0,
// child: InkWell(
// onTap: () => index == 2 ?changeCurrentTab(3):null,
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// border: Border.all(color: Colors.black,width: 0.75),
//
// shape: BoxShape.circle,
// color: index == 3 ? Colors.grey[800] : Colors.white,
// ),
// child: Center(
// child: Texts(
// '4',
// color: index == 3 ? Colors.white : Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// ],
// ):
// Stack(
// children: [
// Container(
// height: 50,
// width: MediaQuery.of(context).size.width,
// color: Colors.transparent,
// child: Center(
// child: Divider(
// color: Colors.grey,
// height: 0.75,
// thickness: 0.75,
// ),
// ),
// ),
// Positioned(
// top: 10,
// left: 0,
// child: InkWell(
// onTap: () => changeCurrentTab(0),
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75),
// shape: BoxShape.circle,
// color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white,
// ),
// child: Center(
// child: Texts(
// '1',
// color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// Positioned(
// top: 10,
// left: MediaQuery.of(context).size.width * 0.3,
// child: InkWell(
// onTap: () => index >= 2 ? changeCurrentTab(1) : null,
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75),
// shape: BoxShape.circle,
// color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
// ),
// child: Center(
// child: Texts(
// '2',
// color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// Positioned(
// top: 10,
// left: MediaQuery.of(context).size.width * 0.6,
// child: InkWell(
// onTap: () => index >= 3 ? changeCurrentTab(2) : null,
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75),
// color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
// ),
// child: Center(
// child: Texts(
// '3',
// color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// Positioned(
// top: 10,
// right: 0,
// child: InkWell(
// onTap: () => index == 2 ?changeCurrentTab(3):null,
// child: Container(
// width: 35,
// height: 35,
// decoration: BoxDecoration(
// border: Border.all(color: Colors.black,width: 0.75),
//
// shape: BoxShape.circle,
// color: index == 3 ? Colors.grey[800] : Colors.white,
// ),
// child: Center(
// child: Texts(
// '4',
// color: index == 3 ? Colors.white : Colors.grey[800],
// ),
// ),
// ),
// ),
// ),
// ],
// );
}
Widget showProgress({String title, String status, Color color, bool isNeedBorder = true}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Column(
height: 50, crossAxisAlignment: CrossAxisAlignment.start,
width: MediaQuery.of(context).size.width, children: [
color: Colors.transparent, Row(
child: Center( children: [
child: Divider( Container(
color: Colors.grey, width: 26,
height: 0.75, height: 26,
thickness: 0.75, decoration: containerRadius(color, 200),
), child: Icon(
), Icons.done,
), color: Colors.white,
Positioned( size: 16,
top: 10, ),
left: 0,
child: InkWell(
onTap: () => changeCurrentTab(0),
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle,
color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'1',
color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800],
),
),
),
),
),
Positioned(
top: 10,
left: MediaQuery.of(context).size.width * 0.3,
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle,
color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'2',
color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
), ),
), if (isNeedBorder)
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: mDivider(Colors.grey),
)),
],
), ),
), mHeight(8),
), Text(
Positioned( title,
top: 10, style: TextStyle(
left: MediaQuery.of(context).size.width * 0.6, fontSize: 11,
child: InkWell( fontWeight: FontWeight.w600,
onTap: () => index >= 3 ? changeCurrentTab(2) : null, letterSpacing: -0.44,
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
shape: BoxShape.circle,
border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75),
color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'3',
color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
),
), ),
), ),
), mHeight(2),
), Container(
Positioned( padding: EdgeInsets.all(5),
top: 10, decoration: containerRadius(color.withOpacity(0.2), 4),
right: 0, child: Text(
child: InkWell( status,
onTap: () => index == 2 ?changeCurrentTab(3):null, style: TextStyle(
child: Container( fontSize: 8,
width: 35, fontWeight: FontWeight.w600,
height: 35, letterSpacing: -0.32,
decoration: BoxDecoration( color: color,
border: Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle,
color: index == 3 ? Colors.grey[800] : Colors.white,
),
child: Center(
child: Texts(
'4',
color: index == 3 ? Colors.white : Colors.grey[800],
), ),
), ),
), ),
), ],
), )
], ],
); );
} }

@ -1,8 +1,6 @@
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/service/AuthenticatedUserObject.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/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
@ -20,7 +18,10 @@ 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/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_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:flutter/material.dart'; import 'package:flutter/material.dart';
@ -40,7 +41,7 @@ class ToDo extends StatefulWidget {
bool isShowAppBar = true; bool isShowAppBar = true;
Function onBackClick; Function onBackClick;
ToDo({@required this.isShowAppBar,this.onBackClick}); ToDo({@required this.isShowAppBar, this.onBackClick});
@override @override
_ToDoState createState() => _ToDoState(); _ToDoState createState() => _ToDoState();
@ -49,11 +50,7 @@ class ToDo extends StatefulWidget {
class _ToDoState extends State<ToDo> { class _ToDoState extends State<ToDo> {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
CountdownTimerController controller; CountdownTimerController controller;
@ -63,7 +60,7 @@ class _ToDoState extends State<ToDo> {
void initState() { void initState() {
widget.patientShareResponse = new PatientShareResponse(); widget.patientShareResponse = new PatientShareResponse();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (authenticatedUserObject.isLogin) getPatientData(); getPatientAppointmentHistory();
}); });
super.initState(); super.initState();
imagesInfo imagesInfo
@ -85,7 +82,7 @@ class _ToDoState extends State<ToDo> {
showNewAppBarTitle: true, showNewAppBarTitle: true,
icon: "assets/images/new/bottom_nav/todo.svg", icon: "assets/images/new/bottom_nav/todo.svg",
description: TranslationBase.of(context).infoTodo, description: TranslationBase.of(context).infoTodo,
onTap:widget.onBackClick, onTap: widget.onBackClick,
backgroundColor: CustomColors.appBackgroudGrey2Color, backgroundColor: CustomColors.appBackgroudGrey2Color,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
@ -98,207 +95,353 @@ class _ToDoState extends State<ToDo> {
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length, itemCount: widget.appoList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
print("ttt " + getNextActionImage(widget.appoList[index].nextAction));
print("ttt " + widget.appoList[index].nextAction.toString());
return Container( return Container(
margin: EdgeInsets.all(10.0), width: double.infinity,
margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0),
decoration: cardRadius(12),
padding: EdgeInsets.all(16),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Row(
child: Card( mainAxisAlignment: MainAxisAlignment.spaceBetween,
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0), children: [
color: Colors.white, Row(
shape: RoundedRectangleBorder( crossAxisAlignment: CrossAxisAlignment.start,
borderRadius: BorderRadius.circular(10), children: [
Padding(
padding: const EdgeInsets.only(top: 4.0),
child: widget.appoList[index].clinicID == 265
? Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/drive-thru.svg"),
)
: widget.appoList[index].isLiveCareAppointment
? SvgPicture.asset("assets/images/new/virtual.svg")
: SvgPicture.asset("assets/images/new/hospital-visit.svg"),
// SvgPicture.asset("assets/images/new/virtual.svg"),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text(
widget.appoList[index].clinicID == 265
? TranslationBase.of(context).drivethruAppo
: widget.appoList[index].isLiveCareAppointment
? TranslationBase.of(context).liveCareAppo
: TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
),
Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: CountdownTimer(
controller: new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) {
return time != null
? Text(
'${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} ' +
TranslationBase.of(context).upcomingTimeLeft,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48))
: Container();
},
),
),
],
),
],
),
Container(
child: InkWell(
onTap: () {
performNextAction(widget.appoList[index]);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: getNextActionButtonColor(widget.appoList[index].nextAction),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6),
),
child: Text(
getNextActionText(widget.appoList[index].nextAction),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
),
),
),
),
],
),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
url: widget.appoList[index].doctorImageURL,
width: 52,
height: 52,
), ),
child: Container( SizedBox(width: 11),
width: MediaQuery.of(context).size.width, Expanded(
padding: EdgeInsets.all(10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName, projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName, projectViewModel.isArabic),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Image.asset("assets/images/new-design/time_icon.png", width: 20.0, height: 20.0), RatingBar.readOnly(
Container( initialRating: widget.appoList[index].actualDoctorRate.toDouble(),
width: MediaQuery.of(context).size.width * 0.4, size: 16.0,
margin: EdgeInsets.only(left: 10.0, right: 10.0), filledColor: Color(0XFFD02127),
child: Text( emptyColor: Color(0XFFD02127),
DateUtil.getWeekDayMonthDayYearDateFormatted( isHalfAllowed: true,
DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") + halfFilledIcon: Icons.star_half,
" " + filledIcon: Icons.star,
widget.appoList[index].startTime.substring(0, 5), emptyIcon: Icons.star_border,
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 10.0)),
),
!widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/hospital_address_icon.png", width: 20.0, height: 20.0) : Container(),
Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: widget.appoList[index].isLiveCareAppointment
? Container()
: Text(widget.appoList[index].projectName != null ? widget.appoList[index].projectName : "-",
overflow: TextOverflow.clip, maxLines: 2, style: TextStyle(fontSize: 10.0)),
), ),
], ],
), ),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Divider(
color: Colors.grey[500],
),
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
height: MediaQuery.of(context).size.height * 0.1,
margin: EdgeInsets.only(top: 5.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(widget.appoList[index].doctorImageURL, fit: BoxFit.fill),
),
),
),
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.bold, letterSpacing: -0.64)),
if (getDoctorSpeciality(widget.appoList[index].doctorSpeciality) != "null\n")
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text(getDoctorSpeciality(widget.appoList[index].doctorSpeciality).trim(),
style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: -0.64)),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: widget.appoList[index].actualDoctorRate.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
],
),
Container(
child: CountdownTimer(
controller:
new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) {
return time != null
? Text(
'${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} ' +
TranslationBase.of(context).upcomingTimeLeft,
style: TextStyle(fontSize: 12.0, color: Color(0xffC5272D)))
: Container();
},
),
),
],
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => performNextAction(widget.appoList[index]),
child: Container(
margin: EdgeInsets.only(top: 20.0),
child: Column(
children: <Widget>[
Image.asset(getNextActionImage(widget.appoList[index].nextAction), width: 50.0, height: 50.0),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(getNextActionText(widget.appoList[index].nextAction), textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)),
)
],
),
),
),
)
],
),
Divider(
color: Colors.grey[500],
),
Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 2,
child: Container(
child: Text(getNextActionDescription(widget.appoList[index].nextAction), style: TextStyle(fontSize: 11.0, color: Colors.grey[700])),
),
),
Expanded(
flex: 1,
child: GestureDetector(
onTap: () {
navigateToAppointmentDetails(context, widget.appoList[index]);
},
child: Container(
child: Text(TranslationBase.of(context).upcomingDetails,
textAlign: TextAlign.end, style: TextStyle(fontSize: 11.0, color: new Color(0xffC5272D), decoration: TextDecoration.underline)),
),
),
)
],
),
], ],
), ),
), ),
), ],
), ),
Container( Padding(
decoration: BoxDecoration( padding: const EdgeInsets.only(top: 12.0),
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10.0), bottomRight: Radius.circular(10.0)), child: Text(
color: Color(0xff20bc44), getNextActionDescription(widget.appoList[index].nextAction),
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16),
), ),
height: 30.0, ),
padding: EdgeInsets.only(right: 10, left: 10), InkWell(
margin: EdgeInsets.symmetric(horizontal: 20), onTap: () {
transform: Matrix4.translationValues(0.0, -8.0, 0.0), navigateToAppointmentDetails(context, widget.appoList[index]);
child: Row( },
mainAxisSize: MainAxisSize.min, child: Padding(
mainAxisAlignment: MainAxisAlignment.start, padding: const EdgeInsets.only(top: 0.0),
children: [ child: Text(
widget.appoList[index].clinicID == 265 TranslationBase.of(context).moreDetails,
? Container( style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48, height: 25 / 16, decoration: TextDecoration.underline),
margin: EdgeInsets.only(left: 5.0, right: 5.0), ),
child: SvgPicture.asset(
"assets/images/new/car_icon.svg",
height: 15,
width: 15,
),
)
: widget.appoList[index].isLiveCareAppointment
? Image.asset("assets/images/new-design/video.png")
: Image.asset("assets/images/new-design/walkin.png"),
widget.appoList[index].clinicID == 265
? Text(TranslationBase.of(context).drivethruAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
: widget.appoList[index].isLiveCareAppointment
? Text(TranslationBase.of(context).videoAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
: Text(TranslationBase.of(context).walkinAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
],
), ),
), ),
], ],
), ),
); );
// return Container(
// margin: EdgeInsets.all(10.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// child: Card(
// margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0),
// color: Colors.white,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// ),
// child: Container(
// width: MediaQuery.of(context).size.width,
// padding: EdgeInsets.all(10.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// Row(
// children: <Widget>[
// Image.asset("assets/images/new-design/time_icon.png", width: 20.0, height: 20.0),
// Container(
// width: MediaQuery.of(context).size.width * 0.4,
// margin: EdgeInsets.only(left: 10.0, right: 10.0),
// child: Text(
// DateUtil.getWeekDayMonthDayYearDateFormatted(
// DateUtil.convertStringToDate(widget.appoList[index].appointmentDate), projectViewModel.isArabic ? "ar" : "en") +
// " " +
// widget.appoList[index].startTime.substring(0, 5),
// overflow: TextOverflow.clip,
// style: TextStyle(fontSize: 10.0)),
// ),
// !widget.appoList[index].isLiveCareAppointment ? Image.asset("assets/images/new-design/hospital_address_icon.png", width: 20.0, height: 20.0) : Container(),
// Container(
// margin: EdgeInsets.only(left: 5.0, right: 5.0),
// child: widget.appoList[index].isLiveCareAppointment
// ? Container()
// : Text(widget.appoList[index].projectName != null ? widget.appoList[index].projectName : "-",
// overflow: TextOverflow.clip, maxLines: 2, style: TextStyle(fontSize: 10.0)),
// ),
// ],
// ),
// Container(
// margin: EdgeInsets.only(top: 5.0),
// child: Divider(
// color: Colors.grey[500],
// ),
// ),
// Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// flex: 1,
// child: Container(
// height: MediaQuery.of(context).size.height * 0.1,
// margin: EdgeInsets.only(top: 5.0),
// child: ClipRRect(
// borderRadius: BorderRadius.circular(100.0),
// child: Image.network(widget.appoList[index].doctorImageURL, fit: BoxFit.fill),
// ),
// ),
// ),
// Expanded(
// flex: 3,
// child: Container(
// margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Text(widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj,
// style: TextStyle(fontSize: 14.0, color: Colors.black, fontWeight: FontWeight.bold, letterSpacing: -0.64)),
// if (getDoctorSpeciality(widget.appoList[index].doctorSpeciality) != "null\n")
// Container(
// margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
// child: Text(getDoctorSpeciality(widget.appoList[index].doctorSpeciality).trim(),
// style: TextStyle(fontSize: 12.0, color: Colors.grey[600], letterSpacing: -0.64)),
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisSize: MainAxisSize.max,
// children: <Widget>[
// RatingBar.readOnly(
// initialRating: widget.appoList[index].actualDoctorRate.toDouble(),
// size: 20.0,
// filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500],
// isHalfAllowed: true,
// halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star,
// emptyIcon: Icons.star,
// ),
// ],
// ),
// Container(
// child: CountdownTimer(
// controller:
// new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60),
// widgetBuilder: (_, CurrentRemainingTime time) {
// return time != null
// ? Text(
// '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} ' +
// TranslationBase.of(context).upcomingTimeLeft,
// style: TextStyle(fontSize: 12.0, color: Color(0xffC5272D)))
// : Container();
// },
// ),
// ),
// ],
// ),
// ),
// ),
// Expanded(
// flex: 1,
// child: InkWell(
// onTap: () => performNextAction(widget.appoList[index]),
// child: Container(
// margin: EdgeInsets.only(top: 20.0),
// child: Column(
// children: <Widget>[
// Image.asset(getNextActionImage(widget.appoList[index].nextAction), width: 50.0, height: 50.0),
// Container(
// margin: EdgeInsets.only(top: 5.0),
// child: Text(getNextActionText(widget.appoList[index].nextAction), textAlign: TextAlign.center, style: TextStyle(fontSize: 12.0)),
// )
// ],
// ),
// ),
// ),
// )
// ],
// ),
// Divider(
// color: Colors.grey[500],
// ),
// Flex(
// direction: Axis.horizontal,
// children: <Widget>[
// Expanded(
// flex: 2,
// child: Container(
// child: Text(getNextActionDescription(widget.appoList[index].nextAction), style: TextStyle(fontSize: 11.0, color: Colors.grey[700])),
// ),
// ),
// Expanded(
// flex: 1,
// child: GestureDetector(
// onTap: () {
// navigateToAppointmentDetails(context, widget.appoList[index]);
// },
// child: Container(
// child: Text(TranslationBase.of(context).upcomingDetails,
// textAlign: TextAlign.end, style: TextStyle(fontSize: 11.0, color: new Color(0xffC5272D), decoration: TextDecoration.underline)),
// ),
// ),
// )
// ],
// ),
// ],
// ),
// ),
// ),
// ),
// Container(
// decoration: BoxDecoration(
// borderRadius: BorderRadius.only(bottomLeft: Radius.circular(10.0), bottomRight: Radius.circular(10.0)),
// color: Color(0xff20bc44),
// ),
// height: 30.0,
// padding: EdgeInsets.only(right: 10, left: 10),
// margin: EdgeInsets.symmetric(horizontal: 20),
// transform: Matrix4.translationValues(0.0, -8.0, 0.0),
// child: Row(
// mainAxisSize: MainAxisSize.min,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// widget.appoList[index].clinicID == 265
// ? Container(
// margin: EdgeInsets.only(left: 5.0, right: 5.0),
// child: SvgPicture.asset(
// "assets/images/new/car_icon.svg",
// height: 15,
// width: 15,
// ),
// )
// : widget.appoList[index].isLiveCareAppointment
// ? Image.asset("assets/images/new-design/video.png")
// : Image.asset("assets/images/new-design/walkin.png"),
// widget.appoList[index].clinicID == 265
// ? Text(TranslationBase.of(context).drivethruAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
// : widget.appoList[index].isLiveCareAppointment
// ? Text(TranslationBase.of(context).videoAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
// : Text(TranslationBase.of(context).walkinAppo, style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 11.0))
// ],
// ),
// ),
// ],
// ),
// );
}, },
), ),
), ),
@ -375,6 +518,48 @@ class _ToDoState extends State<ToDo> {
} }
} }
Color getNextActionButtonColor(nextAction) {
switch (nextAction) {
case 0:
return CustomColors.accentColor;
break;
case 10:
return CustomColors.green;
break;
case 15:
return CustomColors.grey2;
break;
case 20:
return CustomColors.green;
break;
case 30:
return CustomColors.accentColor;
break;
case 40:
return CustomColors.green;
break;
case 50:
return CustomColors.green;
break;
case 60:
return CustomColors.orange;
break;
case 90:
return CustomColors.accentColor;
break;
default:
return CustomColors.green;
}
}
String getNextActionText(nextAction) { String getNextActionText(nextAction) {
switch (nextAction) { switch (nextAction) {
case 0: case 0:
@ -732,35 +917,34 @@ class _ToDoState extends State<ToDo> {
}); });
} }
getPatientData() async { // getPatientData() async {
AppSharedPreferences sharedPref = AppSharedPreferences(); // AppSharedPreferences sharedPref = AppSharedPreferences();
if (await sharedPref.getObject(USER_PROFILE) != null) { // if (await sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); // var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
setState(() { // setState(() {
print(data); // print(data);
authUser = data; // authUser = data;
}); // });
getPatientAppointmentHistory(); // getPatientAppointmentHistory();
} // }
} // }
Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
if (await this.sharedPref.getObject(USER_PROFILE) != null) { // if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); // var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
setState(() { // setState(() {
authUser = data; // authUser = data;
}); // });
} // }
Navigator.push(context, FadePage(page: PaymentMethod( Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) {
onSelectedMethod: (String metohd) {
setState(() {}); setState(() {});
}))).then((value) { }))).then((value) {
print(value); print(value);
getPatientAppointmentHistory(); getPatientAppointmentHistory();
if (value != null) { if (value != null) {
openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
} }
}); });
} }

@ -8,8 +8,9 @@ import 'package:flutter/material.dart';
class PaymentMethod extends StatefulWidget { class PaymentMethod extends StatefulWidget {
Function onSelectedMethod; Function onSelectedMethod;
bool isShowInstallments;
PaymentMethod({this.onSelectedMethod}); PaymentMethod({this.onSelectedMethod, this.isShowInstallments = false});
@override @override
_PaymentMethodState createState() => _PaymentMethodState(); _PaymentMethodState createState() => _PaymentMethodState();
@ -185,55 +186,56 @@ class _PaymentMethodState extends State<PaymentMethod> {
), ),
), ),
), ),
Container( if (widget.isShowInstallments)
width: double.infinity, Container(
child: InkWell( width: double.infinity,
onTap: () { child: InkWell(
updateSelectedPaymentMethod("Installment"); onTap: () {
}, updateSelectedPaymentMethod("Installment");
child: Card( },
elevation: 0.0, child: Card(
margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), elevation: 0.0,
color: Colors.white, margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0),
shape: RoundedRectangleBorder( color: Colors.white,
borderRadius: BorderRadius.circular(10), shape: RoundedRectangleBorder(
side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), borderRadius: BorderRadius.circular(10),
), side: selectedPaymentMethod == "Installment" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0),
child: Padding( ),
padding: const EdgeInsets.all(12.0), child: Padding(
child: Row( padding: const EdgeInsets.all(12.0),
children: [ child: Row(
Container( children: [
width: 24,
height: 24,
decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "Installment" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5),
),
mWidth(12),
Container(
height: 60.0,
padding: EdgeInsets.all(7.0),
width: 60,
child: Image.asset("assets/images/new/payment/installments.png"),
),
mFlex(1),
if (selectedPaymentMethod == "Installment")
Container( Container(
decoration: containerRadius(CustomColors.green, 200), width: 24,
padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), height: 24,
child: Text( decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "Installment" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5),
TranslationBase.of(context).paymentSelected, ),
style: TextStyle( mWidth(12),
color: Colors.white, Container(
fontSize: 11, height: 60.0,
padding: EdgeInsets.all(7.0),
width: 60,
child: Image.asset("assets/images/new/payment/installments.png"),
),
mFlex(1),
if (selectedPaymentMethod == "Installment")
Container(
decoration: containerRadius(CustomColors.green, 200),
padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12),
child: Text(
TranslationBase.of(context).paymentSelected,
style: TextStyle(
color: Colors.white,
fontSize: 11,
),
), ),
), ),
), ],
], ),
), ),
), ),
), ),
), ),
),
Platform.isIOS Platform.isIOS
? Container( ? Container(
width: double.infinity, width: double.infinity,

@ -89,7 +89,7 @@ class _PaymentDialogState extends State<PaymentDialog> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).cancel, TranslationBase.of(context).cancel_nocaps,
() { () {
Navigator.pop(context, null); Navigator.pop(context, null);
}, },

@ -1,20 +1,17 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/my_rich_text.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';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
class TodoListCard extends StatefulWidget { class TodoListCard extends StatefulWidget {
AppoitmentAllHistoryResultList appo; TodoListCard();
var languageID;
final VoidCallback onListUpdated;
TodoListCard({@required this.appo, this.onListUpdated});
@override @override
_TodoListCardState createState() => _TodoListCardState(); _TodoListCardState createState() => _TodoListCardState();
@ -25,333 +22,128 @@ class _TodoListCardState extends State<TodoListCard> {
@override @override
void initState() { void initState() {
// widget.onListUpdated();
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container( return Container(
width: double.infinity,
margin: EdgeInsets.all(10.0), margin: EdgeInsets.all(10.0),
child: Card( decoration: cardRadius(12),
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 8.0), padding: EdgeInsets.all(16),
color: Colors.white, child: Column(
shape: RoundedRectangleBorder( crossAxisAlignment: CrossAxisAlignment.start,
borderRadius: BorderRadius.circular(10), children: [
), Row(
child: Container( mainAxisAlignment: MainAxisAlignment.spaceBetween,
width: MediaQuery.of(context).size.width, children: [
padding: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Row( Row(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
Image.asset("assets/images/new-design/time_icon.png", children: [
width: 20.0, height: 20.0), Padding(
Container( padding: const EdgeInsets.only(top: 4.0),
margin: EdgeInsets.only(left: 10.0, right: 30.0), child: SvgPicture.asset("assets/images/new/virtual.svg"),
child: Text(getDate(widget.appo.appointmentDate),
style: TextStyle(fontSize: 12.0)),
), ),
widget.appo.isLiveCareAppointment Column(
? SvgPicture.asset( crossAxisAlignment: CrossAxisAlignment.start,
"assets/images/new-design/liveCare_logo_icon.svg", children: [
width: 20.0, Padding(
height: 20.0) padding: const EdgeInsets.only(left: 8.0, right: 8.0),
: Image.asset( child: Text(TranslationBase.of(context).videoAppo, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
"assets/images/new-design/hospital_address_icon.png", ),
width: 20.0, Padding(
height: 20.0), padding: const EdgeInsets.only(left: 8.0, right: 8.0),
Container( child: Text("01:23:22 " + TranslationBase.of(context).upcomingTimeLeft, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48)),
margin: EdgeInsets.only(left: 10.0, right: 10.0), ),
child: widget.appo.isLiveCareAppointment ],
? Text(TranslationBase.of(context).upcomingLivecare,
style: TextStyle(fontSize: 12.0))
: Text(widget.appo.projectName,
style: TextStyle(fontSize: 12.0)),
), ),
], ],
), ),
Container( Container(
margin: EdgeInsets.only(top: 5.0), child: InkWell(
child: Divider( onTap: () {
color: Colors.grey[500], // showConfirmMessage(model, order);
), },
), child: Container(
Flex( padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
direction: Axis.horizontal, decoration: BoxDecoration(
children: <Widget>[ color: CustomColors.green,
Expanded( border: Border.all(color: Colors.white, width: 1),
flex: 1, borderRadius: BorderRadius.circular(6),
child: Container(
height: MediaQuery.of(context).size.height * 0.1,
margin: EdgeInsets.only(top: 5.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(widget.appo.doctorImageURL,
fit: BoxFit.fill),
),
), ),
), child: Text(
Expanded( TranslationBase.of(context).confirm,
flex: 3, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
child: Container(
margin:
EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.appo.doctorTitle +
" " +
widget.appo.doctorNameObj,
style: TextStyle(
fontSize: 14.0,
color: Colors.black,
fontWeight: FontWeight.bold,
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text(
getDoctorSpeciality(
widget.appo.doctorSpeciality)
.trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: 4.0,
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
],
),
],
),
), ),
), ),
Expanded( ),
flex: 1,
child: Container(
margin: EdgeInsets.only(top: 20.0),
child: Column(
children: <Widget>[
Image.asset(
getNextActionImage(widget.appo.nextAction),
width: 50.0,
height: 50.0),
Container(
margin: EdgeInsets.only(top: 5.0),
child: Text(
getNextActionText(widget.appo.nextAction),
textAlign: TextAlign.center,
style: TextStyle(fontSize: 12.0)),
)
],
),
),
)
],
), ),
Divider( ],
color: Colors.grey[500], ),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
"Raed Mubarak Bin Ghanem",
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
LargeAvatar(
name: "Raed Mubarak Bin Ghanem",
url: "https://hmgwebservices.com/Images/MobileImages/TAKHSUSI/158210.png",
width: 52,
height: 52,
), ),
Flex( SizedBox(width: 11),
direction: Axis.horizontal, Expanded(
children: <Widget>[ child: Column(
Expanded( crossAxisAlignment: CrossAxisAlignment.start,
flex: 2, mainAxisSize: MainAxisSize.min,
child: Container( children: <Widget>[
child: Text( MyRichText(TranslationBase.of(context).clinic + ": ", "Cardiology", projectViewModel.isArabic),
getNextActionDescription(widget.appo.nextAction), MyRichText(TranslationBase.of(context).appointmentDate + ": ", "11/04/2021 15:30", projectViewModel.isArabic),
style: TextStyle( MyRichText(TranslationBase.of(context).branch, "Olaya Hospital", projectViewModel.isArabic),
fontSize: 12.0, color: Colors.grey[700])), Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating: 4.5,
size: 16.0,
filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127),
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star_border,
),
],
), ),
), ],
Expanded( ),
flex: 1,
child: GestureDetector(
onTap: () {
navigateToAppointmentDetails(context);
},
child: Container(
child: Text(TranslationBase.of(context).upcomingDetails,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 12.0,
color: new Color(0xFF40ACC9),
decoration: TextDecoration.underline)),
),
),
)
],
), ),
], ],
), ),
), Padding(
padding: const EdgeInsets.only(top: 12.0),
child: Text(
"Please confirm the appointment to avoid cancellation",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16),
),
),
Padding(
padding: const EdgeInsets.only(top: 0.0),
child: Text(
"More Details",
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48, height: 25 / 16, decoration: TextDecoration.underline),
),
),
],
), ),
); );
} }
String getNextActionImage(nextAction) {
switch (nextAction) {
case 0:
return "No Action";
break;
case 10:
return "assets/images/new-design/confirm_button.png";
break;
case 15:
return widget.languageID == 'ar'
? "assets/images/new-design/pay_online_button_arabic_disabled.png"
: "assets/images/new-design/pay_online_button_disabled.png";
break;
case 20:
return widget.languageID == 'ar'
? "assets/images/new-design/pay_online_button_arabic.png"
: "assets/images/new-design/pay_online_button.png";
break;
case 30:
return "assets/images/new-design/qr_code_button.png";
break;
case 40:
return "assets/images/new-design/video_call_instruction.png";
break;
case 50:
return "assets/images/new-design/liveCare_logo_icon.png";
break;
default:
return "";
}
}
String getNextActionText(nextAction) {
switch (nextAction) {
case 0:
return "No Action";
break;
case 10:
return TranslationBase.of(context).confirm;
break;
case 15:
return TranslationBase.of(context).pendingPayment;
break;
case 20:
return TranslationBase.of(context).payNow;
break;
case 30:
return TranslationBase.of(context).viewQR;
break;
case 40:
return TranslationBase.of(context).instruction;
break;
case 50:
return TranslationBase.of(context).livecare;
break;
default:
return "";
}
}
String getNextActionDescription(nextAction) {
switch (nextAction) {
case 0:
return "No Action";
break;
case 10:
return TranslationBase.of(context).upcomingConfirm;
break;
case 15:
return TranslationBase.of(context).upcomingPaymentPending;
break;
case 20:
return TranslationBase.of(context).upcomingPaymentNow;
break;
case 30:
return TranslationBase.of(context).upcomingQR;
break;
case 40:
return TranslationBase.of(context).upcomingVirtual;
break;
case 50:
return TranslationBase.of(context).upcomingLivecare;
break;
default:
return "";
}
}
getLanguageID() async {
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
setState(() {
widget.languageID = languageID;
});
}
String getDate(String date) {
DateTime dateObj = DateUtil.convertStringToDate(date);
return DateUtil.getWeekDay(dateObj.weekday) +
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString() +
" " +
dateObj.hour.toString() +
":" +
getMinute(dateObj);
}
String getMinute(DateTime dateObj) {
if (dateObj.minute == 0) {
return dateObj.minute.toString() + "0";
} else {
return dateObj.minute.toString();
}
}
String getDoctorSpeciality(List<String> docSpecial) {
String docSpeciality = "";
docSpecial.forEach((v) {
docSpeciality = docSpeciality + v + "\n";
});
return docSpeciality;
}
Future navigateToAppointmentDetails(context) async {
Navigator.push(
context, FadePage(page: AppointmentDetails()));
}
} }

@ -626,7 +626,7 @@ class _clinic_listState extends State<ClinicList> {
} }
Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async { Future navigateToSearchResults(context, List<DoctorList> docList, List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital) async {
Navigator.push(context, FadePage(page: SearchResults(doctorsList: docList, isLiveCareAppointment: true, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital))); Navigator.push(context, FadePage(page: SearchResults(doctorsList: docList, isLiveCareAppointment: false, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)));
} }
updateSelectedIndex(PatientERGetClinicsList patientERGetClinicsList) { updateSelectedIndex(PatientERGetClinicsList patientERGetClinicsList) {

@ -313,9 +313,11 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: PaymentMethod(onSelectedMethod: (String metohd) { page: PaymentMethod(
setState(() {}); onSelectedMethod: (String metohd) {
}), setState(() {});
},
isShowInstallments: num.tryParse(amount) >= 1000 ? true : false),
), ),
).then( ).then(
(value) { (value) {

@ -1,12 +1,11 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_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/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.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';
@ -14,7 +13,7 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class PrescriptionsHistoryDetailsPage extends StatelessWidget { class PrescriptionsHistoryDetailsPage extends StatelessWidget {
final PrescriptionsOrder prescriptionsOrder; final GetCMCAllOrdersResponseModel prescriptionsOrder;
PrescriptionsHistoryDetailsPage({Key key, this.prescriptionsOrder}); PrescriptionsHistoryDetailsPage({Key key, this.prescriptionsOrder});
@ -22,10 +21,10 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PrescriptionsViewModel>( return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => model.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder), onModelReady: (model) => model.getPrescriptionReportDetailsRC(),
builder: (_, model, widget) { builder: (_, model, widget) {
int status = prescriptionsOrder.status; int status = prescriptionsOrder.statusId;
String _statusDisp = projectViewModel.isArabic ? prescriptionsOrder.descriptionN : prescriptionsOrder.description; String _statusDisp = prescriptionsOrder.statusText;
Color _color; Color _color;
if (status == 1) { if (status == 1) {
//pending //pending
@ -36,7 +35,7 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
} else if (status == 3) { } else if (status == 3) {
//completed //completed
_color = Color(0xff359846); _color = Color(0xff359846);
} else if (status == 4) { } else if (status == 4 || status == 6 || status == 7) {
//cancel // Rejected //cancel // Rejected
_color = Color(0xffD02127); _color = Color(0xffD02127);
} }
@ -109,13 +108,9 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Text( Text(
DateUtil.getDayMonthYearDateFormatted(prescriptionsOrder.createdOn), DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(prescriptionsOrder.created)),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
Text(
DateUtil.formatDateToTimeLang(prescriptionsOrder.createdOn, false),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
),
], ],
) )
], ],
@ -134,7 +129,7 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(30)), borderRadius: BorderRadius.all(Radius.circular(30)),
child: Image.network( child: Image.network(
model.prescriptionReportEnhList[index].imageSRCUrl, model.prescriptionsOrderListRC[index].image,
fit: BoxFit.cover, fit: BoxFit.cover,
width: 48, width: 48,
height: 48, height: 48,
@ -144,9 +139,9 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
SizedBox(width: 14), SizedBox(width: 14),
Expanded( Expanded(
child: Text( child: Text(
(model.prescriptionReportEnhList[index].itemDescription.isNotEmpty (model.prescriptionsOrderListRC[index].itemDescription.isNotEmpty
? model.prescriptionReportEnhList[index].itemDescription ? model.prescriptionsOrderListRC[index].itemDescription
: model.prescriptionReportEnhList[index].itemDescriptionN ?? '') : model.prescriptionsOrderListRC[index].itemDescription ?? '')
.toLowerCase() .toLowerCase()
.capitalizeFirstofEach, .capitalizeFirstofEach,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
@ -155,7 +150,7 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
], ],
), ),
separatorBuilder: (context, index) => SizedBox(height: 12), separatorBuilder: (context, index) => SizedBox(height: 12),
itemCount: model.prescriptionReportEnhList.length) itemCount: model.prescriptionsOrderListRC.length)
], ],
), ),
), ),
@ -168,9 +163,10 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).cancelOrder, TranslationBase.of(context).cancelOrder,
prescriptionsOrder.status != 1 // prescriptionsOrder.statusId != 1
? null // ? null
: () { // :
() {
showCDialog(model, context); showCDialog(model, context);
}, },
disabledColor: Color(0xff575757), disabledColor: Color(0xff575757),

@ -2,10 +2,12 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; 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/pages/medical/prescriptions/prescriptions_history_details_page.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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.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 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -52,17 +54,17 @@ class PrescriptionsHistoryPage extends StatelessWidget {
return InkWell( return InkWell(
onTap: () async { onTap: () async {
// final result = await Navigator.push( final result = await Navigator.push(
// context, context,
// FadePage( FadePage(
// page: PrescriptionsHistoryDetailsPage( page: PrescriptionsHistoryDetailsPage(
// prescriptionsOrder: prescriptionsViewModel.prescriptionsHistory[index], prescriptionsOrder: prescriptionsViewModel.prescriptionsHistory[index],
// ), ),
// ), ),
// ); );
// if (result != null) { if (result != null) {
// showOrderLog(); showOrderLog();
// } }
}, },
child: Container( child: Container(
height: 65, height: 65,

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/search_brands_page.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';
import 'package:diplomaticquarterapp/widgets/others/network_base_view.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';
@ -34,117 +35,121 @@ class _ProductBrandsPageState extends State<ProductBrandsPage> {
isPharmacy: true, isPharmacy: true,
isShowDecPage: false, isShowDecPage: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: NetworkBaseView(
child: Column( baseViewModel: model,
children: [ isLocalLoader:true,
Container( child: Container(
color: Colors.white, child: Column(
alignment: languageID == 'ar' children: [
? Alignment.topRight Container(
: Alignment.topLeft, color: Colors.white,
padding: languageID == 'ar' alignment: languageID == 'ar'
? EdgeInsets.only(right: 10.0, top: 10.0) ? Alignment.topRight
: EdgeInsets.only(left: 10.0, top: 10.0), : Alignment.topLeft,
child: Text( padding: languageID == 'ar'
TranslationBase.of(context).topBrands, ? EdgeInsets.only(right: 10.0, top: 10.0)
style: TextStyle( : EdgeInsets.only(left: 10.0, top: 10.0),
fontWeight: FontWeight.bold, child: Text(
TranslationBase.of(context).topBrands,
style: TextStyle(
fontWeight: FontWeight.bold,
),
), ),
), ),
), Container(
Container( height: 220,
height: 220, width: double.infinity,
width: double.infinity,
color: Colors.white,
child: topBrand(context),
),
SizedBox(
height: 10,
),
Container(
height: MediaQuery.of(context).size.height * 0.076,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white, color: Colors.white,
child: topBrand(context),
), ),
child: topBrand(context), SizedBox(
), height: 10,
SizedBox(
height: 10,
),
Container(
height: MediaQuery.of(context).size.height * 0.056,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
color: Colors.white,
), ),
child: InkWell( Container(
child: Padding( height: MediaQuery.of(context).size.height * 0.076,
padding: EdgeInsets.all(8.0), decoration: BoxDecoration(
child: Row( borderRadius: BorderRadius.circular(5.0),
//crossAxisAlignment: CrossAxisAlignment.center, color: Colors.white,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.search, size: 25.0),
SizedBox(
width: 15.0,
),
Texts(
TranslationBase.of(context).searchProductHere,
fontSize: 13,
)
],
),
), ),
onTap: () { child: topBrand(context),
Navigator.push(
context,
FadePage(page: SearchBrandsPage()),
);
},
), ),
), SizedBox(
SizedBox( height: 10,
height: 10, ),
), Container(
Container( height: MediaQuery.of(context).size.height * 0.066,
height: 250, decoration: BoxDecoration(
width: double.infinity, borderRadius: BorderRadius.circular(5.0),
color: Colors.white, color: Colors.white,
child: ListView.builder( ),
itemCount: model.brandsListList.length, child: InkWell(
itemBuilder: (BuildContext context, int index) { child: Padding(
return InkWell( padding: EdgeInsets.all(8.0),
child: Container( child: Row(
margin: EdgeInsets.only(top: 50, left: 10), //crossAxisAlignment: CrossAxisAlignment.center,
child: Column( mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
mainAxisAlignment: MainAxisAlignment.start, Icon(Icons.search, size: 25.0),
children: [ SizedBox(
languageID == 'ar' width: 15.0,
? Text(model.brandsListList[index].namen)
: Text(model.brandsListList[index].name),
SizedBox(
height: 3,
),
Divider(height: 1, color: Colors.grey)
],
), ),
), Texts(
onTap: () { TranslationBase.of(context).searchProductHere,
Navigator.push( fontSize: 13,
context, )
MaterialPageRoute( ],
builder: (context) => FinalProductsPage( ),
id: model.brandsListList[index].id ),
.toString(), onTap: () {
)), Navigator.push(
); context,
}, FadePage(page: SearchBrandsPage()),
); );
}), },
), ),
], ),
SizedBox(
height: 10,
),
Container(
height: 250,
width: double.infinity,
color: Colors.white,
child: ListView.builder(
itemCount: model.brandsListList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
child: Container(
margin: EdgeInsets.only(top: 50, left: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
languageID == 'ar'
? Text(model.brandsListList[index].namen)
: Text(model.brandsListList[index].name),
SizedBox(
height: 3,
),
Divider(height: 1, color: Colors.grey)
],
),
),
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => FinalProductsPage(
id: model.brandsListList[index].id
.toString(),
)),
);
},
);
}),
),
],
),
), ),
), ),
), ),

@ -347,7 +347,7 @@ class _OrderBottomWidgetState extends State<OrderBottomWidget> {
child: Icon( child: Icon(
Icons.info, Icons.info,
size: 25, size: 25,
color: Color(0xff005aff), color: Color(0xFF4CAF50),
// color: Color(0xff005aff), // color: Color(0xff005aff),
), ),
), ),

@ -26,11 +26,21 @@ class LakumMainPage extends StatelessWidget {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<LacumViewModel>( return BaseView<LacumViewModel>(
onModelReady: (model) => model.getLacumData(), onModelReady: (model) async {
await model.getLacumData();
if (model.lacumInformation.yahalaAccountNo == 0 || model.lacumInformation.yahalaAccountNo == null) {
navigateToLakumRegister(context);
} else {
if (model.lacumInformation.status == "Hold") {
Navigator.pushReplacement(context, FadePage(page: LakumActivationVidaPage()));
}
}
},
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).lakum, appBarTitle: TranslationBase.of(context).lakum,
isShowAppBar: true, isShowAppBar: true,
isPharmacy: true, isPharmacy: true,
showPharmacyCart: false,
isShowDecPage: false, isShowDecPage: false,
backgroundColor: Colors.white, backgroundColor: Colors.white,
baseViewModel: model, baseViewModel: model,

@ -18,6 +18,7 @@ import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/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/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -90,7 +91,9 @@ class _ProfilePageState extends State<PharmacyProfilePage> {
return BaseView<OrderModelViewModel>( return BaseView<OrderModelViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
GifLoaderDialogUtils.showMyDialog(context);
model.getOrder(customerId, page_id); model.getOrder(customerId, page_id);
GifLoaderDialogUtils.hideDialog(context);
}, },
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).myAccount, appBarTitle: TranslationBase.of(context).myAccount,

@ -2610,6 +2610,14 @@ class TranslationBase {
String get laserClinic => localizedValues["laserClinic"][locale.languageCode]; String get laserClinic => localizedValues["laserClinic"][locale.languageCode];
String get noImage => localizedValues["noImage"][locale.languageCode]; String get noImage => localizedValues["noImage"][locale.languageCode];
String get signoutMessage => localizedValues["signoutMessage"][locale.languageCode];
String get RRTTitle => localizedValues["RRTTitle"][locale.languageCode];
String get RRTSubTitle => localizedValues["RRTSubTitle"][locale.languageCode];
String get transportation => localizedValues["transportation"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -28,6 +28,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.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.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/material.dart'; import 'package:flutter/material.dart';
@ -360,7 +361,7 @@ class _AppDrawerState extends State<AppDrawer> {
onTap: () { onTap: () {
//NotificationsPage //NotificationsPage
// Navigator.of(context).pop(); // Navigator.of(context).pop();
if (!projectProvider.isLoginChild) Navigator.push(AppGlobal.context, FadePage(page: NotificationsPage())); if (!projectProvider.isLoginChild) Navigator.push(context, FadePage(page: NotificationsPage()));
}, },
), ),
if (projectProvider.havePrivilege(3)) if (projectProvider.havePrivilege(3))
@ -475,20 +476,28 @@ class _AppDrawerState extends State<AppDrawer> {
} }
logout() async { logout() async {
authenticatedUserObject.logout(); ConfirmDialog dialog = new ConfirmDialog(
projectProvider.isLogin = false; context: context,
await authenticatedUserObject.getUser(); confirmMessage: TranslationBase.of(context).signoutMessage,
_vitalSignService.heightCm = ""; okText: TranslationBase.of(context).confirm,
_vitalSignService.weightKg = ""; cancelText: TranslationBase.of(context).cancel_nocaps,
await _privilegeService.getPrivilege(); okFunction: () async {
projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); authenticatedUserObject.logout();
var appLanguage = await sharedPref.getString(APP_LANGUAGE); projectProvider.isLogin = false;
await sharedPref.clear(); await authenticatedUserObject.getUser();
await sharedPref.setString(APP_LANGUAGE, appLanguage); _vitalSignService.heightCm = "";
await sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL); _vitalSignService.weightKg = "";
this.user = null; await _privilegeService.getPrivilege();
Navigator.of(context).pushNamed(HOME); projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList);
// projectProvider.platformBridge().unRegisterHmgGeofences(); var appLanguage = await sharedPref.getString(APP_LANGUAGE);
await sharedPref.clear();
await sharedPref.setString(APP_LANGUAGE, appLanguage);
await sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL);
this.user = null;
Navigator.of(context).pushNamed(HOME);
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
} }
login() async { login() async {

@ -12,11 +12,11 @@ class MyRichText extends StatelessWidget {
maxLines: 1, maxLines: 1,
text: TextSpan( text: TextSpan(
text: title, text: title,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff575757), letterSpacing: -0.4, height: 18 / 10),
children: <TextSpan>[ children: <TextSpan>[
TextSpan( TextSpan(
text: " $value", text: " $value",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, fontFamily: isArabic ? 'Cairo' : 'Poppins', color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
) )
]), ]),
); );

@ -129,7 +129,7 @@ class productTile extends StatelessWidget {
), ),
), ),
Text( Text(
'$approvedTotalReviews', '${approvedTotalReviews} ${TranslationBase.of(context).reviews}',
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13),
), ),
], ],
@ -159,7 +159,7 @@ class productTile extends StatelessWidget {
icon: Icon( icon: Icon(
Icons.shopping_cart, Icons.shopping_cart,
size: 18, size: 18,
color: Colors.blue, color: Colors.green,
), ),
onPressed: () async { onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
@ -253,7 +253,8 @@ class productTile extends StatelessWidget {
// alignment: Alignment.topLeft, // alignment: Alignment.topLeft,
child: RichText( child: RichText(
text: TextSpan( text: TextSpan(
text: '($productReviews reviews)', text: '${productReviews} ${TranslationBase.of(context).reviews}',
// text: '($productReviews reviews)',
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13), style: TextStyle(fontWeight: FontWeight.bold, color: Colors.grey, fontSize: 13),
), ),
), ),

@ -2,6 +2,8 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/close_back.dart'; import 'package:diplomaticquarterapp/widgets/others/close_back.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -17,32 +19,28 @@ class PickupLocationFromMap extends StatelessWidget {
final String buttonLabel; final String buttonLabel;
final Color buttonColor; final Color buttonColor;
const PickupLocationFromMap( const PickupLocationFromMap({Key key, this.onPick, this.latitude, this.longitude, this.isWithAppBar = true, this.buttonLabel, this.buttonColor}) : super(key: key);
{Key key,
this.onPick,
this.latitude,
this.longitude,
this.isWithAppBar = true,
this.buttonLabel,
this.buttonColor})
: super(key: key);
@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: isWithAppBar isShowAppBar: true,
? AppBar( showNewAppBarTitle: true,
elevation: 0, showNewAppBar: true,
textTheme: TextTheme( appBarTitle: TranslationBase.of(context).selectLocation,
headline6: // appBar: isWithAppBar
TextStyle(color: Colors.white, fontWeight: FontWeight.bold), // ? AppBar(
), // elevation: 0,
title: Text('Location'), // textTheme: TextTheme(
leading: CloseBack(), // headline6:
centerTitle: true, // TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
) // ),
: null, // title: Text('Location'),
// leading: CloseBack(),
// centerTitle: true,
// )
// : null,
body: PlacePicker( body: PlacePicker(
apiKey: GOOGLE_API_KEY, apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true, enableMyLocationButton: true,
@ -55,8 +53,7 @@ class PickupLocationFromMap extends StatelessWidget {
onPick(result); onPick(result);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
selectedPlaceWidgetBuilder: selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused"); print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused return isSearchBarFocused
? Container() ? Container()
@ -70,28 +67,13 @@ class PickupLocationFromMap extends StatelessWidget {
? Center(child: CircularProgressIndicator()) ? Center(child: CircularProgressIndicator())
: Container( : Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: BorderedButton( child: DefaultButton(
buttonLabel != null ? buttonLabel : TranslationBase.of(context).next, TranslationBase.of(context).next,
textColor: Colors.white, () {
fontWeight: FontWeight.bold,
backgroundColor: buttonColor != null ? buttonColor : Colors.grey[800],
fontSize: 14,
vPadding: 12,
radius: 10,
handler: () {
onPick(selectedPlace); onPick(selectedPlace);
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
), ),
/* SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
onPick(selectedPlace);
Navigator.of(context).pop();
},
label: TranslationBase.of(context).next,
),*/
), ),
); );
}, },

Loading…
Cancel
Save