Merge branch 'development' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into health-converter

 Conflicts:
	lib/config/localized_values.dart
	lib/uitl/translations_delegate_base.dart
merge-requests/252/head
hussam al-habibeh 5 years ago
commit 97919c217f

@ -292,6 +292,8 @@ const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult'
const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage';
const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult';
const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
const UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult';
const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
@ -332,7 +334,7 @@ const GET_PHARMACY_BEST_SELLER_PRODUCT = "epharmacy/api/bestsellerproducts";
const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/"; const GET_PHARMACY_PRODUCTs_BY_IDS = "epharmacy/api/productsbyids/";
const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/"; const GET_CUSTOMERS_ADDRESSES = "epharmacy/api/Customers/";
const GET_ORDER = "orders?"; const GET_ORDER = "orders?";
const GET_ORDER_DETAILS = "epharmacy/api/orders/"; const GET_ORDER_DETAILS = "orders/";
const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress"; const ADD_CUSTOMER_ADDRESS = "epharmacy/api/addcustomeraddress";
const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress"; const EDIT_CUSTOMER_ADDRESS = "epharmacy/api/editcustomeraddress";
const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress"; const DELETE_CUSTOMER_ADDRESS = "epharmacy/api/deletecustomeraddress";
@ -359,6 +361,7 @@ const TRANSFER_YAHALA_LOYALITY_POINTS =
"Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LAKUM_GET_USER_TERMS_AND_CONDITIONS = const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
// Home Health Care // Home Health Care
const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices";
@ -376,6 +379,8 @@ const GET_PATIENT_ALL_PRES_ORD =
const PATIENT_ER_INSERT_PRES_ORDER = const PATIENT_ER_INSERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder'; 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews'; const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews';
const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
//Pharmacy wishlist //Pharmacy wishlist
const GET_WISHLIST = "shopping_cart_items/"; const GET_WISHLIST = "shopping_cart_items/";

@ -231,6 +231,7 @@ const Map localizedValues = {
'ar': 'ابحث عن الدواء هنا' 'ar': 'ابحث عن الدواء هنا'
}, },
'description': {'en': 'Description', 'ar': 'الوصف'}, 'description': {'en': 'Description', 'ar': 'الوصف'},
'howToUse': {'en': 'How to Use', 'ar': 'طريقة الأستخدام'},
'price': {'en': 'Price', 'ar': 'السعر'}, 'price': {'en': 'Price', 'ar': 'السعر'},
'youCanFindItIn': {'en': 'You can find it in', 'ar': 'يمكنكة ان تجده في'}, 'youCanFindItIn': {'en': 'You can find it in', 'ar': 'يمكنكة ان تجده في'},
'pleaseEnterMedicineName': { 'pleaseEnterMedicineName': {
@ -601,6 +602,7 @@ const Map localizedValues = {
"SelectPatientName": {"en": "Select Patient Name", "ar": "اختر اسم المريض"}, "SelectPatientName": {"en": "Select Patient Name", "ar": "اختر اسم المريض"},
"SelectFamilyPatientName": {"en": "Family Members", "ar": "أفراد الأسرة"}, "SelectFamilyPatientName": {"en": "Family Members", "ar": "أفراد الأسرة"},
"SelectHospital": {"en": "Select Hospital", "ar": "اختر المستشفى"}, "SelectHospital": {"en": "Select Hospital", "ar": "اختر المستشفى"},
"selectCity": {"en": "Select City", "ar": "اختر المدينة"},
"MyAccount": {"en": "My Account", "ar": "حسابي"}, "MyAccount": {"en": "My Account", "ar": "حسابي"},
"OtherAccount": {"en": "Other Account", "ar": "حساب آخر"}, "OtherAccount": {"en": "Other Account", "ar": "حساب آخر"},
"SelectBeneficiary": {"en": "Select Beneficiary", "ar": "حدد المستفيد"}, "SelectBeneficiary": {"en": "Select Beneficiary", "ar": "حدد المستفيد"},
@ -717,6 +719,7 @@ const Map localizedValues = {
"cancelledOrder": {"en": " CANCELLED", "ar": "ملغي"}, "cancelledOrder": {"en": " CANCELLED", "ar": "ملغي"},
"compare": {"en": " Compare", "ar": "مقارنه"}, "compare": {"en": " Compare", "ar": "مقارنه"},
"medicationsRefill": {"en": " Medication Refill", "ar": "طلب أعادة صرف"}, "medicationsRefill": {"en": " Medication Refill", "ar": "طلب أعادة صرف"},
"recommended": {"en": " Recommended For You", "ar": "موصى لك"},
"myPrescription": {"en": " My Prescriptions", "ar": "وصفاتي"}, "myPrescription": {"en": " My Prescriptions", "ar": "وصفاتي"},
"quantity": {"en": " QTY ", "ar": "الكمية"}, "quantity": {"en": " QTY ", "ar": "الكمية"},
"backMyAccount": { "backMyAccount": {
@ -1540,6 +1543,14 @@ const Map localizedValues = {
"هذا ملخص التقرير الصحي الشهري و الذي يسرد المؤشرات الصحية و نتائج التحاليل لأخر الزيارات. يرجى ملاحظة أن هذا التقرير هو تقرير يتم ارساله بشكل آلي من النظام و لا يعتبر رسمي و لا تؤخذ عليه أي قرارات طبية" "هذا ملخص التقرير الصحي الشهري و الذي يسرد المؤشرات الصحية و نتائج التحاليل لأخر الزيارات. يرجى ملاحظة أن هذا التقرير هو تقرير يتم ارساله بشكل آلي من النظام و لا يعتبر رسمي و لا تؤخذ عليه أي قرارات طبية"
}, },
"reqId": {"en": "Request ID:", "ar": " رقم الطلب"}, "reqId": {"en": "Request ID:", "ar": " رقم الطلب"},
"RRT-orders-log": {
"en": "Orders Log",
"ar": "سجل الطلبات"
},
"blood-sugar": {
"en": "Blood Sugar",
"ar": "سكر الدم"
},
"covid19_driveThrueTest": { "covid19_driveThrueTest": {
"en": "'Covid-19- Drive-Thru Test'", "en": "'Covid-19- Drive-Thru Test'",
@ -1601,4 +1612,46 @@ const Map localizedValues = {
"ar": "ar":
"تحويل مستوى الدهون الثلاثية في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس" "تحويل مستوى الدهون الثلاثية في الدم من مليمول/ لتر (مقياس المملكة المتحدة) الى ملغ/ ديسيلتر (مقياس الولايات المتحدة) والعكس"
}, },
"my-tracker": {
"en": "My Tracker",
"ar": "قراءاتي"
},
"weekly": {
"en": "Weekly",
"ar": "أسبوعي"
},
"monthly": {
"en": "Monthly",
"ar": "شهري"
},
"yearly": {
"en": "Yearly",
"ar": "سنوي"
},
"measured": {
"en": "Measured",
"ar": "قياس"
},
"sugar-add": {
"en": "Enter Blood Sugar Value",
"ar": "أدخل قيمة قراءة السكر"
},
"other": {
"en": "Other",
"ar": "آخر"
},
"measure-unit": {
"en": "Measure unit",
"ar": "وحدة القياس"
},
"measure-time": {
"en": "Measure time",
"ar": "وقت القياس"
},"update": {
"en": "Update",
"ar": "تعديل"
},
"bloodD-enter-desc": {"en" : "Enter the required information, In order to register for Blood Donation Service", "ar": "أدخل المعلومات المطلوبة ، للتسجيل في خدمة التبرع بالدم"},
"viewTermsConditions": {"en" : "To view the terms and conditions", "ar": "لعرض الشروط والأحكام"},
// "visit": {"en" : "Visit", "ar": "الزيارة"},
}; };

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
enum Ambulate { Wheelchair, Walker, Stretcher, None } enum Ambulate { Wheelchair, Walker, Stretcher, None }
@ -6,19 +7,19 @@ extension SelectedAmbulate on Ambulate {
String getAmbulateTitle(BuildContext context) { String getAmbulateTitle(BuildContext context) {
switch (this) { switch (this) {
case Ambulate.Wheelchair: case Ambulate.Wheelchair:
return 'Wheelchair'; return TranslationBase.of(context).wheelchair;
break; break;
case Ambulate.Walker: case Ambulate.Walker:
return 'Walker'; return TranslationBase.of(context).walker;
break; break;
case Ambulate.Stretcher: case Ambulate.Stretcher:
return 'Stretcher'; return TranslationBase.of(context).stretcher;
break; break;
case Ambulate.None: case Ambulate.None:
return 'None'; return TranslationBase.of(context).none;
break; break;
} }
return 'None'; return TranslationBase.of(context).none;
} }
int selectAmbulateNumber() { int selectAmbulateNumber() {

@ -17,7 +17,7 @@ class DiabtecPatientResult {
int patientID; int patientID;
var remark; var remark;
var resultDesc; var resultDesc;
int resultValue; dynamic resultValue;
String unit; String unit;
var weekAverageResult; var weekAverageResult;
String weekDesc; String weekDesc;

@ -1,7 +1,7 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class WeekDiabtectResultAverage { class WeekDiabtectResultAverage {
int dailyAverageResult; dynamic dailyAverageResult;
DateTime dateChart; DateTime dateChart;
WeekDiabtectResultAverage({this.dailyAverageResult, this.dateChart}); WeekDiabtectResultAverage({this.dailyAverageResult, this.dateChart});

@ -0,0 +1,157 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class Prescriptions {
String setupID;
int projectID;
int patientID;
int appointmentNo;
String appointmentDate;
String doctorName;
String clinicDescription;
String name;
int episodeID;
int actualDoctorRate;
int admission;
int clinicID;
String companyName;
String despensedStatus;
DateTime dischargeDate;
int dischargeNo;
int doctorID;
String doctorImageURL;
int doctorRate;
String doctorTitle;
int gender;
String genderDescription;
bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall;
bool isExecludeDoctor;
bool isInOutPatient;
String isInOutPatientDescription;
String isInOutPatientDescriptionN;
bool isInsurancePatient;
String nationalityFlagURL;
int noOfPatientsRate;
String qR;
List<String> speciality;
Prescriptions(
{this.setupID,
this.projectID,
this.patientID,
this.appointmentNo,
this.appointmentDate,
this.doctorName,
this.clinicDescription,
this.name,
this.episodeID,
this.actualDoctorRate,
this.admission,
this.clinicID,
this.companyName,
this.despensedStatus,
this.dischargeDate,
this.dischargeNo,
this.doctorID,
this.doctorImageURL,
this.doctorRate,
this.doctorTitle,
this.gender,
this.genderDescription,
this.isActiveDoctorProfile,
this.isDoctorAllowVedioCall,
this.isExecludeDoctor,
this.isInOutPatient,
this.isInOutPatientDescription,
this.isInOutPatientDescriptionN,
this.isInsurancePatient,
this.nationalityFlagURL,
this.noOfPatientsRate,
this.qR,
this.speciality});
Prescriptions.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
patientID = json['PatientID'];
appointmentNo = json['AppointmentNo'];
appointmentDate = json['AppointmentDate'];
doctorName = json['DoctorName'];
clinicDescription = json['ClinicDescription'];
name = json['Name'];
episodeID = json['EpisodeID'];
actualDoctorRate = json['ActualDoctorRate'];
admission = json['Admission'];
clinicID = json['ClinicID'];
companyName = json['CompanyName'];
despensedStatus = json['Despensed_Status'];
dischargeDate = DateUtil.convertStringToDate(json['DischargeDate']);
dischargeNo = json['DischargeNo'];
doctorID = json['DoctorID'];
doctorImageURL = json['DoctorImageURL'];
doctorRate = json['DoctorRate'];
doctorTitle = json['DoctorTitle'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
isExecludeDoctor = json['IsExecludeDoctor'];
isInOutPatient = json['IsInOutPatient'];
isInOutPatientDescription = json['IsInOutPatientDescription'];
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
isInsurancePatient = json['IsInsurancePatient'];
nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate'];
qR = json['QR'];
// speciality = json['Speciality'].cast<String>();
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['PatientID'] = this.patientID;
data['AppointmentNo'] = this.appointmentNo;
data['AppointmentDate'] = this.appointmentDate;
data['DoctorName'] = this.doctorName;
data['ClinicDescription'] = this.clinicDescription;
data['Name'] = this.name;
data['EpisodeID'] = this.episodeID;
data['ActualDoctorRate'] = this.actualDoctorRate;
data['Admission'] = this.admission;
data['ClinicID'] = this.clinicID;
data['CompanyName'] = this.companyName;
data['Despensed_Status'] = this.despensedStatus;
data['DischargeDate'] = this.dischargeDate;
data['DischargeNo'] = this.dischargeNo;
data['DoctorID'] = this.doctorID;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorRate'] = this.doctorRate;
data['DoctorTitle'] = this.doctorTitle;
data['Gender'] = this.gender;
data['GenderDescription'] = this.genderDescription;
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
data['IsExecludeDoctor'] = this.isExecludeDoctor;
data['IsInOutPatient'] = this.isInOutPatient;
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
data['IsInsurancePatient'] = this.isInsurancePatient;
data['NationalityFlagURL'] = this.nationalityFlagURL;
data['NoOfPatientsRate'] = this.noOfPatientsRate;
data['QR'] = this.qR;
data['Speciality'] = this.speciality;
return data;
}
}
//class PrescriptionsList {
// String filterName = "";
// List<Prescriptions> prescriptionsList = List();
//
// PrescriptionsList({this.filterName, Prescriptions prescriptions}) {
// prescriptionsList.add(prescriptions);
// }
//}

@ -32,6 +32,7 @@ class OrderModel {
this.taxRates, this.taxRates,
this.orderTax, this.orderTax,
this.orderDiscount, this.orderDiscount,
this.productCount,
this.orderTotal, this.orderTotal,
this.refundedAmount, this.refundedAmount,
this.rewardPointsWereAdded, this.rewardPointsWereAdded,
@ -96,6 +97,7 @@ class OrderModel {
String taxRates; String taxRates;
double orderTax; double orderTax;
dynamic orderDiscount; dynamic orderDiscount;
dynamic productCount;
double orderTotal; double orderTotal;
dynamic refundedAmount; dynamic refundedAmount;
dynamic rewardPointsWereAdded; dynamic rewardPointsWereAdded;
@ -160,6 +162,7 @@ class OrderModel {
taxRates: json["tax_rates"], taxRates: json["tax_rates"],
orderTax: json["order_tax"].toDouble(), orderTax: json["order_tax"].toDouble(),
orderDiscount: json["order_discount"], orderDiscount: json["order_discount"],
productCount: json["product_count"],
orderTotal: json["order_total"].toDouble(), orderTotal: json["order_total"].toDouble(),
refundedAmount: json["refunded_amount"], refundedAmount: json["refunded_amount"],
rewardPointsWereAdded: json["reward_points_were_added"], rewardPointsWereAdded: json["reward_points_were_added"],

@ -0,0 +1,77 @@
class OrdersModel {
List<Orders> orders;
OrdersModel({this.orders});
OrdersModel.fromJson(Map<String, dynamic> json) {
if (json['orders'] != null) {
orders = new List<Orders>();
json['orders'].forEach((v) {
orders.add(new Orders.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.orders != null) {
data['orders'] = this.orders.map((v) => v.toJson()).toList();
}
return data;
}
}
class Orders {
String id;
int productCount;
double orderTotal;
String createdOnUtc;
int orderStatusId;
String orderStatus;
String orderStatusn;
bool canCancel;
bool canRefund;
dynamic customerId;
Orders(
{this.id,
this.productCount,
this.orderTotal,
this.createdOnUtc,
this.orderStatusId,
this.orderStatus,
this.orderStatusn,
this.canCancel,
this.canRefund,
this.customerId,});
Orders.fromJson(Map<String, dynamic> json) {
try {
id = json['id'];
productCount = json['product_count'];
orderTotal = json['order_total'];
createdOnUtc = json['created_on_utc'];
orderStatusId = json['order_status_id'];
orderStatus = json['order_status'];
orderStatusn = json['order_statusn'];
canCancel = json['can_cancel'];
canRefund = json['can_refund'];
customerId = json['customer_id'];
}catch(e){
print(e);
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['product_count'] = this.productCount;
data['order_total'] = this.orderTotal;
data['created_on_utc'] = this.createdOnUtc;
data['order_status_id'] = this.orderStatusId;
data['order_status'] = this.orderStatus;
data['order_statusn'] = this.orderStatusn;
return data;
}
}

@ -69,25 +69,34 @@ class BloodSugarService extends BaseService {
}, body: Map()); }, body: Map());
} }
addDiabtecResult( addDiabtecResult({String bloodSugerDateChart, String bloodSugerResult, String diabtecUnit, int measuredTime}) async {
{String bloodSugerDateChart,
String bloodSugerResult,
String diabtecUnit,
int measuredTime}) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['BloodSugerDateChart'] = bloodSugerDateChart; body['BloodSugerDateChart'] = bloodSugerDateChart;
body['BloodSugerResult'] = bloodSugerResult; body['BloodSugerResult'] = bloodSugerResult;
body['DiabtecUnit'] = diabtecUnit; body['DiabtecUnit'] = diabtecUnit;
body['MeasuredTime'] =2;// measuredTime; body['MeasuredTime'] = measuredTime;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(ADD_BLOOD_PRESSURE_RESULT, await baseAppClient.post(ADD_BLOOD_PRESSURE_RESULT,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {},
var asd =""; onFailure: (String error, int statusCode) {
}, hasError = true;
super.error = error;
}, body: body);
}
updateDiabtecResult({DateTime month,DateTime hour,String bloodSugerResult,String diabtecUnit, int measuredTime,int lineItemNo}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['BloodSugerResult'] = bloodSugerResult;
body['DiabtecUnit'] = diabtecUnit;
body['BloodSugerDateChart'] = '${month.year}-${month.month}-${month.day} ${hour.hour}:${hour.minute}:00';
body['isDentalAllowedBackend'] = false;
body['MeasuredTime'] = measuredTime;
body['LineItemNo'] = lineItemNo;
await baseAppClient.post(UPDATE_DIABETIC_RESULT,
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/blooddonation/blood_groub_details.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
@ -23,11 +24,11 @@ class MyBalanceService extends BaseService {
PatientInfoAndMobileNumber patientInfoAndMobileNumber; PatientInfoAndMobileNumber patientInfoAndMobileNumber;
String logInTokenID; String logInTokenID;
String verificationCode; String verificationCode;
String updatedRegisterBloodMessage = "";
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>(); locator<AuthenticatedUserObject>();
MyBalanceService(){ MyBalanceService() {
getFamilyFiles(); getFamilyFiles();
} }
@ -156,4 +157,49 @@ class MyBalanceService extends BaseService {
return await getSharedRecordByStatus(); return await getSharedRecordByStatus();
} }
} }
Future updateBloodGroup(List_BloodGroupDetailsModel detailsModel) async {
hasError = false;
await getUser();
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Map<String, dynamic> body = Map();
body['City'] = detailsModel.city;
body['cityCode'] = detailsModel.cityCode;
body['Gender'] = detailsModel.gender;
body['BloodGroup'] = detailsModel.bloodGroup;
body['CellNumber'] = user.mobileNumber;
body['LanguageID'] = languageID;
body['NationalID'] = user.nationalityID;
body['ZipCode'] = user.zipCode ?? "+966";
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(BLOOD_DONATION_REGISTER_BLOOD_TYPE,
onSuccess: (dynamic response, int statusCode) {
updatedRegisterBloodMessage = response['ErrorEndUserMessage'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
if(error == null){
super.error = "Something went wrong";
}
}, body: body);
}
Future addUserAgreementForBloodDonation() async {
hasError = false;
var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Map<String, dynamic> body = Map();
body['IsAgreed'] = true;
body['LanguageID'] = languageID;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(ADD_USER_AGREEMENT_FOR_BLOOD_DONATION,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
} }

@ -6,17 +6,21 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
class PharmacyModuleService extends BaseService { class PharmacyModuleService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences(); final AppSharedPreferences sharedPref = AppSharedPreferences();
bool isFinished = true; bool isFinished = true;
bool hasError = false; bool hasError = false;
String errorMsg = ''; String errorMsg = '';
String url ="";
List<PharmacyImageObject> bannerItems = List(); List<PharmacyImageObject> bannerItems = List();
List<Manufacturer> manufacturerList = List(); List<Manufacturer> manufacturerList = List();
List<PharmacyProduct> bestSellerProducts = List(); List<PharmacyProduct> bestSellerProducts = List();
List<PharmacyProduct> lastVisitedProducts = List(); List<PharmacyProduct> lastVisitedProducts = List();
Future makeVerifyCustomer(dynamic data) async { Future makeVerifyCustomer(dynamic data) async {
Map<String, String> queryParams = {'FileNumber': data['PatientID'].toString()}; Map<String, String> queryParams = {'FileNumber': data['PatientID'].toString()};
hasError = false; hasError = false;
@ -148,4 +152,5 @@ class PharmacyModuleService extends BaseService {
} }
} }
} }
} }

@ -0,0 +1,53 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
class PrescriptionService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences();
bool isFinished = true;
bool hasError = false;
String errorMsg = '';
String url = "";
List<Prescriptions> _prescriptionsList = List();
List<Prescriptions> get prescriptionsList => _prescriptionsList;
Future getPrescription() async {
hasError = false;
url = PRESCRIPTION;
print("Print PRESCRIPTION url" + url);
await baseAppClient.get(url,
onSuccess: (dynamic response, int statusCode) {
_prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((item) {
_prescriptionsList.add(Prescriptions.fromJson(item));
});
print(_prescriptionsList.length);
print(response);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
}
// Future getPrescription() async {
// hasError = false;
// Map<String, dynamic> body = Map();
// body['isDentalAllowedBackend'] = false;
// await baseAppClient.post(PRESCRIPTION,
// onSuccess: (dynamic response, int statusCode) {
// prescriptionsList.clear();
// response['PatientPrescriptionList'].forEach((prescriptions) {
// prescriptionsList.add(Prescriptions.fromJson(prescriptions));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// }, body: body);
// }
}

@ -0,0 +1,18 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class TermsConditionsService extends BaseService {
String userAgreementContent = "";
Future getUserTermsAndConditions() async {
hasError = false;
await baseAppClient.post(GET_USER_TERMS,
onSuccess: (dynamic response, int statusCode) {
userAgreementContent = response['UserAgreementContent'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: Map<String, dynamic>());
}
}

@ -0,0 +1,29 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/service/termsConditionsService.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../locator.dart';
class TermsConditionsViewModel extends BaseViewModel{
TermsConditionsService _service = locator<TermsConditionsService>();
String get userAgreementContent => _service.userAgreementContent;
getUserTermsAndConditions() async {
setState(ViewState.Busy);
await _service.getUserTermsAndConditions();
if (_service.hasError) {
error = _service.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
@override
void dispose() {
super.dispose();
}
}

@ -45,7 +45,6 @@ class BloodSugarViewMode extends BaseViewModel {
x: index, x: index,
y: bloodSugarService y: bloodSugarService
.monthDiabtectResultAverageList[index].weekAverageResult)); .monthDiabtectResultAverageList[index].weekAverageResult));
var asd="";
} }
bloodSugarService.yearDiabtecResultAverageList.forEach((element) { bloodSugarService.yearDiabtecResultAverageList.forEach((element) {
@ -94,11 +93,7 @@ class BloodSugarViewMode extends BaseViewModel {
]; ];
} }
addDiabtecResult( Future addDiabtecResult({String bloodSugerDateChart, String bloodSugerResult, String diabtecUnit, int measuredTime}) async {
{String bloodSugerDateChart,
String bloodSugerResult,
String diabtecUnit,
int measuredTime}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await bloodSugarService.addDiabtecResult( await bloodSugarService.addDiabtecResult(
bloodSugerDateChart: bloodSugerDateChart, bloodSugerDateChart: bloodSugerDateChart,
@ -114,6 +109,24 @@ class BloodSugarViewMode extends BaseViewModel {
} }
} }
Future updateDiabtecResult({DateTime month,DateTime hour,String bloodSugerResult,String diabtecUnit, int measuredTime,int lineItemNo}) async {
setState(ViewState.BusyLocal);
await bloodSugarService.updateDiabtecResult(
bloodSugerResult: bloodSugerResult ,
diabtecUnit: diabtecUnit,
hour: hour,
measuredTime: measuredTime,
lineItemNo: lineItemNo,
month: month);
if (bloodSugarService.hasError) {
error = bloodSugarService.error;
setState(ViewState.Error);
} else {
await getBloodSugar();
setState(ViewState.Idle);
}
}
} }

@ -41,6 +41,9 @@ class MyBalanceViewModel extends BaseViewModel {
double get totalAdvanceBalanceAmount => double get totalAdvanceBalanceAmount =>
_myBalanceService.totalAdvanceBalanceAmount; _myBalanceService.totalAdvanceBalanceAmount;
String get updatedRegisterBloodMessage =>
_myBalanceService.updatedRegisterBloodMessage;
GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse => GetAllSharedRecordsByStatusResponse get getAllSharedRecordsByStatusResponse =>
_myBalanceService.getAllSharedRecordsByStatusResponse; _myBalanceService.getAllSharedRecordsByStatusResponse;
@ -74,7 +77,6 @@ class MyBalanceViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getCities() async { Future getCities() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _bloodDonationService.getAllCitiesOrders(); await _bloodDonationService.getAllCitiesOrders();
@ -159,4 +161,17 @@ class MyBalanceViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future updateBloodGroup(List_BloodGroupDetailsModel detailsModel) async {
setState(ViewState.Busy);
await _myBalanceService.updateBloodGroup(detailsModel);
if (_myBalanceService.hasError) {
error = _myBalanceService.error;
setState(ViewState.ErrorLocal);
} else {
await _myBalanceService.addUserAgreementForBloodDonation();
setState(ViewState.Idle);
}
}
} }

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_serv
import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/orderDetails_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../locator.dart'; import '../../../locator.dart';
@ -17,15 +18,12 @@ import '../base_view_model.dart';
class OrderModelViewModel extends BaseViewModel { class OrderModelViewModel extends BaseViewModel {
OrderService _orderService = locator<OrderService>(); OrderService _orderService = locator<OrderService>();
List<Orders> get orders => _orderService.orderList;
List<OrderModel> get order => _orderService.orderList;
OrderDetailsService _orderDetailsService = locator<OrderDetailsService>(); OrderDetailsService _orderDetailsService = locator<OrderDetailsService>();
List<OrderModel> get orderListModel => _orderDetailsService.orderList;
List<OrderModel> get orderDetails => _orderDetailsService.orderDetails;
CancelOrderService _cancelOrderService = locator<CancelOrderService>(); CancelOrderService _cancelOrderService = locator<CancelOrderService>();
List<OrderModel> get cancelOrder => _cancelOrderService.cancelOrderList; List<OrderModel> get cancelOrder => _cancelOrderService.cancelOrderList;
@ -52,9 +50,9 @@ class OrderModelViewModel extends BaseViewModel {
} }
} }
Future getOrderDetails(orderId) async { Future getOrderDetails(OrderId) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _orderDetailsService.getOrderDetails(orderId); await _orderDetailsService.getOrderDetails(OrderId);
if (_orderDetailsService.hasError) { if (_orderDetailsService.hasError) {
error = _orderDetailsService.error; error = _orderDetailsService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -3,7 +3,11 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
//import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
//import 'package:diplomaticquarterapp/core/service/medical/prescriptions_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import '../../../locator.dart'; import '../../../locator.dart';
@ -11,6 +15,8 @@ import '../../../locator.dart';
class PharmacyModuleViewModel extends BaseViewModel { class PharmacyModuleViewModel extends BaseViewModel {
PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>(); PharmacyModuleService _pharmacyService = locator<PharmacyModuleService>();
PrescriptionService _prescriptionService = locator<PrescriptionService>();
List<PharmacyImageObject> get bannerList => _pharmacyService.bannerItems; List<PharmacyImageObject> get bannerList => _pharmacyService.bannerItems;
List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList; List<Manufacturer> get manufacturerList => _pharmacyService.manufacturerList;
@ -21,6 +27,11 @@ class PharmacyModuleViewModel extends BaseViewModel {
List<PharmacyProduct> get lastVisitedProducts => List<PharmacyProduct> get lastVisitedProducts =>
_pharmacyService.lastVisitedProducts; _pharmacyService.lastVisitedProducts;
List<Prescriptions> get prescriptionsList =>
_prescriptionService.prescriptionsList;
// List<PharmacyProduct> get pharmacyPrescriptionsList => PharmacyProduct.pharmacyPrescriptionsList ;
Future getPharmacyHomeData() async { Future getPharmacyHomeData() async {
setState(ViewState.Busy); setState(ViewState.Busy);
var data = await sharedPref.getObject(USER_PROFILE); var data = await sharedPref.getObject(USER_PROFILE);
@ -92,6 +103,17 @@ class PharmacyModuleViewModel extends BaseViewModel {
} }
} }
/////////////RecommendedProducts
// _getRecommendedProducts() async {
// await _pharmacyService.getRecommendedProducts();
// if (_pharmacyService.hasError) {
// error = _pharmacyService.error;
// setState(ViewState.Error);
// } else {
// setState(ViewState.Idle);
// }
// }
Future<bool> checkUserIsActivated() async { Future<bool> checkUserIsActivated() async {
if (authenticatedUserObject.isLogin) { if (authenticatedUserObject.isLogin) {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
@ -105,4 +127,17 @@ class PharmacyModuleViewModel extends BaseViewModel {
return false; return false;
} }
} }
getPrescription() async {
print("Print PRESCRIPTION url");
setState(ViewState.Busy);
await _prescriptionService.getPrescription();
if (_prescriptionService.hasError) {
error = _prescriptionService.error;
setState(ViewState.Error);
} else {
setState(ViewState.Idle);
}
}
} }

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart';
import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart';
import 'package:diplomaticquarterapp/core/service/qr_service.dart'; import 'package:diplomaticquarterapp/core/service/qr_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart';
@ -59,12 +60,14 @@ import 'core/service/parmacyModule/order-preview-service.dart';
import 'core/service/notifications_service.dart'; import 'core/service/notifications_service.dart';
import 'core/service/parmacyModule/terms-condition-service.dart'; import 'core/service/parmacyModule/terms-condition-service.dart';
import 'core/service/privilege_service.dart'; import 'core/service/privilege_service.dart';
import 'core/service/termsConditionsService.dart';
import 'core/service/weather_service.dart'; import 'core/service/weather_service.dart';
import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'core/service/parmacyModule/parmacy_module_service.dart'; import 'core/service/parmacyModule/parmacy_module_service.dart';
import 'core/service/offers_service.dart'; import 'core/service/offers_service.dart';
import 'core/service/pharmacy_categorise_service.dart'; import 'core/service/pharmacy_categorise_service.dart';
import 'core/viewModels/TermsConditionsViewModel.dart';
import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'core/viewModels/appointment_rate_view_model.dart'; import 'core/viewModels/appointment_rate_view_model.dart';
import 'core/viewModels/blooddonation/blood_details_view_model.dart'; import 'core/viewModels/blooddonation/blood_details_view_model.dart';
@ -202,8 +205,11 @@ void setupLocator() {
locator.registerLazySingleton(() => CustomerAddressesService()); locator.registerLazySingleton(() => CustomerAddressesService());
locator.registerLazySingleton(() => TermsConditionService()); locator.registerLazySingleton(() => TermsConditionService());
locator.registerLazySingleton(() => CancelOrderService()); locator.registerLazySingleton(() => CancelOrderService());
locator.registerLazySingleton(() => PrescriptionService());
locator.registerLazySingleton(() => PrivilegeService()); locator.registerLazySingleton(() => PrivilegeService());
locator.registerLazySingleton(() => WeatherService()); locator.registerLazySingleton(() => WeatherService());
locator.registerLazySingleton(() => TermsConditionsService());
/// View Model /// View Model
locator.registerFactory(() => HospitalViewModel()); locator.registerFactory(() => HospitalViewModel());
@ -259,7 +265,6 @@ void setupLocator() {
locator.registerFactory(() => ProductDetailViewModel()); locator.registerFactory(() => ProductDetailViewModel());
locator.registerFactory(() => WeatherViewModel()); locator.registerFactory(() => WeatherViewModel());
locator.registerFactory(() => OrderPreviewViewModel()); locator.registerFactory(() => OrderPreviewViewModel());
locator.registerFactory(() => LacumViewModel()); locator.registerFactory(() => LacumViewModel());
locator.registerFactory(() => LacumTranferViewModel()); locator.registerFactory(() => LacumTranferViewModel());
@ -271,11 +276,16 @@ void setupLocator() {
// Offer And Packages // Offer And Packages
//---------------------- //----------------------
locator.registerLazySingleton(() => OffersAndPackagesServices()); // offerPackagesServices Service locator.registerLazySingleton(
locator.registerFactory(() => OfferCategoriesViewModel()); // Categories View Model () => OffersAndPackagesServices()); // offerPackagesServices Service
locator.registerFactory(() => OfferProductsViewModel()); // Products View Model locator.registerFactory(
() => OfferCategoriesViewModel()); // Categories View Model
locator
.registerFactory(() => OfferProductsViewModel()); // Products View Model
// Geofencing // Geofencing
// --------------------- // ---------------------
locator.registerLazySingleton(() => GeofencingServices()); // Geofencing Services locator.registerLazySingleton(
() => GeofencingServices()); // Geofencing Services
locator.registerFactory(() => TermsConditionsViewModel());
} }

@ -1,14 +1,15 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.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/hospitals/hospitals_model.dart'; //import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/core/service/blood/blood_details_servies.dart'; import 'package:diplomaticquarterapp/core/service/blood/blood_details_servies.dart';
import 'package:diplomaticquarterapp/core/viewModels/blooddonation/blood_details_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/blooddonation/blood_details_view_model.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/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart';
@ -27,6 +28,7 @@ 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:giffy_dialog/giffy_dialog.dart'; import 'package:giffy_dialog/giffy_dialog.dart';
import 'package:provider/provider.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart';
//import '../../../core/model/my_balance/AdvanceModel.dart'; //import '../../../core/model/my_balance/AdvanceModel.dart';
@ -39,8 +41,8 @@ import 'dialogs/SelectPatientInfoDialog.dart';
import 'new_text_Field.dart'; import 'new_text_Field.dart';
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
enum Gender{Male,Female,NON} enum Gender { Male, Female, NON }
enum Blood{Oplus,Ominus,Aplus,Aminus,Bplus,Bminus,ABplus,ABminus,NON} enum Blood { Oplus, Ominus, Aplus, Aminus, Bplus, Bminus, ABplus, ABminus, NON }
class BloodDonationPage extends StatefulWidget { class BloodDonationPage extends StatefulWidget {
@override @override
@ -51,8 +53,8 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
TextEditingController _fileTextController = TextEditingController(); TextEditingController _fileTextController = TextEditingController();
TextEditingController _notesTextController = TextEditingController(); TextEditingController _notesTextController = TextEditingController();
BeneficiaryType beneficiaryType = BeneficiaryType.NON; BeneficiaryType beneficiaryType = BeneficiaryType.NON;
Gender gender = Gender.Male;//Gender.NON; Gender gender = Gender.Male; //Gender.NON;
Blood blood = Blood.Aminus;//Blood.NON; Blood blood = Blood.Aminus; //Blood.NON;
//HospitalsModel _selectedHospital; //HospitalsModel _selectedHospital;
CitiesModel _selectedHospital; CitiesModel _selectedHospital;
@ -62,22 +64,27 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
GetAllSharedRecordsByStatusList selectedPatientFamily; GetAllSharedRecordsByStatusList selectedPatientFamily;
AdvanceModel advanceModel = AdvanceModel(); AdvanceModel advanceModel = AdvanceModel();
List_BloodGroupDetailsModel bloodDetails=List_BloodGroupDetailsModel(); List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-");
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; AuthenticatedUser authUser;
var checkedValue = false; var checkedValue = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
getAuthUser(); getAuthUser();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) => model.getCities(),//model.getHospitals(), onModelReady: (model) => model.getCities(), //model.getHospitals(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: "Blood Donation",//TranslationBase.of(context).advancePayment, baseViewModel: model,
appBarTitle: TranslationBase.of(context).bloodD,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
@ -86,15 +93,16 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Texts(
// TranslationBase.of(context).advancePaymentLabel, TranslationBase.of(context).bloodDEnterDesc,
"Enter the required information, In order to register for Blood Donation Service",//+model.user.firstName,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
InkWell( InkWell(
onTap: () => confirmSelectHospitalDialog(model.CitiesModelList),//model.hospitals onTap: () =>
confirmSelectHospitalDialog(model.CitiesModelList),
//model.hospitals
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
@ -105,7 +113,7 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName()), Texts(getHospitalName(projectProvider, context)),
Icon(Icons.arrow_drop_down) Icon(Icons.arrow_drop_down)
], ],
), ),
@ -116,7 +124,8 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
), ),
InkWell( InkWell(
//======Gender======== //======Gender========
onTap: () => confirmSelectGenderDialog(),//confirmSelectBeneficiaryDialog(model), onTap: () => confirmSelectGenderDialog(),
//confirmSelectBeneficiaryDialog(model),
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
@ -128,49 +137,19 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
//Texts(getBeneficiaryType()), //Texts(getBeneficiaryType()),
Texts(getGender()), Texts(getGender(context)),
Icon(Icons.arrow_drop_down) Icon(Icons.arrow_drop_down)
], ],
), ),
), ),
), ),
// if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
// SizedBox(
// height: 12,
// ),
// if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
// InkWell(
// onTap: () {
// model.getFamilyFiles().then((value) {
// confirmSelectFamilyDialog(model
// .getAllSharedRecordsByStatusResponse
// .getAllSharedRecordsByStatusList);
// }).showProgressBar(
// text: "Loading",
// backgroundColor: Colors.blue.withOpacity(0.6));
// },
// child: Container(
// padding: EdgeInsets.all(12),
// width: double.infinity,
// height: 65,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Texts(getFamilyMembersName()),
// Icon(Icons.arrow_drop_down)
// ],
// ),
// ),
// ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
InkWell( InkWell(
//======Gender======== //======Gender========
onTap: () => confirmSelectBloodDialog(),//confirmSelectBeneficiaryDialog(model), onTap: () => confirmSelectBloodDialog(),
//confirmSelectBeneficiaryDialog(model),
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
@ -188,44 +167,14 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
), ),
), ),
), ),
// if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
// SizedBox(
// height: 12,
// ),
// if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
// InkWell(
// onTap: () {
// model.getFamilyFiles().then((value) {
// confirmSelectFamilyDialog(model
// .getAllSharedRecordsByStatusResponse
// .getAllSharedRecordsByStatusList);
// }).showProgressBar(
// text: "Loading",
// backgroundColor: Colors.blue.withOpacity(0.6));
// },
// child: Container(
// padding: EdgeInsets.all(12),
// width: double.infinity,
// height: 65,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Texts(getFamilyMembersName()),
// Icon(Icons.arrow_drop_down)
// ],
// ),
// ),
// ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Row( Row(
children: [ children: [
Container( Container(
child: Text(" To view the terms and conditions "), child: Text(
TranslationBase.of(context).viewTermsConditions),
), ),
SizedBox( SizedBox(
width: MediaQuery.of(context).size.height * 0.10, width: MediaQuery.of(context).size.height * 0.10,
@ -233,10 +182,14 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.of(context).push(MaterialPageRoute( Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => UserAgreementPage())); builder: (BuildContext context) =>
UserAgreementPage()));
}, },
child: Container( child: Container(
child: Texts(" Click here ",color: Colors.blue,), child: Texts(
TranslationBase.of(context).clickHere,
color: Colors.blue,
),
), ),
) )
], ],
@ -247,99 +200,34 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
Row( Row(
children: [ children: [
Checkbox( Checkbox(
onChanged: (bool value) { onChanged: (bool value) {
setState(() { setState(() {
checkedValue = value; checkedValue = value;
}); });
}, },
// tristate: checkedValue==true,//i == 1, // tristate: checkedValue==true,//i == 1,
value: checkedValue, value: checkedValue,
activeColor: Colors.red,//Color(0xFF6200EE), activeColor: Color(0xFFc5272d), //Color(0xFF6200EE),
),
SizedBox(
height: 10,
),
Row(
children: [],
), ),
SizedBox(height: 10,),
Row(children: [
],),
SizedBox( SizedBox(
width: 10, width: 10,
), ),
Text( Text(
'I agree to the terms and conditions ', TranslationBase.of(context)
style: Theme.of(context).textTheme.subtitle1.copyWith(color: checkedValue? Colors.red : Colors.black), .iAgreeToTheTermsAndConditions,
style: Theme.of(context).textTheme.subtitle1.copyWith(
color: checkedValue
? Color(0xFFc5272d)
: Colors.black),
), ),
], ],
), ),
// NewTextFields(
// hintText: TranslationBase.of(context).fileNumber,
// controller: _fileTextController,
// ),
// if (beneficiaryType == BeneficiaryType.OtherAccount)
// SizedBox(
// height: 12,
// ),
// if (beneficiaryType == BeneficiaryType.OtherAccount)
// InkWell(
// onTap: () {
// if (_fileTextController.text.isNotEmpty)
// model
// .getPatientInfoByPatientID(
// id: _fileTextController.text)
// .then((value) {
// confirmSelectPatientDialog(model.patientInfoList);
// }).showProgressBar(
// text: "Loading",
// backgroundColor:
// Colors.blue.withOpacity(0.6));
// else
// AppToast.showErrorToast(
// message: 'Please Enter The File Number');
// },
// child: Container(
// padding: EdgeInsets.all(12),
// width: double.infinity,
// height: 65,
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(12),
// color: Colors.white),
// child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// Texts(getPatientName()),
// Icon(Icons.arrow_drop_down)
// ],
// ),
// ),
// ),
// SizedBox(
// height: 12,
// ),
// NewTextFields(
// hintText: TranslationBase.of(context).amount,
// keyboardType: TextInputType.number,
// onChanged: (value) {
// setState(() {
// amount = value;
// });
// },
// ),
// SizedBox(
// height: 12,
// ),
// NewTextFields(
// hintText: TranslationBase.of(context).depositorEmail,
// initialValue: model.user.emailAddress,
// onChanged: (value) {
// email = value;
// },
// ),
// SizedBox(
// height: 12,
// ),
// NewTextFields(
// hintText: TranslationBase.of(context).notes,
// controller: _notesTextController,
// ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
@ -355,29 +243,25 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
onTap: () { onTap: () {
showDialog( showDialog(
context: context, context: context,
builder: (_) => builder: (_) => AssetGiffyDialog(
AssetGiffyDialog(
title: Text( title: Text(
"", "",
style: TextStyle( style: TextStyle(
fontSize: 22.0, fontSize: 22.0,
fontWeight: fontWeight: FontWeight.w600),
FontWeight
.w600),
), ),
image: Image.asset( image: Image.asset(
'assets/images/BloodChrt_EN.png'), 'assets/images/BloodChrt_EN.png'),
buttonCancelText: buttonCancelText: Text(
Text('cancel'), TranslationBase.of(context).cancel),
buttonCancelColor: buttonCancelColor: Colors.grey,
Colors.grey,
onlyCancelButton: true, onlyCancelButton: true,
)); ));
}, },
child: Container( child: Container(
width: 250, width: 250,
height: 200, height: 200,
child:Image.asset( child: Image.asset(
'assets/images/BloodChrt_EN.png')), 'assets/images/BloodChrt_EN.png')),
), ),
), ),
@ -395,25 +279,41 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12, height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), color: checkedValue == false
label: "Save", ? Color(0xFFa0a4a6)
// : Color.fromRGBO(
onTap: (){ 63,
72,
bloodDetails.city=_selectedHospital.toString(); 74,
1,
// bloodDetails. ),
label: TranslationBase.of(context).save,
onTap: () async {
if(_selectedHospital == null){
AppToast.showErrorToast(message: TranslationBase.of(context).selectCity);
return;
}
bloodDetails.city = projectProvider.isArabic
? _selectedHospital.descriptionN
: _selectedHospital.description;
bloodDetails.cityCode = _selectedHospital.iD.toString();
bloodDetails.gender = gender == Gender.Male ? 1 : 2;
await model.updateBloodGroup(bloodDetails);
if (model.state == ViewState.Idle) {
AppToast.showSuccessToast(
message: model.updatedRegisterBloodMessage);
} else {
AppToast.showErrorToast(message: model.error);
}
}, },
), ),
)), )),
); );
} }
//============== //==============
void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) { void confirmSelectBeneficiaryDialog(MyBalanceViewModel model) {
showDialog( showDialog(
@ -435,94 +335,85 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
), ),
); );
} }
void confirmSelectBloodDialog(){
void confirmSelectBloodDialog() {
showDialog( showDialog(
context: context, context: context,
child: SelectBloodDialog(bloodType: blood, child: SelectBloodDialog(
bloodType: blood,
onValueSelected: (value) { onValueSelected: (value) {
setState(() { setState(() {
if (value == Blood.Oplus) { if (value == Blood.Oplus) {
bloodDetails.bloodGroup="O+"; bloodDetails.bloodGroup = "O+";
// _fileTextController.text = model.user.patientID.toString(); // _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName = // advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName; // model.user.firstName + " " + model.user.lastName;
}else } else if (value == Blood.Ominus) {
if (value == Blood.Ominus) {
// _fileTextController.text = model.user.patientID.toString(); // _fileTextController.text = model.user.patientID.toString();
bloodDetails.bloodGroup="O-"; bloodDetails.bloodGroup = "O-";
// advanceModel.depositorName = // advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName; // model.user.firstName + " " + model.user.lastName;
}else } else if (value == Blood.ABplus) {
if (value == Blood.ABplus) { bloodDetails.bloodGroup = "AB+";
bloodDetails.bloodGroup="AB+";
// _fileTextController.text = model.user.patientID.toString(); // _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName = // advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName; // model.user.firstName + " " + model.user.lastName;
}else } else if (value == Blood.ABminus) {
if (value == Blood.ABminus) { bloodDetails.bloodGroup = "AB-";
bloodDetails.bloodGroup="AB-";
// _fileTextController.text = model.user.patientID.toString(); // _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName = // advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName; // model.user.firstName + " " + model.user.lastName;
}else } else if (value == Blood.Aplus) {
if (value == Blood.Aplus) { bloodDetails.bloodGroup = "A+";
bloodDetails.bloodGroup="A+";
// _fileTextController.text = model.user.patientID.toString(); // _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName = // advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName; // model.user.firstName + " " + model.user.lastName;
}else } else if (value == Blood.Aminus) {
if (value == Blood.Aminus) { bloodDetails.bloodGroup = "A-";
bloodDetails.bloodGroup="A-";
// _fileTextController.text = model.user.patientID.toString(); // _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName = // advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName; // model.user.firstName + " " + model.user.lastName;
}else } else if (value == Blood.Bplus) {
if (value == Blood.Bplus) { bloodDetails.bloodGroup = "B+";
bloodDetails.bloodGroup="B+";
// _fileTextController.text = model.user.patientID.toString(); // _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName = // advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName; // model.user.firstName + " " + model.user.lastName;
}else } else if (value == Blood.Bminus) {
if (value == Blood.Bminus) { bloodDetails.bloodGroup = "B-";
bloodDetails.bloodGroup="B-";
// _fileTextController.text = model.user.patientID.toString(); // _fileTextController.text = model.user.patientID.toString();
// advanceModel.depositorName = // advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName; // model.user.firstName + " " + model.user.lastName;
} } else
else
_fileTextController.text = ""; _fileTextController.text = "";
// beneficiaryType = value; // beneficiaryType = value;
blood=value; blood = value;
} });
);
}, },
), ),
); );
} }
void confirmSelectGenderDialog(){
void confirmSelectGenderDialog() {
showDialog( showDialog(
context: context, context: context,
child: SelectGenderDialog(beneficiaryType: gender, child: SelectGenderDialog(
beneficiaryType: gender,
onValueSelected: (value) { onValueSelected: (value) {
setState(() { setState(() {
if (value == Gender.Male) { if (value == Gender.Male) {
// _fileTextController.text = model.user.patientID.toString(); // _fileTextController.text = model.user.patientID.toString();
bloodDetails.patientType=1; bloodDetails.patientType = 1;
// advanceModel.depositorName = // advanceModel.depositorName =
// model.user.firstName + " " + model.user.lastName; // model.user.firstName + " " + model.user.lastName;
} else } else
// _fileTextController.text = ""; // _fileTextController.text = "";
{bloodDetails.gender=2;} {
bloodDetails.gender = 2;
}
// beneficiaryType = value; // beneficiaryType = value;
gender=value; gender = value;
}); });
}, },
), ),
@ -591,23 +482,25 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
return TranslationBase.of(context).otherAccount; return TranslationBase.of(context).otherAccount;
break; break;
case BeneficiaryType.NON: case BeneficiaryType.NON:
return "Select Gender";//TranslationBase.of(context).selectBeneficiary; return TranslationBase.of(context).selectBeneficiary;
} }
return "Select Gender";//TranslationBase.of(context).selectBeneficiary; return TranslationBase.of(context).selectBeneficiary;
} }
String getGender() {
String getGender(BuildContext context) {
switch (gender) { switch (gender) {
case Gender.Male: case Gender.Male:
return "Male"; return TranslationBase.of(context).male;
case Gender.Female: case Gender.Female:
return "Female"; return TranslationBase.of(context).female;
break; break;
case Gender.NON: case Gender.NON:
return "Select Gender";//TranslationBase.of(context).selectBeneficiary; return TranslationBase.of(context).selectGender;
} }
return "Select Gender";//TranslationBase.of(context).selectBeneficiary; return TranslationBase.of(context).selectGender;
} }
String getBlood() { String getBlood() {
switch (blood) { switch (blood) {
case Blood.Oplus: case Blood.Oplus:
@ -639,18 +532,19 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
break; break;
case Blood.NON: case Blood.NON:
return "Select Blood Type";//TranslationBase.of(context).selectBeneficiary; return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary;
} }
return "Select Blood Type";//TranslationBase.of(context).selectBeneficiary; return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary;
} }
String getHospitalName() { String getHospitalName(ProjectViewModel projectProvider, BuildContext context) {
if (_selectedHospital != null) if (_selectedHospital != null)
return _selectedHospital.description; return projectProvider.isArabic
? _selectedHospital.descriptionN
: _selectedHospital.description;
else else
return return TranslationBase.of(context).selectCity;
"Riyadh"; // return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital;
// return List_BloodGroupDetailsModel.fromJson(0).city.toString();//"Select City";//TranslationBase.of(context).selectHospital;
} }
String getPatientName() { String getPatientName() {
@ -677,8 +571,6 @@ class _BloodDonationPageState extends State<BloodDonationPage> {
return TranslationBase.of(context).selectFamilyPatientName; return TranslationBase.of(context).selectFamilyPatientName;
} }
//================
//================
} }

@ -38,7 +38,7 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text("Male"), title: Text(TranslationBase.of(context).male),
leading: Radio( leading: Radio(
value: Gender.Male, value: Gender.Male,
groupValue: beneficiaryType, groupValue: beneficiaryType,
@ -68,7 +68,7 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
}); });
}, },
child: ListTile( child: ListTile(
title: Text("Female"), title: Text(TranslationBase.of(context).female),
leading: Radio( leading: Radio(
value: Gender.Female, value: Gender.Female,
groupValue: beneficiaryType, groupValue: beneficiaryType,

@ -1,55 +1,23 @@
import 'package:diplomaticquarterapp/core/viewModels/TermsConditionsViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_html/flutter_html.dart';
class UserAgreementPage extends StatelessWidget { class UserAgreementPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return BaseView<TermsConditionsViewModel>(
isShowAppBar: true, onModelReady: (model) => model.getUserTermsAndConditions(),
appBarTitle: "User Agreement", builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
body: appBarTitle: TranslationBase.of(context).userAgreement,
Container( body: SingleChildScrollView(
child:ListView( child: Html(
scrollDirection: Axis.vertical, data: model.userAgreementContent,
children: <Widget>[ ),
/////////// )),
Column( );
children: [
SizedBox(
height: 20,
),
Container(
child:Text("Communication via email, text messages and phone calls",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)),
),
SizedBox(
height: 20,
),
Container(
child:
Text("I understand that the contact number or Email that \n I have provided on registration will be used for communication by HMG.\n I hereby agree to be notified by HMG through SMS, Email or any other method for appointments notifications, current HMGs medical services, and any services introduced by the HMG in the future or any modifications made to the services offered by the HMG. And these messages may be submitted as evidence where the HMG has the right to use at any time whatsoever and as it sees fit.",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)),
),
SizedBox(
height: 20,
),
Container(
child:
Text("I understand the risks of communicating by email and text messages, in particular the privacy risks. \nI understand that HMG cannot guarantee the security and confidentiality of email or text communication. HMG will not be responsible for messages that are not received or delivered due to technical failure, or for disclosure of confidential information unless caused by intentional misconduct.",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)),
),
SizedBox(
height: 20,
),
Container(
child:
Text("\b I hereby agree to receive emails, text messages, phone calls for appointments notifications, special promotions and new features or products introduced by HMG or any third party.",textAlign: TextAlign.center,style: TextStyle(fontWeight: FontWeight.bold,fontSize: 16)),
),
],
)
///////////
])
));
} }
} }

@ -107,7 +107,7 @@ class _AmbulanceReqState extends State<AmbulanceReq>
Container( Container(
width: MediaQuery.of(context).size.width * 0.30, width: MediaQuery.of(context).size.width * 0.30,
child: Center( child: Center(
child: Texts("Orders Log"), child: Texts(TranslationBase.of(context).ordersLog),
), ),
), ),
], ],

@ -46,7 +46,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
body: false body: widget.amRequestViewModel.pickUpRequestPresOrder != null
? Column( ? Column(
children: [ children: [
SizedBox( SizedBox(

@ -5,6 +5,7 @@ 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/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -45,306 +46,309 @@ class _BillAmountState extends State<BillAmount> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return AppScaffold(
physics: BouncingScrollPhysics(), isShowDecPage: false,
child: Container( isShowAppBar: false,
margin: EdgeInsets.only(left: 12, right: 12), body: SingleChildScrollView(
child: Column( physics: BouncingScrollPhysics(),
crossAxisAlignment: CrossAxisAlignment.start, child: Container(
children: [ margin: EdgeInsets.only(left: 12, right: 12),
Texts(TranslationBase.of(context).billAmount), child: Column(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
height: 10, children: [
), Texts(TranslationBase.of(context).billAmount),
Table( SizedBox(
border: TableBorder.symmetric( height: 10,
inside: BorderSide(width: 1.0, color: Colors.grey[300]), ),
outside: BorderSide(width: 1.0, color: Colors.grey[300])), Table(
children: [ border: TableBorder.symmetric(
TableRow( inside: BorderSide(width: 1.0, color: Colors.grey[300]),
children: [ outside: BorderSide(width: 1.0, color: Colors.grey[300])),
Container( children: [
height: MediaQuery.of(context).size.height * 0.09, TableRow(
decoration: BoxDecoration( children: [
color: Colors.white, Container(
borderRadius: BorderRadius.only( height: MediaQuery.of(context).size.height * 0.09,
topLeft: Radius.circular(10.0), decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
), ),
), child: Padding(
child: Padding( padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0), child: Texts(
child: Texts( TranslationBase.of(context).patientShareB,
TranslationBase.of(context).patientShareB, textAlign: TextAlign.start,
textAlign: TextAlign.start, color: Colors.black,
color: Colors.black, fontSize: 15,
fontSize: 15, ),
), ),
), ),
), Container(
Container( height: MediaQuery.of(context).size.height * 0.09,
height: MediaQuery.of(context).size.height * 0.09, decoration: BoxDecoration(
decoration: BoxDecoration( color: Colors.white,
color: Colors.white, borderRadius: BorderRadius.only(
borderRadius: BorderRadius.only( topRight: Radius.circular(10.0),
topRight: Radius.circular(10.0), ),
), ),
), child: Padding(
child: Padding( padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0), child: Texts(
child: Texts( TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.price}',
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.price}', color: Colors.black,
color: Colors.black, textAlign: TextAlign.start,
textAlign: TextAlign.start, fontSize: 15,
fontSize: 15, ),
), ),
), ),
), ],
], ),
), TableRow(
TableRow( children: [
children: [ Container(
Container( color: Colors.white,
color: Colors.white, height: MediaQuery.of(context).size.height * 0.09,
height: MediaQuery.of(context).size.height * 0.09, child: Padding(
child: Padding( padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0), child: Texts(
child: Texts( TranslationBase.of(context).patientShareTax,
TranslationBase.of(context).patientShareTax, color: Colors.black,
color: Colors.black, fontSize: 15,
fontSize: 15, textAlign: TextAlign.start,
textAlign: TextAlign.start, ),
),
),
),
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.patientERTransportationMethod.vAT}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
), ),
), ),
), Container(
], height: MediaQuery.of(context).size.height * 0.09,
),
TableRow(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.only( child: Padding(
bottomLeft: Radius.circular(10.0), padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.vAT}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
), ),
), ),
child: Padding( ],
padding: const EdgeInsets.all(8.0), ),
child: Texts( TableRow(
TranslationBase.of(context).patientShareTotal, children: [
color: Colors.black, Container(
fontSize: 15, height: MediaQuery.of(context).size.height * 0.09,
textAlign: TextAlign.start, decoration: BoxDecoration(
bold: true, color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10.0),
),
), ),
), child: Padding(
), padding: const EdgeInsets.all(8.0),
Container( child: Texts(
height: MediaQuery.of(context).size.height * 0.09, TranslationBase.of(context).patientShareTotal,
decoration: BoxDecoration( color: Colors.black,
color: Colors.white, fontSize: 15,
borderRadius: BorderRadius.only( textAlign: TextAlign.start,
bottomRight: Radius.circular(10.0), bold: true,
),
), ),
), ),
child: Padding( Container(
padding: const EdgeInsets.all(8.0), height: MediaQuery.of(context).size.height * 0.09,
child: Texts( decoration: BoxDecoration(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}', color: Colors.white,
color: Colors.black, borderRadius: BorderRadius.only(
fontSize: 15, bottomRight: Radius.circular(10.0),
textAlign: TextAlign.start, ),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
), ),
), ),
), ],
], ),
), ],
], ),
), SizedBox(
SizedBox( height: 10,
height: 10, ),
), Texts(TranslationBase.of(context).selectAmbulate,bold: true,),
Texts(TranslationBase.of(context).selectAmbulate,bold: true,), SizedBox(height: 5,),
SizedBox(height: 5,), Row(
Row( children: [
children: [ Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _ambulate = Ambulate.Wheelchair;
_ambulate = Ambulate.Wheelchair; });
}); },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title: Text(TranslationBase.of(context).wheelchair),
title: Text(TranslationBase.of(context).wheelchair), leading: Radio(
leading: Radio( value: Ambulate.Wheelchair,
value: Ambulate.Wheelchair, groupValue: _ambulate,
groupValue: _ambulate, onChanged: (value) {
activeColor: Colors.red[800], setState(() {
onChanged: (value) { _ambulate = value;
setState(() { });
_ambulate = value; },
}); ),
},
), ),
), ),
), ),
), ),
), Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _ambulate = Ambulate.Walker;
_ambulate = Ambulate.Walker; });
}); },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title: Text(TranslationBase.of(context).walker),
title: Text(TranslationBase.of(context).walker), leading: Radio(
leading: Radio( value: Ambulate.Walker,
value: Ambulate.Walker, groupValue: _ambulate,
groupValue: _ambulate,
activeColor: Colors.red[800], onChanged: (value) {
onChanged: (value) { setState(() {
setState(() { _ambulate = value;
_ambulate = value; });
}); },
}, ),
), ),
), ),
), ),
), ),
), ],
], ),
), SizedBox(height: 5,),
SizedBox(height: 5,), Row(
Row( children: [
children: [ Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _ambulate = Ambulate.Stretcher;
_ambulate = Ambulate.Stretcher; });
}); },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title: Text(TranslationBase.of(context).stretcher),
title: Text(TranslationBase.of(context).stretcher), leading: Radio(
leading: Radio( value: Ambulate.Stretcher,
value: Ambulate.Stretcher, groupValue: _ambulate,
groupValue: _ambulate,
activeColor: Colors.red[800], onChanged: (value) {
onChanged: (value) { setState(() {
setState(() { _ambulate = value;
_ambulate = value; });
}); },
}, ),
), ),
), ),
), ),
), ),
), Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _ambulate = Ambulate.None;
_ambulate = Ambulate.None; });
}); },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title: Text(TranslationBase.of(context).none),
title: Text(TranslationBase.of(context).none), leading: Radio(
leading: Radio( value: Ambulate.None,
value: Ambulate.None, groupValue: _ambulate,
groupValue: _ambulate,
activeColor: Colors.red[800], onChanged: (value) {
onChanged: (value) { setState(() {
setState(() { _ambulate = value;
_ambulate = value; });
}); },
}, ),
), ),
), ),
), ),
), ),
), ],
], ),
), SizedBox(height: 12,),
SizedBox(height: 12,), NewTextFields(
NewTextFields( hintText: TranslationBase.of(context).notes,
hintText: TranslationBase.of(context).notes, initialValue: note,
initialValue: note, onChanged: (value){
onChanged: (value){
setState(() {
note = value;
});
},
),
SizedBox(
height: 15,
),
Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 76,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() { setState(() {
widget.patientER.ambulate = _ambulate; note = value;
widget.patientER.requesterNote = note;
widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber();
widget.changeCurrentTab(3);
}); });
}, },
label: TranslationBase.of(context).next,
), ),
)
], SizedBox(
height: 15,
),
],
),
),
),
bottomSheet: Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 90,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientER.ambulate = _ambulate;
widget.patientER.requesterNote = note;
widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber();
widget.changeCurrentTab(3);
});
},
label: TranslationBase.of(context).next,
), ),
), ),
); );

@ -5,23 +5,20 @@ import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.da
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/Blood/dialogs/SelectHospitalDialog.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.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';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
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: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: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';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import '../AmbulanceReq.dart';
import '../AvailableAppointmentsPage.dart'; import '../AvailableAppointmentsPage.dart';
enum HaveAppointment { YES, NO } enum HaveAppointment { YES, NO }
@ -68,370 +65,397 @@ class _PickupLocationState extends State<PickupLocation> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return AppScaffold(
physics: BouncingScrollPhysics(), isShowAppBar: false,
child: Container( isShowDecPage: false,
margin: EdgeInsets.only(left: 12, right: 12), body: SingleChildScrollView(
child: Column( physics: BouncingScrollPhysics(),
crossAxisAlignment: CrossAxisAlignment.start, child: Container(
children: [ margin: EdgeInsets.only(left: 12, right: 12),
if (widget.patientER.direction == 1) child: Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ if (widget.patientER.direction == 1)
Texts(TranslationBase.of(context).pickupLocation), Column(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
height: 15, children: [
), Texts(TranslationBase.of(context).pickupLocation),
InkWell( SizedBox(
onTap: (){ height: 15,
Navigator.push( ),
context, InkWell(
MaterialPageRoute( onTap: () {
builder: (context) => PickupLocationFromMap( Navigator.push(
latitude: _latitude, context,
longitude: _longitude, MaterialPageRoute(
onPick: (value) { builder: (context) => PickupLocationFromMap(
latitude: _latitude,
longitude: _longitude,
onPick: (value) {
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: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getSelectFromMapName(context))),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
),
),
),
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).pickupSpot),
SizedBox(
height: 5,
),
InkWell(
onTap: () {
setState(() {
_isInsideHome = !_isInsideHome;
});
},
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(
title: Texts(TranslationBase.of(context).insideHome),
leading: Checkbox(
value: _isInsideHome,
onChanged: (value) {
setState(() { setState(() {
_result = value; _isInsideHome = 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: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getSelectFromMapName(context)),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
), ),
), ),
), SizedBox(
SizedBox( height: 12,
height: 12, ),
), Texts(TranslationBase.of(context).haveAppo),
Texts(TranslationBase.of(context).pickupSpot), SizedBox(
SizedBox( height: 5,
height: 5,
),
InkWell(
onTap: () {
setState(() {
_isInsideHome = !_isInsideHome;
});
},
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(
title: Texts(TranslationBase.of(context).insideHome),
leading: Checkbox(
activeColor: Colors.red[800],
value: _isInsideHome,
onChanged: (value) {
setState(() {
_isInsideHome = value;
});
},
),
),
), ),
), Row(
SizedBox( children: [
height: 12, Expanded(
), child: InkWell(
Texts(TranslationBase.of(context).haveAppo), onTap: () {
SizedBox( if (myAppointment == null) {
height: 5, getAppointment();
), setState(() {
Row( _haveAppointment = HaveAppointment.YES;
children: [ });
Expanded( }
child: InkWell( },
onTap: () { child: Container(
if (myAppointment == null) { decoration: BoxDecoration(
getAppointment(); shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border:
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Texts(TranslationBase.of(context).yes),
leading: Radio(
value: HaveAppointment.YES,
groupValue: _haveAppointment,
onChanged: (value) {
if (myAppointment == null) {
getAppointment();
setState(() {
_haveAppointment = value;
});
}
},
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() { setState(() {
_haveAppointment = HaveAppointment.YES; _haveAppointment = HaveAppointment.NO;
myAppointment = null;
}); });
} },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title: Texts(TranslationBase.of(context).no),
title: Texts(TranslationBase.of(context).yes), leading: Radio(
leading: Radio( value: HaveAppointment.NO,
value: HaveAppointment.YES, groupValue: _haveAppointment,
groupValue: _haveAppointment, onChanged: (value) {
activeColor: Colors.red[800],
onChanged: (value) {
if (myAppointment == null) {
getAppointment();
setState(() { setState(() {
_haveAppointment = value; _haveAppointment = value;
myAppointment = null;
}); });
} },
}, ),
), ),
), ),
), ),
), ),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_haveAppointment = HaveAppointment.NO;
myAppointment = null;
});
},
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(
title: Texts(TranslationBase.of(context).no),
leading: Radio(
value: HaveAppointment.NO,
groupValue: _haveAppointment,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_haveAppointment = value;
myAppointment = null;
});
},
),
),
),
),
),
],
),
if (myAppointment != null)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
AppointmentCard(
appointment: myAppointment,
)
], ],
), ),
SizedBox( if (myAppointment != null)
height: 12, Column(
), crossAxisAlignment: CrossAxisAlignment.start,
Texts(TranslationBase.of(context).dropoffLocation),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectHospitalDialog(
widget.amRequestViewModel.hospitals);
},
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: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), SizedBox(
Icon( height: 12,
Icons.arrow_drop_down, ),
size: 24, AppointmentCard(
color: Colors.black, appointment: myAppointment,
) )
], ],
), ),
SizedBox(
height: 12,
), ),
), Texts(TranslationBase.of(context).dropoffLocation),
], SizedBox(
), height: 8,
if (widget.patientER.direction == 0) ),
Column( InkWell(
crossAxisAlignment: CrossAxisAlignment.start, onTap: () {
children: [ confirmSelectHospitalDialog(
Texts(TranslationBase.of(context).pickupLocation), widget.amRequestViewModel.hospitals);
SizedBox( },
height: 15, child: Container(
), padding: EdgeInsets.all(12),
InkWell( decoration: BoxDecoration(
onTap: () { shape: BoxShape.rectangle,
confirmSelectHospitalDialog( borderRadius: BorderRadius.circular(8),
widget.amRequestViewModel.hospitals); border: Border.all(color: Colors.grey, width: 0.5),
}, color: Colors.white,
child: Container( ),
padding: EdgeInsets.all(12), child: Row(
decoration: BoxDecoration( mainAxisAlignment: MainAxisAlignment.spaceBetween,
shape: BoxShape.rectangle, children: [
borderRadius: BorderRadius.circular(8), Texts(getHospitalName(
border: Border.all(color: Colors.grey, width: 0.5), TranslationBase.of(context).pickupLocation)),
color: Colors.white, Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
)
],
),
), ),
child: Row( ),
mainAxisAlignment: MainAxisAlignment.spaceBetween, ],
children: [ ),
Texts(getHospitalName(TranslationBase.of(context).pickupLocation)), if (widget.patientER.direction == 0)
Icon( Column(
Icons.arrow_drop_down, crossAxisAlignment: CrossAxisAlignment.start,
size: 24, children: [
color: Colors.black, Texts(TranslationBase.of(context).pickupLocation),
) SizedBox(
], height: 15,
),
InkWell(
onTap: () {
confirmSelectHospitalDialog(
widget.amRequestViewModel.hospitals);
},
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: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getHospitalName(
TranslationBase.of(context).pickupLocation)),
Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
)
],
),
), ),
), ),
), SizedBox(
SizedBox( height: 12,
height: 12, ),
), Texts(TranslationBase.of(context).dropoffLocation),
Texts(TranslationBase.of(context).dropoffLocation), SizedBox(
SizedBox( height: 8,
height: 8, ),
), InkWell(
InkWell( onTap: () {
onTap: () { Navigator.push(
Navigator.push( context,
context, MaterialPageRoute(
MaterialPageRoute( builder: (context) => PickupLocationFromMap(
builder: (context) => PickupLocationFromMap( latitude: _latitude,
latitude: _latitude, longitude: _longitude,
longitude: _longitude, onPick: (value) {
onPick: (value) { setState(() {
setState(() { _result = value;
_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: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Texts(getSelectFromMapName(context))),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
), ),
);
},
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: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getSelectFromMapName(context)),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
), ),
), ),
), ],
], ),
SizedBox(
height: 45,
), ),
SizedBox( ],
height: 45, ),
), ),
Container( ),
padding: EdgeInsets.all(15), bottomSheet: Container(
width: double.maxFinite, padding: EdgeInsets.all(15),
height: 76, width: double.maxFinite,
child: SecondaryButton( height: 90,
color: Colors.grey[800], child: SecondaryButton(
textColor: Colors.white, color: Colors.grey[800],
onTap: () { textColor: Colors.white,
if (_result == null || _selectedHospital == null) onTap: () {
AppToast.showErrorToast( if (_result == null || _selectedHospital == null)
message: TranslationBase.of(context).selectAll); AppToast.showErrorToast(
else message: TranslationBase.of(context).selectAll);
setState(() { else
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; setState(() {
if (widget.patientER.direction == 0) { widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
widget.patientER.pickupLocationLattitude = _result.geometry.location.lat.toString(); if (widget.patientER.direction == 0) {
widget.patientER.pickupLocationLongitude = _result.geometry.location.lng.toString(); widget.patientER.pickupLocationLattitude =
widget.patientER.dropoffLocationLattitude = _selectedHospital.latitude; _result.geometry.location.lat.toString();
widget.patientER.dropoffLocationLongitude = _selectedHospital.longitude; widget.patientER.pickupLocationLongitude =
} else { _result.geometry.location.lng.toString();
widget.patientER.pickupLocationLattitude = _selectedHospital.latitude; widget.patientER.dropoffLocationLattitude =
widget.patientER.pickupLocationLongitude = _selectedHospital.longitude; _selectedHospital.latitude;
widget.patientER.dropoffLocationLattitude = _result.geometry.location.lat.toString(); widget.patientER.dropoffLocationLongitude =
widget.patientER.dropoffLocationLongitude = _result.geometry.location.lng.toString(); _selectedHospital.longitude;
} } else {
widget.patientER.pickupLocationLattitude =
_selectedHospital.latitude;
widget.patientER.pickupLocationLongitude =
_selectedHospital.longitude;
widget.patientER.dropoffLocationLattitude =
_result.geometry.location.lat.toString();
widget.patientER.dropoffLocationLongitude =
_result.geometry.location.lng.toString();
}
widget.patientER.latitude = widget.patientER.pickupLocationLattitude; widget.patientER.latitude =
widget.patientER.longitude = widget.patientER.pickupLocationLongitude; widget.patientER.pickupLocationLattitude;
widget.patientER.dropoffLocationName = _selectedHospital.name; widget.patientER.longitude =
widget.patientER.createdBy = widget.amRequestViewModel.user.patientID; widget.patientER.pickupLocationLongitude;
widget.patientER.isOutPatient = widget.amRequestViewModel.user.outSA; widget.patientER.dropoffLocationName =
widget.patientER.patientIdentificationID = widget.amRequestViewModel.user.patientIdentificationNo; _selectedHospital.name;
widget.patientER.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); widget.patientER.createdBy =
widget.patientER.pickupLocationName = _result.formattedAddress; widget.amRequestViewModel.user.patientID;
widget.patientER.projectID = widget.amRequestViewModel.user.projectID; widget.patientER.isOutPatient =
widget.patientER.requesterFileNo = widget.amRequestViewModel.user.patientID; widget.amRequestViewModel.user.outSA;
widget.patientER.requesterIsOutSA = false; widget.patientER.patientIdentificationID = widget
widget.patientER.lineItemNo =0; .amRequestViewModel.user.patientIdentificationNo;
widget.patientER.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber; widget.patientER.pickupDateTime =
DateUtil.convertDateToStringLocation(DateTime.now());
widget.patientER.pickupLocationName =
_result.formattedAddress;
widget.patientER.projectID =
widget.amRequestViewModel.user.projectID;
widget.patientER.requesterFileNo =
widget.amRequestViewModel.user.patientID;
widget.patientER.requesterIsOutSA = false;
widget.patientER.lineItemNo = 0;
widget.patientER.requesterMobileNo =
widget.amRequestViewModel.user.mobileNumber;
if (_haveAppointment == HaveAppointment.YES) { if (_haveAppointment == HaveAppointment.YES) {
widget.patientER.appointmentNo = myAppointment.appointmentNo.toString(); widget.patientER.appointmentNo =
widget.patientER.appointmentClinicName = myAppointment.clinicName; myAppointment.appointmentNo.toString();
widget.patientER.appointmentDoctorName = myAppointment.doctorNameObj; widget.patientER.appointmentClinicName =
widget.patientER.appointmentBranch = myAppointment.projectName; myAppointment.clinicName;
widget.patientER.appointmentTime = myAppointment.appointmentDate; widget.patientER.appointmentDoctorName =
widget.patientER.haveAppointment = true; myAppointment.doctorNameObj;
} else { widget.patientER.appointmentBranch =
widget.patientER.appointmentNo = "0"; myAppointment.projectName;
widget.patientER.appointmentClinicName = null; widget.patientER.appointmentTime =
widget.patientER.appointmentDoctorName = null; myAppointment.appointmentDate;
widget.patientER.appointmentBranch = null; widget.patientER.haveAppointment = true;
widget.patientER.appointmentTime = null; } else {
widget.patientER.haveAppointment = false; widget.patientER.appointmentNo = "0";
} widget.patientER.appointmentClinicName = null;
widget.patientER.appointmentDoctorName = null;
widget.patientER.appointmentBranch = null;
widget.patientER.appointmentTime = null;
widget.patientER.haveAppointment = false;
}
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
widget.changeCurrentTab(2); widget.changeCurrentTab(2);
}); });
}, },
label: TranslationBase.of(context).next, label: TranslationBase.of(context).next,
),
)
],
), ),
), ),
); );
@ -457,11 +481,13 @@ 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
: TranslationBase.of(context).selectMap;
} }
getAppointment() { getAppointment() {
ProgressDialogUtil.showProgressDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.amRequestViewModel.getAppointmentHistory().then((value) { widget.amRequestViewModel.getAppointmentHistory().then((value) {
if (widget.amRequestViewModel.state == ViewState.Error || if (widget.amRequestViewModel.state == ViewState.Error ||
widget.amRequestViewModel.state == ViewState.ErrorLocal) { widget.amRequestViewModel.state == ViewState.ErrorLocal) {
@ -469,7 +495,7 @@ class _PickupLocationState extends State<PickupLocation> {
} else if (widget } else if (widget
.amRequestViewModel.appoitmentAllHistoryResultList.length > .amRequestViewModel.appoitmentAllHistoryResultList.length >
0) { 0) {
ProgressDialogUtil.hideProgressDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -491,14 +517,15 @@ class _PickupLocationState extends State<PickupLocation> {
} }
}); });
} else { } else {
ProgressDialogUtil.hideProgressDialog(context); GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
_haveAppointment = HaveAppointment.NO; _haveAppointment = HaveAppointment.NO;
}); });
AppToast.showErrorToast(message: TranslationBase.of(context).noAppointment); AppToast.showErrorToast(
message: TranslationBase.of(context).noAppointment);
} }
}).catchError((e) { }).catchError((e) {
ProgressDialogUtil.hideProgressDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: e); AppToast.showErrorToast(message: e);
}); });
} }

@ -1,15 +1,15 @@
import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_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/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/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
enum Direction { ToHospital, FromHospital } enum Direction { ToHospital, FromHospital }
enum Way { OneWay, TwoWays } enum Way { OneWay, TwoWays }
@ -58,251 +58,267 @@ class _SelectTransportationMethodState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( ProjectViewModel projectViewModel = Provider.of(context);
physics: BouncingScrollPhysics(), return AppScaffold(
child: Container( isShowAppBar: false,
margin: EdgeInsets.only(left: 12, right: 12), isShowDecPage: false,
child: Column( body: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, physics: BouncingScrollPhysics(),
children: [ child: Container(
SizedBox( margin: EdgeInsets.only(left: 12, right: 12),
height: 12, child: Column(
), crossAxisAlignment: CrossAxisAlignment.start,
Texts(TranslationBase.of(context).transportHeading), children: [
...List.generate( SizedBox(
widget.amRequestViewModel.amRequestModeList.length, height: 12,
(index) => InkWell( ),
onTap: () { Texts(TranslationBase.of(context).transportHeading),
setState(() { ...List.generate(
_erTransportationMethod = widget.amRequestViewModel.amRequestModeList.length,
widget.amRequestViewModel.amRequestModeList[index]; (index) => InkWell(
}); onTap: () {
}, setState(() {
child: Container( _erTransportationMethod =
margin: EdgeInsets.all(5), widget.amRequestViewModel.amRequestModeList[index];
decoration: BoxDecoration( });
shape: BoxShape.rectangle, },
borderRadius: BorderRadius.circular(8), child: Container(
border: Border.all(color: Colors.grey, width: 0.5), margin: EdgeInsets.all(5),
color: Colors.white, decoration: BoxDecoration(
), shape: BoxShape.rectangle,
child: Row( borderRadius: BorderRadius.circular(8),
children: [ border: Border.all(color: Colors.grey, width: 0.5),
Expanded( color: Colors.white,
flex: 3, ),
child: ListTile( child: Row(
title: Text(widget.amRequestViewModel children: [
.amRequestModeList[index].title), Expanded(
leading: Radio( flex: 3,
value: widget child: ListTile(
.amRequestViewModel.amRequestModeList[index], title: Texts(projectViewModel.isArabic
groupValue: _erTransportationMethod, ? widget.amRequestViewModel
activeColor: Colors.red[800], .amRequestModeList[index].titleAR
onChanged: (value) { : widget.amRequestViewModel
setState(() { .amRequestModeList[index].title),
_erTransportationMethod = value; leading: Radio(
}); value: widget
}, .amRequestViewModel.amRequestModeList[index],
groupValue: _erTransportationMethod,
onChanged: (value) {
setState(() {
_erTransportationMethod = value;
});
},
),
), ),
), ),
), Expanded(
Expanded( flex: 1,
flex: 1, child: Texts(TranslationBase.of(context).sar +
child: Texts( ' ${widget.amRequestViewModel.amRequestModeList[index].price}'),
TranslationBase.of(context).sar+' ${widget.amRequestViewModel.amRequestModeList[index].price}'), )
) ],
], ),
), ),
), ),
), ),
), SizedBox(
SizedBox( height: 12,
height: 12, ),
), Texts(TranslationBase.of(context).directionHeading),
Texts(TranslationBase.of(context).directionHeading), SizedBox(
SizedBox( height: 5,
height: 5, ),
), Container(
Container( width: double.maxFinite,
width: double.maxFinite, child: Row(
child: Row( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, children: [
children: [ Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _direction = Direction.ToHospital;
_direction = Direction.ToHospital; });
}); },
}, child: Container(
child: Container( width: double.maxFinite,
width: double.maxFinite, decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border: Border.all(color: Colors.grey, width: 0.5),
border: Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title: Texts(TranslationBase.of(context).toHospital),
title: Text(TranslationBase.of(context).toHospital), leading: Radio(
leading: Radio( value: Direction.ToHospital,
value: Direction.ToHospital, groupValue: _direction,
groupValue: _direction, onChanged: (value) {
activeColor: Colors.red[800], setState(() {
onChanged: (value) { _direction = value;
setState(() { });
_direction = value; },
}); ),
},
), ),
), ),
), ),
), ),
), Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _direction = Direction.FromHospital;
_direction = Direction.FromHospital; });
}); },
}, child: Container(
child: Container( width: double.maxFinite,
width: double.maxFinite, decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border: Border.all(color: Colors.grey, width: 0.5),
border: Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title:
title: Text(TranslationBase.of(context).fromHospital), Texts(TranslationBase.of(context).fromHospital),
leading: Radio( leading: Radio(
value: Direction.FromHospital, value: Direction.FromHospital,
groupValue: _direction, groupValue: _direction,
activeColor: Colors.red[800], onChanged: (value) {
onChanged: (value) { setState(() {
setState(() { _direction = value;
_direction = value; });
}); },
}, ),
), ),
), ),
), ),
), ),
), ],
], ),
), ),
), if (_direction == Direction.ToHospital)
if (_direction == Direction.ToHospital) Column(
Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ SizedBox(
SizedBox( height: 8,
height: 8, ),
), Texts(TranslationBase.of(context).directionHeading),
Texts(TranslationBase.of(context).directionHeading), SizedBox(
SizedBox( height: 5,
height: 5, ),
), Row(
Row( children: [
children: [ Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _way = Way.OneWay;
_way = Way.OneWay; });
}); },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title:
title: Text(TranslationBase.of(context).oneDirec), Texts(TranslationBase.of(context).oneDirec),
leading: Radio( leading: Radio(
value: Way.OneWay, value: Way.OneWay,
groupValue: _way, groupValue: _way,
activeColor: Colors.red[800], onChanged: (value) {
onChanged: (value) { setState(() {
setState(() { _way = value;
_way = value; });
}); },
}, ),
), ),
), ),
), ),
), ),
), Expanded(
Expanded( child: InkWell(
child: InkWell( onTap: () {
onTap: () { setState(() {
setState(() { _way = Way.TwoWays;
_way = Way.TwoWays; });
}); },
}, child: Container(
child: Container( decoration: BoxDecoration(
decoration: BoxDecoration( shape: BoxShape.rectangle,
shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), border:
border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5), color: Colors.white,
color: Colors.white, ),
), child: ListTile(
child: ListTile( title:
title: Text(TranslationBase.of(context).twoDirec), Texts(TranslationBase.of(context).twoDirec),
leading: Radio( leading: Radio(
value: Way.TwoWays, value: Way.TwoWays,
groupValue: _way, groupValue: _way,
activeColor: Colors.red[800], onChanged: (value) {
onChanged: (value) { setState(() {
setState(() { _way = value;
_way = value; });
}); },
}, ),
), ),
), ),
), ),
), ),
), ],
], ),
), ],
], ),
), SizedBox(
SizedBox( height: 15,
height: 15,
),
Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 76,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientER.transportationMethodId =(widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 0;
widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER.patientERTransportationMethod = _erTransportationMethod;
widget.patientER.orderServiceID = _orderService.getIdOrderService();
widget.patientER.pickupUrgency = 1;
widget.patientER.lineItemNo = 1;
widget.patientER.cost = _erTransportationMethod.price;
widget.patientER.vAT = _erTransportationMethod.vAT ?? 0;
widget.patientER.totalPrice = _erTransportationMethod.totalPrice;
widget.changeCurrentTab(1);
});
},
label: TranslationBase.of(context).next,
), ),
) ],
], ),
),
),
bottomSheet: Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 90,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientER.transportationMethodId = (widget
.amRequestViewModel.amRequestModeList
.indexOf(_erTransportationMethod) +
1);
widget.patientER.direction =
_direction == Direction.ToHospital ? 1 : 0;
widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER.selectedAmbulate = (widget
.amRequestViewModel.amRequestModeList
.indexOf(_erTransportationMethod) +
1);
widget.patientER.patientERTransportationMethod =
_erTransportationMethod;
widget.patientER.orderServiceID =
_orderService.getIdOrderService();
widget.patientER.pickupUrgency = 1;
widget.patientER.lineItemNo = 1;
widget.patientER.cost = _erTransportationMethod.price;
widget.patientER.vAT = _erTransportationMethod.vAT ?? 0;
widget.patientER.totalPrice =
_erTransportationMethod.totalPrice;
widget.changeCurrentTab(1);
});
},
label: TranslationBase.of(context).next,
), ),
), ),
); );

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.da
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
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:diplomaticquarterapp/core/enum/Ambulate.dart'; import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
@ -18,89 +19,93 @@ class Summary extends StatefulWidget {
_SummaryState createState() => _SummaryState(); _SummaryState createState() => _SummaryState();
} }
//TODO it should be dynamic
class _SummaryState extends State<Summary> { class _SummaryState extends State<Summary> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return AppScaffold(
child: Container( isShowDecPage: false,
margin: EdgeInsets.only(left: 12, right: 12), isShowAppBar: false,
child: Column( body: SingleChildScrollView(
crossAxisAlignment: CrossAxisAlignment.start, child: Container(
children: [ margin: EdgeInsets.only(left: 12, right: 12),
Texts(TranslationBase.of(context).RRTSummary), child: Column(
SizedBox(height: 5,), crossAxisAlignment: CrossAxisAlignment.start,
Container( children: [
width: double.infinity, Texts(TranslationBase.of(context).RRTSummary),
padding: EdgeInsets.all(10), SizedBox(height: 5,),
decoration: BoxDecoration( Container(
color: Colors.white, width: double.infinity,
borderRadius: BorderRadius.circular(12), padding: EdgeInsets.all(10),
), decoration: BoxDecoration(
child: Column( color: Colors.white,
crossAxisAlignment: CrossAxisAlignment.start, borderRadius: BorderRadius.circular(12),
children: [ ),
Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,), child: Column(
Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,), crossAxisAlignment: CrossAxisAlignment.start,
SizedBox(height: 8,), children: [
Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,),
Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,),
SizedBox(height: 8,),
Texts(TranslationBase.of(context).directions,color: Colors.grey,), Texts(TranslationBase.of(context).directions,color: Colors.grey,),
Texts('From Hospital',bold: true,), Texts(widget.patientER.direction ==0? TranslationBase.of(context).toHospital:TranslationBase.of(context).fromHospital,bold: true,),
SizedBox(height: 8,), SizedBox(height: 8,),
Texts('Pickup Location',color: Colors.grey,), Texts(TranslationBase.of(context).pickupLocation,color: Colors.grey,),
Texts('SZR Medical Center',bold: true,), Texts('${widget.patientER.pickupLocationName}',bold: true,),
SizedBox(height: 8,), SizedBox(height: 8,),
Texts('Drop off location',color: Colors.grey,), Texts(TranslationBase.of(context).dropoffLocation,color: Colors.grey,),
Texts('6199, Al Ameen wlfn nif',bold: true,), Texts('${widget.patientER.dropoffLocationName}',bold: true,),
SizedBox(height: 8,), SizedBox(height: 8,),
Texts('Select Ambulate',color: Colors.grey,), Texts(TranslationBase.of(context).selectAmbulate,color: Colors.grey,),
Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,), Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,),
SizedBox(height: 8,), SizedBox(height: 8,),
Texts('Note',color: Colors.grey,), Texts(TranslationBase.of(context).notes,color: Colors.grey,),
Texts('${widget.patientER.requesterNote?? '---'}',bold: true,), Texts('${widget.patientER.requesterNote?? '---'}',bold: true,),
SizedBox(height: 8,), SizedBox(height: 8,),
], ],
), ),
),
SizedBox(height: 20,),
Texts('Bill Amount',textAlign: TextAlign.start,),
SizedBox(height: 5,),
Container(
height: 55,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8)
), ),
child: Row( SizedBox(height: 20,),
mainAxisAlignment: MainAxisAlignment.spaceBetween, Texts(TranslationBase.of(context).billAmount,textAlign: TextAlign.start,),
children: [ SizedBox(height: 5,),
Texts('Total amount payable:'), Container(
Texts('SR ${widget.patientER.patientERTransportationMethod.totalPrice}') height: 55,
], padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(TranslationBase.of(context).patientShareTotal+':'),
Texts(TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.totalPrice}')
],
),
), ),
),
SizedBox(height: 45,), SizedBox(height: 45,),
Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 76,
child:SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
label: TranslationBase.of(context).send,
onTap: () async {
await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER);
} ],
), ),
) ),
], ),
bottomSheet: Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 90,
child:SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
label: TranslationBase.of(context).send,
onTap: () async {
await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER);
}
), ),
), ),
); );

@ -30,28 +30,28 @@ class OrderLogPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
OrderLogItem( OrderLogItem(
title: 'Request ID', title: TranslationBase.of(context).reqId,
value: amRequestViewModel.patientAllPresOrdersList[index].iD value: amRequestViewModel.patientAllPresOrdersList[index].iD
.toString(), .toString(),
), ),
OrderLogItem( OrderLogItem(
title: 'Status', title: TranslationBase.of(context).orderStatus,
value: amRequestViewModel value: amRequestViewModel
.patientAllPresOrdersList[index].description, .patientAllPresOrdersList[index].description,
), ),
OrderLogItem( OrderLogItem(
title: 'Pickup Date', title: TranslationBase.of(context).pickupDate,
value: DateUtil.getDayMonthYearDateFormatted( value: DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(amRequestViewModel DateUtil.convertStringToDate(amRequestViewModel
.patientAllPresOrdersList[index].createdOn)), .patientAllPresOrdersList[index].createdOn)),
), ),
OrderLogItem( OrderLogItem(
title: 'Pickup Location', title: TranslationBase.of(context).pickupLocation,
value: amRequestViewModel value: amRequestViewModel
.patientAllPresOrdersList[index].pickupLocationName, .patientAllPresOrdersList[index].pickupLocationName,
), ),
OrderLogItem( OrderLogItem(
title: 'Drop off Location', title: TranslationBase.of(context).dropoffLocation,
value: amRequestViewModel value: amRequestViewModel
.patientAllPresOrdersList[index].dropoffLocationName, .patientAllPresOrdersList[index].dropoffLocationName,
), ),

@ -13,7 +13,8 @@ class StepsWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return projectViewModel.isArabic? Stack( return projectViewModel.isArabic?
Stack(
children: [ children: [
Container( Container(
height: 50, height: 50,
@ -29,7 +30,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
left: 0, right: 0,
child: InkWell( child: InkWell(
onTap: () => changeCurrentTab(0), onTap: () => changeCurrentTab(0),
child: Container( child: Container(
@ -51,7 +52,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
left: MediaQuery.of(context).size.width * 0.3, right: MediaQuery.of(context).size.width * 0.3,
child: InkWell( child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null, onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Container( child: Container(
@ -73,7 +74,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
left: MediaQuery.of(context).size.width * 0.6, right: MediaQuery.of(context).size.width * 0.6,
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null, onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Container( child: Container(
@ -95,7 +96,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
right: 0, left: 0,
child: InkWell( child: InkWell(
onTap: () => index == 2 ?changeCurrentTab(3):null, onTap: () => index == 2 ?changeCurrentTab(3):null,
child: Container( child: Container(
@ -117,7 +118,8 @@ class StepsWidget extends StatelessWidget {
), ),
), ),
], ],
):Stack( ):
Stack(
children: [ children: [
Container( Container(
height: 50, height: 50,
@ -133,7 +135,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
right: 0, left: 0,
child: InkWell( child: InkWell(
onTap: () => changeCurrentTab(0), onTap: () => changeCurrentTab(0),
child: Container( child: Container(
@ -155,7 +157,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
right: MediaQuery.of(context).size.width * 0.3, left: MediaQuery.of(context).size.width * 0.3,
child: InkWell( child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null, onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Container( child: Container(
@ -177,7 +179,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
right: MediaQuery.of(context).size.width * 0.6, left: MediaQuery.of(context).size.width * 0.6,
child: InkWell( child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null, onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Container( child: Container(
@ -199,7 +201,7 @@ class StepsWidget extends StatelessWidget {
), ),
Positioned( Positioned(
top: 10, top: 10,
left: 0, right: 0,
child: InkWell( child: InkWell(
onTap: () => index == 2 ?changeCurrentTab(3):null, onTap: () => index == 2 ?changeCurrentTab(3):null,
child: Container( child: Container(

@ -1,9 +1,11 @@
//import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; //import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.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/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/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class SelectCiteisDialog extends StatefulWidget { class SelectCiteisDialog extends StatefulWidget {
final List<CitiesModel> hospitals; final List<CitiesModel> hospitals;
@ -12,6 +14,7 @@ class SelectCiteisDialog extends StatefulWidget {
SelectCiteisDialog( SelectCiteisDialog(
{Key key, this.hospitals, this.onValueSelected, this.selectedHospital}); {Key key, this.hospitals, this.onValueSelected, this.selectedHospital});
@override @override
_SelectCiteisDialogState createState() => _SelectCiteisDialogState(); _SelectCiteisDialogState createState() => _SelectCiteisDialogState();
} }
@ -24,9 +27,10 @@ class _SelectCiteisDialogState extends State<SelectCiteisDialog> {
widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0]; widget.selectedHospital = widget.selectedHospital ?? widget.hospitals[0];
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context);
return SimpleDialog( return SimpleDialog(
children: [ children: [
Column( Column(
@ -34,7 +38,7 @@ class _SelectCiteisDialogState extends State<SelectCiteisDialog> {
Divider(), Divider(),
...List.generate( ...List.generate(
widget.hospitals.length, widget.hospitals.length,
(index) => Column( (index) => Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
@ -53,7 +57,9 @@ class _SelectCiteisDialogState extends State<SelectCiteisDialog> {
child: ListTile( child: ListTile(
// title: Text(widget.hospitals[index].description + // title: Text(widget.hospitals[index].description +
// ' ${widget.hospitals[index].distanceInKilometers} KM'), // ' ${widget.hospitals[index].distanceInKilometers} KM'),
title: Text(widget.hospitals[index].description), title: Text(projectProvider.isArabic
? widget.hospitals[index].descriptionN
: widget.hospitals[index].description),
leading: Radio( leading: Radio(
value: widget.hospitals[index], value: widget.hospitals[index],
groupValue: widget.selectedHospital, groupValue: widget.selectedHospital,
@ -116,9 +122,9 @@ class _SelectCiteisDialogState extends State<SelectCiteisDialog> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
)), )),
), ),
), ),
), ),

@ -3,18 +3,37 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_mo
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/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/RadioStringDialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:feather_icons_flutter/feather_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class AddBloodSugarPage extends StatefulWidget { class AddBloodSugarPage extends StatefulWidget {
final DateTime bloodSugarDate;
final String measureUnitSelectedType;
final bool isUpdate;
final String measuredTime;
final String bloodSugarValue;
final int lineItemNo;
final BloodSugarViewMode bloodSugarViewMode;
AddBloodSugarPage(
{Key key,
this.bloodSugarDate,
this.measureUnitSelectedType,
this.isUpdate = false,
this.measuredTime,
this.bloodSugarValue, this.lineItemNo, this.bloodSugarViewMode})
: super(key: key);
@override @override
_AddBloodSugarPageState createState() => _AddBloodSugarPageState(); _AddBloodSugarPageState createState() => _AddBloodSugarPageState();
} }
@ -24,7 +43,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
DateTime bloodSugarDate = DateTime.now(); DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now();
String measureUnitSelectedType = 'mg/dlt'; String measureUnitSelectedType = 'mg/dlt';
int measuredTime=1; int measuredTime = 1;
final List<String> measureUnitList = ['mg/dlt', 'mol/L']; final List<String> measureUnitList = ['mg/dlt', 'mol/L'];
final List<String> measureTimeEnList = [ final List<String> measureTimeEnList = [
'Before Breakfast', 'Before Breakfast',
@ -39,270 +58,229 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
'Other', 'Other',
]; ];
final List<String> measureTimeArList = [ final List<String> measureTimeArList = [
'Before Breakfast', "قبل الإفطار",
'After Breakfast', "بعد الإفطار",
'Before Lunch', "بعد الغداء",
'After Lunch', "بعد الغداء",
'Before Dinner', "قبل العشاء",
'After Dinner', "بعد العشاء",
'Before Sleep', "قبل النوم",
'After Sleep', "بعد النوم",
'Fasting', "صائم",
'Other', "آخر",
]; ];
String measureTimeSelectedType; String measureTimeSelectedType;
@override
void initState() {
super.initState();
if (widget.isUpdate) {
bloodSugarDate = widget.bloodSugarDate;
timeSugarDate = widget.bloodSugarDate;
measureUnitSelectedType = widget.measureUnitSelectedType;
if (measureTimeEnList.contains(widget.measuredTime))
measuredTime = measureTimeEnList.indexOf(widget.measuredTime);
else if (measureTimeArList.contains(widget.measuredTime))
measuredTime = measureTimeArList.indexOf(widget.measuredTime);
_bloodSugarValueController.text = widget.bloodSugarValue;
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
showTaskOptions() { return AppScaffold(
showModalBottomSheet( isShowAppBar: true,
backgroundColor: Colors.white, appBarTitle: widget.isUpdate
context: context, ? TranslationBase.of(context).update
builder: (BuildContext bc) { : TranslationBase.of(context).add,
return Container( body: SingleChildScrollView(
padding: EdgeInsets.symmetric(vertical: 12.0), physics: BouncingScrollPhysics(),
decoration: BoxDecoration( child: Container(
color: Colors.white, margin: EdgeInsets.all(15),
borderRadius: BorderRadius.only( child: Column(
topLeft: Radius.circular(16.0), children: [
topRight: Radius.circular(16.0))), SizedBox(
child: Column( height: 15,
mainAxisSize: MainAxisSize.min, ),
children: <Widget>[ NewTextFields(
Container( hintText: TranslationBase.of(context).sugarAdd,
decoration: BoxDecoration( controller: _bloodSugarValueController,
color: Colors.grey[200], keyboardType: TextInputType.number,
borderRadius: BorderRadius.circular(3.0)), ),
width: 40.0, SizedBox(
height: 6.0, height: 8,
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.pop(context); confirmSelectMeasureUnitDialog();
}, },
child: Padding( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.all(12),
horizontal: 18.0, vertical: 18.0), width: double.infinity,
child: Row( height: 65,
children: <Widget>[ decoration: BoxDecoration(
Icon( borderRadius: BorderRadius.circular(12),
FeatherIcons.share, color: Colors.white),
color: Theme child: Row(
.of(context) mainAxisAlignment: MainAxisAlignment.spaceBetween,
.primaryColor, children: [
size: 18.0, Texts(measureUnitSelectedType),
), Icon(
SizedBox(width: 24.0), Icons.arrow_drop_down,
Texts('Share Task', color: Colors.grey,
variant: "body2Link", color: Colors.grey[800]), )
], ],
),
),
),
InkWell(
onTap: () {
Navigator.pop(context);
// Navigator.of(context).push(SlideUpPageRoute(widget: PostTaskIndex(task: new Task(category: task?.category, description: task?.description, title: task?.title))));
},
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: 18.0, vertical: 18.0),
child: Row(
children: <Widget>[
Icon(
FeatherIcons.copy,
color: Theme
.of(context)
.primaryColor,
size: 18.0,
),
SizedBox(width: 24.0),
Texts('Post Similar Task',
variant: "body2Link", color: Colors.grey[800]),
],
),
),
), ),
], ),
), ),
); SizedBox(
}); height: 8,
} ),
InkWell(
return BaseView<BloodSugarViewMode>( onTap: () {
builder: (_, model, w) => DatePicker.showDatePicker(context,
AppScaffold( showTitleActions: true,
isShowAppBar: true, minTime: DateTime(DateTime.now().year - 1, 1, 1),
appBarTitle: 'Add', maxTime: DateTime.now(), onConfirm: (date) {
body: SingleChildScrollView( setState(() {
physics: BouncingScrollPhysics(), bloodSugarDate = date;
child: Container( });
margin: EdgeInsets.all(15),
child: Column(
children: [
SizedBox(
height: 15,
),
NewTextFields(
hintText: 'Enter Blood Sugar Value',
controller: _bloodSugarValueController,
keyboardType: TextInputType.number,
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
confirmSelectMeasureUnitDialog();
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(measureUnitSelectedType),
Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
),
),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showDatePicker(context,
showTitleActions: true,
minTime: DateTime(DateTime
.now()
.year - 1, 1, 1),
maxTime: DateTime.now(),
onConfirm: (date) {
print('confirm $date');
setState(() {
bloodSugarDate = date;
});
},
currentTime: bloodSugarDate,
locale: projectViewModel.localeType);
},
child: Container(
padding: EdgeInsets.all(12),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts('Date'),
Texts(getDate()),
],
),
),
),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
DatePicker.showTimePicker(
context, showTitleActions: true,
onConfirm: (date) {
print('confirm $date');
setState(() {
timeSugarDate = date;
});
},
currentTime: timeSugarDate,
locale: projectViewModel.localeType);
}, },
child: Container( currentTime: bloodSugarDate,
padding: EdgeInsets.all(12), locale: projectViewModel.localeType);
width: double.infinity, },
height: 65, child: Container(
decoration: BoxDecoration( padding: EdgeInsets.all(12),
borderRadius: BorderRadius.circular(12), width: double.infinity,
color: Colors.white), height: 65,
child: Row( decoration: BoxDecoration(
mainAxisAlignment: MainAxisAlignment.spaceBetween, borderRadius: BorderRadius.circular(12),
children: [Texts('Time'), Texts(getTime())], color: Colors.white),
), child: Row(
), mainAxisAlignment: MainAxisAlignment.spaceBetween,
), children: [
SizedBox( Texts(TranslationBase.of(context).date),
height: 8, Texts(getDate()),
), ],
InkWell( ),
onTap: () { ),
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ),
? measureTimeEnList SizedBox(
: measureTimeArList); height: 8,
),
InkWell(
onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true,
onConfirm: (date) {
setState(() {
timeSugarDate = date;
});
}, },
child: Container( currentTime: timeSugarDate,
padding: EdgeInsets.all(12), locale: projectViewModel.localeType);
width: double.infinity, },
height: 65, child: Container(
decoration: BoxDecoration( padding: EdgeInsets.all(12),
borderRadius: BorderRadius.circular(12), width: double.infinity,
color: Colors.white), height: 65,
child: Row( decoration: BoxDecoration(
mainAxisAlignment: MainAxisAlignment.spaceBetween, borderRadius: BorderRadius.circular(12),
children: [ color: Colors.white),
Texts(measureTimeSelectedType ?? 'Others'), child: Row(
Icon( mainAxisAlignment: MainAxisAlignment.spaceBetween,
Icons.arrow_drop_down, children: [
color: Colors.grey, Texts(TranslationBase.of(context).time),
) Texts(getTime())
], ],
), ),
),
),
],
), ),
), ),
), SizedBox(
bottomSheet: Container( height: 8,
color: Colors.transparent, ),
width: double.infinity, InkWell(
height: MediaQuery onTap: () {
.of(context) confirmSelectMeasureTimeDialog(projectViewModel.isArabic
.size ? measureTimeArList
.width * 0.2, : measureTimeEnList);
child: Padding( },
padding: const EdgeInsets.all(15.0), child: Container(
child: SecondaryButton( padding: EdgeInsets.all(12),
loading: model.state == ViewState.BusyLocal, width: double.infinity,
label: 'SAVE', textColor: Colors.white, onTap: () { height: 65,
if (_bloodSugarValueController.text.isNotEmpty) { decoration: BoxDecoration(
model.addDiabtecResult(diabtecUnit: measureUnitSelectedType, borderRadius: BorderRadius.circular(12),
measuredTime: measuredTime, color: Colors.white),
bloodSugerResult:_bloodSugarValueController.text.toString(), child: Row(
bloodSugerDateChart: '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
); Texts(measureTimeSelectedType ??
} TranslationBase.of(context).other),
}), Icon(
Icons.arrow_drop_down,
color: Colors.grey,
)
],
),
),
), ),
), ],
), ),
),
),
bottomSheet: Container(
color: Colors.transparent,
width: double.infinity,
height: MediaQuery.of(context).size.width * 0.2,
child: Padding(
padding: const EdgeInsets.all(15.0),
child: SecondaryButton(
label: TranslationBase.of(context).save,
textColor: Colors.white,
onTap: () {
if (_bloodSugarValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
if (widget.isUpdate)
widget.bloodSugarViewMode.updateDiabtecResult(
month: bloodSugarDate,
hour: timeSugarDate,
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
lineItemNo: widget.lineItemNo,
bloodSugerResult:
_bloodSugarValueController.text.toString()).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if(widget.bloodSugarViewMode.state == ViewState.Error)
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
});
else
widget.bloodSugarViewMode.addDiabtecResult(
diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime,
bloodSugerResult:
_bloodSugarValueController.text.toString(),
bloodSugerDateChart:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
).then((value) {
GifLoaderDialogUtils.hideDialog(context);
if(widget.bloodSugarViewMode.state == ViewState.Error)
AppToast.showErrorToast(message: widget.bloodSugarViewMode.error);
else
Navigator.pop(context);
});
}
}),
),
),
); );
} }
String getDate() { String getDate() {
return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}";
.day}, ${bloodSugarDate.year}";
} }
String getTime() { String getTime() {
@ -314,7 +292,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
context: context, context: context,
child: RadioStringDialog( child: RadioStringDialog(
radioList: measureUnitList, radioList: measureUnitList,
title: 'Measure unit', title: TranslationBase.of(context).measureUnit,
selectedValue: measureUnitSelectedType, selectedValue: measureUnitSelectedType,
onValueSelected: (value) { onValueSelected: (value) {
setState(() { setState(() {
@ -330,7 +308,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
context: context, context: context,
child: RadioStringDialog( child: RadioStringDialog(
radioList: list, radioList: list,
title: 'Measure time', title: TranslationBase.of(context).measureTime,
selectedValue: measureTimeSelectedType, selectedValue: measureTimeSelectedType,
onValueSelected: (value) { onValueSelected: (value) {
setState(() { setState(() {

@ -1,13 +1,16 @@
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class BloodMonthlyPage extends StatelessWidget { class BloodMonthlyPage extends StatelessWidget {
final List<charts.Series<YearMonthlyChartDate, int>> data; final List<charts.Series<YearMonthlyChartDate, int>> data;
@ -17,6 +20,7 @@ class BloodMonthlyPage extends StatelessWidget {
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: ListView( body: ListView(
children: [ children: [
@ -34,7 +38,7 @@ class BloodMonthlyPage extends StatelessWidget {
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts('Details'), child: Texts(TranslationBase.of(context).details),
), ),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
@ -46,7 +50,7 @@ class BloodMonthlyPage extends StatelessWidget {
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),
children: fullData(), children: fullData(context,projectViewModel),
), ),
], ],
), ),
@ -56,7 +60,7 @@ class BloodMonthlyPage extends StatelessWidget {
); );
} }
List<TableRow> fullData() { List<TableRow> fullData(BuildContext context,ProjectViewModel projectViewModel) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -64,14 +68,15 @@ class BloodMonthlyPage extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515B5D'), color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0), topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Date', TranslationBase.of(context).date,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -82,11 +87,11 @@ class BloodMonthlyPage extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515B5D'), color: Theme.of(context).primaryColor,
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Time', TranslationBase.of(context).time,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -96,11 +101,11 @@ class BloodMonthlyPage extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515B5D'), color: Theme.of(context).primaryColor,
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Measured', TranslationBase.of(context).measured,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -110,20 +115,22 @@ class BloodMonthlyPage extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515B5D'), color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0), topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0),
topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Value', TranslationBase.of(context).value,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
), ),
height: 40), height: 40),
), ),
], ],
), ),
); );

@ -1,12 +1,15 @@
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class BloodYearPage extends StatelessWidget { class BloodYearPage extends StatelessWidget {
final List<charts.Series<WeekChartDate, DateTime>> data; final List<charts.Series<WeekChartDate, DateTime>> data;
@ -17,6 +20,7 @@ class BloodYearPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: ListView( body: ListView(
children: [ children: [
@ -34,7 +38,7 @@ class BloodYearPage extends StatelessWidget {
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts('Details'), child: Texts(TranslationBase.of(context).details),
), ),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
@ -46,7 +50,7 @@ class BloodYearPage extends StatelessWidget {
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),
children: fullData(), children: fullData(context,projectViewModel),
), ),
], ],
), ),
@ -56,7 +60,7 @@ class BloodYearPage extends StatelessWidget {
); );
} }
List<TableRow> fullData() { List<TableRow> fullData(BuildContext context,ProjectViewModel projectViewModel) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -64,14 +68,15 @@ class BloodYearPage extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515B5D'), color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0), topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Date', TranslationBase.of(context).date,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -82,11 +87,11 @@ class BloodYearPage extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515B5D'), color: Theme.of(context).primaryColor,
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Time', TranslationBase.of(context).time,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -96,11 +101,11 @@ class BloodYearPage extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515B5D'), color: Theme.of(context).primaryColor,
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Measured', TranslationBase.of(context).measured,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -110,20 +115,22 @@ class BloodYearPage extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515B5D'), color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0), topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0),
topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Value', TranslationBase.of(context).value,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
), ),
height: 40), height: 40),
), ),
], ],
), ),
); );

@ -43,7 +43,7 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
onModelReady: (model) => model.getBloodSugar(), onModelReady: (model) => model.getBloodSugar(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Blood Sugar', appBarTitle: TranslationBase.of(context).bloodSugar,
baseViewModel: model, baseViewModel: model,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
@ -81,21 +81,21 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.27, width: MediaQuery.of(context).size.width * 0.33,
child: Center( child: Center(
child: Texts('Weekly'), child: Texts(TranslationBase.of(context).weekly),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.27, width: MediaQuery.of(context).size.width * 0.33,
child: Center( child: Center(
child: Texts('Monthly'), child: Texts(TranslationBase.of(context).monthlyT),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.27, width: MediaQuery.of(context).size.width * 0.34,
child: Center( child: Center(
child: Texts('Yearly'), child: Texts(TranslationBase.of(context).yearly),
), ),
), ),
], ],
@ -116,6 +116,7 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
BloodSugarWeeklyPage( BloodSugarWeeklyPage(
data: model.getBloodWeeklySeries(), data: model.getBloodWeeklySeries(),
diabtecPatientResult: model.weekDiabtecPatientResult, diabtecPatientResult: model.weekDiabtecPatientResult,
bloodSugarViewMode: model,
), ),
BloodMonthlyPage( BloodMonthlyPage(
data: model.getBloodMonthlyTimeSeriesSales(), data: model.getBloodMonthlyTimeSeriesSales(),
@ -132,13 +133,13 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
), ),
floatingActionButton: InkWell( floatingActionButton: InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: AddBloodSugarPage())); Navigator.push(context, FadePage(page: AddBloodSugarPage(bloodSugarViewMode: model,)));
}, },
child: Container( child: Container(
width: 55, width: 55,
height: 55, height: 55,
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.circle, color: HexColor('515B5D')), shape: BoxShape.circle, color:Theme.of(context).primaryColor),
child: Center( child: Center(
child: Icon( child: Icon(
Icons.add, Icons.add,

@ -1,22 +1,31 @@
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts; import 'package:charts_flutter/flutter.dart' as charts;
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import 'AddBloodSugarPage.dart';
class BloodSugarWeeklyPage extends StatelessWidget { class BloodSugarWeeklyPage extends StatelessWidget {
final List<charts.Series<WeekChartDate, DateTime>> data; final List<charts.Series<WeekChartDate, DateTime>> data;
final List<DiabtecPatientResult> diabtecPatientResult; final List<DiabtecPatientResult> diabtecPatientResult;
final BloodSugarViewMode bloodSugarViewMode;
const BloodSugarWeeklyPage({Key key, this.data, this.diabtecPatientResult}) const BloodSugarWeeklyPage({Key key, this.data, this.diabtecPatientResult, this.bloodSugarViewMode})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: ListView( body: ListView(
children: [ children: [
@ -34,7 +43,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts('Details'), child: Texts(TranslationBase.of(context).details),
), ),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
@ -46,7 +55,7 @@ class BloodSugarWeeklyPage extends StatelessWidget {
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),
children: fullData(), children: fullData(context, projectViewModel,bloodSugarViewMode),
), ),
], ],
), ),
@ -56,7 +65,8 @@ class BloodSugarWeeklyPage extends StatelessWidget {
); );
} }
List<TableRow> fullData() { List<TableRow> fullData(
BuildContext context, ProjectViewModel projectViewModel, BloodSugarViewMode bloodSugarViewMode) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -64,14 +74,19 @@ class BloodSugarWeeklyPage extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515B5D'), color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0), topLeft: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Date', TranslationBase.of(context).date,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -82,11 +97,11 @@ class BloodSugarWeeklyPage extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515B5D'), color: Theme.of(context).primaryColor,
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Time', TranslationBase.of(context).time,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -96,11 +111,11 @@ class BloodSugarWeeklyPage extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515B5D'), color: Theme.of(context).primaryColor,
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Measured', TranslationBase.of(context).measured,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -110,11 +125,11 @@ class BloodSugarWeeklyPage extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515B5D'), color: Theme.of(context).primaryColor,
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Value', TranslationBase.of(context).value,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -124,14 +139,19 @@ class BloodSugarWeeklyPage extends StatelessWidget {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#515B5D'), color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0), topLeft: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
'Edit', TranslationBase.of(context).edit,
color: Colors.white, color: Colors.white,
fontSize: 15, fontSize: 15,
), ),
@ -203,12 +223,30 @@ class BloodSugarWeeklyPage extends StatelessWidget {
), ),
), ),
Container( Container(
child: Container( child: InkWell(
height: 70, onTap: () {
padding: EdgeInsets.all(10), Navigator.push(
color: Colors.white, context,
child: Center( FadePage(
child: Icon(Icons.edit), page: AddBloodSugarPage(
isUpdate: true,
bloodSugarDate: diabtec.dateChart,
measuredTime: diabtec.measuredDesc,
bloodSugarValue: diabtec.resultValue.toString(),
lineItemNo: diabtec.lineItemNo,
measureUnitSelectedType: diabtec.unit,
bloodSugarViewMode: bloodSugarViewMode,
),
),
);
},
child: Container(
height: 70,
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Icon(Icons.edit),
),
), ),
), ),
), ),

@ -1,3 +1,5 @@
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -11,7 +13,7 @@ class MyTrackers extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: 'My Tracker', appBarTitle: TranslationBase.of(context).myTracker,
isShowAppBar: true, isShowAppBar: true,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
@ -41,7 +43,7 @@ class MyTrackers extends StatelessWidget {
children: [ children: [
Image.asset('assets/tracker/blood-suger.png',width: 60.0,), Image.asset('assets/tracker/blood-suger.png',width: 60.0,),
SizedBox(height: 15,), SizedBox(height: 15,),
Text('Blood Sugar'), Texts(TranslationBase.of(context).bloodSugar),
], ],
), ),
), ),
@ -65,7 +67,7 @@ class MyTrackers extends StatelessWidget {
children: [ children: [
Image.asset('assets/tracker/blood-pressure.png',width: 60.0,), Image.asset('assets/tracker/blood-pressure.png',width: 60.0,),
SizedBox(height: 15,), SizedBox(height: 15,),
Text('Blood Pressure'), Texts(TranslationBase.of(context).bloodPressure),
], ],
), ),
), ),
@ -94,7 +96,7 @@ class MyTrackers extends StatelessWidget {
children: [ children: [
Image.asset('assets/tracker/weight.png',width: 60.0,), Image.asset('assets/tracker/weight.png',width: 60.0,),
SizedBox(height: 15,), SizedBox(height: 15,),
Text('Weight'), Texts(TranslationBase.of(context).weight),
], ],
), ),
), ),

@ -279,6 +279,31 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container(
child: Text(
languageID == 'ar'
? widget.product.shortDescriptionn
: widget.product.shortDescription,
style: TextStyle(
fontSize: 16,
fontFamily: 'WorkSans-Regular'),
),
),
SizedBox(
height: 10,
),
Container(
child: Text(
TranslationBase.of(context).howToUse,
style: TextStyle(
fontSize: 17,
color: Colors.grey,
fontWeight: FontWeight.w600),
),
),
SizedBox(
height: 10,
),
Container( Container(
child: Text( child: Text(
languageID == 'ar' languageID == 'ar'

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart'; import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart';
@ -15,11 +16,21 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart';
import 'lacum-activitaion-vida-page.dart'; import 'lacum-activitaion-vida-page.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
class PharmacyPage extends StatelessWidget { class PharmacyPage extends StatelessWidget {
@override
void initState() {
// print("model prescription " + model.prescriptionsList.length);
// cancelOrderDetail(order)
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PharmacyModuleViewModel>( return BaseView<PharmacyModuleViewModel>(
@ -37,8 +48,242 @@ class PharmacyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
BannerPager(model), BannerPager(model),
GridViewButtons(model), // GridViewButtons(model),
Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).myPrescription,
bold: true,
),
BorderedButton(
TranslationBase.of(context).viewAll,
hasBorder: true,
borderColor: Colors.green,
textColor: Colors.green,
vPadding: 6,
hPadding: 4,
handler: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
HomePrescriptionsPage()));
},
),
],
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 24.0),
height: MediaQuery.of(context).size.height * 0.30,
// width: 200.0,
// height: MediaQuery.of(context).size.height / 4 + 20,
margin: EdgeInsets.only(left: 10),
child: BaseView<PharmacyModuleViewModel>(
onModelReady: (model) => model.getPrescription(),
builder: (_, model, wi) => model.prescriptionsList.length != 0
// model.getPrescription();
? ListView.builder(
scrollDirection: Axis.horizontal,
shrinkWrap: true,
physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(),
// itemCount: 4,
itemCount: model.prescriptionsList.length,
itemBuilder: (context, index) {
return Container(
// width: 160.0,
height: MediaQuery.of(context).size.height * 0.6,
padding: EdgeInsets.only(bottom: 5.0, left: 5.0),
margin: EdgeInsets.only(right: 10.0),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey,
style: BorderStyle.solid,
width: 1.0,
),
color: Colors.white,
borderRadius: BorderRadius.circular(10.0)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
Column(children: [
Container(
padding: EdgeInsets.only(
top: 10.0,
left: 10.0,
right: 3.0,
bottom: 15.0,
),
child: Image.network(
model.prescriptionsList[index]
.doctorImageURL,
width: 60,
height: 60,
),
),
]),
Column(
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(left: 1),
padding: EdgeInsets.only(
left: 15.0, right: 15.0),
decoration: BoxDecoration(
border: Border.all(
color: Colors.green,
style: BorderStyle.solid,
width: 4.0,
),
color: Colors.green,
borderRadius:
BorderRadius.circular(
30.0)),
child: Text(
model.prescriptionsList[index]
.isInOutPatientDescription
.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 15.0,
// fontWeight: FontWeight.bold,
),
)),
Row(children: <Widget>[
Image.asset(
'assets/images/Icon-awesome-calendar.png',
width: 30,
height: 30,
),
Text(
model.prescriptionsList[index]
.appointmentDate
.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
// fontWeight: FontWeight.bold,
),
)
]),
],
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Row(children: <Widget>[
Text(
model.prescriptionsList[index]
.doctorTitle
.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
Text(
model.prescriptionsList[index]
.doctorName
.toString(),
style: TextStyle(
color: Colors.black,
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
),
]),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Text(
model.prescriptionsList[index]
.clinicDescription
.toString(),
style: TextStyle(
color: Colors.green,
fontSize: 15.0,
// fontWeight: FontWeight.bold,
),
),
),
],
),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 5),
child: Align(
alignment: Alignment.topLeft,
child: RatingBar.readOnly(
// initialRating: productRate,
size: 15.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
),
)
]),
]),
);
})
: Container(),
),
),
Container(
margin: EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
TranslationBase.of(context).recommended,
bold: true,
),
BorderedButton(
TranslationBase.of(context).viewAll,
hasBorder: true,
borderColor: Colors.green,
textColor: Colors.green,
vPadding: 6,
hPadding: 4,
handler: () {},
),
],
),
),
Container(
height: MediaQuery.of(context).size.height / 4 + 20,
child: ListView.builder(
itemBuilder: (ctx, i) =>
ProductTileItem(model.bestSellerProduct[i]),
scrollDirection: Axis.horizontal,
itemCount: model.bestSellerProduct.length,
),
),
Container( Container(
margin: EdgeInsets.fromLTRB(10, 0, 10, 0), margin: EdgeInsets.fromLTRB(10, 0, 10, 0),
child: Row( child: Row(
@ -55,8 +300,9 @@ class PharmacyPage extends StatelessWidget {
hPadding: 4, hPadding: 4,
borderColor: Colors.green, borderColor: Colors.green,
textColor: Colors.green, textColor: Colors.green,
handler: () =>{ handler: () => {
Navigator.push(context,FadePage(page: ProductBrandsPage())), Navigator.push(
context, FadePage(page: ProductBrandsPage())),
}, },
), ),
], ],
@ -119,8 +365,9 @@ class PharmacyPage extends StatelessWidget {
textColor: Colors.green, textColor: Colors.green,
vPadding: 6, vPadding: 6,
hPadding: 4, hPadding: 4,
handler: () =>{ handler: () => {
Navigator.push(context,FadePage(page: ProductBrandsPage())), Navigator.push(
context, FadePage(page: ProductBrandsPage())),
}, },
), ),
], ],
@ -180,15 +427,15 @@ class GridViewButtons extends StatelessWidget {
hasColorFilter: false, hasColorFilter: false,
child: GridViewCard(TranslationBase.of(context).medicationRefill, child: GridViewCard(TranslationBase.of(context).medicationRefill,
'assets/images/pharmacy_module/medication_icon.png', () { 'assets/images/pharmacy_module/medication_icon.png', () {
model.checkUserIsActivated().then((isActivated) { model.checkUserIsActivated().then((isActivated) {
if (isActivated) { if (isActivated) {
Navigator.push(context, FadePage(page: LakumMainPage())); Navigator.push(context, FadePage(page: LakumMainPage()));
} else { } else {
Navigator.push( Navigator.push(
context, FadePage(page: LakumActivationVidaPage())); context, FadePage(page: LakumActivationVidaPage()));
} }
}); });
}), }),
), ),
DashboardItem( DashboardItem(
imageName: 'pharmacy_module/bg_3.png', imageName: 'pharmacy_module/bg_3.png',
@ -196,8 +443,9 @@ class GridViewButtons extends StatelessWidget {
hasColorFilter: false, hasColorFilter: false,
child: GridViewCard(TranslationBase.of(context).myPrescriptions, child: GridViewCard(TranslationBase.of(context).myPrescriptions,
'assets/images/pharmacy_module/prescription_icon.png', () { 'assets/images/pharmacy_module/prescription_icon.png', () {
Navigator.push(context, FadePage(page: PharmacyAddressesPage())); Navigator.push(
}), context, FadePage(page: PharmacyAddressesPage()));
}),
), ),
DashboardItem( DashboardItem(
imageName: 'pharmacy_module/bg_4.png', imageName: 'pharmacy_module/bg_4.png',
@ -206,7 +454,7 @@ class GridViewButtons extends StatelessWidget {
child: GridViewCard( child: GridViewCard(
TranslationBase.of(context).searchAndScanMedication, TranslationBase.of(context).searchAndScanMedication,
'assets/images/pharmacy_module/search_scan_icon.png', 'assets/images/pharmacy_module/search_scan_icon.png',
() {}), () {}),
), ),
], ],
), ),

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -31,11 +32,11 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
String customerId = ""; String customerId = "";
String order =""; String order ="";
List <OrderModel> orderList = [] ; List <Orders> orderList = [] ;
List <OrderModel> deliveredOrderList = [] ; List <Orders> deliveredOrderList = [] ;
List <OrderModel> processingOrderList = []; List <Orders> processingOrderList = [];
List <OrderModel> cancelledOrderList = []; List <Orders> cancelledOrderList = [];
List <OrderModel> pendingOrderList = []; List <Orders> pendingOrderList = [];
TabController _tabController; TabController _tabController;
// AppSharedPreferences sharedPref = AppSharedPreferences(); // AppSharedPreferences sharedPref = AppSharedPreferences();
@ -66,6 +67,8 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
child: Column( child: Column(
children: [ children: [
TabBar( TabBar(
labelPadding:
EdgeInsets.only(left: 3.0, right: 3.0),
tabs: [ tabs: [
Tab(text: TranslationBase.of(context).delivered), Tab(text: TranslationBase.of(context).delivered),
Tab(text: TranslationBase.of(context).processing), Tab(text: TranslationBase.of(context).processing),
@ -103,16 +106,16 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Widget getDeliveredOrder(OrderModelViewModel model){ Widget getDeliveredOrder(OrderModelViewModel model){
for(int i=0 ; i< model.order.length; i++){ for(int i=0 ; i< model.orders.length; i++){
if( model.order[i].orderStatusId == 30 || model.order[i].orderStatusId == 997 if( model.orders[i].orderStatusId == 30 || model.orders[i].orderStatusId == 997
|| model.order[i].orderStatusId == 994 || model.orders[i].orderStatusId == 994
){ ){
deliveredOrderList.add(model.order[i]); deliveredOrderList.add(model.orders[i]);
} }
} }
return Container( return Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
child: model.order.length != 0 child: model.orders.length != 0
? SingleChildScrollView( ? SingleChildScrollView(
child: Column( child: Column(
children:<Widget> [ children:<Widget> [
@ -162,7 +165,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
), ),
), ),
Container( Container(
child: Text(deliveredOrderList[index].createdOnUtc.toString().substring(0,11), child: Text(deliveredOrderList[index].createdOnUtc.toString().substring(0,10),
style: TextStyle(fontSize: 14.0, style: TextStyle(fontSize: 14.0,
), ),
), ),
@ -177,7 +180,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(context,
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:deliveredOrderList[index]))); MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel: deliveredOrderList[index]),));
}, },
child: SvgPicture.asset( child: SvgPicture.asset(
languageID == "ar" languageID == "ar"
@ -260,7 +263,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Row( Row(
children: [ children: [
Container( Container(
child: Text(deliveredOrderList[index].orderItems.length.toString(), child: Text(deliveredOrderList[index].productCount.toString(),
style: TextStyle(fontSize: 14.0, style: TextStyle(fontSize: 14.0,
), ),
), ),
@ -317,15 +320,15 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
} }
Widget getProcessingOrder(OrderModelViewModel model){ Widget getProcessingOrder(OrderModelViewModel model){
for(int i=0 ; i< model.order.length; i++){ for(int i=0 ; i< model.orders.length; i++){
if( model.order[i].orderStatusId == 20 || model.order[i].orderStatusId == 995 || if( model.orders[i].orderStatusId == 20 || model.orders[i].orderStatusId == 995 ||
model.order[i].orderStatusId == 998 || model.order[i].orderStatusId == 999){ model.orders[i].orderStatusId == 998 || model.orders[i].orderStatusId == 999){
processingOrderList.add(model.order[i]); processingOrderList.add(model.orders[i]);
} }
} }
return Container( return Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
child: model.order.length != 0 child: model.orders.length != 0
? SingleChildScrollView( ? SingleChildScrollView(
child: Column( child: Column(
children:<Widget> [ children:<Widget> [
@ -375,7 +378,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
), ),
), ),
Container( Container(
child: Text(processingOrderList[index].createdOnUtc.toString().substring(0,11), child: Text(processingOrderList[index].createdOnUtc.toString().substring(0,10),
style: TextStyle(fontSize: 14.0, style: TextStyle(fontSize: 14.0,
), ),
), ),
@ -390,8 +393,9 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(context,
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:processingOrderList[index]))); MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel :processingOrderList[index])));
},
},
child: SvgPicture.asset( child: SvgPicture.asset(
languageID == "ar" languageID == "ar"
? 'assets/images/pharmacy/arrow_left.svg' ? 'assets/images/pharmacy/arrow_left.svg'
@ -473,7 +477,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Row( Row(
children: [ children: [
Container( Container(
child: Text(processingOrderList[index].orderItems.length.toString(), child: Text(processingOrderList[index].productCount.toString(),
style: TextStyle(fontSize: 14.0, style: TextStyle(fontSize: 14.0,
), ),
), ),
@ -709,13 +713,13 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
} }
Widget getPendingOrder(OrderModelViewModel model){ Widget getPendingOrder(OrderModelViewModel model){
for(int i=0 ; i< model.order.length; i++){ for(int i=0 ; i< model.orders.length; i++){
if( model.order[i].orderStatusId == 10){ if( model.orders[i].orderStatusId == 10){
pendingOrderList.add(model.order[i]); pendingOrderList.add(model.orders[i]);
} }
} }
return Container( return Container(
child: model.order.length != 0 child: model.orders.length != 0
? SingleChildScrollView( ? SingleChildScrollView(
child: Column( child: Column(
children:<Widget> [ children:<Widget> [
@ -766,7 +770,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
), ),
), ),
Container( Container(
child: Text(pendingOrderList[index].createdOnUtc.toString().substring(0,11), child: Text(pendingOrderList[index].createdOnUtc.toString().substring(0,10),
style: TextStyle(fontSize: 14.0, style: TextStyle(fontSize: 14.0,
), ),
), ),
@ -782,7 +786,8 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(context,
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:pendingOrderList[index]))); MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:pendingOrderList[index])));
},
},
child: SvgPicture.asset( child: SvgPicture.asset(
languageID == "ar" languageID == "ar"
? 'assets/images/pharmacy/arrow_left.svg' ? 'assets/images/pharmacy/arrow_left.svg'
@ -864,7 +869,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Row( Row(
children: [ children: [
Container( Container(
child: Text(pendingOrderList[index].orderItems.length.toString(), child: Text(pendingOrderList[index].productCount.toString(),
style: TextStyle(fontSize: 14.0, style: TextStyle(fontSize: 14.0,
), ),
), ),
@ -924,15 +929,14 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
} }
Widget getCancelledOrder(OrderModelViewModel model){ Widget getCancelledOrder(OrderModelViewModel model){
for(int i=0 ; i< model.orders.length; i++){
for(int i=0 ; i< model.order.length; i++){ if( model.orders[i].orderStatusId == 40 || model.orders[i].orderStatus == 996
if( model.order[i].orderStatusId == 40 || model.order[i].orderStatusId == 996 || model.orders[i].orderStatusId == 200){
|| model.order[i].orderStatusId == 200){ cancelledOrderList.add(model.orders[i]);
cancelledOrderList.add(model.order[i]);
} }
} }
return Container( return Container(
child: model.order.length != 0 child: model.orders.length != 0
? SingleChildScrollView( ? SingleChildScrollView(
child: Column( child: Column(
children:<Widget> [ children:<Widget> [
@ -983,7 +987,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
), ),
), ),
Container( Container(
child: Text(cancelledOrderList[index].createdOnUtc.toString().substring(0,11), child: Text(cancelledOrderList[index].createdOnUtc.toString().substring(0,10),
style: TextStyle(fontSize: 14.0, style: TextStyle(fontSize: 14.0,
), ),
), ),
@ -998,7 +1002,8 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(context,
MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:cancelledOrderList[index]))); MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel: cancelledOrderList[index])));
}, },
child: SvgPicture.asset( child: SvgPicture.asset(
languageID == "ar" languageID == "ar"
@ -1081,7 +1086,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
Row( Row(
children: [ children: [
Container( Container(
child: Text(cancelledOrderList[index].orderItems.length.toString(), child: Text(cancelledOrderList[index].productCount.toString(),
style: TextStyle(fontSize: 14.0, style: TextStyle(fontSize: 14.0,
), ),
), ),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart';
@ -18,15 +19,16 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
dynamic languageID; dynamic languageID;
class OrderDetailsPage extends StatefulWidget {
OrderModel orderModel;
class OrderDetailsPage extends StatefulWidget {
Orders orderModel;
OrderDetailsPage({@required this.orderModel}); OrderDetailsPage({@required this.orderModel});
// Orders orderModel;
// OrderModel orderModelDetails;
// OrderDetailsPage({@required this.orderModel, this.orderModelDetails});
@override @override
_OrderDetailsPageState createState() => _OrderDetailsPageState(); _OrderDetailsPageState createState() => _OrderDetailsPageState();
} }
@ -37,9 +39,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
} }
// AppSharedPreferences sharedPref = AppSharedPreferences(); // AppSharedPreferences sharedPref = AppSharedPreferences();
String orderId = "";
String customerId; String customerId;
List<OrderModel> orderList = []; List<OrderModel> ordersList = [];
List<OrderModel> cancelledOrderList = []; List<OrderModel> cancelledOrderList = [];
@ -55,8 +56,10 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
void initState() { void initState() {
getLanguageID(); getLanguageID();
super.initState(); super.initState();
print(widget.orderModel.orderItems.length); // print(widget.orderModel.orderItems.length);
getCancelOrder(widget.orderModel.id); getCancelOrder(widget.orderModel.id);
print("ID is" + widget.orderModel.id);
// cancelOrderDetail(order) // cancelOrderDetail(order)
} }
@ -108,8 +111,10 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
borderRadius: BorderRadius.circular(30.0)), borderRadius: BorderRadius.circular(30.0)),
child: Text( child: Text(
languageID == "ar" languageID == "ar"
? widget.orderModel.orderStatusn.toString(): ? model.orderListModel[0].orderStatusn.toString()
widget.orderModel.orderStatus.toString().substring(12) , : model.orderListModel[0].orderStatus
.toString()
.substring(12),
// TranslationBase.of(context).delivered, // TranslationBase.of(context).delivered,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
@ -126,11 +131,11 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
widget.orderModel.shippingAddress.firstName model.orderListModel[0].shippingAddress.firstName
.toString() .toString()
.substring(10) + .substring(10) +
' ' + ' ' +
widget.orderModel.shippingAddress.lastName model.orderListModel[0].shippingAddress.lastName
.toString() .toString()
.substring(9), .substring(9),
style: TextStyle( style: TextStyle(
@ -146,7 +151,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
widget.orderModel.shippingAddress.address1 model.orderListModel[0].shippingAddress.address1
.toString() .toString()
.substring(9), .substring(9),
style: TextStyle( style: TextStyle(
@ -154,8 +159,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.grey, color: Colors.grey,
), ),
),] ),
), ]),
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0), margin: EdgeInsets.fromLTRB(10.0, 5.0, 1.0, 5.0),
@ -163,14 +168,15 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
widget.orderModel.shippingAddress.address2 model.orderListModel[0].shippingAddress.address2
.toString() .toString()
.substring(9) + .substring(9) +
' ' + ' ' +
widget.orderModel.shippingAddress.country model.orderListModel[0].shippingAddress.country
.toString() + .toString() +
' ' + ' ' +
widget.orderModel.shippingAddress.zipPostalCode model.orderListModel[0].shippingAddress
.zipPostalCode
.toString(), .toString(),
style: TextStyle( style: TextStyle(
fontSize: 10.0, fontSize: 10.0,
@ -193,7 +199,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
Container( Container(
margin: EdgeInsets.only(top: 5.0, bottom: 5.0), margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: Text( child: Text(
widget.orderModel.shippingAddress.phoneNumber model.orderListModel[0].shippingAddress.phoneNumber
.toString(), .toString(),
style: TextStyle( style: TextStyle(
fontSize: 15.0, fontSize: 15.0,
@ -232,8 +238,9 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
Container( Container(
child: flutterImage.Image.asset( child: flutterImage.Image.asset(
widget.orderModel.shippingRateComputationMethodSystemName != model.orderListModel[0]
"Shipping.Aramex" .shippingRateComputationMethodSystemName !=
"Shipping.Aramex"
? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png" ? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png"
: "assets/images/pharmacy_module/payment/aramex_shipping_logo.png", : "assets/images/pharmacy_module/payment/aramex_shipping_logo.png",
fit: BoxFit.contain, fit: BoxFit.contain,
@ -284,7 +291,9 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
Container( Container(
margin: EdgeInsets.only(bottom: 10.0, top: 10.0), margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
child: Text( child: Text(
widget.orderModel.paymentName.toString().substring(12), model.orderListModel[0].paymentName
.toString()
.substring(12),
style: TextStyle( style: TextStyle(
fontSize: 13.0, fontSize: 13.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -320,23 +329,40 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
itemCount:widget.orderModel.orderItems.length, itemCount: model.orderListModel[0].orderItems.length,
itemBuilder: (context, index){ itemBuilder: (context, index) {
return Container( return Container(
child: productTile(productName: widget.orderModel.orderItems[index].product.name.toString(), child: productTile(
productPrice: widget.orderModel.orderItems[index].product.price.toString(), productName: model
productRate: widget.orderModel.orderItems[index].product.approvedRatingSum.toDouble(), .orderListModel[0].orderItems[index].product.name
productReviews:widget.orderModel.orderItems[index].product.approvedTotalReviews, .toString(),
totalPrice: "${(widget.orderModel.orderItems[index].product.price productPrice: model
* widget.orderModel.orderItems[index].quantity).toStringAsFixed(2)}", .orderListModel[0].orderItems[index].product.price
qyt: widget.orderModel.orderItems[index].quantity.toString(), .toString(),
isOrderDetails:true, productRate: model.orderListModel[0].orderItems[index]
imgs: widget.orderModel.orderItems[index].product.images != null && .product.approvedRatingSum
widget.orderModel.orderItems[index].product.images.length != 0 .toDouble(),
? widget.orderModel.orderItems[index].product.images [0].src.toString() productReviews: model.orderListModel[0]
.orderItems[index].product.approvedTotalReviews,
totalPrice:
"${(model.orderListModel[0].orderItems[index].product.price * model.orderListModel[0].orderItems[index].quantity).toStringAsFixed(2)}",
qyt: model
.orderListModel[0].orderItems[index].quantity
.toString(),
isOrderDetails: true,
imgs: model.orderListModel[0].orderItems[index]
.product.images !=
null &&
model.orderListModel[0].orderItems[index]
.product.images.length !=
0
? model.orderListModel[0].orderItems[index]
.product.images[0].src
.toString()
: null, : null,
status: widget.orderModel.orderStatusId, status: model.orderListModel[0].orderStatusId,
product: widget.orderModel.orderItems[index].product, product:
model.orderListModel[0].orderItems[index].product,
), ),
); );
}), }),
@ -385,7 +411,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
Text( Text(
widget.orderModel.orderSubtotalExclTax.toString(), model.orderListModel[0].orderSubtotalExclTax
.toString(),
style: TextStyle( style: TextStyle(
fontSize: 13.0, fontSize: 13.0,
), ),
@ -423,7 +450,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
Text( Text(
widget.orderModel.orderShippingExclTax.toString(), model.orderListModel[0].orderShippingExclTax
.toString(),
style: TextStyle( style: TextStyle(
fontSize: 13.0, fontSize: 13.0,
), ),
@ -461,7 +489,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
Text( Text(
widget.orderModel.orderTax.toString(), model.orderListModel[0].orderTax.toString(),
style: TextStyle( style: TextStyle(
fontSize: 13.0, fontSize: 13.0,
), ),
@ -499,7 +527,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
), ),
Text( Text(
widget.orderModel.orderTotal.toString(), model.orderListModel[0].orderTotal.toString(),
style: TextStyle( style: TextStyle(
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -510,83 +538,83 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
], ],
), ),
widget.orderModel.orderStatusId == 10 model.orderListModel[0].orderStatusId == 10
? InkWell( ? InkWell(
onTap: () { onTap: () {
model.makeOrder(); model.makeOrder();
}, },
child: Container( child: Container(
// margin: EdgeInsets.only(top: 20.0), // margin: EdgeInsets.only(top: 20.0),
height: 50.0, height: 50.0,
color: Colors.transparent, color: Colors.transparent,
child: Container( child: Container(
padding: EdgeInsets.only(left: 130.0, right: 130.0), padding: EdgeInsets.only(left: 130.0, right: 130.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.green, color: Colors.green,
style: BorderStyle.solid, style: BorderStyle.solid,
width: 4.0), width: 4.0),
color: Colors.green, color: Colors.green,
borderRadius: BorderRadius.circular(5.0)), borderRadius: BorderRadius.circular(5.0)),
child: Center( child: Center(
child: Text( child: Text(
TranslationBase.of(context).payOnline, TranslationBase.of(context).payOnline,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
),
),
),
), ),
), ),
), )
),
),
)
: Container(), : Container(),
// getCancelOrder(canCancel, canRefund), // getCancelOrder(canCancel, canRefund),
isCancel isCancel
? InkWell( ? InkWell(
onTap: () { onTap: () {
presentConfirmDialog(model, presentConfirmDialog(model, widget.orderModel.id);
widget.orderModel.id); //(widget.orderModel.id)); // model.orderListModel[0].id//(widget.orderModel.id));
// //
}, },
child: Container( child: Container(
// padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), // padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0),
height: 50.0, height: 50.0,
color: Colors.transparent, color: Colors.transparent,
child: Center( child: Center(
child: Text( child: Text(
TranslationBase.of(context).cancelOrder, TranslationBase.of(context).cancelOrder,
style: TextStyle( style: TextStyle(
color: Colors.red[900], color: Colors.red[900],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
decoration: TextDecoration.underline), decoration: TextDecoration.underline),
), ),
), ),
), ),
) )
: Container(), : Container(),
isActiveDelivery isActiveDelivery
? InkWell( ? InkWell(
onTap: () { onTap: () {
Navigator.push( // Navigator.push(
context, // context,
MaterialPageRoute(builder: (context) => TrackDriver(order: widget.orderModel), // MaterialPageRoute(builder: (context) => TrackDriver(order: widget.orderModel),
)); // ));
}, },
child: Container( child: Container(
height: 50.0, height: 50.0,
color: Colors.transparent, color: Colors.transparent,
child: Center( child: Center(
child: Text( child: Text(
TranslationBase.of(context).trackDeliveryDriver, TranslationBase.of(context).trackDeliveryDriver,
style: TextStyle( style: TextStyle(
color: Colors.green[900], color: Colors.green[900],
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
decoration: TextDecoration.none), decoration: TextDecoration.none),
), ),
), ),
), ),
) )
: Container(), : Container(),
], ],
), ),
@ -655,6 +683,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => OrderPage( builder: (context) => OrderPage(
// customerID: model.ordersList[0].customerId.toString()
customerID: widget.orderModel.customerId.toString())), customerID: widget.orderModel.customerId.toString())),
); );
}), }),

File diff suppressed because it is too large Load Diff

@ -16,20 +16,20 @@ class OrderDetailsService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
// String url ="";
List<OrderModel> get orderDetails => orderDetails; // List<OrderModel> get orderDetails => ordeDetails;
List<OrderModel> _orderList = List(); List<OrderModel> _orderList = List();
List<OrderModel> get orderList => _orderList; List<OrderModel> get orderList => _orderList;
Future getOrderDetails(orderId) async { Future getOrderDetails(OrderId) async {
print("step 2" + orderId);
hasError = false; hasError = false;
await baseAppClient.getPharmacy(GET_ORDER_DETAILS+orderId, await baseAppClient.getPharmacy(GET_ORDER_DETAILS+OrderId,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_orderList.clear(); _orderList.clear();
response['orders'].forEach((item) { response['orders'].forEach((item) {
_orderList.add(OrderModel.fromJson(item)); _orderList.add(OrderModel.fromJson(item));
print(response);
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart';
class OrderService extends BaseService{ class OrderService extends BaseService{
@ -14,21 +14,23 @@ class OrderService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
List<OrderModel> _orderList = List(); List<Orders> _orderList = List();
List<OrderModel> get orderList => _orderList; List<Orders> get orderList => _orderList;
String url =""; String url ="";
Future getOrder(customerId, pageId) async { Future getOrder(customerId, pageId) async {
hasError = false; hasError = false;
// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; // url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368";
url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId"; // url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$pageId&limit=200&customer_id=$customerId";
url =GET_ORDER+"customer=1&fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc,product_count,can_cancel,can_refund&page=$pageId&limit=200&customer_id=$customerId";
print(url); print(url);
await baseAppClient.getPharmacy(url, await baseAppClient.getPharmacy(url,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_orderList.clear(); _orderList.clear();
response['orders'].forEach((item) { response['orders'].forEach((item) {
_orderList.add(OrderModel.fromJson(item)); _orderList.add(Orders.fromJson(item));
}); });
print(_orderList.length); print(_orderList.length);
print(response); print(response);
@ -39,25 +41,27 @@ class OrderService extends BaseService{
} }
Future getProductReview(orderId) async { // Future getProductReview(orderId) async {
print("step 1"); // print("step 1");
hasError = false; // hasError = false;
url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368"; // url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=1&limit=200&customer_id=1367368";
// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$page_id&limit=200&customer_id=$custmerId"; //// url =GET_ORDER+"customer=1,fields=id,order_total,order_status,order_statusn,order_status_id,created_on_utc&page=$page_id&limit=200&customer_id=$custmerId";
print(url); // print(url);
await baseAppClient.getPharmacy(url, // await baseAppClient.getPharmacy(url,
onSuccess: (dynamic response, int statusCode) { // onSuccess: (dynamic response, int statusCode) {
_orderList.clear(); // _orderList.clear();
response['orders'].forEach((item) { // response['orders'].forEach((item) {
_orderList.add(OrderModel.fromJson(item)); // _orderList.add(OrderModel.fromJson(item));
}); // });
print(_orderList.length); // print(_orderList.length);
print(response); // print(response);
}, onFailure: (String error, int statusCode) { // }, onFailure: (String error, int statusCode) {
hasError = true; // hasError = true;
super.error = error; // super.error = error;
}); // });
} // }
// Future<Map> getOrder(BuildContext context ) async { // Future<Map> getOrder(BuildContext context ) async {
// //
// if (await this.sharedPref.getObject(USER_PROFILE) != null) { // if (await this.sharedPref.getObject(USER_PROFILE) != null) {

@ -272,6 +272,7 @@ class TranslationBase {
localizedValues['pharmaciesList'][locale.languageCode]; localizedValues['pharmaciesList'][locale.languageCode];
String get description => localizedValues['description'][locale.languageCode]; String get description => localizedValues['description'][locale.languageCode];
String get howToUse => localizedValues['howToUse'][locale.languageCode];
String get price => localizedValues['price'][locale.languageCode]; String get price => localizedValues['price'][locale.languageCode];
@ -644,6 +645,8 @@ class TranslationBase {
localizedValues['SelectFamilyPatientName'][locale.languageCode]; localizedValues['SelectFamilyPatientName'][locale.languageCode];
String get selectHospital => String get selectHospital =>
localizedValues['SelectHospital'][locale.languageCode]; localizedValues['SelectHospital'][locale.languageCode];
String get selectCity =>
localizedValues['selectCity'][locale.languageCode];
String get myAccount => localizedValues['MyAccount'][locale.languageCode]; String get myAccount => localizedValues['MyAccount'][locale.languageCode];
String get otherAccount => String get otherAccount =>
localizedValues['OtherAccount'][locale.languageCode]; localizedValues['OtherAccount'][locale.languageCode];
@ -819,6 +822,7 @@ class TranslationBase {
String get recentlyViewed => String get recentlyViewed =>
localizedValues['recentlyViewed'][locale.languageCode]; localizedValues['recentlyViewed'][locale.languageCode];
String get bestSellers => localizedValues['bestSellers'][locale.languageCode]; String get bestSellers => localizedValues['bestSellers'][locale.languageCode];
String get recommended => localizedValues['recommended'][locale.languageCode];
String get deleteAllItems => String get deleteAllItems =>
localizedValues['deleteAllItems'][locale.languageCode]; localizedValues['deleteAllItems'][locale.languageCode];
String get selectAddress => String get selectAddress =>
@ -1313,6 +1317,18 @@ class TranslationBase {
String get instructionAgree => String get instructionAgree =>
localizedValues['instructionAgree'][locale.languageCode]; localizedValues['instructionAgree'][locale.languageCode];
String get reqId => localizedValues['reqId'][locale.languageCode]; String get reqId => localizedValues['reqId'][locale.languageCode];
String get ordersLog => localizedValues['RRT-orders-log'][locale.languageCode];
String get bloodSugar => localizedValues['blood-sugar'][locale.languageCode];
String get myTracker => localizedValues['my-tracker'][locale.languageCode];
String get weekly => localizedValues['weekly'][locale.languageCode];
String get monthlyT => localizedValues['monthly'][locale.languageCode];
String get yearly => localizedValues['yearly'][locale.languageCode];
String get measured => localizedValues['measured'][locale.languageCode];
String get sugarAdd => localizedValues['sugar-add'][locale.languageCode];
String get other => localizedValues['other'][locale.languageCode];
String get measureUnit => localizedValues['measure-unit'][locale.languageCode];
String get measureTime => localizedValues['measure-time'][locale.languageCode];
String get update => localizedValues['update'][locale.languageCode];
String get covid19_driveThrueTest => String get covid19_driveThrueTest =>
localizedValues['covid19_driveThrueTest'][locale.languageCode]; localizedValues['covid19_driveThrueTest'][locale.languageCode];
@ -1352,6 +1368,13 @@ class TranslationBase {
localizedValues["convertCholesterolStatement"][locale.languageCode]; localizedValues["convertCholesterolStatement"][locale.languageCode];
String get triglyceridesConvertStatement => String get triglyceridesConvertStatement =>
localizedValues["triglyceridesConvertStatement"][locale.languageCode]; localizedValues["triglyceridesConvertStatement"][locale.languageCode];
String get addNewChild => localizedValues["add-new-child"][locale.languageCode];
String get sendChildEmailMsg => localizedValues["send-child-email-msg"][locale.languageCode];
String get vaccinationAddChildMsg => localizedValues["vaccination-add-child-msg"][locale.languageCode];
String get childAddedSuccessfully => localizedValues["child_added_successfully"][locale.languageCode];
String get bloodDEnterDesc => localizedValues["bloodD-enter-desc"][locale.languageCode];
String get viewTermsConditions => localizedValues["viewTermsConditions"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save