# Conflicts:
#	android/app/src/main/AndroidManifest.xml
#	lib/config/config.dart
#	lib/pages/AlHabibMedicalService/​ health_calculators.dart
#	lib/pages/BookAppointment/widgets/DoctorView.dart
#	lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart
fix_authentication
haroon amjad 6 years ago
commit 6b316bf262

@ -27,7 +27,7 @@ apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android { android {
compileSdkVersion 30 compileSdkVersion 28
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
@ -41,7 +41,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.cloud.diplomaticquarterapp" applicationId "com.cloud.diplomaticquarterapp"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 30 targetSdkVersion 28
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
multiDexEnabled true multiDexEnabled true

@ -2,4 +2,4 @@
android.enableR8=true android.enableR8=true
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
org.gradle.jvmargs=-Xmx4608m org.gradle.jvmargs=-Xmx4608m

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 16 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

@ -29,8 +29,10 @@ const GET_PRESCRIPTION_REPORT_ENH =
///Lab Order ///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; const GET_Patient_LAB_SPECIAL_RESULT =
const GET_Patient_LAB_RESULT = '/Services/Patients.svc/REST/GetPatientLabResults'; 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const GET_Patient_LAB_RESULT =
'/Services/Patients.svc/REST/GetPatientLabResults';
/// ///
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
@ -43,8 +45,7 @@ const SEND_RAD_REPORT_EMAIL =
///Feedback ///Feedback
const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList';
const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC'; const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC';
const GET_PATIENT_AppointmentHistory = const GET_PATIENT_AppointmentHistory = 'Services'
'Services'
'/Doctors.svc/REST/PateintHasAppoimentHistory'; '/Doctors.svc/REST/PateintHasAppoimentHistory';
///VITAL SIGN ///VITAL SIGN
@ -52,52 +53,50 @@ const GET_PATIENT_VITAL_SIGN =
'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
///Er Nearest ///Er Nearest
const GET_NEAREST_HOSPITAL= const GET_NEAREST_HOSPITAL =
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
///Er Nearest ///Er Nearest
const GET_AMBULANCE_REQUEST= const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; const GET_PATIENT_ALL_PRES_ORDERS= 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID= 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID';
///FindUs ///FindUs
const GET_FINDUS_REQUEST= const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
'Services/Lists.svc/REST/Get_HMG_Locations';
///LiveChat ///LiveChat
const GET_LIVECHAT_REQUEST= const GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects';
'Services/Patients.svc/REST/GetPatientICProjects';
///babyInformation ///babyInformation
const GET_BABYINFORMATION_REQUEST= const GET_BABYINFORMATION_REQUEST =
'Services/Community.svc/REST/GetBabyByUserID'; 'Services/Community.svc/REST/GetBabyByUserID';
///Get Baby By User ID
const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID';
///userInformation ///userInformation
const GET_USERINFORMATION_REQUEST= const GET_USERINFORMATION_REQUEST =
'Services/Community.svc/REST/GetUserInformation_New'; 'Services/Community.svc/REST/GetUserInformation_New';
///addNewChild ///addNewChild
const GET_NEWCHILD_REQUEST= const GET_NEWCHILD_REQUEST = 'Services/Community.svc/REST/CreateNewBaby';
'Services/Community.svc/REST/CreateNewBaby';
///newUserId
const GET_NEW_USER_REQUEST = 'Services/Community.svc/REST/CreateNewUser_New';
///addNewTABLE ///delteChild
const GET_TABLE_REQUEST= const DELETE_CHILD_REQUEST = 'Services/Community.svc/REST/DeleteBaby';
'Services/Community.svc/REST/CreateVaccinationTable';
///addNewTABLE
const GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable';
///BloodDenote ///BloodDenote
const GET_CITIES_REQUEST= const GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities';
'Services/Lists.svc/REST/GetAllCities';
///BloodDetails ///BloodDetails
const GET_BLOOD_REQUEST= const GET_BLOOD_REQUEST =
'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails';
///Reports ///Reports
const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
const INSERT_REQUEST_FOR_MEDICAL_REPORT = const INSERT_REQUEST_FOR_MEDICAL_REPORT =
@ -125,7 +124,8 @@ const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';
const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime";
//URL to dental doctors list //URL to dental doctors list
const GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; const GET_DENTAL_DOCTORS_LIST_URL =
"Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping";
//URL to get doctor free slots //URL to get doctor free slots
const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots";
@ -139,8 +139,7 @@ const GET_PATIENT_SHARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history //URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY = const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory";
"Services/Doctors.svc/REST/PateintHasAppoimentHistory";
//URL to get patient appointment curfew history //URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
@ -215,9 +214,9 @@ const CANCEL_LIVECARE_REQUEST =
const SEND_LIVECARE_INVOICE_EMAIL = const SEND_LIVECARE_INVOICE_EMAIL =
'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; 'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
const GET_USER_TERMS = '/Services/Patients.svc/REST/GetUserTermsAndConditions';
const GET_USER_TERMS ='/Services/Patients.svc/REST/GetUserTermsAndConditions'; const UPDATE_HEALTH_TERMS =
const UPDATE_HEALTH_TERMS ='/services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; '/services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
//URL to get medicine and pharmacies list //URL to get medicine and pharmacies list
const CHANNEL = 3; const CHANNEL = 3;
@ -252,11 +251,17 @@ const GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave';
const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail';
const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; const GET_PATIENT_AdVANCE_BALANCE_AMOUNT =
const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount';
const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; const GET_PATIENT_INFO_BY_ID =
const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; 'Services/Doctors.svc/REST/GetPatientInfoByPatientID';
const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER =
'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber';
const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment';
const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment';
const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter';
@ -265,51 +270,59 @@ const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetP
const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
///My Trackers ///My Trackers
const GET_DIABETIC_RESULT_AVERAGE='Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; const GET_DIABETIC_RESULT_AVERAGE =
const GET_DIABTEC_RESULT='Services/Patients.svc/REST/Patient_GetDiabtecResults'; 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
const ADD_DIABTEC_RESULT='Services/Patients.svc/REST/Patient_AddDiabtecResult'; const GET_DIABTEC_RESULT =
'Services/Patients.svc/REST/Patient_GetDiabtecResults';
const ADD_DIABTEC_RESULT =
const GET_BLOOD_PRESSURE_RESULT_AVERAGE='Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; 'Services/Patients.svc/REST/Patient_AddDiabtecResult';
const GET_BLOOD_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_GetBloodPressureResult';
const ADD_BLOOD_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_AddBloodPressureResult'; const GET_BLOOD_PRESSURE_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage';
const GET_WEIGHT_PRESSURE_RESULT_AVERAGE='Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; const GET_BLOOD_PRESSURE_RESULT =
const GET_WEIGHT_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; 'Services/Patients.svc/REST/Patient_GetBloodPressureResult';
const ADD_WEIGHT_PRESSURE_RESULT='Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; const ADD_BLOOD_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID='Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; const GET_WEIGHT_PRESSURE_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
const GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; const GET_WEIGHT_PRESSURE_RESULT =
const GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
const ADD_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID =
'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID';
const GET_CALL_INFO_HOURS_RESULT =
'Services/Doctors.svc/REST/GetCallInfoHoursResult';
const GET_CALL_REQUEST_TYPE_LOV =
'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse';
const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus';
const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies';
// H2O // H2O
const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; const H2O_GET_USER_PROGRESS =
const H2O_INSERT_USER_ACTIVITY="Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; "Services/H2ORemainder.svc/REST/H2O_GetUserProgress";
const H2O_INSERT_USER_ACTIVITY =
"Services/H2ORemainder.svc/REST/H2O_InsertUserActivity";
//E_Referral Services //E_Referral Services
const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes"; const GET_ALL_RELATIONSHIP_TYPES =
const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/SendActivationCodeForEReferral'; "Services/Patients.svc/REST/GetAllRelationshipTypes";
const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral'; const SEND_ACTIVATION_CODE_FOR_E_REFERRAL =
'Services/Authentication.svc/REST/SendActivationCodeForEReferral';
const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL =
'Services/Authentication.svc/REST/CheckActivationCodeForEReferral';
const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities';
const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral";
const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
const TIMER_MIN = 10; const TIMER_MIN = 10;
class AppGlobal { class AppGlobal {

@ -379,6 +379,16 @@ const Map<String, Map<String, String>> localizedValues = {
"ar": "ar":
"السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك." "السماح لتطبيق مجموعة الحبيب الطبية بالوصول إلى موقعك سيساعدك في إظهار المستشفيات وفقًا للأقرب إليك."
}, },
"user-view-requester": {
"en": "User Wants To View Your Medical File",
"ar": "أشخاص يرغبون الاطلاع على ملفك الطبي"
},
"user-view": {
"en": "User Can View Your Medical File",
"ar": "أشخاص يمكنهم الاطلاع على ملفك الطبي"
},
"parking": {"en": "Parking", "ar": "مواقف"}, "parking": {"en": "Parking", "ar": "مواقف"},
"alhabiServices": {"en": "HMG Service", "ar": "خدمات الحبيب"}, "alhabiServices": {"en": "HMG Service", "ar": "خدمات الحبيب"},
"parkingTitle": { "parkingTitle": {
@ -569,6 +579,15 @@ const Map<String, Map<String, String>> localizedValues = {
"All":{"en":"All","ar":"الكل"}, "All":{"en":"All","ar":"الكل"},
"QuestionHere":{"en":"Enter the question here...","ar":"اضف الاستفسار هنا"}, "QuestionHere":{"en":"Enter the question here...","ar":"اضف الاستفسار هنا"},
"ViewDoctorResponses":{"en":"View Doctor Responses","ar":"الاطلاع على ردود الأطباء"}, "ViewDoctorResponses":{"en":"View Doctor Responses","ar":"الاطلاع على ردود الأطباء"},
"ServiceInformationButton":{"en":"LOGIN / REGISTER","ar":"دخول / تسجيل"},
"ServiceInformationTitle":{"en":"Service Information","ar":"معلومات الخدمة"},
"info-lab": {
"en": "This service allows you to view the results of all laboratory tests performed in Al Habib Medical Group as well as sending the report via e-mail.",
"ar": "خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية."
},
"info-radiology": {
"en": "This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.",
"ar": "خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل."
},
}; };

@ -14,4 +14,5 @@ const FAMILY_FILE = 'family-file';
const USER_LAT = 'user-lat'; const USER_LAT = 'user-lat';
const USER_LONG = 'user-long'; const USER_LONG = 'user-long';
const IS_GO_TO_PARKING = 'IS_GO_TO_PARKING'; const IS_GO_TO_PARKING = 'IS_GO_TO_PARKING';
const IS_SEARCH_APPO = 'is-search-appo';
const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment'; const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment';

@ -0,0 +1,60 @@
import 'package:flutter/cupertino.dart';
enum Ambulate { Wheelchair, Walker, Stretcher, None }
extension SelectedAmbulate on Ambulate {
String getAmbulateTitle(BuildContext context) {
switch (this) {
case Ambulate.Wheelchair:
return 'Wheelchair';
break;
case Ambulate.Walker:
return 'Walker';
break;
case Ambulate.Stretcher:
return 'Stretcher';
break;
case Ambulate.None:
return 'None';
break;
}
return 'None';
}
int selectAmbulateNumber() {
switch (this) {
case Ambulate.Wheelchair:
return 0;
break;
case Ambulate.Walker:
return 1;
break;
case Ambulate.Stretcher:
return 2;
break;
case Ambulate.None:
return 3;
break;
}
return 3;
}
Ambulate getAmbulateById(int id) {
switch (id) {
case 0:
return Ambulate.Wheelchair;
break;
case 1:
return Ambulate.Walker;
break;
case 2:
return Ambulate.Stretcher;
break;
case 3:
return Ambulate.None;
break;
}
return Ambulate.None;
}
}

@ -0,0 +1,22 @@
enum OrderService { AMBULANCE }
extension SelectedOrderService on OrderService {
int getIdOrderService() {
switch (this) {
case OrderService.AMBULANCE:
return 4;
break;
}
return 4;
}
OrderService getOrderServiceById(int id) {
switch (id) {
case 4:
return OrderService.AMBULANCE;
break;
}
return OrderService.AMBULANCE;
}
}

@ -0,0 +1,165 @@
class CreateNewUser_New {
Null date;
int languageID;
int serviceName;
Null time;
Null androidLink;
Null authenticationTokenID;
Null data;
bool dataw;
int dietType;
Null errorCode;
Null errorEndUserMessage;
Null errorEndUserMessageN;
Null errorMessage;
int errorType;
int foodCategory;
Null iOSLink;
bool isAuthenticated;
int mealOrderStatus;
int mealType;
int messageStatus;
int numberOfResultRecords;
Null patientBlodType;
Null successMsg;
Null successMsgN;
Null htmlResult;
bool isHMGPatient;
bool isRegister;
bool isSendSMS;
Null listBabyInformationModel;
Null listBabyNeedReminderModel;
Null listCreateVaccinationTableModel;
Null listHisPatientModel;
Null listUserInformationModel;
Null listUserInformationModelNew;
Null listVaccinationTableModel;
Null tokinID;
int userID;
Null verificationCode;
CreateNewUser_New(
{this.date,
this.languageID,
this.serviceName,
this.time,
this.androidLink,
this.authenticationTokenID,
this.data,
this.dataw,
this.dietType,
this.errorCode,
this.errorEndUserMessage,
this.errorEndUserMessageN,
this.errorMessage,
this.errorType,
this.foodCategory,
this.iOSLink,
this.isAuthenticated,
this.mealOrderStatus,
this.mealType,
this.messageStatus,
this.numberOfResultRecords,
this.patientBlodType,
this.successMsg,
this.successMsgN,
this.htmlResult,
this.isHMGPatient,
this.isRegister,
this.isSendSMS,
this.listBabyInformationModel,
this.listBabyNeedReminderModel,
this.listCreateVaccinationTableModel,
this.listHisPatientModel,
this.listUserInformationModel,
this.listUserInformationModelNew,
this.listVaccinationTableModel,
this.tokinID,
this.userID,
this.verificationCode});
CreateNewUser_New.fromJson(Map<String, dynamic> json) {
date = json['Date'];
languageID = json['LanguageID'];
serviceName = json['ServiceName'];
time = json['Time'];
androidLink = json['AndroidLink'];
authenticationTokenID = json['AuthenticationTokenID'];
data = json['Data'];
dataw = json['Dataw'];
dietType = json['DietType'];
errorCode = json['ErrorCode'];
errorEndUserMessage = json['ErrorEndUserMessage'];
errorEndUserMessageN = json['ErrorEndUserMessageN'];
errorMessage = json['ErrorMessage'];
errorType = json['ErrorType'];
foodCategory = json['FoodCategory'];
iOSLink = json['IOSLink'];
isAuthenticated = json['IsAuthenticated'];
mealOrderStatus = json['MealOrderStatus'];
mealType = json['MealType'];
messageStatus = json['MessageStatus'];
numberOfResultRecords = json['NumberOfResultRecords'];
patientBlodType = json['PatientBlodType'];
successMsg = json['SuccessMsg'];
successMsgN = json['SuccessMsgN'];
htmlResult = json['HtmlResult'];
isHMGPatient = json['IsHMGPatient'];
isRegister = json['IsRegister'];
isSendSMS = json['IsSendSMS'];
listBabyInformationModel = json['List_BabyInformationModel'];
listBabyNeedReminderModel = json['List_BabyNeedReminderModel'];
listCreateVaccinationTableModel = json['List_CreateVaccinationTableModel'];
listHisPatientModel = json['List_His_PatientModel'];
listUserInformationModel = json['List_UserInformationModel'];
listUserInformationModelNew = json['List_UserInformationModel_New'];
listVaccinationTableModel = json['List_VaccinationTableModel'];
tokinID = json['TokinID'];
userID = json['UserID'];
verificationCode = json['VerificationCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Date'] = this.date;
data['LanguageID'] = this.languageID;
data['ServiceName'] = this.serviceName;
data['Time'] = this.time;
data['AndroidLink'] = this.androidLink;
data['AuthenticationTokenID'] = this.authenticationTokenID;
data['Data'] = this.data;
data['Dataw'] = this.dataw;
data['DietType'] = this.dietType;
data['ErrorCode'] = this.errorCode;
data['ErrorEndUserMessage'] = this.errorEndUserMessage;
data['ErrorEndUserMessageN'] = this.errorEndUserMessageN;
data['ErrorMessage'] = this.errorMessage;
data['ErrorType'] = this.errorType;
data['FoodCategory'] = this.foodCategory;
data['IOSLink'] = this.iOSLink;
data['IsAuthenticated'] = this.isAuthenticated;
data['MealOrderStatus'] = this.mealOrderStatus;
data['MealType'] = this.mealType;
data['MessageStatus'] = this.messageStatus;
data['NumberOfResultRecords'] = this.numberOfResultRecords;
data['PatientBlodType'] = this.patientBlodType;
data['SuccessMsg'] = this.successMsg;
data['SuccessMsgN'] = this.successMsgN;
data['HtmlResult'] = this.htmlResult;
data['IsHMGPatient'] = this.isHMGPatient;
data['IsRegister'] = this.isRegister;
data['IsSendSMS'] = this.isSendSMS;
data['List_BabyInformationModel'] = this.listBabyInformationModel;
data['List_BabyNeedReminderModel'] = this.listBabyNeedReminderModel;
data['List_CreateVaccinationTableModel'] =
this.listCreateVaccinationTableModel;
data['List_His_PatientModel'] = this.listHisPatientModel;
data['List_UserInformationModel'] = this.listUserInformationModel;
data['List_UserInformationModel_New'] = this.listUserInformationModelNew;
data['List_VaccinationTableModel'] = this.listVaccinationTableModel;
data['TokinID'] = this.tokinID;
data['UserID'] = this.userID;
data['VerificationCode'] = this.verificationCode;
return data;
}
}

@ -0,0 +1,76 @@
class DeleteBaby {
bool isLogin;
int babyID;
int editedBy;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int patientOutSA;
String sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
int patientID;
String tokenID;
int patientTypeID;
int patientType;
DeleteBaby(
{this.isLogin,
this.babyID,
this.editedBy,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.patientID,
this.tokenID,
this.patientTypeID,
this.patientType});
DeleteBaby.fromJson(Map<String, dynamic> json) {
isLogin = json['IsLogin'];
babyID = json['BabyID'];
editedBy = json['EditedBy'];
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
patientOutSA = json['PatientOutSA'];
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
patientID = json['PatientID'];
tokenID = json['TokenID'];
patientTypeID = json['PatientTypeID'];
patientType = json['PatientType'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['IsLogin'] = this.isLogin;
data['BabyID'] = this.babyID;
data['EditedBy'] = this.editedBy;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA;
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
data['PatientID'] = this.patientID;
data['TokenID'] = this.tokenID;
data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType;
return data;
}
}

@ -0,0 +1,132 @@
class PatientAllPresOrders {
int iD;
String patientID;
bool patientOutSA;
bool isOutPatient;
int projectID;
int nearestProjectID;
double longitude;
double latitude;
String appointmentNo;
String dischargeID;
int lineItemNo;
int status;
String description;
String descriptionN;
String createdOn;
int serviceID;
int createdBy;
String editedOn;
int editedBy;
int channel;
dynamic clientRequestID;
bool returnedToQueue;
dynamic pickupDateTime;
dynamic pickupLocationName;
dynamic dropoffLocationName;
int realRRTHaveTransactions;
String nearestProjectDescription;
String nearestProjectDescriptionN;
String projectDescription;
String projectDescriptionN;
PatientAllPresOrders(
{this.iD,
this.patientID,
this.patientOutSA,
this.isOutPatient,
this.projectID,
this.nearestProjectID,
this.longitude,
this.latitude,
this.appointmentNo,
this.dischargeID,
this.lineItemNo,
this.status,
this.description,
this.descriptionN,
this.createdOn,
this.serviceID,
this.createdBy,
this.editedOn,
this.editedBy,
this.channel,
this.clientRequestID,
this.returnedToQueue,
this.pickupDateTime,
this.pickupLocationName,
this.dropoffLocationName,
this.realRRTHaveTransactions,
this.nearestProjectDescription,
this.nearestProjectDescriptionN,
this.projectDescription,
this.projectDescriptionN});
PatientAllPresOrders.fromJson(Map<String, dynamic> json) {
iD = json['ID'];
patientID = json['PatientID'];
patientOutSA = json['PatientOutSA'];
isOutPatient = json['IsOutPatient'];
projectID = json['ProjectID'];
nearestProjectID = json['NearestProjectID'];
longitude = json['Longitude'];
latitude = json['Latitude'];
appointmentNo = json['AppointmentNo'];
dischargeID = json['DischargeID'];
lineItemNo = json['LineItemNo'];
status = json['Status'];
description = json['Description'];
descriptionN = json['DescriptionN'];
createdOn = json['CreatedOn'];
serviceID = json['ServiceID'];
createdBy = json['CreatedBy'];
editedOn = json['EditedOn'];
editedBy = json['EditedBy'];
channel = json['Channel'];
clientRequestID = json['ClientRequestID'];
returnedToQueue = json['ReturnedToQueue'];
pickupDateTime = json['PickupDateTime'];
pickupLocationName = json['PickupLocationName'];
dropoffLocationName = json['DropoffLocationName'];
realRRTHaveTransactions = json['RealRRT_HaveTransactions'];
nearestProjectDescription = json['NearestProjectDescription'];
nearestProjectDescriptionN = json['NearestProjectDescriptionN'];
projectDescription = json['ProjectDescription'];
projectDescriptionN = json['ProjectDescriptionN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ID'] = this.iD;
data['PatientID'] = this.patientID;
data['PatientOutSA'] = this.patientOutSA;
data['IsOutPatient'] = this.isOutPatient;
data['ProjectID'] = this.projectID;
data['NearestProjectID'] = this.nearestProjectID;
data['Longitude'] = this.longitude;
data['Latitude'] = this.latitude;
data['AppointmentNo'] = this.appointmentNo;
data['DischargeID'] = this.dischargeID;
data['LineItemNo'] = this.lineItemNo;
data['Status'] = this.status;
data['Description'] = this.description;
data['DescriptionN'] = this.descriptionN;
data['CreatedOn'] = this.createdOn;
data['ServiceID'] = this.serviceID;
data['CreatedBy'] = this.createdBy;
data['EditedOn'] = this.editedOn;
data['EditedBy'] = this.editedBy;
data['Channel'] = this.channel;
data['ClientRequestID'] = this.clientRequestID;
data['ReturnedToQueue'] = this.returnedToQueue;
data['PickupDateTime'] = this.pickupDateTime;
data['PickupLocationName'] = this.pickupLocationName;
data['DropoffLocationName'] = this.dropoffLocationName;
data['RealRRT_HaveTransactions'] = this.realRRTHaveTransactions;
data['NearestProjectDescription'] = this.nearestProjectDescription;
data['NearestProjectDescriptionN'] = this.nearestProjectDescriptionN;
data['ProjectDescription'] = this.projectDescription;
data['ProjectDescriptionN'] = this.projectDescriptionN;
return data;
}
}

@ -0,0 +1,207 @@
import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
import 'get_all_transportation_method_list_model.dart';
class PatientER {
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int patientOutSA;
String sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
int patientID;
String tokenID;
int patientTypeID;
int patientType;
int orderServiceID;
String patientIdentificationID;
int direction;
bool haveAppointment;
int tripType;
int pickupUrgency;
int pickupSpot;
String pickupDateTime;
int transportationMethodId;
int selectedAmbulate;
String requesterNote;
int requesterFileNo;
String requesterMobileNo;
bool requesterIsOutSA;
int isOutPatient;
String pickupLocationName;
String dropoffLocationName;
int projectID;
int createdBy;
int lineItemNo;
int cost;
double vAT;
double totalPrice;
String pickupLocationLattitude;
String pickupLocationLongitude;
String dropoffLocationLattitude;
String dropoffLocationLongitude;
String latitude;
String longitude;
String appointmentNo;
dynamic appointmentClinicName;
dynamic appointmentDoctorName;
dynamic appointmentBranch;
dynamic appointmentTime;
PatientERTransportationMethod patientERTransportationMethod;
Ambulate ambulate;
PatientER(
{this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.patientID,
this.tokenID,
this.patientTypeID,
this.patientType,
this.orderServiceID = 4,
this.patientIdentificationID,
this.direction,
this.haveAppointment,
this.tripType,
this.pickupUrgency,
this.pickupSpot,
this.pickupDateTime,
this.transportationMethodId,
this.selectedAmbulate,
this.requesterNote,
this.requesterFileNo,
this.requesterMobileNo,
this.requesterIsOutSA,
this.isOutPatient,
this.pickupLocationName,
this.dropoffLocationName,
this.projectID,
this.createdBy,
this.lineItemNo,
this.cost,
this.vAT,
this.totalPrice,
this.pickupLocationLattitude,
this.pickupLocationLongitude,
this.dropoffLocationLattitude,
this.dropoffLocationLongitude,
this.latitude,
this.longitude,
this.appointmentNo,
this.appointmentClinicName,
this.appointmentDoctorName,
this.appointmentBranch,
this.appointmentTime,
this.patientERTransportationMethod,
this.ambulate});
PatientER.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID'];
channel = json['Channel'];
languageID = json['LanguageID'];
iPAdress = json['IPAdress'];
generalid = json['generalid'];
patientOutSA = json['PatientOutSA'];
sessionID = json['SessionID'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
deviceTypeID = json['DeviceTypeID'];
patientID = json['PatientID'];
tokenID = json['TokenID'];
patientTypeID = json['PatientTypeID'];
patientType = json['PatientType'];
orderServiceID = json['OrderServiceID'];
patientIdentificationID = json['PatientIdentificationID'];
direction = json['Direction'];
haveAppointment = json['HaveAppointment'];
tripType = json['TripType'];
pickupUrgency = json['PickupUrgency'];
pickupSpot = json['PickupSpot'];
pickupDateTime = json['PickupDateTime'];
transportationMethodId = json['TransportationMethodId'];
selectedAmbulate = json['SelectedAmbulate'];
requesterNote = json['RequesterNote'];
requesterFileNo = json['RequesterFileNo'];
requesterMobileNo = json['RequesterMobileNo'];
requesterIsOutSA = json['RequesterIsOutSA'];
isOutPatient = json['IsOutPatient'];
pickupLocationName = json['PickupLocationName'];
dropoffLocationName = json['DropoffLocationName'];
projectID = json['ProjectID'];
createdBy = json['CreatedBy'];
lineItemNo = json['LineItemNo'];
cost = json['Cost'];
vAT = json['VAT'];
totalPrice = json['TotalPrice'];
pickupLocationLattitude = json['PickupLocationLattitude'];
pickupLocationLongitude = json['PickupLocationLongitude'];
dropoffLocationLattitude = json['DropoffLocationLattitude'];
dropoffLocationLongitude = json['DropoffLocationLongitude'];
latitude = json['Latitude'];
longitude = json['Longitude'];
appointmentNo = json['AppointmentNo'];
appointmentClinicName = json['AppointmentClinicName'];
appointmentDoctorName = json['AppointmentDoctorName'];
appointmentBranch = json['AppointmentBranch'];
appointmentTime = json['AppointmentTime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA;
data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID;
data['PatientID'] = this.patientID;
data['TokenID'] = this.tokenID;
data['PatientTypeID'] = this.patientTypeID;
data['PatientType'] = this.patientType;
data['OrderServiceID'] = this.orderServiceID;
data['PatientIdentificationID'] = this.patientIdentificationID;
data['Direction'] = this.direction;
data['HaveAppointment'] = this.haveAppointment;
data['TripType'] = this.tripType;
data['PickupUrgency'] = this.pickupUrgency;
data['PickupSpot'] = this.pickupSpot;
data['PickupDateTime'] = this.pickupDateTime;
data['TransportationMethodId'] = this.transportationMethodId;
data['SelectedAmbulate'] = this.selectedAmbulate;
data['RequesterNote'] = this.requesterNote;
data['RequesterFileNo'] = this.requesterFileNo;
data['RequesterMobileNo'] = this.requesterMobileNo;
data['RequesterIsOutSA'] = this.requesterIsOutSA;
data['IsOutPatient'] = this.isOutPatient;
data['PickupLocationName'] = this.pickupLocationName;
data['DropoffLocationName'] = this.dropoffLocationName;
data['ProjectID'] = this.projectID;
data['CreatedBy'] = this.createdBy;
data['LineItemNo'] = this.lineItemNo;
data['Cost'] = this.cost;
data['VAT'] = this.vAT;
data['TotalPrice'] = this.totalPrice;
data['PickupLocationLattitude'] = this.pickupLocationLattitude;
data['PickupLocationLongitude'] = this.pickupLocationLongitude;
data['DropoffLocationLattitude'] = this.dropoffLocationLattitude;
data['DropoffLocationLongitude'] = this.dropoffLocationLongitude;
data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude;
data['AppointmentNo'] = this.appointmentNo;
data['AppointmentClinicName'] = this.appointmentClinicName;
data['AppointmentDoctorName'] = this.appointmentDoctorName;
data['AppointmentBranch'] = this.appointmentBranch;
data['AppointmentTime'] = this.appointmentTime;
return data;
}
}

@ -0,0 +1,204 @@
class PickUpRequestPresOrder {
int id;
int presOrderID;
String createDate;
String lastEditDate;
int createdBy;
int lastEditBy;
bool isActive;
String requestNo;
int requesterId;
int direction;
bool haveAppointment;
dynamic appointmentId;
int tripType;
int pickupUrgency;
String pickupDateTime;
dynamic pickupLocationId;
int pickupSpot;
dynamic dropoffLocationId;
int transportationMethodId;
int cost;
double vAT;
double totalPrice;
int amountCollected;
int selectedAmbulate;
String requesterNote;
int status;
int paymentStatus;
dynamic rejectReason;
int visibility;
dynamic durationId;
dynamic imageId;
String requesterFileNo;
String requesterMobileNo;
bool requesterIsOutSA;
String pickupLocationLongitude;
String pickupLocationLattitude;
String dropoffLocationLongitude;
String dropoffLocationLattitude;
dynamic appointmentClinicName;
dynamic appointmentDoctorName;
dynamic appointmentBranch;
dynamic appointmentTime;
String pickupLocationName;
String dropoffLocationName;
String title;
String titleAR;
String ambulateDescription;
String ambulateDescriptionN;
PickUpRequestPresOrder(
{this.id,
this.presOrderID,
this.createDate,
this.lastEditDate,
this.createdBy,
this.lastEditBy,
this.isActive,
this.requestNo,
this.requesterId,
this.direction,
this.haveAppointment,
this.appointmentId,
this.tripType,
this.pickupUrgency,
this.pickupDateTime,
this.pickupLocationId,
this.pickupSpot,
this.dropoffLocationId,
this.transportationMethodId,
this.cost,
this.vAT,
this.totalPrice,
this.amountCollected,
this.selectedAmbulate,
this.requesterNote,
this.status,
this.paymentStatus,
this.rejectReason,
this.visibility,
this.durationId,
this.imageId,
this.requesterFileNo,
this.requesterMobileNo,
this.requesterIsOutSA,
this.pickupLocationLongitude,
this.pickupLocationLattitude,
this.dropoffLocationLongitude,
this.dropoffLocationLattitude,
this.appointmentClinicName,
this.appointmentDoctorName,
this.appointmentBranch,
this.appointmentTime,
this.pickupLocationName,
this.dropoffLocationName,
this.title,
this.titleAR,
this.ambulateDescription,
this.ambulateDescriptionN});
PickUpRequestPresOrder.fromJson(Map<String, dynamic> json) {
id = json['Id'];
presOrderID = json['PresOrderID'];
createDate = json['CreateDate'];
lastEditDate = json['LastEditDate'];
createdBy = json['CreatedBy'];
lastEditBy = json['LastEditBy'];
isActive = json['IsActive'];
requestNo = json['RequestNo'];
requesterId = json['RequesterId'];
direction = json['Direction'];
haveAppointment = json['HaveAppointment'];
appointmentId = json['AppointmentId'];
tripType = json['TripType'];
pickupUrgency = json['PickupUrgency'];
pickupDateTime = json['PickupDateTime'];
pickupLocationId = json['PickupLocationId'];
pickupSpot = json['PickupSpot'];
dropoffLocationId = json['DropoffLocationId'];
transportationMethodId = json['TransportationMethodId'];
cost = json['Cost'];
vAT = json['VAT'];
totalPrice = json['TotalPrice'];
amountCollected = json['AmountCollected'];
selectedAmbulate = json['SelectedAmbulate'];
requesterNote = json['RequesterNote'];
status = json['Status'];
paymentStatus = json['PaymentStatus'];
rejectReason = json['RejectReason'];
visibility = json['Visibility'];
durationId = json['DurationId'];
imageId = json['ImageId'];
requesterFileNo = json['RequesterFileNo'];
requesterMobileNo = json['RequesterMobileNo'];
requesterIsOutSA = json['RequesterIsOutSA'];
pickupLocationLongitude = json['PickupLocationLongitude'];
pickupLocationLattitude = json['PickupLocationLattitude'];
dropoffLocationLongitude = json['DropoffLocationLongitude'];
dropoffLocationLattitude = json['DropoffLocationLattitude'];
appointmentClinicName = json['AppointmentClinicName'];
appointmentDoctorName = json['AppointmentDoctorName'];
appointmentBranch = json['AppointmentBranch'];
appointmentTime = json['AppointmentTime'];
pickupLocationName = json['PickupLocationName'];
dropoffLocationName = json['DropoffLocationName'];
title = json['Title'];
titleAR = json['TitleAR'];
ambulateDescription = json['AmbulateDescription'];
ambulateDescriptionN = json['AmbulateDescriptionN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Id'] = this.id;
data['PresOrderID'] = this.presOrderID;
data['CreateDate'] = this.createDate;
data['LastEditDate'] = this.lastEditDate;
data['CreatedBy'] = this.createdBy;
data['LastEditBy'] = this.lastEditBy;
data['IsActive'] = this.isActive;
data['RequestNo'] = this.requestNo;
data['RequesterId'] = this.requesterId;
data['Direction'] = this.direction;
data['HaveAppointment'] = this.haveAppointment;
data['AppointmentId'] = this.appointmentId;
data['TripType'] = this.tripType;
data['PickupUrgency'] = this.pickupUrgency;
data['PickupDateTime'] = this.pickupDateTime;
data['PickupLocationId'] = this.pickupLocationId;
data['PickupSpot'] = this.pickupSpot;
data['DropoffLocationId'] = this.dropoffLocationId;
data['TransportationMethodId'] = this.transportationMethodId;
data['Cost'] = this.cost;
data['VAT'] = this.vAT;
data['TotalPrice'] = this.totalPrice;
data['AmountCollected'] = this.amountCollected;
data['SelectedAmbulate'] = this.selectedAmbulate;
data['RequesterNote'] = this.requesterNote;
data['Status'] = this.status;
data['PaymentStatus'] = this.paymentStatus;
data['RejectReason'] = this.rejectReason;
data['Visibility'] = this.visibility;
data['DurationId'] = this.durationId;
data['ImageId'] = this.imageId;
data['RequesterFileNo'] = this.requesterFileNo;
data['RequesterMobileNo'] = this.requesterMobileNo;
data['RequesterIsOutSA'] = this.requesterIsOutSA;
data['PickupLocationLongitude'] = this.pickupLocationLongitude;
data['PickupLocationLattitude'] = this.pickupLocationLattitude;
data['DropoffLocationLongitude'] = this.dropoffLocationLongitude;
data['DropoffLocationLattitude'] = this.dropoffLocationLattitude;
data['AppointmentClinicName'] = this.appointmentClinicName;
data['AppointmentDoctorName'] = this.appointmentDoctorName;
data['AppointmentBranch'] = this.appointmentBranch;
data['AppointmentTime'] = this.appointmentTime;
data['PickupLocationName'] = this.pickupLocationName;
data['DropoffLocationName'] = this.dropoffLocationName;
data['Title'] = this.title;
data['TitleAR'] = this.titleAR;
data['AmbulateDescription'] = this.ambulateDescription;
data['AmbulateDescriptionN'] = this.ambulateDescriptionN;
return data;
}
}

@ -1,23 +1,23 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class PatientER_RRT_GetAllTransportationMethodListModel { class PatientERTransportationMethod {
int id; dynamic id;
DateTime createDate; DateTime createDate;
DateTime lastEditDate; DateTime lastEditDate;
int createdBy; dynamic createdBy;
int lastEditBy; dynamic lastEditBy;
bool isActive; bool isActive;
String title; String title;
String titleAR; String titleAR;
int price; dynamic price;
Null isDefault; dynamic isDefault;
int visibility; dynamic visibility;
Null durationId; dynamic durationId;
String description; String description;
String descriptionAR; String descriptionAR;
int totalPrice; dynamic totalPrice;
int vAT; dynamic vAT;
PatientER_RRT_GetAllTransportationMethodListModel( PatientERTransportationMethod(
{ {
this.id, this.id,
this.createDate, this.createDate,
@ -36,7 +36,7 @@ class PatientER_RRT_GetAllTransportationMethodListModel {
this.totalPrice, this.totalPrice,
this.vAT}); this.vAT});
PatientER_RRT_GetAllTransportationMethodListModel.fromJson( PatientERTransportationMethod.fromJson(
Map<String, dynamic> json) { Map<String, dynamic> json) {
id = json['Id']; id = json['Id'];
createDate = DateUtil.convertStringToDate(json['CreateDate']); createDate = DateUtil.convertStringToDate(json['CreateDate']);

@ -2,16 +2,17 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
class AuthenticatedUserObject{ class AuthenticatedUserObject {
AuthenticatedUser user; AuthenticatedUser user;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
bool isLogin = false; bool isLogin = false;
AuthenticatedUserObject(){
AuthenticatedUserObject() {
getUser(); getUser();
} }
getUser() async { getUser() async {
if (user==null) { if (user == null) {
var userData = await sharedPref.getObject(USER_PROFILE); var userData = await sharedPref.getObject(USER_PROFILE);
if (userData != null) user = AuthenticatedUser.fromJson(userData); if (userData != null) user = AuthenticatedUser.fromJson(userData);
} }
@ -20,4 +21,7 @@ class AuthenticatedUserObject{
this.isLogin = isLogin != null; this.isLogin = isLogin != null;
} }
logout() async {
isLogin = false;
}
} }

@ -17,6 +17,7 @@ class BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
BaseService() { BaseService() {
authenticatedUserObject.getUser();
user = authenticatedUserObject.user; user = authenticatedUserObject.user;
// getUser(); // getUser();
} }

@ -1,26 +1,41 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import '../base_service.dart'; import '../base_service.dart';
class CreteNewBabyService extends BaseService { class CreteNewBabyService extends BaseService {
List<CreateNewBaby> createNewBabyModelList = List(); List<CreateNewBaby> createNewBabyModelList = List();
List<List_UserInformationModel> userModelList = List();
List<CreateNewUser_New> newUserModelList = List();
Future getCreateNewBabyOrders({ CreateNewBaby newChild}) async {
Future getCreateNewBabyOrders({CreateNewBaby newChild,int userID}) async {
hasError = false; hasError = false;
await getUser();
Map<String, dynamic> body = Map.from(newChild.toJson());
body['CreatedBy'] = 102;
body['EditedBy'] = 102;
body['UserID'] = userID;
body['AlertBy'] = 2;
body['EmailAddress'] = user.emailAddress;
body['IsLogin'] = true;
body['LogInTokenID'] = await sharedPref.getString(TOKEN);
body['MobileNumber'] = user.mobileNumber;
body['NationalID'] = user.nationalityID;
body['ZipCode'] = user.zipCode;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_NEWCHILD_REQUEST, await baseAppClient.post(GET_NEWCHILD_REQUEST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
createNewBabyModelList.clear(); var asd ="";
},
response['List_UserInformationModel_New'].forEach((vital) { onFailure: (String error, int statusCode) {
createNewBabyModelList.add( hasError = true;
CreateNewBaby.fromJson(vital)); super.error = error;
}); }, body: body);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: newChild.toJson());
} }
}
}

@ -1,5 +1,6 @@
import 'dart:convert'; import 'dart:convert';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
@ -8,22 +9,17 @@ import '../base_service.dart';
class ChildVaccinesService extends BaseService { class ChildVaccinesService extends BaseService {
List<List_BabyInformationModel> babyInformationModelList = List(); List<List_BabyInformationModel> babyInformationModelList = List();
List<List_UserInformationModel> userInformationModelList = List(); List<List_UserInformationModel> userInformationModelList = List();
int userID = 0;
Map<String, dynamic> body = Map();
Future getAllBabyInformationOrders() async { Future getAllBabyInformationOrders() async {
Map<String, dynamic> body = Map();
hasError = false; hasError = false;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['IsLogin'] = true; body['IsLogin'] = true;
body['UserID'] = userID;
//body['UserID'] = userInformationModelList[0].userID;//AuthenticatedUser.fromJson(json['List'][0] //babyInformationModelList[0].userID; await baseAppClient.post(GET_BABY_BY_USER_ID,
body['UserID'] = 46013;//42843;
await baseAppClient.post(GET_BABYINFORMATION_REQUEST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
babyInformationModelList.clear(); babyInformationModelList.clear();
response['List_BabyInformationModel'].forEach((vital) { response['List_BabyInformationModel'].forEach((vital) {
babyInformationModelList.add(List_BabyInformationModel.fromJson(vital)); babyInformationModelList.add(List_BabyInformationModel.fromJson(vital));
}); });
@ -32,4 +28,29 @@ class ChildVaccinesService extends BaseService {
super.error = error; super.error = error;
}, body: body); }, body: body);
} }
Future getNewUserOrders() async {
Map<String, dynamic> body = Map();
hasError = false;
await getUser();
body['CreatedBy'] = 102;
body['EditedBy'] = 102;
body['UserID'] = userID;
body['AlertBy'] = 2;
body['EmailAddress'] = user.emailAddress;
body['IsLogin'] = true;
body['LogInTokenID'] = await sharedPref.getString(TOKEN);
body['MobileNumber'] = user.mobileNumber;
body['NationalID'] = user.nationalityID;
body['ZipCode'] = user.zipCode;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_NEW_USER_REQUEST,
onSuccess: (dynamic response, int statusCode) {
userID = response['UserID'];
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
} }

@ -0,0 +1,75 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import '../base_service.dart';
class DeleteBabyService extends BaseService{
List<CreateNewBaby> createNewBabyModelList = List();
List<List_UserInformationModel> userModelList = List();
List<CreateNewUser_New> newUserModelList = List();
List<DeleteBaby> deleteBabyModelList= List();
Future getDeleteBabyOrder({DeleteBaby deleteChild,int babyID}) async {
hasError = false;
await getUser();
Map<String, dynamic> body = Map.from(deleteChild.toJson());
// body['CreatedBy'] = 102;
body['EditedBy'] = 102;
//body['BabyID'] = babyID;
//body['BabyID'] = createNewBabyModelList ;
// body['AlertBy'] = 2;
// body['EmailAddress'] = user.emailAddress;
body['IsLogin'] = true;
body['LogInTokenID'] = await sharedPref.getString(TOKEN);
body['MobileNumber'] = user.mobileNumber;
body['NationalID'] = user.nationalityID;
body['ZipCode'] = user.zipCode;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(DELETE_CHILD_REQUEST,
onSuccess: (dynamic response, int statusCode) {
var asd ="";
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
// Future getCreateNewBabyOrders({CreateNewBaby newChild,int userID}) async {
// hasError = false;
// await getUser();
// Map<String, dynamic> body = Map.from(newChild.toJson());
// body['CreatedBy'] = 102;
// body['EditedBy'] = 102;
// body['UserID'] = userID;
// body['AlertBy'] = 2;
// body['EmailAddress'] = user.emailAddress;
// body['IsLogin'] = true;
// body['LogInTokenID'] = await sharedPref.getString(TOKEN);
// body['MobileNumber'] = user.mobileNumber;
// body['NationalID'] = user.nationalityID;
// body['ZipCode'] = user.zipCode;
//
// body['isDentalAllowedBackend'] = false;
//
// await baseAppClient.post(GET_NEWCHILD_REQUEST,
// onSuccess: (dynamic response, int statusCode) {
// var asd ="";
// },
// onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// }, body: body);
// }
}

@ -11,17 +11,6 @@ class GetVccinationsItemsService extends BaseService {
Future getaccinationsitemOrders() async { Future getaccinationsitemOrders() async {
hasError = false; hasError = false;
// await getUser();
// body['BabyName']="fffffffffff eeeeeeeeeeeeee";
// body['DOB'] = "/Date(1585774800000+0300)/";
// body['EmailAddress'] = user.emailAddress;
// body['isDentalAllowedBackend'] = false;
// body['SendEmail'] = false;
// body['IsLogin'] =true;
await baseAppClient.post(GET_TABLE_REQUEST, await baseAppClient.post(GET_TABLE_REQUEST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
getVaccinationsItemModelList.clear(); getVaccinationsItemModelList.clear();

@ -1,41 +1,35 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import '../base_service.dart'; import '../base_service.dart';
class UserInformationService extends BaseService{ class UserInformationService extends BaseService {
List<List_UserInformationModel> userInformationModelList = List(); List<List_UserInformationModel> userInformationModelList = List();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
Future getUserInformationOrders() async { Future getUserInformationOrders() async {
hasError = false; hasError = false;
await getUser(); await getUser();
body['CreatedBy'] = 102; body['CreatedBy'] = 102;
body['EditedBy'] = 102; body['EditedBy'] = 102;
body['EmailAddress'] = user.emailAddress; body['EmailAddress'] = user.emailAddress;
body['IsLogin'] =true; body['IsLogin'] = true;
body['LogInTokenID'] = 'ZBGoQFUG50eQJd6Y7u1ykA=='; body['LogInTokenID'] = await sharedPref.getString(TOKEN);
body['MobileNumber'] = user.mobileNumber; body['MobileNumber'] = user.mobileNumber;
body['NationalID'] = user.nationalityID; body['NationalID'] = user.nationalityID;
body['ZipCode'] = user.zipCode; body['ZipCode'] = user.zipCode;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_USERINFORMATION_REQUEST, await baseAppClient.post(GET_USERINFORMATION_REQUEST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
userInformationModelList.clear(); userInformationModelList.clear();
response['List_UserInformationModel_New'].forEach((vital) { response['List_UserInformationModel_New'].forEach((vital) {
userInformationModelList.add(List_UserInformationModel.fromJson(vital)); userInformationModelList.add(List_UserInformationModel.fromJson(vital));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
} }
}
}

@ -15,7 +15,7 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
///await BaseAppClient.post('', ///await BaseAppClient.post('',
/// onSuccess: (dynamic response, int statusCode) {}, /// onSuccess: (dynamic response, int statusCode) {},
/// onFailure: (String error, int statusCode) {}, /// onFailure: (String error, int statusCode) {},
/// body: null); /// body: Map();
class BaseAppClient { class BaseAppClient {
post(String endPoint, post(String endPoint,
@ -32,7 +32,9 @@ class BaseAppClient {
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] : SETUP_ID ? body['SetupID'] != null
? body['SetupID']
: SETUP_ID
: SETUP_ID; : SETUP_ID;
} }
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
@ -41,7 +43,9 @@ class BaseAppClient {
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA') body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null ? body['PatientOutSA'] : PATIENT_OUT_SA ? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA; : PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
@ -55,30 +59,31 @@ class BaseAppClient {
body['DeviceTypeID'] = DeviceTypeID; body['DeviceTypeID'] = DeviceTypeID;
if(!body.containsKey('IsPublicRequest')) { if (!body.containsKey('IsPublicRequest')) {
body['PatientType'] = body.containsKey('PatientType') body['PatientType'] = body.containsKey('PatientType')
? body['PatientType'] != null ? body['PatientType'] : PATIENT_TYPE ? body['PatientType'] != null
? body['PatientType']
: PATIENT_TYPE
: PATIENT_TYPE; : PATIENT_TYPE;
body['PatientTypeID'] = body.containsKey('PatientTypeID') body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null ? body['PatientTypeID'] != null
? body['PatientTypeID'] ? body['PatientTypeID']
: PATIENT_TYPE_ID : PATIENT_TYPE_ID
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
if (user != null) { if (user != null) {
body['TokenID'] = token; body['TokenID'] = token;
body['PatientID'] = body['PatientID'] =
body['PatientID'] != null ? body['PatientID'] : user['PatientID']; body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientOutSA'] = user['OutSA']; body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = getSessionId(token); body['SessionID'] = SESSION_ID;//getSessionId(token);
} }
} }
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
var asd="";
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(url.trim(), final response = await http.post(url.trim(),
body: json.encode(body), body: json.encode(body),
@ -139,6 +144,7 @@ class BaseAppClient {
} }
String getSessionId(String id) { String getSessionId(String id) {
return id.replaceAll(RegExp('/[^a-zA-Z ]'), ''); ///return id.replaceAll(RegExp('/[^\w\s]/'), '');
// return id.replaceAll(RegExp('/[^a-zA-Z ]'), '');
} }
} }

@ -1,25 +1,76 @@
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/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart';
import 'package:diplomaticquarterapp/core/model/er/PickUpRequestPresOrder.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 '../base_service.dart'; import '../base_service.dart';
class AmService extends BaseService { class AmService extends BaseService {
List<PatientER_RRT_GetAllTransportationMethodListModel> AmModelList = List(); List<PatientERTransportationMethod> amModelList = List();
Map<String, dynamic> body = Map(); List<PatientAllPresOrders> patientAllPresOrdersList = List();
bool hasPendingOrder = false;
int pendingOrderID = 0;
String pendingOrderStatus = "";
String pendingOrderStatusAR = "";
PickUpRequestPresOrder pickUpRequestPresOrder;
Future getAllTransportationOrders() async { Future getAllTransportationOrders() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['IdentificationNo'] = user.patientIdentificationNo;
await baseAppClient.post(GET_AMBULANCE_REQUEST, await baseAppClient.post(GET_AMBULANCE_REQUEST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
AmModelList.clear(); amModelList.clear();
response['AmModelList'].forEach((vital) { response['PatientER_RRT_GetAllTransportationMethodList'].forEach((item) {
AmModelList.add( amModelList.add(PatientERTransportationMethod.fromJson(item));
PatientER_RRT_GetAllTransportationMethodListModel.fromJson(vital));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
} }
Future getPatientAllPresOrdersList() async {
hasError = false;
hasPendingOrder = false;
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS,
onSuccess: (dynamic response, int statusCode) {
patientAllPresOrdersList.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((item) {
if (item['ServiceID'] == OrderService.AMBULANCE.getIdOrderService()) {
var order = PatientAllPresOrders.fromJson(item);
patientAllPresOrdersList.add(order);
if (order.status == 1) {
hasPendingOrder = true;
pendingOrderID = order.iD;
pendingOrderStatus = order.description;
pendingOrderStatusAR = order.descriptionN;
}
}
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: Map());
}
Future getOrderDetails() async {
hasError = false;
hasPendingOrder = false;
Map<String, dynamic> body = Map();
body['PresOrderID'] = pendingOrderID;
await baseAppClient.post(GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID,
onSuccess: (dynamic response, int statusCode) {
patientAllPresOrdersList.clear();
response['PatientER_RRT_GetPickUpRequestByPresOrderIDList']
.forEach((item) {
pickUpRequestPresOrder = PickUpRequestPresOrder.fromJson(item);
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: Map());
}
} }

@ -1,13 +1,20 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:flutter/cupertino.dart';
class MedicalService extends BaseService { class MedicalService extends BaseService {
List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList = List(); List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList = List();
getAppointmentHistory() async { getAppointmentHistory({bool isActiveAppointment = false}) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
Map<String, dynamic> body = Map();
if(isActiveAppointment) {
body['IsActiveAppointment'] = true;
body['isDentalAllowedBackend'] = false;
}
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {
@ -19,6 +26,23 @@ class MedicalService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: Map()); }, body: body);
}
addAmbulanceRequest({@required PatientER patientER}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['RequesterFileNo'] = user.patientID;
body['RequesterMobileNo'] = user.mobileNumber;
body['RequesterIsOutSA'] = user.outSA;
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY,
onSuccess: (response, statusCode) async {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
} }
} }

@ -18,6 +18,7 @@ class BaseViewModel extends ChangeNotifier {
AuthenticatedUser user; AuthenticatedUser user;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
void setState(ViewState viewState) { void setState(ViewState viewState) {
_state = viewState; _state = viewState;

@ -1,28 +1,42 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart'; import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/delete_baby_service.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
class AddNewChildViewModel extends BaseViewModel{ class AddNewChildViewModel extends BaseViewModel {
CreteNewBabyService _creteNewBabyService = locator<CreteNewBabyService>(); CreteNewBabyService _creteNewBabyService = locator<CreteNewBabyService>();
ChildVaccinesService _childVaccinesService = locator<ChildVaccinesService>();
// DeleteBabyService _deleteBabyService = locator<DeleteBabyService>();
bool isAdded = false;
List<CreateNewBaby> get creteNewBabyModelList=> _creteNewBabyService.createNewBabyModelList; ///create new baby
getNewBabyOrders({ CreateNewBaby newChild}) async { createNewBabyOrders({ CreateNewBaby newChild}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild, userID: _childVaccinesService.userID);
await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild); if (_creteNewBabyService.hasError) {
error = _creteNewBabyService.error;
if ( _creteNewBabyService.hasError) {
error = _creteNewBabyService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else {
isAdded = true;
setState(ViewState.Idle); setState(ViewState.Idle);
await _childVaccinesService.getAllBabyInformationOrders();
if (_childVaccinesService.hasError) {
error = _childVaccinesService.error;
setState(ViewState.Error);
} else{
}
}
} }
} }

@ -1,24 +1,43 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart'; import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart';
//========
import 'package:diplomaticquarterapp/core/service/childvaccines/add_new_child_service.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/child_vaccines_service.dart';
import 'package:diplomaticquarterapp/core/service/childvaccines/delete_baby_service.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
class ChildVaccinesViewModel extends BaseViewModel{ class ChildVaccinesViewModel extends BaseViewModel{
ChildVaccinesService _childVaccinesService = locator<ChildVaccinesService>();
List<List_BabyInformationModel> get babyInformationModelList=> _childVaccinesService.babyInformationModelList;
ChildVaccinesService _childVaccinesService = locator<ChildVaccinesService>();
//===========
CreteNewBabyService _creteNewBabyService = locator<CreteNewBabyService>();
DeleteBabyService _deleteBabyService = locator<DeleteBabyService>();
bool isAdded = false;
bool isDeleted = false;
//============
List<List_BabyInformationModel> get babyInformationModelList=> _childVaccinesService.babyInformationModelList;//BabyInformationModelList;
getBabyInformatioRequestOrders() async { getNewUserOrders() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _childVaccinesService.getNewUserOrders();
if (_childVaccinesService.hasError) {
error = _childVaccinesService.error;
setState(ViewState.Error);
} else
getBabyInformatioRequestOrders();
}
getBabyInformatioRequestOrders() async {
await _childVaccinesService.getAllBabyInformationOrders(); await _childVaccinesService.getAllBabyInformationOrders();
if (_childVaccinesService.hasError) { if (_childVaccinesService.hasError) {
error = _childVaccinesService.error; error = _childVaccinesService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -26,4 +45,29 @@ class ChildVaccinesViewModel extends BaseViewModel{
setState(ViewState.Idle); setState(ViewState.Idle);
} }
///delete baby
deleteBabyOrders({ DeleteBaby newChild}) async {
setState(ViewState.Busy);
//await _creteNewBabyService.getCreateNewBabyOrders(newChild: newChild, userID: _childVaccinesService.userID);
await _deleteBabyService.getDeleteBabyOrder(deleteChild: newChild,babyID: newChild.babyID);
//getDeleteBabyOrder(deleteChild: newChild,);
// getDeleteBabyOrder
if (_creteNewBabyService.hasError) {
error = _creteNewBabyService.error;
setState(ViewState.Error);
} else {
isDeleted = true;
setState(ViewState.Idle);
await _childVaccinesService.getAllBabyInformationOrders();
if (_childVaccinesService.hasError) {
error = _childVaccinesService.error;
setState(ViewState.Error);
} else{
}
}
}
} }

@ -11,11 +11,9 @@ class UserInformationViewModel extends BaseViewModel {
List<List_UserInformationModel> get userInformationModelList => List<List_UserInformationModel> get userInformationModelList =>
_userInformationService.userInformationModelList; _userInformationService.userInformationModelList;
getUserInformatioRequestOrders() async { getUserInformationRequestOrders() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _userInformationService.getUserInformationOrders(); await _userInformationService.getUserInformationOrders();
if (_userInformationService.hasError) { if (_userInformationService.hasError) {
error = _userInformationService.error; error = _userInformationService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -1,32 +1,82 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.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/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/service/er/am_service.dart'; import 'package:diplomaticquarterapp/core/service/er/am_service.dart';
import 'package:diplomaticquarterapp/core/service/hospital_service.dart';
import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
import '../../../locator.dart'; import '../../../locator.dart';
class AmRequestViewModel extends BaseViewModel{ class AmRequestViewModel extends BaseViewModel {
AmService _amService = locator<AmService>();
HospitalService _hospitalService = locator<HospitalService>();
MedicalService _medicalService = locator<MedicalService>();
List<PatientERTransportationMethod> get amRequestModeList =>
_amService.amModelList;
AmService _amService = locator<AmService>(); List<PatientAllPresOrders> get patientAllPresOrdersList =>
_amService.patientAllPresOrdersList;
List<PatientER_RRT_GetAllTransportationMethodListModel> get AmRequestModeList=> List<AppoitmentAllHistoryResultList> get appoitmentAllHistoryResultList =>
_amService.AmModelList; _medicalService.appoitmentAllHistoryResultList;
getAmRequestOrders({int id, int projectID}) async { List<HospitalsModel> get hospitals => _hospitalService.hospitals;
setState(ViewState.Busy);
bool get hasPendingOrder =>_amService.hasPendingOrder;
await _amService.getAllTransportationOrders(); Future getAppointmentHistory() async {
setState(ViewState.BusyLocal);
await _medicalService.getAppointmentHistory(isActiveAppointment: true);
if (_medicalService.hasError) {
error = _medicalService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
if ( _amService.hasError) { Future getAmRequestOrders() async {
error = _amService.error; setState(ViewState.Busy);
await _amService.getAllTransportationOrders();
if (_amService.hasError) {
error = _amService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); getHospitals();
} }
Future getHospitals() async {
setState(ViewState.Busy);
await _hospitalService.getHospitals();
if (_hospitalService.hasError) {
error = _hospitalService.error;
setState(ViewState.Error);
} else
getPatientAllPresOrdersList();
}
Future getPatientAllPresOrdersList() async {
setState(ViewState.Busy);
await _amService.getPatientAllPresOrdersList();
if (_hospitalService.hasError) {
error = _hospitalService.error;
setState(ViewState.Error);
} else if (_amService.hasPendingOrder) {
getOrderDetails();
} else
setState(ViewState.Idle);
}
} Future getOrderDetails() async {
setState(ViewState.Busy);
await _amService.getOrderDetails();
if (_hospitalService.hasError) {
error = _hospitalService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -21,52 +21,54 @@ class LabsViewModel extends BaseViewModel {
: _patientLabOrdersListHospital; : _patientLabOrdersListHospital;
void getLabs() async { void getLabs() async {
setState(ViewState.Busy); if (authenticatedUserObject.isLogin) {
await _labsService.getPatientLabOrdersList(); setState(ViewState.Busy);
if (_labsService.hasError) { await _labsService.getPatientLabOrdersList();
error = _labsService.error; if (_labsService.hasError) {
setState(ViewState.Error); error = _labsService.error;
} else { setState(ViewState.Error);
_labsService.patientLabOrdersList.forEach((element) { } else {
List<PatientLabOrdersList> patientLabOrdersClinic = _labsService.patientLabOrdersList.forEach((element) {
_patientLabOrdersListClinic List<PatientLabOrdersList> patientLabOrdersClinic =
.where((elementClinic) => _patientLabOrdersListClinic
elementClinic.filterName == element.clinicDescription) .where((elementClinic) =>
.toList(); elementClinic.filterName == element.clinicDescription)
.toList();
if (patientLabOrdersClinic.length != 0) { if (patientLabOrdersClinic.length != 0) {
_patientLabOrdersListClinic[_patientLabOrdersListClinic _patientLabOrdersListClinic[_patientLabOrdersListClinic
.indexOf(patientLabOrdersClinic[0])] .indexOf(patientLabOrdersClinic[0])]
.patientLabOrdersList .patientLabOrdersList
.add(element); .add(element);
} else { } else {
_patientLabOrdersListClinic.add(PatientLabOrdersList( _patientLabOrdersListClinic.add(PatientLabOrdersList(
filterName: element.clinicDescription, filterName: element.clinicDescription,
patientDoctorAppointment: element)); patientDoctorAppointment: element));
} }
// doctor list sort via project // doctor list sort via project
List<PatientLabOrdersList> patientLabOrdersHospital = List<PatientLabOrdersList> patientLabOrdersHospital =
_patientLabOrdersListHospital _patientLabOrdersListHospital
.where( .where(
(elementClinic) => (elementClinic) =>
elementClinic.filterName == element.projectName, elementClinic.filterName == element.projectName,
) )
.toList(); .toList();
if (patientLabOrdersHospital.length != 0) { if (patientLabOrdersHospital.length != 0) {
_patientLabOrdersListHospital[_patientLabOrdersListHospital _patientLabOrdersListHospital[_patientLabOrdersListHospital
.indexOf(patientLabOrdersHospital[0])] .indexOf(patientLabOrdersHospital[0])]
.patientLabOrdersList .patientLabOrdersList
.add(element); .add(element);
} else { } else {
_patientLabOrdersListHospital.add(PatientLabOrdersList( _patientLabOrdersListHospital.add(PatientLabOrdersList(
filterName: element.projectName, filterName: element.projectName,
patientDoctorAppointment: element)); patientDoctorAppointment: element));
} }
}); });
setState(ViewState.Idle); setState(ViewState.Idle);
}
} }
} }

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart'; import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
@ -11,13 +12,15 @@ class MedicalViewModel extends BaseViewModel {
_medicalService.appoitmentAllHistoryResultList; _medicalService.appoitmentAllHistoryResultList;
getAppointmentHistory() async { getAppointmentHistory() async {
setState(ViewState.Busy); if (authenticatedUserObject.isLogin) {
if (_medicalService.appoitmentAllHistoryResultList.length == 0) setState(ViewState.Busy);
await _medicalService.getAppointmentHistory(); if (_medicalService.appoitmentAllHistoryResultList.length == 0)
if (_medicalService.hasError) { await _medicalService.getAppointmentHistory();
error = _medicalService.error; if (_medicalService.hasError) {
setState(ViewState.Error); error = _medicalService.error;
} else setState(ViewState.Error);
setState(ViewState.Idle); } else
setState(ViewState.Idle);
}
} }
} }

@ -13,6 +13,7 @@ import 'core/service/blood/blood_details_servies.dart';
import 'core/service/blood/blood_donation_service.dart'; import 'core/service/blood/blood_donation_service.dart';
import 'core/service/childvaccines/add_new_child_service.dart'; import 'core/service/childvaccines/add_new_child_service.dart';
import 'core/service/childvaccines/child_vaccines_service.dart'; import 'core/service/childvaccines/child_vaccines_service.dart';
import 'core/service/childvaccines/delete_baby_service.dart';
import 'core/service/childvaccines/user_information_service.dart'; import 'core/service/childvaccines/user_information_service.dart';
import 'core/service/childvaccines/vaccination_table_service.dart'; import 'core/service/childvaccines/vaccination_table_service.dart';
import 'core/service/contactus/finadus_service.dart'; import 'core/service/contactus/finadus_service.dart';
@ -123,6 +124,10 @@ void setupLocator() {
locator.registerLazySingleton(() => ChildVaccinesService()); locator.registerLazySingleton(() => ChildVaccinesService());
locator.registerLazySingleton(() => UserInformationService()); locator.registerLazySingleton(() => UserInformationService());
locator.registerLazySingleton(() => CreteNewBabyService()); locator.registerLazySingleton(() => CreteNewBabyService());
locator.registerLazySingleton(() => DeleteBabyService());
locator.registerLazySingleton(() => VaccinationTableService()); locator.registerLazySingleton(() => VaccinationTableService());

@ -66,7 +66,8 @@ class MyApp extends StatelessWidget {
hintColor: Colors.grey[400], hintColor: Colors.grey[400],
disabledColor: Colors.grey[300], disabledColor: Colors.grey[300],
errorColor: Color.fromRGBO(235, 80, 60, 1.0), errorColor: Color.fromRGBO(235, 80, 60, 1.0),
scaffoldBackgroundColor:Hexcolor('#E9E9E9'),// Colors.grey[100], scaffoldBackgroundColor:
HexColor('#E9E9E9'), // Colors.grey[100],
textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5), textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
textSelectionHandleColor: Colors.grey, textSelectionHandleColor: Colors.grey,
canvasColor: Colors.white, canvasColor: Colors.white,
@ -74,9 +75,8 @@ class MyApp extends StatelessWidget {
highlightColor: Colors.grey[100].withOpacity(0.4), highlightColor: Colors.grey[100].withOpacity(0.4),
splashColor: Colors.transparent, splashColor: Colors.transparent,
primaryColor: Colors.grey, primaryColor: Colors.grey,
bottomSheetTheme:BottomSheetThemeData( bottomSheetTheme: BottomSheetThemeData(
backgroundColor: Hexcolor('#E0E0E0') backgroundColor: HexColor('#E0E0E0')),
) ,
cursorColor: Colors.grey, cursorColor: Colors.grey,
iconTheme: IconThemeData(), iconTheme: IconThemeData(),
appBarTheme: AppBarTheme( appBarTheme: AppBarTheme(

@ -174,7 +174,9 @@ class PatientDoctorAppointmentList {
List<DoctorList> patientDoctorAppointmentList = List(); List<DoctorList> patientDoctorAppointmentList = List();
PatientDoctorAppointmentList( PatientDoctorAppointmentList(
{this.filterName, this.distanceInKMs, DoctorList patientDoctorAppointment}) { {this.filterName,
this.distanceInKMs,
DoctorList patientDoctorAppointment}) {
patientDoctorAppointmentList.add(patientDoctorAppointment); patientDoctorAppointmentList.add(patientDoctorAppointment);
} }
} }

@ -17,66 +17,63 @@ import 'e_referral_page.dart';
class EReferralIndexPage extends StatelessWidget { class EReferralIndexPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: "Service Information", appBarTitle: "Service Information",
body: SingleChildScrollView( body: SingleChildScrollView(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child:
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
"E-Referral: ",
fontWeight: FontWeight.normal,
fontSize: 25,
color: Hexcolor("#60686b"),
),
SizedBox(
height: 12,
),
Texts(
"This service allows you to submit a Referral request from any health care providers either inside or outside the kingdom of Saudi Arabia to any of HMG Hospitals, By filling some of the patient's data and attaching the medical reports, moreover you can track the request status (Under process, Accepted or Rejected)",
fontWeight: FontWeight.normal,
fontSize: 17,
),
SizedBox(
height: 22,
),
Center(
child: SizedBox(
height: MediaQuery.of(context).size.height * 0.55,
width: MediaQuery.of(context).size.width * 0.50,
child: CarouselSlider(
imagesUrlList: [
"https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/0.png",
"https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/1.png"
],
),
),
),
SizedBox(
height: 77,
),
],
)
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Texts(
width: MediaQuery.of(context).size.width * 0.9, "E-Referral: ",
child: SecondaryButton( fontWeight: FontWeight.normal,
onTap: ()=> Navigator.push(context, FadePage(page: EReferralPage())), fontSize: 25,
label: "E-Referral", color: HexColor("#60686b"),
textColor: Theme.of(context).backgroundColor), ),
SizedBox(
height: 12,
),
Texts(
"This service allows you to submit a Referral request from any health care providers either inside or outside the kingdom of Saudi Arabia to any of HMG Hospitals, By filling some of the patient's data and attaching the medical reports, moreover you can track the request status (Under process, Accepted or Rejected)",
fontWeight: FontWeight.normal,
fontSize: 17,
),
SizedBox(
height: 22,
),
Center(
child: SizedBox(
height: MediaQuery.of(context).size.height * 0.55,
width: MediaQuery.of(context).size.width * 0.50,
child: CarouselSlider(
imagesUrlList: [
"https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/0.png",
"https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/1.png"
],
),
),
),
SizedBox(
height: 77,
), ),
], ],
), )),
bottomSheet: Container(
)); height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
onTap: () => Navigator.push(
context, FadePage(page: EReferralPage())),
label: "E-Referral",
textColor: Theme.of(context).backgroundColor),
),
],
),
));
} }
} }

@ -17,6 +17,7 @@ import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dar
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -41,6 +42,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).alhabiServices, appBarTitle: TranslationBase.of(context).alhabiServices,
isShowDecPage: false,
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
@ -212,9 +214,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
title: TranslationBase.of(context).todoList, title: TranslationBase.of(context).todoList,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: () => Navigator.of(context).pushNamed(
context, SYMPTOM_CHECKER,
FadePage(),
), ),
imageLocation: 'assets/images/new-design/body_icon.png', imageLocation: 'assets/images/new-design/body_icon.png',
title: 'Symptom Checker'), title: 'Symptom Checker'),

@ -23,7 +23,7 @@ class H2OPageIndexPage extends StatelessWidget {
"Water Tracker:", "Water Tracker:",
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 25, fontSize: 25,
color: Hexcolor("#60686b"), color: HexColor("#60686b"),
), ),
SizedBox( SizedBox(
height: 12, height: 12,

@ -6,10 +6,11 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:percent_indicator/circular_percent_indicator.dart'; import 'package:percent_indicator/circular_percent_indicator.dart';
class TodayPage extends StatelessWidget { class TodayPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<H2OViewModel>( return BaseView<H2OViewModel>(
onModelReady: (model) => model.getUserProgressForTodayData(), onModelReady: (model) => model.getUserProgressForTodayData(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: false, isShowAppBar: false,
@ -27,11 +28,11 @@ class TodayPage extends StatelessWidget {
animation: true, animation: true,
animationDuration: 1200, animationDuration: 1200,
lineWidth: 15.0, lineWidth: 15.0,
percent:model.userProgressData ==null ?0.0: percent: model.userProgressData == null
(model.userProgressData.percentageConsumed / ? 0.0
100) >= 1 ? 1 : (model.userProgressData : (model.userProgressData.percentageConsumed / 100) >= 1
.percentageConsumed / ? 1
100), : (model.userProgressData.percentageConsumed / 100),
//, //,
center: Center( center: Center(
child: Column( child: Column(
@ -46,13 +47,16 @@ class TodayPage extends StatelessWidget {
SizedBox( SizedBox(
height: 4, height: 4,
), ),
Text(model.userProgressData ==null ?"0.0": Text(
model.userProgressData.quantityConsumed model.userProgressData == null
.toString() + 'ml', ? "0.0"
: model.userProgressData.quantityConsumed
.toString() +
'ml',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 20.0, fontSize: 20.0,
color: Hexcolor("#60BCF9")), color: HexColor("#60BCF9")),
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -60,9 +64,7 @@ class TodayPage extends StatelessWidget {
SizedBox( SizedBox(
height: 5, height: 5,
width: 50, width: 50,
child: Container( child: Container(),
),
), ),
SizedBox( SizedBox(
height: 4, height: 4,
@ -74,23 +76,28 @@ class TodayPage extends StatelessWidget {
SizedBox( SizedBox(
height: 4, height: 4,
), ),
Text(model.userProgressData ==null ?"0.0": Text(
(model.userProgressData.quantityLimit - model.userProgressData == null
model.userProgressData ? "0.0"
.quantityConsumed) < 0 ? "0 ml" : : (model.userProgressData.quantityLimit -
(model.userProgressData.quantityLimit - model.userProgressData
model.userProgressData .quantityConsumed) <
.quantityConsumed).toString() + ' ml', 0
? "0 ml"
: (model.userProgressData.quantityLimit -
model.userProgressData
.quantityConsumed)
.toString() +
' ml',
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold, fontSize: 18.0),
fontSize: 18.0),
), ),
], ],
), ),
), ),
circularStrokeCap: CircularStrokeCap.butt, circularStrokeCap: CircularStrokeCap.butt,
backgroundColor: Hexcolor("#D1E3F6"), backgroundColor: HexColor("#D1E3F6"),
progressColor: Hexcolor("#60BCF9"), progressColor: HexColor("#60BCF9"),
), ),
), ),
Row( Row(
@ -105,9 +112,9 @@ class TodayPage extends StatelessWidget {
height: 30, height: 30,
width: 70, width: 70,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor("#D1E3F6"), color: HexColor("#D1E3F6"),
borderRadius: BorderRadius.all( borderRadius:
Radius.circular(30))), BorderRadius.all(Radius.circular(30))),
), ),
), ),
Text( Text(
@ -125,9 +132,9 @@ class TodayPage extends StatelessWidget {
height: 30, height: 30,
width: 70, width: 70,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor("#60BCF9"), color: HexColor("#60BCF9"),
borderRadius: BorderRadius.all( borderRadius:
Radius.circular(30))), BorderRadius.all(Radius.circular(30))),
), ),
), ),
Text( Text(
@ -143,10 +150,7 @@ class TodayPage extends StatelessWidget {
), ),
SizedBox( SizedBox(
height: 0.5, height: 0.5,
width: MediaQuery width: MediaQuery.of(context).size.width,
.of(context)
.size
.width,
child: Container( child: Container(
color: Colors.grey, color: Colors.grey,
), ),
@ -163,4 +167,3 @@ class TodayPage extends StatelessWidget {
); );
} }
} }

@ -1,4 +1,3 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -6,6 +5,8 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'dart:math'; import 'dart:math';
import 'result_page.dart';
const activeCardColor = Color(0xff70777A); const activeCardColor = Color(0xff70777A);
const inactiveCardColor = Color(0xffFAFAFd); const inactiveCardColor = Color(0xffFAFAFd);

@ -1,10 +1,11 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:math'; import 'dart:math';
import 'bmr_result_page.dart';
const activeCardColorGender = Color(0xffC5272D); const activeCardColorGender = Color(0xffC5272D);
const inactiveCardColorGender = Color(0xffFAFAFd); const inactiveCardColorGender = Color(0xffFAFAFd);
const activeCardColor = Color(0xff70777A); const activeCardColor = Color(0xff70777A);
@ -207,7 +208,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
Row( Row(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -306,7 +307,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
Row( Row(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -481,7 +482,7 @@ class _BmrCalculatorState extends State<BmrCalculator> {
Row( Row(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,

@ -1,10 +1,11 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:math'; import 'dart:math';
import 'body_fat_result_page.dart';
const activeCardColorGender = Color(0xffC5272D); const activeCardColorGender = Color(0xffC5272D);
const inactiveCardColorGender = Color(0xffFAFAFd); const inactiveCardColorGender = Color(0xffFAFAFd);
const activeCardColor = Color(0xff70777A); const activeCardColor = Color(0xff70777A);
@ -285,98 +286,101 @@ class _BodyFatState extends State<BodyFat> {
), ),
Row( Row(
children: [ children: [
Container( Expanded(
width: 335.0, child: Container(
height: 60.0, width: 340.0,
decoration: BoxDecoration( height: 60.0,
color: Colors.white, decoration: BoxDecoration(
), color: Colors.white,
child: Row( ),
children: [ child: Row(
Padding( children: [
padding: EdgeInsets.symmetric( Padding(
vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
child: Center( vertical: 10.0, horizontal: 8.0),
child: Container( child: Center(
width: 60.0, child: Container(
foregroundDecoration: BoxDecoration( width: 60.0,
borderRadius: BorderRadius.circular(5.0), foregroundDecoration: BoxDecoration(
border: Border.all( borderRadius:
color: Colors.blueGrey, BorderRadius.circular(5.0),
width: 2.0, border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
), ),
), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Center(
child: Center( child: Text(heightCm.toString()),
child: Text(heightCm.toString()), ),
), ),
), Container(
Container( height: 38.0,
height: 38.0, child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, children: <Widget>[
children: <Widget>[ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( border: Border(
border: Border( bottom: BorderSide(
bottom: BorderSide( width: 0.5,
width: 0.5, ),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
), ),
onTap: () {
setState(() {
if (heightCm < 250)
heightCm++;
});
},
), ),
), ),
child: InkWell( InkWell(
child: Icon( child: Icon(
Icons.arrow_drop_up, Icons.arrow_drop_down,
size: 18.0, size: 18.0,
), ),
onTap: () { onTap: () {
setState(() { setState(() {
if (heightCm < 250) if (heightCm > 0)
heightCm++; heightCm--;
}); });
}, },
), ),
), ],
InkWell( ),
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (heightCm > 0)
heightCm--;
});
},
),
],
), ),
), ],
], ),
), ),
), ),
), ),
), Expanded(
Expanded( child: Slider(
child: Slider( value: heightCm.toDouble(),
value: heightCm.toDouble(), min: 0,
min: 0, max: 250,
max: 250, onChanged: (double newValue) {
onChanged: (double newValue) { setState(() {
setState(() { heightCm = newValue.round();
heightCm = newValue.round(); });
}); },
}, activeColor: Color(0xffC5272D),
activeColor: Color(0xffC5272D), inactiveColor: Color(0xffF3C5C6),
inactiveColor: Color(0xffF3C5C6), ),
), ),
), ],
], ),
), ),
), ),
], ],
@ -458,96 +462,99 @@ class _BodyFatState extends State<BodyFat> {
), ),
Row( Row(
children: [ children: [
Container( Expanded(
width: 335.0, child: Container(
height: 60.0, width: 340.0,
decoration: BoxDecoration( height: 60.0,
color: Colors.white, decoration: BoxDecoration(
), color: Colors.white,
child: Row( ),
children: [ child: Row(
Padding( children: [
padding: EdgeInsets.symmetric( Padding(
vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
child: Center( vertical: 10.0, horizontal: 8.0),
child: Container( child: Center(
width: 60.0, child: Container(
foregroundDecoration: BoxDecoration( width: 60.0,
borderRadius: BorderRadius.circular(5.0), foregroundDecoration: BoxDecoration(
border: Border.all( borderRadius:
color: Colors.blueGrey, BorderRadius.circular(5.0),
width: 2.0, border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
), ),
), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Center(
child: Center( child: Text(neck.toString()),
child: Text(neck.toString()), ),
), ),
), Container(
Container( height: 38.0,
height: 38.0, child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, children: <Widget>[
children: <Widget>[ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( border: Border(
border: Border( bottom: BorderSide(
bottom: BorderSide( width: 0.5,
width: 0.5, ),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
), ),
onTap: () {
setState(() {
if (neck < 60) neck++;
});
},
), ),
), ),
child: InkWell( InkWell(
child: Icon( child: Icon(
Icons.arrow_drop_up, Icons.arrow_drop_down,
size: 18.0, size: 18.0,
), ),
onTap: () { onTap: () {
setState(() { setState(() {
if (neck < 60) neck++; if (neck > 5) neck--;
}); });
}, },
), ),
), ],
InkWell( ),
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (neck > 5) neck--;
});
},
),
],
), ),
), ],
], ),
), ),
), ),
), ),
), Expanded(
Expanded( child: Slider(
child: Slider( value: neck.toDouble(),
value: neck.toDouble(), min: 5,
min: 5, max: 60,
max: 60, onChanged: (double newValue) {
onChanged: (double newValue) { setState(() {
setState(() { neck = newValue.round();
neck = newValue.round(); });
}); },
}, activeColor: Color(0xffC5272D),
activeColor: Color(0xffC5272D), inactiveColor: Color(0xffF3C5C6),
inactiveColor: Color(0xffF3C5C6), ),
), ),
), ],
], ),
), ),
), ),
], ],
@ -629,96 +636,100 @@ class _BodyFatState extends State<BodyFat> {
), ),
Row( Row(
children: [ children: [
Container( Expanded(
width: 335.0, child: Container(
height: 60.0, width: 340.0,
decoration: BoxDecoration( height: 60.0,
color: Colors.white, decoration: BoxDecoration(
), color: Colors.white,
child: Row( ),
children: [ child: Row(
Padding( children: [
padding: EdgeInsets.symmetric( Padding(
vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
child: Center( vertical: 10.0, horizontal: 8.0),
child: Container( child: Center(
width: 60.0, child: Container(
foregroundDecoration: BoxDecoration( width: 60.0,
borderRadius: BorderRadius.circular(5.0), foregroundDecoration: BoxDecoration(
border: Border.all( borderRadius:
color: Colors.blueGrey, BorderRadius.circular(5.0),
width: 2.0, border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
), ),
), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Center(
child: Center( child: Text(waist.toString()),
child: Text(waist.toString()), ),
), ),
), Container(
Container( height: 38.0,
height: 38.0, child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, children: <Widget>[
children: <Widget>[ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( border: Border(
border: Border( bottom: BorderSide(
bottom: BorderSide( width: 0.5,
width: 0.5, ),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
), ),
onTap: () {
setState(() {
if (waist < 200)
waist++;
});
},
), ),
), ),
child: InkWell( InkWell(
child: Icon( child: Icon(
Icons.arrow_drop_up, Icons.arrow_drop_down,
size: 18.0, size: 18.0,
), ),
onTap: () { onTap: () {
setState(() { setState(() {
if (waist < 200) waist++; if (waist > 5) waist--;
}); });
}, },
), ),
), ],
InkWell( ),
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (waist > 5) waist--;
});
},
),
],
), ),
), ],
], ),
), ),
), ),
), ),
), Expanded(
Expanded( child: Slider(
child: Slider( value: waist.toDouble(),
value: waist.toDouble(), min: 5,
min: 5, max: 200,
max: 200, onChanged: (double newValue) {
onChanged: (double newValue) { setState(() {
setState(() { waist = newValue.round();
waist = newValue.round(); });
}); },
}, activeColor: Color(0xffC5272D),
activeColor: Color(0xffC5272D), inactiveColor: Color(0xffF3C5C6),
inactiveColor: Color(0xffF3C5C6), ),
), ),
), ],
], ),
), ),
), ),
], ],
@ -800,96 +811,99 @@ class _BodyFatState extends State<BodyFat> {
), ),
Row( Row(
children: [ children: [
Container( Expanded(
width: 335.0, child: Container(
height: 60.0, width: 340.0,
decoration: BoxDecoration( height: 60.0,
color: Colors.white, decoration: BoxDecoration(
), color: Colors.white,
child: Row( ),
children: [ child: Row(
Padding( children: [
padding: EdgeInsets.symmetric( Padding(
vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
child: Center( vertical: 10.0, horizontal: 8.0),
child: Container( child: Center(
width: 60.0, child: Container(
foregroundDecoration: BoxDecoration( width: 60.0,
borderRadius: BorderRadius.circular(5.0), foregroundDecoration: BoxDecoration(
border: Border.all( borderRadius:
color: Colors.blueGrey, BorderRadius.circular(5.0),
width: 2.0, border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
), ),
), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Center(
child: Center( child: Text(hip.toString()),
child: Text(hip.toString()), ),
), ),
), Container(
Container( height: 38.0,
height: 38.0, child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, children: <Widget>[
children: <Widget>[ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( border: Border(
border: Border( bottom: BorderSide(
bottom: BorderSide( width: 0.5,
width: 0.5, ),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
), ),
onTap: () {
setState(() {
if (hip < 140) hip++;
});
},
), ),
), ),
child: InkWell( InkWell(
child: Icon( child: Icon(
Icons.arrow_drop_up, Icons.arrow_drop_down,
size: 18.0, size: 18.0,
), ),
onTap: () { onTap: () {
setState(() { setState(() {
if (hip < 140) hip++; if (hip > 5) hip--;
}); });
}, },
), ),
), ],
InkWell( ),
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (hip > 5) hip--;
});
},
),
],
), ),
), ],
], ),
), ),
), ),
), ),
), Expanded(
Expanded( child: Slider(
child: Slider( value: hip.toDouble(),
value: hip.toDouble(), min: 5,
min: 5, max: 140,
max: 140, onChanged: (double newValue) {
onChanged: (double newValue) { setState(() {
setState(() { hip = newValue.round();
hip = newValue.round(); });
}); },
}, activeColor: Color(0xffC5272D),
activeColor: Color(0xffC5272D), inactiveColor: Color(0xffF3C5C6),
inactiveColor: Color(0xffF3C5C6), ),
), ),
), ],
], ),
), ),
), ),
], ],

@ -1,9 +1,10 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'calorie_result_page.dart';
const activeCardColorGender = Color(0xffC5272D); const activeCardColorGender = Color(0xffC5272D);
const inactiveCardColorGender = Color(0xffFAFAFd); const inactiveCardColorGender = Color(0xffFAFAFd);
const activeCardColor = Color(0xff70777A); const activeCardColor = Color(0xff70777A);
@ -181,7 +182,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
Row( Row(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -280,7 +281,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
Row( Row(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -448,7 +449,7 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
Row( Row(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,

@ -1,13 +1,13 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:math'; import 'dart:math';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'carbs_result_page.dart';
class Carbs extends StatefulWidget { class Carbs extends StatefulWidget {
@override @override
_CarbsState createState() => _CarbsState(); _CarbsState createState() => _CarbsState();
@ -97,7 +97,7 @@ class _CarbsState extends State<Carbs> {
Column( Column(
children: [ children: [
Container( Container(
width: 335.0, width: 340.0,
height: 60.0, height: 60.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,

@ -0,0 +1,146 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:intl/intl.dart';
import 'delivery_due_result_page.dart';
class DeliveryDue extends StatefulWidget {
@override
_DeliveryDueState createState() => _DeliveryDueState();
}
class _DeliveryDueState extends State<DeliveryDue> {
DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now();
var dateFrom = DateTime.now();
var dateTo = DateTime.now();
var conceivedDate = DateTime.now();
var deliveryDue = DateTime.now();
var firstTrimester = DateTime.now();
var secondTrimester = DateTime.now();
var thirdTrimester = DateTime.now();
var dt = DateTime.now();
var newFormat = DateFormat("yy-MM-dd");
String getDate() {
return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}";
}
String getTime() {
return " ${timeSugarDate.hour}:${timeSugarDate.minute}";
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Delivery Due Date',
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 35.0, vertical: 20.0),
child: SingleChildScrollView(
child: Container(
child: Column(
//mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Texts(
'Congratulations, you are pregnant! Now when will the new baby arrive? To estimate the due date, enter the date when the last menstrual perios began (the first day), then click calculate.',
),
Divider(
//height: 2,
thickness: 2,
),
Column(
children: [
Texts(
'What was the date of the first day of the last period?',
),
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
? null
: bloodSugarDate = DateTime.now();
dateFrom = date.add(Duration(days: 10));
dateTo = date.add(Duration(days: 20));
conceivedDate = date.add(Duration(days: 14));
deliveryDue = date.add(Duration(days: 280));
firstTrimester = date.add(Duration(days: 85));
secondTrimester = date.add(Duration(days: 190));
thirdTrimester = date.add(Duration(days: 280));
});
},
currentTime: DateTime.now(),
);
},
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: [
Row(
children: [
Icon(Icons.date_range),
Texts('Date'),
],
),
Texts(getDate()),
],
),
),
),
],
),
SizedBox(
height: 280.0,
),
Container(
height: 100.0,
width: 350.0,
child: Button(
label: 'CALCULATE',
onTap: () {
setState(() {
{
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => DeliveryDueResult(
conceivedDate: conceivedDate,
dateFrom: dateFrom,
dateTo: dateTo,
deliveryDue: deliveryDue,
firstTrimester: firstTrimester,
secondTrimester: secondTrimester,
thirdTrimester: thirdTrimester,
)),
);
}
});
},
),
),
],
),
),
),
),
);
}
}

@ -0,0 +1,106 @@
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class DeliveryDueResult extends StatelessWidget {
var dateFrom;
var dateTo;
var conceivedDate;
var deliveryDue;
var firstTrimester;
var secondTrimester;
var thirdTrimester;
DeliveryDueResult(
{this.dateFrom,
this.dateTo,
this.conceivedDate,
this.deliveryDue,
this.firstTrimester,
this.secondTrimester,
this.thirdTrimester});
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Delivery Due Date',
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 12.0),
child: SingleChildScrollView(
child: Container(
height: 750.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Texts(
'The next ovulation period is estimated to be:',
fontWeight: FontWeight.w400,
),
Texts(
'From:',
fontWeight: FontWeight.w400,
),
Texts(DateFormat.yMMMEd().format(dateFrom),
fontWeight: FontWeight.w800,
fontSize: 21.0,
color: Color(0xffC5272D)),
Texts(
'To:',
fontWeight: FontWeight.w400,
),
Texts(DateFormat.yMMMEd().format(dateTo),
fontWeight: FontWeight.w800,
fontSize: 21.0,
color: Color(0xffC5272D)),
Texts(
'You have conceived on:',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(conceivedDate),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'First Trimester Ends (12 weeks):',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(firstTrimester),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'Second Trimester Ends (27 weeks):',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(secondTrimester),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'Third Trimester, Estimated Due Date (40 weeks):',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(thirdTrimester),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Container(
width: 350,
child: Button(
label: 'See List Of Doctors',
),
),
],
),
),
),
),
);
}
}

@ -1,10 +1,11 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'dart:math'; import 'dart:math';
import 'ideal_body_result_page.dart';
const activeCardColor = Color(0xff70777A); const activeCardColor = Color(0xff70777A);
const inactiveCardColor = Color(0xffFAFAFd); const inactiveCardColor = Color(0xffFAFAFd);
@ -29,7 +30,7 @@ class _IdealBodyState extends State<IdealBody> {
double overWeightBy; double overWeightBy;
int weight = 0; int weight = 0;
double idealWeight = 0; double idealWeight = 0;
String dropdownValue; String dropdownValue = 'Medium(fingers touch)';
double calories = 0; double calories = 0;
String textResult = ''; String textResult = '';
double maxIdealWeight; double maxIdealWeight;
@ -126,97 +127,100 @@ class _IdealBodyState extends State<IdealBody> {
), ),
Row( Row(
children: [ children: [
Container( Expanded(
width: 335.0, child: Container(
height: 60.0, width: 340.0,
decoration: BoxDecoration( height: 60.0,
color: Colors.white, decoration: BoxDecoration(
), color: Colors.white,
child: Row( ),
children: [ child: Row(
Padding( children: [
padding: EdgeInsets.symmetric( Padding(
vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
child: Center( vertical: 10.0, horizontal: 8.0),
child: Container( child: Center(
width: 60.0, child: Container(
foregroundDecoration: BoxDecoration( width: 60.0,
borderRadius: BorderRadius.circular(5.0), foregroundDecoration: BoxDecoration(
border: Border.all( borderRadius:
color: Colors.blueGrey, BorderRadius.circular(5.0),
width: 2.0, border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
), ),
), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Center(
child: Center( child: Text(height.toString()),
child: Text(height.toString()), ),
), ),
), Container(
Container( height: 38.0,
height: 38.0, child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, children: <Widget>[
children: <Widget>[ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( border: Border(
border: Border( bottom: BorderSide(
bottom: BorderSide( width: 0.5,
width: 0.5, ),
), ),
), ),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (height < 250)
height++;
});
},
),
), ),
child: InkWell( InkWell(
child: Icon( child: Icon(
Icons.arrow_drop_up, Icons.arrow_drop_down,
size: 18.0, size: 18.0,
), ),
onTap: () { onTap: () {
setState(() { setState(() {
if (height < 250) if (height > 0) height--;
height++;
}); });
}, },
), ),
), ],
InkWell( ),
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (height > 0) height--;
});
},
),
],
), ),
), ],
], ),
), ),
), ),
), ),
), Expanded(
Expanded( child: Slider(
child: Slider( value: height.toDouble(),
value: height.toDouble(), min: 0,
min: 0, max: 250,
max: 250, onChanged: (double newValue) {
onChanged: (double newValue) { setState(() {
setState(() { height = newValue.round();
height = newValue.round(); });
}); },
}, activeColor: Color(0xffC5272D),
activeColor: Color(0xffC5272D), inactiveColor: Color(0xffF3C5C6),
inactiveColor: Color(0xffF3C5C6), ),
), ),
), ],
], ),
), ),
), ),
], ],
@ -304,97 +308,100 @@ class _IdealBodyState extends State<IdealBody> {
), ),
Row( Row(
children: [ children: [
Container( Expanded(
width: 335.0, child: Container(
height: 60.0, width: 340.0,
decoration: BoxDecoration( height: 60.0,
color: Colors.white, decoration: BoxDecoration(
), color: Colors.white,
child: Row( ),
children: [ child: Row(
Padding( children: [
padding: EdgeInsets.symmetric( Padding(
vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
child: Center( vertical: 10.0, horizontal: 8.0),
child: Container( child: Center(
width: 60.0, child: Container(
foregroundDecoration: BoxDecoration( width: 60.0,
borderRadius: BorderRadius.circular(5.0), foregroundDecoration: BoxDecoration(
border: Border.all( borderRadius:
color: Colors.blueGrey, BorderRadius.circular(5.0),
width: 2.0, border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
), ),
), child: Row(
child: Row( children: <Widget>[
children: <Widget>[ Expanded(
Expanded( child: Center(
child: Center( child: Text(weight.toString()),
child: Text(weight.toString()), ),
), ),
), Container(
Container( height: 38.0,
height: 38.0, child: Column(
child: Column( crossAxisAlignment:
crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center, mainAxisAlignment:
mainAxisAlignment: MainAxisAlignment.center,
MainAxisAlignment.center, children: <Widget>[
children: <Widget>[ Container(
Container( decoration: BoxDecoration(
decoration: BoxDecoration( border: Border(
border: Border( bottom: BorderSide(
bottom: BorderSide( width: 0.5,
width: 0.5, ),
), ),
), ),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (weight < 250)
weight++;
});
},
),
), ),
child: InkWell( InkWell(
child: Icon( child: Icon(
Icons.arrow_drop_up, Icons.arrow_drop_down,
size: 18.0, size: 18.0,
), ),
onTap: () { onTap: () {
setState(() { setState(() {
if (weight < 250) if (weight > 0) weight--;
weight++;
}); });
}, },
), ),
), ],
InkWell( ),
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (weight > 0) weight--;
});
},
),
],
), ),
), ],
], ),
), ),
), ),
), ),
), Expanded(
Expanded( child: Slider(
child: Slider( value: weight.toDouble(),
value: weight.toDouble(), min: 0,
min: 0, max: 250,
max: 250, onChanged: (double newValue) {
onChanged: (double newValue) { setState(() {
setState(() { weight = newValue.round();
weight = newValue.round(); });
}); },
}, activeColor: Color(0xffC5272D),
activeColor: Color(0xffC5272D), inactiveColor: Color(0xffF3C5C6),
inactiveColor: Color(0xffF3C5C6), ),
), ),
), ],
], ),
), ),
), ),
], ],

@ -0,0 +1,351 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:intl/intl.dart';
import 'ovulation_result_page.dart';
class OvulationPeriod extends StatefulWidget {
@override
_OvulationPeriodState createState() => _OvulationPeriodState();
}
class _OvulationPeriodState extends State<OvulationPeriod> {
DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now();
int cycleLength = 0;
int lutealPhaseLength = 0;
String selectedDate;
var dateFrom = DateTime.now();
var dateTo = DateTime.now();
var conceivedDate = DateTime.now();
var deliveryDue = DateTime.now();
var dt = DateTime.now();
var newFormat = DateFormat("yy-MM-dd");
String updatedDt;
String getTime() {
return " ${timeSugarDate.hour}:${timeSugarDate.minute}";
}
String getDate() {
return "${DateUtil.getMonth(bloodSugarDate.month)} ${bloodSugarDate.day}, ${bloodSugarDate.year}";
}
// void calculate() {}
//
// void calculateFertility(DateTime selectedDate) {const diff = Date.}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Ovulation Period',
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 25.0, vertical: 15.0),
child: SingleChildScrollView(
child: Container(
height: 700.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Calculates Ovulation Period'),
SizedBox(
height: 12.0,
),
Divider(
//height: 2,
thickness: 2,
),
SizedBox(
height: 12.0,
),
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;
dateFrom = date.add(Duration(days: 10));
updatedDt = DateFormat.yMMMEd().format(dateFrom);
dateTo = date.add(Duration(days: 20));
conceivedDate = date.add(Duration(days: 14));
deliveryDue = date.add(Duration(days: 280));
});
},
currentTime: DateTime.now(),
);
},
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: 5.0,
),
Texts(
'Average Cycle Length (usually 28 days):',
fontWeight: FontWeight.w400,
),
SizedBox(
height: 5.0,
),
Row(
children: [
Container(
width: 340.0,
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
),
child: Row(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
child: Center(
child: Container(
width: 60.0,
foregroundDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
),
child: Row(
children: <Widget>[
Expanded(
child: Center(
child: Text(cycleLength.toString()),
),
),
Container(
height: 38.0,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (cycleLength < 45)
cycleLength++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (cycleLength > 0)
cycleLength--;
});
},
),
],
),
),
],
),
),
),
),
Expanded(
child: Slider(
value: cycleLength.toDouble(),
min: 0,
max: 45,
onChanged: (double newValue) {
setState(() {
cycleLength = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
),
),
],
),
Texts(
'Average Luteal Phase Length (usually 14 days):',
fontWeight: FontWeight.w400,
),
SizedBox(
height: 5.0,
),
Row(
children: [
Container(
width: 340.0,
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
),
child: Row(
children: [
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
child: Center(
child: Container(
width: 60.0,
foregroundDecoration: BoxDecoration(
borderRadius: BorderRadius.circular(5.0),
border: Border.all(
color: Colors.blueGrey,
width: 2.0,
),
),
child: Row(
children: <Widget>[
Expanded(
child: Center(
child:
Text(lutealPhaseLength.toString()),
),
),
Container(
height: 38.0,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 0.5,
),
),
),
child: InkWell(
child: Icon(
Icons.arrow_drop_up,
size: 18.0,
),
onTap: () {
setState(() {
if (lutealPhaseLength < 15)
lutealPhaseLength++;
});
},
),
),
InkWell(
child: Icon(
Icons.arrow_drop_down,
size: 18.0,
),
onTap: () {
setState(() {
if (lutealPhaseLength > 0)
lutealPhaseLength--;
});
},
),
],
),
),
],
),
),
),
),
Expanded(
child: Slider(
value: lutealPhaseLength.toDouble(),
min: 0,
max: 15,
onChanged: (double newValue) {
setState(() {
lutealPhaseLength = newValue.round();
});
},
activeColor: Color(0xffC5272D),
inactiveColor: Color(0xffF3C5C6),
),
),
],
),
),
],
),
SizedBox(
height: 220.0,
),
Container(
height: 100.0,
width: 350.0,
child: Button(
label: 'CALCULATE',
onTap: () {
setState(() {
{
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => OvulationResult(
conceivedDate: conceivedDate,
dateFrom: dateFrom,
dateTo: dateTo,
deliveryDue: deliveryDue,
)),
);
}
});
},
),
),
],
),
),
),
),
);
}
}

@ -0,0 +1,96 @@
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class OvulationResult extends StatelessWidget {
var dateFrom;
var dateTo;
var conceivedDate;
var deliveryDue;
OvulationResult(
{this.dateFrom, this.dateTo, this.deliveryDue, this.conceivedDate});
//var newFormat = DateFormat("yy-MM-dd");
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Ovulation Period',
body: Padding(
padding: EdgeInsets.symmetric(horizontal: 30.0, vertical: 15.0),
child: SingleChildScrollView(
child: Container(
height: 750.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Texts(
'The next ovulation period is estimated to be:',
fontWeight: FontWeight.w400,
),
Texts(
'From:',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(dateFrom),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'To:',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(dateTo),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'Useful Information:',
color: Color(0xffC5272D),
),
Texts(
'You have conceived on:',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(conceivedDate),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'The baby\'s age right now:',
fontWeight: FontWeight.w400,
),
Texts(
'5 Weeks, 2',
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Texts(
'The delivery due date is estimated to be on the: ',
fontWeight: FontWeight.w400,
),
Texts(
DateFormat.yMMMEd().format(deliveryDue),
fontWeight: FontWeight.w800,
fontSize: 21.0,
),
Container(
width: 350,
child: Button(
label: 'See List Of Doctors',
),
),
],
),
),
),
),
);
}
}

@ -1,5 +1,8 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -9,6 +12,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'health_calculator/bmi_calculator/bmi_calculator.dart'; import 'health_calculator/bmi_calculator/bmi_calculator.dart';
import 'health_calculator/bmr_calculator/bmr_calculator.dart'; import 'health_calculator/bmr_calculator/bmr_calculator.dart';
import 'health_calculator/calorie_calculator/calorie_calculator.dart'; import 'health_calculator/calorie_calculator/calorie_calculator.dart';
import 'health_calculator/delivery_due/delivery_due.dart';
import 'health_calculator/ideal_body/ideal_body.dart'; import 'health_calculator/ideal_body/ideal_body.dart';
class HealthCalculators extends StatefulWidget { class HealthCalculators extends StatefulWidget {
@ -233,10 +237,10 @@ class _HealthCalculatorsState extends State<HealthCalculators>
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
// Navigator.push( Navigator.push(
// context, context,
// FadePage(page: BloodSugar()), FadePage(page: OvulationPeriod()),
// ); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: 'Ovulation', title: 'Ovulation',
@ -249,12 +253,12 @@ class _HealthCalculatorsState extends State<HealthCalculators>
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
// Navigator.push( Navigator.push(
// context, context,
// FadePage( FadePage(
// page: BloodCholesterol(), page: DeliveryDue(),
// ), ),
// ); );
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: 'Delivery', title: 'Delivery',

@ -39,7 +39,7 @@ class MyBalancePage extends StatelessWidget {
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#B61422'), color: HexColor('#B61422'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
), ),
@ -97,7 +97,8 @@ class MyBalancePage extends StatelessWidget {
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).createAdvancedPayment, label: TranslationBase.of(context).createAdvancedPayment,
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(
context,
//FadePage(page: AdvancePaymentPage())); //FadePage(page: AdvancePaymentPage()));
FadePage(page: BloodDonationPage())); FadePage(page: BloodDonationPage()));
}, },

@ -47,16 +47,16 @@ class _DoctorProfileState extends State<DoctorProfile>
vsync: this, vsync: this,
initialIndex: widget.isOpenAppt == true ? 1 : 0); initialIndex: widget.isOpenAppt == true ? 1 : 0);
event.controller.stream.listen((p) { // event.controller.stream.listen((p) {
if (p['clinic_id'] != null && // if (p['clinic_id'] != null &&
p['doctor_id'] != null && // p['doctor_id'] != null &&
p['project_id'] != null) { // p['project_id'] != null) {
setState(() { // setState(() {
// need to take the data from here // // need to take the data from here
// dropdownValue = p['clinic_id']; // // dropdownValue = p['clinic_id'];
}); // });
} // }
}); // });
_tabController = new TabController(length: 2, vsync: this); _tabController = new TabController(length: 2, vsync: this);
widget.authUser = new AuthenticatedUser(); widget.authUser = new AuthenticatedUser();
widget.doctor.speciality = widget.docProfileList.specialty; widget.doctor.speciality = widget.docProfileList.specialty;

@ -1,17 +1,18 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
class Search extends StatefulWidget { class Search extends StatefulWidget {
final int type; final int type;
final List clnicIds;
Search({this.type = 0}); Search({this.type = 0, this.clnicIds});
@override @override
_SearchState createState() => _SearchState(); _SearchState createState() => _SearchState();
} }
@ -29,24 +30,35 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.context = context;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
bottom: TabBar( bottom: TabBar(
tabs: [ tabs: [
Tab(text: TranslationBase.of(context).clinicName), Tab(text: TranslationBase.of(context).clinicName),
Tab( Tab(
text: TranslationBase.of(context).doctorName, text: TranslationBase.of(context).doctorName,
) )
], ],
controller: _tabController, controller: _tabController,
), ),
title: Text(TranslationBase.of(context).bookAppo, title: Text(TranslationBase.of(context).bookAppo,
style: TextStyle(color: Colors.white)), style: TextStyle(color: Colors.white)),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
},
), ),
body: TabBarView( ),
physics: NeverScrollableScrollPhysics(), body: TabBarView(
children: [SearchByClinic(), SearchByDoctor()], physics: NeverScrollableScrollPhysics(),
controller: _tabController), children: [
bottomNavigationBar: BottomBarSearch()); SearchByClinic(
clnicIds: widget.clnicIds,
),
SearchByDoctor()
],
controller: _tabController),
);
} }
} }

@ -1,6 +1,6 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; // import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -19,15 +19,9 @@ class SearchResults extends StatefulWidget {
} }
class _SearchResultsState extends State<SearchResults> { class _SearchResultsState extends State<SearchResults> {
var event = RobotProvider(); // var event = RobotProvider();
List<DoctorList> tempList = []; List<DoctorList> tempList = [];
@override
void initState() {
event.controller.stream.listen((p) {});
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
@ -42,9 +36,14 @@ class _SearchResultsState extends State<SearchResults> {
...List.generate( ...List.generate(
widget.patientDoctorAppointmentListHospital.length, widget.patientDoctorAppointmentListHospital.length,
(index) => AppExpandableNotifier( (index) => AppExpandableNotifier(
title: widget isExpand: index == 1 ? true : false,
.patientDoctorAppointmentListHospital[index].filterName + " - " +widget title: widget.patientDoctorAppointmentListHospital[index]
.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km, .filterName +
" - " +
widget.patientDoctorAppointmentListHospital[index]
.distanceInKMs +
" " +
TranslationBase.of(context).km,
bodyWidget: Column( bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,

@ -11,10 +11,13 @@ import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart';
class SearchByClinic extends StatefulWidget { class SearchByClinic extends StatefulWidget {
final List clnicIds;
SearchByClinic({this.clnicIds});
@override @override
_SearchByClinicState createState() => _SearchByClinicState(); _SearchByClinicState createState() => _SearchByClinicState();
} }
@ -23,11 +26,11 @@ class _SearchByClinicState extends State<SearchByClinic> {
bool nearestAppo = false; bool nearestAppo = false;
String dropdownValue; String dropdownValue;
String projectDropdownValue; String projectDropdownValue;
var event = RobotProvider(); // var event = RobotProvider();
List<ListClinicCentralized> clinicsList = []; List<ListClinicCentralized> clinicsList = [];
List<HospitalsModel> projectsList = []; List<HospitalsModel> projectsList = [];
bool isMobileAppDentalAllow = false; bool isMobileAppDentalAllow = false;
bool isLoaded = false;
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList()); WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList());
@ -56,40 +59,70 @@ class _SearchByClinicState extends State<SearchByClinic> {
style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)), style: TextStyle(fontSize: 16.0, letterSpacing: 0.9)),
], ],
), ),
Container( widget.clnicIds != null &&
height: 60.0, widget.clnicIds.length > 1 &&
decoration: BoxDecoration( isLoaded == true
color: Colors.white, ? Column(
border: Border.all( crossAxisAlignment: CrossAxisAlignment.start,
color: Colors.grey[400], children: clinicsList.map<Widget>((result) {
width: 1.0, return RoundedContainer(
), child: ListTile(
borderRadius: BorderRadius.circular(10), onTap: () {
), // setState(() {
// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0), dropdownValue = result.clinicID.toString();
padding: EdgeInsets.all(8.0), setState(() {
width: MediaQuery.of(context).size.width, if (!isDentalSelectedAndSupported()) {
child: DropdownButtonHideUnderline( projectDropdownValue = "";
child: DropdownButton<String>( getDoctorsList(context);
hint: new Text("Select Clinic"), }
value: dropdownValue, });
items: clinicsList.map((item) { },
return new DropdownMenuItem<String>( // trailing: Icon(TranslationBase.of(AppGlobal.context)
value: item.clinicID.toString(), // .locale
child: new Text(item.clinicDescription), // .languageCode ==
); // 'en'
}).toList(), // ? Icons.keyboard_arrow_right
onChanged: (newValue) { // : Icons.keyboard_arrow_left),
setState(() { title: Text(result.clinicDescription,
dropdownValue = newValue; style: TextStyle(
if (!isDentalSelectedAndSupported() && !nearestAppo) { fontSize: 14.0,
projectDropdownValue = ""; color: Colors.grey[700],
getDoctorsList(context); letterSpacing: 1.0))));
} }).toList())
}); : Container(
}, height: 60.0,
), decoration: BoxDecoration(
)), color: Colors.white,
border: Border.all(
color: Colors.grey[400],
width: 1.0,
),
borderRadius: BorderRadius.circular(10),
),
// margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
padding: EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width,
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
hint: new Text("Select Clinic"),
value: dropdownValue,
items: clinicsList.map((item) {
return new DropdownMenuItem<String>(
value: item.clinicID.toString(),
child: new Text(item.clinicDescription),
);
}).toList(),
onChanged: (newValue) {
setState(() {
dropdownValue = newValue;
if (!isDentalSelectedAndSupported() && !nearestAppo) {
projectDropdownValue = "";
getDoctorsList(context);
}
});
},
),
)),
isDentalSelectedAndSupported() == true || nearestAppo isDentalSelectedAndSupported() == true || nearestAppo
? Container( ? Container(
height: 60.0, height: 60.0,
@ -168,6 +201,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
}); });
print(projectsList.length); print(projectsList.length);
}); });
filterClinic();
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -254,4 +288,17 @@ class _SearchByClinicState extends State<SearchByClinic> {
getProjectsList(); getProjectsList();
}); });
} }
filterClinic() {
setState(() {
if (widget.clnicIds.length > 0) {
clinicsList = clinicsList
.where((i) => widget.clnicIds.indexOf(i.clinicID) > -1)
.toList();
isLoaded = true;
///print(clinicsList);
}
});
}
} }

@ -27,9 +27,11 @@ class _BranchViewState extends State<BranchView> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).bookAppo,
isShowAppBar: true, isShowAppBar: true,
isBottomBar: false,
body: new ListView.builder( body: new ListView.builder(
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return new ExpandableListView( return new ExpandableListView(
isExpanded: index == 0 ? true : false,
result2: widget.result, result2: widget.result,
resultDistance: widget.resultDistance, resultDistance: widget.resultDistance,
val: index, val: index,
@ -46,9 +48,15 @@ class ExpandableListView extends StatefulWidget {
final List<String> resultDistance; final List<String> resultDistance;
final List<DoctorList> doctorsList2; final List<DoctorList> doctorsList2;
final val; final val;
static int doctorListheight = 0;
final bool isExpanded;
const ExpandableListView( const ExpandableListView(
{Key key, this.result2, this.resultDistance, this.val, this.doctorsList2}) {Key key,
this.result2,
this.resultDistance,
this.val,
this.doctorsList2,
this.isExpanded})
: super(key: key); : super(key: key);
@override @override
@ -57,9 +65,17 @@ class ExpandableListView extends StatefulWidget {
class _ExpandableListViewState extends State<ExpandableListView> { class _ExpandableListViewState extends State<ExpandableListView> {
bool expandFlag = false; bool expandFlag = false;
@override
void initState() {
setState(() {
expandFlag = widget.isExpanded;
setDoctorViewHeight(widget.result2[widget.val].toString());
});
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Container( return new Container(
width: MediaQuery.of(context).size.width * 0.6, width: MediaQuery.of(context).size.width * 0.6,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 0.0), margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 0.0),
@ -109,6 +125,10 @@ class _ExpandableListViewState extends State<ExpandableListView> {
onPressed: () { onPressed: () {
setState(() { setState(() {
expandFlag = !expandFlag; expandFlag = !expandFlag;
if (expandFlag == true) {
setDoctorViewHeight(
widget.result2[widget.val].toString());
}
}); });
}), }),
], ],
@ -143,6 +163,11 @@ class _ExpandableListViewState extends State<ExpandableListView> {
); );
} }
setDoctorViewHeight(name) {
ExpandableListView.doctorListheight =
widget.doctorsList2.where((e) => e.projectName == name).toList().length;
}
String getProjectDistance(String distance) { String getProjectDistance(String distance) {
if (distance != "0") if (distance != "0")
return " - " + distance + " " + TranslationBase.of(context).km; return " - " + distance + " " + TranslationBase.of(context).km;
@ -150,6 +175,9 @@ class _ExpandableListViewState extends State<ExpandableListView> {
return ""; return "";
} }
} }
sortByProject() {}
sortByClinic() {}
} }
class ExpandableContainer extends StatelessWidget { class ExpandableContainer extends StatelessWidget {
@ -172,9 +200,12 @@ class ExpandableContainer extends StatelessWidget {
duration: new Duration(milliseconds: 500), duration: new Duration(milliseconds: 500),
curve: Curves.easeInOut, curve: Curves.easeInOut,
width: screenWidth, width: screenWidth,
height: expanded ? MediaQuery.of(context).size.height : collapsedHeight, height: expanded
? (ExpandableListView.doctorListheight * 160).toDouble()
: collapsedHeight,
child: new Container( child: new Container(
child: child, child: child,
padding: EdgeInsets.only(bottom: 30),
decoration: new BoxDecoration( decoration: new BoxDecoration(
border: new Border.all(width: 1.0, color: Colors.white)), border: new Border.all(width: 1.0, color: Colors.white)),
), ),

@ -14,6 +14,7 @@ class DoctorView extends StatelessWidget {
bool isLiveCareAppointment; bool isLiveCareAppointment;
DoctorView({@required this.doctor, @required this.isLiveCareAppointment}); DoctorView({@required this.doctor, @required this.isLiveCareAppointment});
@override @override

@ -1,6 +1,7 @@
import 'package:device_calendar/device_calendar.dart'; import 'package:device_calendar/device_calendar.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/add_newchild_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/create_new_user_model.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/user_information_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/add_new_child_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/add_new_child_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
@ -19,8 +20,6 @@ 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:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
enum Gender { Male, Female, NON } enum Gender { Male, Female, NON }
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
@ -56,6 +55,7 @@ class AddNewChildPage extends StatefulWidget {
DateTime.now().day, (hour * count))); DateTime.now().day, (hour * count)));
} }
} }
@override @override
_AddNewChildPageState createState() => _AddNewChildPageState(); _AddNewChildPageState createState() => _AddNewChildPageState();
} }
@ -75,15 +75,17 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
TextEditingController _notesTextController = TextEditingController(); TextEditingController _notesTextController = TextEditingController();
BeneficiaryType beneficiaryType = BeneficiaryType.NON; BeneficiaryType beneficiaryType = BeneficiaryType.NON;
Gender gender = Gender.Male; Gender gender = Gender.Male;
CreateNewUser_New newUserChild = CreateNewUser_New();
//ChildVaccinesViewModel addvancedModel = ChildVaccinesViewModel(); //ChildVaccinesViewModel addvancedModel = ChildVaccinesViewModel();
List_BabyInformationModel addvancedModel = List_BabyInformationModel(); List_BabyInformationModel addvancedModel = List_BabyInformationModel();
CreateNewBaby newChild=CreateNewBaby(); CreateNewBaby newChild = CreateNewBaby();
List_UserInformationModel informationModel =List_UserInformationModel(); List_UserInformationModel informationModel = List_UserInformationModel();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<AddNewChildViewModel>( return BaseView<AddNewChildViewModel>(
builder: (_,model,w)=> AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: "Vaccintion", appBarTitle: "Vaccintion",
body: SingleChildScrollView( body: SingleChildScrollView(
@ -97,7 +99,8 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
height: 50, height: 50,
), ),
Texts( Texts(
"Add the child's information below to recieve the schedule of vaccinations.", //+model.user.firstName, "Add the child's information below to recieve the schedule of vaccinations.",
//+model.user.firstName,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
SizedBox( SizedBox(
@ -130,22 +133,25 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
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: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Container( Container(
height: MediaQuery.of(context).size.height * 0.12, height: MediaQuery.of(context).size.height * 0.12,
width: 170, width: 175,
color: Colors.white,
child: SecondaryButton( child: SecondaryButton(
textColor: textColor:
checkedValue == 1 ? Colors.white : Colors.black, checkedValue == 1 ? Colors.white : Colors.black,
color: checkedValue == 1 ? Colors.red : Colors.white, color: checkedValue == 1 ? Colors.red : Colors.white,
label: "Male", label: "Male",
// //
onTap: () { onTap: () {
// bloodDetails.city=_selectedHospital.toString();
setState(() { setState(() {
checkedValue = 1; checkedValue = 1;
print("checkedValue=" + checkedValue.toString()); print("checkedValue=" + checkedValue.toString());
@ -157,10 +163,11 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
), ),
Container( Container(
height: MediaQuery.of(context).size.height * 0.12, height: MediaQuery.of(context).size.height * 0.12,
width: 170, width: 175,
color: Colors.white,
child: SecondaryButton( child: SecondaryButton(
textColor: textColor:
checkedValue == 2 ? Colors.white : Colors.black, checkedValue == 2 ? Colors.white : Colors.black,
color: checkedValue == 2 ? Colors.red : Colors.white, color: checkedValue == 2 ? Colors.red : Colors.white,
label: "Female", label: "Female",
// //
@ -220,9 +227,8 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(//getStartDay() Texts(//getStartDay()
// DateUtil.yearMonthDay(DateTime.now()) // DateUtil.yearMonthDay(DateTime.now())
getStartDay() getStartDay()),
),
Icon( Icon(
Icons.calendar_today, Icons.calendar_today,
color: Colors.black, color: Colors.black,
@ -234,62 +240,47 @@ class _AddNewChildPageState extends State<AddNewChildPage> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
//========= Container(
], height: MediaQuery.of(context).size.height * 0.12,
), width: double.infinity,
), padding: EdgeInsets.all(15),
), child: SecondaryButton(
bottomSheet: Container( textColor: Colors.white,
height: MediaQuery.of(context).size.height * 0.12, color: checkedValue == false
width: double.infinity, ? Colors.white24
padding: EdgeInsets.all(12), : Color.fromRGBO(
child: SecondaryButton( 63,
textColor: Colors.white, 72,
color: checkedValue == false 74,
? Colors.white24 1,
: Color.fromRGBO( ),
63, label: "Add",
72, //
74, onTap: () async{
1, newChild.babyName = _firstTextController.text + " " + _secondTextController.text;
), newChild.gender = checkedValue.toString();
label: "Add", newChild.strDOB = getStartDay();
// newChild.tempValue = true;
onTap: () { newChild.isLogin = true;
newChild.babyName =
_firstTextController.text + " " + _secondTextController.text;
newChild.gender = checkedValue.toString();
newChild.strDOB=getStartDay() ;
newChild.alertBy=addvancedModel.alertBy;
newChild.createdBy=informationModel.createdBy ;
newChild.editedBy=informationModel.createdBy;
newChild.tempValue=true;
// newChild.userID=46013;//informationModel.userID;
newChild.isLogin=true;
//newChild.tokenID='qMgbP94U23RkXtWWT0Sw==';
//'ZBGoQFUG50eQJd6Y7u1ykA==';
model.getNewBabyOrders(newChild: newChild);
await model.createNewBabyOrders(newChild: newChild);
if(model.isAdded){
AppToast.showSuccessToast(message: "Record Added");
Navigator.pop(context,model.isAdded);
}else{
AppToast.showSuccessToast(message: "Record Added"); //TODO handling error
//============ }
Navigator.push(
context,
FadePage(
page: ChildPage(),
},
),
), ),
); //=========
//============== ],
),
// bloodDetails.
},
), ),
), ),
// bottomSheet:
), ),
); );
} }

@ -1,8 +1,10 @@
import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart';
import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart';
import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -11,140 +13,190 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class ChildPage extends StatefulWidget { import 'dialogs/delete_child.dart';
class ChildPage extends StatefulWidget {
@override @override
_ChildPageState createState() => _ChildPageState(); _ChildPageState createState() => _ChildPageState();
} }
class _ChildPageState extends State<ChildPage> with SingleTickerProviderStateMixin { class _ChildPageState extends State<ChildPage>
with SingleTickerProviderStateMixin {
DeleteBaby deleteBaby = DeleteBaby();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var checkedValue= true; var checkedValue = true;
return BaseView<ChildVaccinesViewModel>( return BaseView<ChildVaccinesViewModel>(
onModelReady: (model) => model.getBabyInformatioRequestOrders(),//model.getCOC(),getFindUsRequestOrders() onModelReady: (model) => model.getNewUserOrders(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: " Vaccination", appBarTitle: " Vaccination",
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
margin: EdgeInsets.only(left: 15,right: 15,top: 70), margin: EdgeInsets.only(left: 15, right: 15, top: 70),
child: Column( child: Column(
children: [ children: [
...List.generate(model.babyInformationModelList.length, (index) => ...List.generate(
Container( model.babyInformationModelList.length,
decoration: BoxDecoration( (index) => Container(
shape: BoxShape.rectangle, margin: EdgeInsets.only(
border: Border.all(color: Colors.white, width: 0.5), left: 0, right: 0, bottom: 20),
borderRadius: BorderRadius.all(Radius.circular(5)),
color: Colors.white, decoration: BoxDecoration(
shape: BoxShape.rectangle,
), border: Border.all(
padding: EdgeInsets.all(12), color: Colors.white, width: 0.5),
borderRadius:
BorderRadius.all(Radius.circular(5)),
color: Colors.white,
),
padding: EdgeInsets.all(12),
width: 200,//double.infinity,
child: Column(
children: [
Row(children: [
Texts("CHILD NAME"),
]),
Row(children: [
Texts(model
.babyInformationModelList[index]
.babyName
.trim()),
]),
Row(children: [
IconButton(
icon: Image.asset(model
.babyInformationModelList[
index]
.gender ==
1
? 'assets/images/new-design/male.png'
: 'assets/images/new-design/female.png'),
tooltip: '',
onPressed: () {
setState(() {
// _volume += 10;
// launch("tel://" +model.FindusHospitalModelList[index].phoneNumber);
});
},
),
Texts(model
.babyInformationModelList[index]
.genderDescription),
IconButton(
icon: Icon(
Icons.remove_red_eye,
color: Colors.red,
),
tooltip: '',
onPressed: () {
Navigator.push(
context,
FadePage(
page: VaccinationTablePage(),
),
);
},
)
]),
Row(children: [
Texts("Birthday"),
]),
Row(children: [
IconButton(
icon: new Image.asset(
'assets/images/new-design/calender-secondary.png'),
tooltip: '',
onPressed: () {
setState(() {
});
},
),
Texts(DateUtil.yearMonthDay(model
.babyInformationModelList[index]
.dOB)),
]),
Row(children: [
IconButton(
icon: new Image.asset(
'assets/images/new-design/garbage.png'),
tooltip: '',
onPressed: ()async {
//=====================
await model.deleteBabyOrders(newChild:deleteBaby );
deleteBaby.babyID=model.babyInformationModelList[index]
.babyID;
await model.deleteBabyOrders(newChild:deleteBaby );
if(model.isDeleted){
AppToast.showSuccessToast(message: "Record Deleted");
Navigator.pop(context,model.isDeleted);
}else{
//TODO handling error
}
},
),
Texts("Delete"),
]),
SizedBox(
height: 12,
),
],
),
),
)
],
))
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity, width: double.infinity,
child: Column( padding: EdgeInsets.all(15),
child: SecondaryButton(
children: [ textColor: Colors.white,
Row(children:[Texts("CHILD NAME"),]), color: checkedValue == false
Row(children:[Texts(model.babyInformationModelList[index].babyName.trim()),]), ? Colors.white24
: Color.fromRGBO(
Row( 63,
children: [IconButton( 72,
icon: Image.asset(model.babyInformationModelList[index].gender==1? 'assets/images/new-design/male.png':'assets/images/new-design/female.png'), 74,
tooltip: '', 1,
onPressed: () { ),
setState(() { label: "ADD NEW CHILD ",
// _volume += 10; //
// launch("tel://" +model.FindusHospitalModelList[index].phoneNumber); onTap: () {
}); Navigator.push(
}, context,
), MaterialPageRoute(
Texts(model.babyInformationModelList[index].genderDescription), builder: (context) => AddNewChildPage(),
IconButton( ),
icon: Icon(Icons.remove_red_eye,color: Colors.red,), ).then((value) {
tooltip: 'Increase volume by 10', if (value) model.getNewUserOrders();
onPressed: () { });
Navigator.push( },
context, ),
FadePage( ),
page: VaccinationTablePage(), ));
//ChildPage(babyInformationModelList:model.BabyInformationModelList)
// HospitalsPage(
// findusHospitalModelList: model.FindusHospitalModelList,
// )
),
);
// setState(() {
// // _volume += 10;
// // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber);
// });
},
)]
),
Row(children:[Texts("Birthday"),]),
Row(children:[IconButton(
icon: new Image.asset('assets/images/new-design/calender-secondary.png'),
tooltip: 'Increase volume by 10',
onPressed: () {
setState(() {
// _volume += 10;
// launch("tel://" +model.FindusHospitalModelList[index].phoneNumber);
});
},
),
Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]),
Row(children:[IconButton(
icon: new Image.asset('assets/images/new-design/garbage.png'),
tooltip: '',
onPressed: () {
setState(() {
// _volume += 10;
// launch("tel://" +model.FindusHospitalModelList[index].phoneNumber);
});
},
),
Texts("Birthday"),]),
],
)
)
)
],
)
)
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12,
width: double.infinity,
padding: EdgeInsets.all(12),
child: SecondaryButton(
textColor: Colors.white,
color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,),
label: "ADD NEW CHILD ",
//
onTap: () => Navigator.push(
context,
FadePage(
page: AddNewChildPage(),
),
),
),
),
)
);
} }
} }

@ -29,7 +29,7 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<UserInformationViewModel>( return BaseView<UserInformationViewModel>(
onModelReady: (model) => model.getUserInformatioRequestOrders(), onModelReady: (model) => model.getUserInformationRequestOrders(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
@ -50,7 +50,8 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
child: Texts("Welcome back",fontSize: 20,), child: Texts("Welcome back",fontSize: 20,),
) , ) ,
), ),
Divider(color:Colors.black ,), Divider(color:Colors.black , indent: 10,
endIndent: 10,),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
@ -61,13 +62,17 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
) , ) ,
), ),
Divider(color:Colors.black ,), Divider(color:Colors.black , indent: 10,
endIndent: 10,),
Padding( Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
child:Container( child:Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
child: TextFields( child: TextFields(
hintText: model.user.emailAddress,//'Title', fillColor: Colors.red,
hintText: model.user.emailAddress,
controller: titleController, controller: titleController,
fontSize: 20, fontSize: 20,
hintColor: Colors.black, hintColor: Colors.black,
@ -75,9 +80,7 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
onChanged: (text) { onChanged: (text) {
addEmail=text; addEmail=text;
model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true; model.user.emailAddress==addEmail?checkedValue=false:checkedValue=true;
// checkedValue=true;
// print("First text field: $text");
// print("First text field:"+ model.user.emailAddress);
}, },
validator: (value) { validator: (value) {
@ -99,7 +102,7 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
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(15),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,), color: checkedValue== false ?Colors.white24:Color.fromRGBO(63, 72, 74, 1,),
@ -121,7 +124,7 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
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(15),
child: SecondaryButton( child: SecondaryButton(
textColor: Colors.white, textColor: Colors.white,
color: Color.fromRGBO(63, 72, 74, 1,), color: Color.fromRGBO(63, 72, 74, 1,),
@ -132,10 +135,7 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
FadePage( FadePage(
page: ChildPage(), page: ChildPage(),
//ChildPage(babyInformationModelList:model.BabyInformationModelList)
// HospitalsPage(
// findusHospitalModelList: model.FindusHospitalModelList,
// )
), ),
), ),
@ -143,6 +143,7 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
), ),
), ),
// Texts( // Texts(
// // TranslationBase.of(context).advancePaymentLabel, // // TranslationBase.of(context).advancePaymentLabel,
// model.user.emailAddress, // model.user.emailAddress,
@ -151,253 +152,21 @@ class _ChildVaccinesPageState extends State<ChildVaccinesPage>
SizedBox( SizedBox(
height: 12, height: 12,
), ),
// InkWell(
// onTap: () => confirmSelectHospitalDialog(model.CitiesModelList),//model.hospitals
// 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(getHospitalName()),
// Icon(Icons.arrow_drop_down)
// ],
// ),
// ),
// ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
// InkWell(
// //======Gender========
// onTap: () => confirmSelectGenderDialog(),//confirmSelectBeneficiaryDialog(model),
// 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(getBeneficiaryType()),
// Texts(getGender()),
// 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(
// //======Gender========
// onTap: () => confirmSelectBloodDialog(),//confirmSelectBeneficiaryDialog(model),
// 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(getBeneficiaryType()),
// Texts(getBlood()),
// 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,
), ),
// Row(
// children: [
// Container(
// child: Text(" To view the terms and conditions "),
// ),
// SizedBox(
// width: MediaQuery.of(context).size.height * 0.10,
// ),
// // InkWell(
// // onTap: () {
// // Navigator.of(context).push(MaterialPageRoute(
// // builder: (BuildContext context) => UserAgreementPage()));
// // },
// // child: Container(
// // child: Texts(" Click here ",color: Colors.blue,),
// // ),
// // )
// ],
// ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
// Row(
// children: [
// Checkbox(
// onChanged: (bool value) {
// setState(() {
// checkedValue = value;
// });
// },
// // tristate: checkedValue==true,//i == 1,
// value: checkedValue,
// activeColor: Colors.red,//Color(0xFF6200EE),
// ),
// SizedBox(height: 10,),
// Row(children: [
//
// ],),
// SizedBox(
// width: 10,
// ),
// Text(
// 'I agree to the terms and conditions ',
// style: Theme.of(context).textTheme.subtitle1.copyWith(color: checkedValue? Colors.red : 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,
), ),

@ -1,10 +1,14 @@
import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/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';
class SelectGenderDialog extends StatefulWidget { class SelectGenderDialog extends StatefulWidget {
final Email;
const SelectGenderDialog({Key key, this.Email}) : super(key: key);
@override @override
_SelectGenderDialogState createState() => _SelectGenderDialogState(); _SelectGenderDialogState createState() => _SelectGenderDialogState();
} }
@ -31,6 +35,7 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
child: ListTile( child: ListTile(
title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "), title: Text("Send the child's schedule to the email\n Tamer.dasdasdas@gmail.com "),
), ),
), ),
) )
@ -77,6 +82,7 @@ class _SelectGenderDialogState extends State<SelectGenderDialog> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
AppToast.showSuccessToast(message: "Email Sended");
// widget.onValueSelected(beneficiaryType); // widget.onValueSelected(beneficiaryType);
Navigator.pop(context); Navigator.pop(context);
}, },

@ -0,0 +1,103 @@
import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class DeleteChild extends StatefulWidget {
@override
_DeleteChildState createState() => _DeleteChildState();
}
class _DeleteChildState extends State<DeleteChild> {
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Container(
child: Column(
children: [
Divider(),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
setState(() {
//beneficiaryType = Gender.Male;
});
},
child: ListTile(
title: Text("Delete the child "),
),
),
)
],
),
SizedBox(
height: 5.0,
),
SizedBox(
height: 5.0,
),
SizedBox(
height: 5.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
// widget.onValueSelected(beneficiaryType);
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
),
),
),
),
),
],
)
],
),
)
],
);
}
}

@ -61,67 +61,7 @@ class VaccinationTablePage extends StatelessWidget {
],), ],),
Divider(color:Colors.black ,), Divider(color:Colors.black ,),
// Row(children:[Texts("CHILD NAME"),]),
// Row(children:[Texts(model.babyInformationModelList[index].babyName.trim()),]),
// Row(
// children: [IconButton(
// icon: Image.asset(model.babyInformationModelList[index].gender==1? 'assets/images/new-design/male.png':'assets/images/new-design/female.png'),
// tooltip: '',
// onPressed: () {
// setState(() {
// // _volume += 10;
// // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber);
// });
// },
// ),
// Texts(model.babyInformationModelList[index].genderDescription),
// IconButton(
// icon: Icon(Icons.remove_red_eye,color: Colors.red,),
// tooltip: 'Increase volume by 10',
// onPressed: () {
// Navigator.push(
// context,
// FadePage(
// page: VaccinationTablePage(),
//
// //ChildPage(babyInformationModelList:model.BabyInformationModelList)
// // HospitalsPage(
// // findusHospitalModelList: model.FindusHospitalModelList,
// // )
//
// ),
// );
// // setState(() {
// // // _volume += 10;
// // // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber);
// // });
// },
// )]
// ),
// Row(children:[Texts("Birthday"),]),
// Row(children:[IconButton(
// icon: new Image.asset('assets/images/new-design/calender-secondary.png'),
// tooltip: 'Increase volume by 10',
// onPressed: () {
// setState(() {
// // _volume += 10;
// // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber);
// });
// },
// ),
// Texts(DateUtil.yearMonthDay(model.babyInformationModelList[index].dOB)),]),
// Row(children:[IconButton(
// icon: new Image.asset('assets/images/new-design/garbage.png'),
// tooltip: '',
// onPressed: () {
// setState(() {
// // _volume += 10;
// // launch("tel://" +model.FindusHospitalModelList[index].phoneNumber);
// });
// },
// ),
// Texts("Birthday"),]),
], ],
) )

@ -138,8 +138,7 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
))), //model.cOCItemList[index].cOCTitl ))), //model.cOCItemList[index].cOCTitl
IconButton( IconButton(
icon: Icon( icon: Icon(
Icons Icons.arrow_forward_ios,
.arrow_forward,
color: color:
tappedIndex == index tappedIndex == index
? Colors.white ? Colors.white

@ -6,12 +6,12 @@ import 'package:flutter/material.dart';
import '../../uitl/translations_delegate_base.dart'; import '../../uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart';
class HmgServicePage extends StatefulWidget { class ContactUsPage extends StatefulWidget {
@override @override
_HmgServicePageState createState() => _HmgServicePageState(); _ContactUsPageState createState() => _ContactUsPageState();
} }
class _HmgServicePageState extends State<HmgServicePage> { class _ContactUsPageState extends State<ContactUsPage> {
LocationUtils locationUtils; LocationUtils locationUtils;
@ -29,6 +29,7 @@ class _HmgServicePageState extends State<HmgServicePage> {
return AppScaffold( return AppScaffold(
isShowAppBar: true,//widget.isAppbar, isShowAppBar: true,//widget.isAppbar,
appBarTitle: "HMG Services",//TranslationBase.of(context).bookAppo, appBarTitle: "HMG Services",//TranslationBase.of(context).bookAppo,
isShowDecPage: false,
body: Container( body: Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Column( child: Column(

@ -115,7 +115,7 @@ class _HospitalsPageState extends State<HospitalsPage> {
CrossAxisAlignment.center, CrossAxisAlignment.center,
children: [ children: [
IconButton( IconButton(
// icon: Icon(Icons.person_pin_circle_outlined,color: Colors.red,), // icon: Icon(Icons.location_on,color: Colors.red,),
icon: new Image.asset( icon: new Image.asset(
'assets/images/new-design/navigate.png'), 'assets/images/new-design/navigate.png'),
tooltip: '', tooltip: '',

@ -141,7 +141,7 @@ class _PharmaciesPageState extends State<PharmaciesPage> {
IconButton( IconButton(
// icon: Icon( // icon: Icon(
// Icons // Icons
// .person_pin_circle_outlined, // .location_on,
// color: Colors.red, // color: Colors.red,
// ), // ),
icon: new Image.asset( icon: new Image.asset(

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart';
@ -9,6 +10,9 @@ 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 'AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart';
import 'OrderLogPage.dart';
class AmbulanceReq extends StatefulWidget { class AmbulanceReq extends StatefulWidget {
@override @override
_AmbulanceReqState createState() => _AmbulanceReqState(); _AmbulanceReqState createState() => _AmbulanceReqState();
@ -23,18 +27,21 @@ class _AmbulanceReqState extends State<AmbulanceReq>
super.initState(); super.initState();
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 2, vsync: this);
} }
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
_tabController.dispose(); _tabController.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PrescriptionsViewModel>( return BaseView<AmRequestViewModel>(
onModelReady: (model) => model.getPrescriptions(), onModelReady: (model) => model.getAmRequestOrders(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: "Ambulance Request", appBarTitle: "Ambulance Request",
baseViewModel: model,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(
@ -76,13 +83,14 @@ class _AmbulanceReqState extends State<AmbulanceReq>
indicatorColor: Colors.red[800], indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.40, width: MediaQuery.of(context).size.width * 0.40,
child: Center( child: Center(
child: Texts("Ambulance Request"),//TranslationBase.of(context).prescriptions child: Texts(
"Ambulance Request"), //TranslationBase.of(context).prescriptions
), ),
), ),
Container( Container(
@ -106,11 +114,13 @@ class _AmbulanceReqState extends State<AmbulanceReq>
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: <Widget>[ children: <Widget>[
PrescriptionsPage( model.hasPendingOrder
prescriptionsViewModel: model, ? Container()
), : AmbulanceRequestIndexPage(
PrescriptionsHistoryPage( amRequestViewModel: model,
prescriptionsViewModel: model, ),
OrderLogPage(
amRequestViewModel: model,
) )
], ],
), ),
@ -121,5 +131,4 @@ class _AmbulanceReqState extends State<AmbulanceReq>
), ),
); );
} }
} }

@ -0,0 +1,87 @@
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'BillAmount.dart';
import 'PickupLocation.dart';
import 'SelectTransportationMethod.dart';
import 'Summary.dart';
class AmbulanceRequestIndexPage extends StatefulWidget {
final AmRequestViewModel amRequestViewModel;
AmbulanceRequestIndexPage({Key key, this.amRequestViewModel});
@override
_AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState();
}
class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
int currentIndex = 0;
PageController pageController;
PatientER _patientER = PatientER();
_changeCurrentTab(int tab) {
setState(() {
currentIndex = tab;
});
pageController.animateToPage(tab,
duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
}
@override
void initState() {
super.initState();
pageController = new PageController();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
body: Column(
children: [
SizedBox(
height: 80,
),
Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: StepsWidget(
index: currentIndex,
changeCurrentTab: _changeCurrentTab,
)),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: <Widget>[
//Container(),
SelectTransportationMethod(
changeCurrentTab: _changeCurrentTab,
patientER: _patientER,
amRequestViewModel: widget.amRequestViewModel,
),
PickupLocation(
changeCurrentTab: _changeCurrentTab,
patientER: _patientER,
amRequestViewModel: widget.amRequestViewModel,
),
BillAmount(
changeCurrentTab: _changeCurrentTab,
patientER: _patientER,
amRequestViewModel: widget.amRequestViewModel,
),
Summary(
changeCurrentTab: _changeCurrentTab,
patientER: _patientER,
amRequestViewModel: widget.amRequestViewModel,
),
],
),
),
],
),
);
}
}

@ -0,0 +1,351 @@
import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class BillAmount extends StatefulWidget {
final Function changeCurrentTab;
final PatientER patientER;
final AmRequestViewModel amRequestViewModel;
BillAmount(
{Key key,
this.changeCurrentTab,
this.patientER,
this.amRequestViewModel});
@override
_BillAmountState createState() => _BillAmountState();
}
class _BillAmountState extends State<BillAmount> {
Ambulate _ambulate = Ambulate.None;
String note ="";
@override
void initState() {
if(widget.patientER.ambulate!=null)
{
setState(() {
_ambulate = widget.patientER.ambulate;
note = widget.patientER.requesterNote;
});
}
super.initState();
}
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Bill Amount '),
SizedBox(
height: 10,
),
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 1.0, color: Colors.grey[300]),
outside: BorderSide(width: 1.0, color: Colors.grey[300])),
children: [
TableRow(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
'Amount before tax: ',
textAlign: TextAlign.start,
color: Colors.black,
fontSize: 15,
),
),
),
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
'SR ${widget.patientER.patientERTransportationMethod.price}',
color: Colors.black,
textAlign: TextAlign.start,
fontSize: 15,
),
),
),
],
),
TableRow(
children: [
Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.09,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
'Tax amount :',
color: Colors.black,
fontSize: 15,
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(
'SR ${widget.patientER.patientERTransportationMethod.vAT}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
),
),
],
),
TableRow(
children: [
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
'Total amount payable',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
bold: true,
),
),
),
Container(
height: MediaQuery.of(context).size.height * 0.09,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(10.0),
),
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Texts(
'SR ${widget.patientER.patientERTransportationMethod.totalPrice}',
color: Colors.black,
fontSize: 15,
textAlign: TextAlign.start,
),
),
),
],
),
],
),
SizedBox(
height: 10,
),
Texts('Select Ambulate',bold: true,),
SizedBox(height: 5,),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Wheelchair;
});
},
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: Text('Wheelchair'),
leading: Radio(
value: Ambulate.Wheelchair,
groupValue: _ambulate,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Walker;
});
},
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: Text('Walker'),
leading: Radio(
value: Ambulate.Walker,
groupValue: _ambulate,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
),
),
),
),
],
),
SizedBox(height: 5,),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.Stretcher;
});
},
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: Text('Stretcher'),
leading: Radio(
value: Ambulate.Stretcher,
groupValue: _ambulate,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_ambulate = Ambulate.None;
});
},
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: Text('None'),
leading: Radio(
value: Ambulate.None,
groupValue: _ambulate,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_ambulate = value;
});
},
),
),
),
),
),
],
),
SizedBox(height: 12,),
NewTextFields(
hintText: 'Note',
initialValue: note,
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(() {
widget.patientER.ambulate = _ambulate;
widget.patientER.requesterNote = note;
widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber();
widget.changeCurrentTab(3);
});
},
label: 'Next',
),
)
],
),
),
);
}
}

@ -0,0 +1,473 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/Blood/dialogs/SelectHospitalDialog.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:geolocator/geolocator.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';
enum HaveAppointment { YES, NO }
class PickupLocation extends StatefulWidget {
final Function changeCurrentTab;
final PatientER patientER;
final AmRequestViewModel amRequestViewModel;
PickupLocation(
{Key key,
this.changeCurrentTab,
this.patientER,
this.amRequestViewModel});
@override
_PickupLocationState createState() => _PickupLocationState();
}
class _PickupLocationState extends State<PickupLocation> {
bool _isInsideHome = false;
HaveAppointment _haveAppointment = HaveAppointment.NO;
double _latitude;
double _longitude;
AppoitmentAllHistoryResultList myAppointment;
HospitalsModel _selectedHospital;
PickResult _result;
@override
void initState() {
super.initState();
_getCurrentLocation();
}
_getCurrentLocation() async {
await getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
// currentLocation = LatLng(position.latitude, position.longitude);
}
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.patientER.direction == 1)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Pickup Location'),
SizedBox(
height: 15,
),
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('Select From Map'),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
),
),
SizedBox(
height: 12,
),
Texts('Pickup Spot'),
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('Inside Home'),
leading: Checkbox(
activeColor: Colors.red[800],
value: _isInsideHome,
onChanged: (value) {
setState(() {
_isInsideHome = value;
});
},
),
),
),
),
SizedBox(
height: 12,
),
Texts('Do you have an appointment ?'),
SizedBox(
height: 5,
),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
if (myAppointment == null) {
getAppointment();
setState(() {
_haveAppointment = HaveAppointment.YES;
});
}
},
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: Text('Yes'),
leading: Radio(
value: HaveAppointment.YES,
groupValue: _haveAppointment,
activeColor: Colors.red[800],
onChanged: (value) {
if (myAppointment == null) {
getAppointment();
setState(() {
_haveAppointment = value;
});
}
},
),
),
),
),
),
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: Text('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(
height: 12,
),
Texts('Drop off Location'),
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: [
Texts(getHospitalName('Pickup Location')),
Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
)
],
),
),
),
],
),
if (widget.patientER.direction == 1)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Pickup Location'),
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('Pickup Location')),
Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
)
],
),
),
),
SizedBox(
height: 12,
),
Texts('Drop off Location'),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PlacePicker(
apiKey: 'AIzaSyCiD4YqVqLNYbt8-htvFy4Wp8XSph9E3wM',
// Put YOUR OWN KEY here.
onPlacePicked: (PickResult result) {
print(result.adrAddress);
setState(() {
_result = result;
});
Navigator.of(context).pop();
},
initialPosition: LatLng(_latitude, _longitude),
useCurrentLocation: true,
),
),
);
},
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('Select From Map'),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
),
),
),
],
),
//TODO show dialog projects
SizedBox(
height: 45,
),
Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 76,
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
if(_result==null || _selectedHospital == null)
AppToast.showErrorToast(message: 'please select all fields');
else
setState(() {
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
if (widget.patientER.direction == 0) {
widget.patientER.pickupLocationLattitude = _result.geometry.location.lat.toString();
widget.patientER.pickupLocationLongitude = _result.geometry.location.lng.toString();
widget.patientER.dropoffLocationLattitude = _selectedHospital.latitude;
widget.patientER.dropoffLocationLongitude = _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.longitude = widget.patientER.pickupLocationLongitude;
if(_haveAppointment == HaveAppointment.YES){
widget.patientER.appointmentNo = myAppointment.appointmentNo.toString();
widget.patientER.appointmentClinicName = myAppointment.clinicName;
widget.patientER.appointmentDoctorName = myAppointment.doctorNameObj;
widget.patientER.appointmentBranch = myAppointment.projectName;
widget.patientER.appointmentTime = myAppointment.appointmentDate;
}else{
widget.patientER.appointmentNo ="0";
widget.patientER.appointmentClinicName = null;
widget.patientER.appointmentDoctorName = null;
widget.patientER.appointmentBranch = null;
widget.patientER.appointmentTime = null;
}
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
widget.changeCurrentTab(2);
});
},
label: 'Next',
),
)
],
),
),
);
}
void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) {
showDialog(
context: context,
child: SelectHospitalDialog(
hospitals: hospitals,
selectedHospital: _selectedHospital,
onValueSelected: (value) {
setState(() {
_selectedHospital = value;
});
},
),
);
}
String getHospitalName(String title) {
return _selectedHospital == null ? title : _selectedHospital.name;
}
getAppointment() {
ProgressDialogUtil.showProgressDialog(context);
widget.amRequestViewModel.getAppointmentHistory().then((value) {
if (widget.amRequestViewModel.state == ViewState.Error ||
widget.amRequestViewModel.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: widget.amRequestViewModel.error);
} else if (widget
.amRequestViewModel.appoitmentAllHistoryResultList.length >
0) {
ProgressDialogUtil.hideProgressDialog(context);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AvailableAppointmentsPage(
appointmentsAllHistoryList:
widget.amRequestViewModel.appoitmentAllHistoryResultList,
),
),
).then((value) {
if (value != null)
setState(() {
myAppointment = value;
});
else {
ProgressDialogUtil.hideProgressDialog(context);
setState(() {
_haveAppointment = HaveAppointment.NO;
});
}
});
} else {
ProgressDialogUtil.hideProgressDialog(context);
setState(() {
_haveAppointment = HaveAppointment.NO;
});
AppToast.showErrorToast(message: 'You don\'t have any appointment');
}
}).catchError((e) {
ProgressDialogUtil.hideProgressDialog(context);
AppToast.showErrorToast(message: e);
});
}
}

@ -0,0 +1,309 @@
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/get_all_transportation_method_list_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
enum Direction { ToHospital, FromHospital }
enum Way { OneWay, TwoWays }
class SelectTransportationMethod extends StatefulWidget {
final Function changeCurrentTab;
final PatientER patientER;
final AmRequestViewModel amRequestViewModel;
SelectTransportationMethod(
{Key key,
this.changeCurrentTab,
this.patientER,
this.amRequestViewModel});
@override
_SelectTransportationMethodState createState() =>
_SelectTransportationMethodState();
}
class _SelectTransportationMethodState
extends State<SelectTransportationMethod> {
PatientERTransportationMethod _erTransportationMethod =
PatientERTransportationMethod();
Direction _direction = Direction.FromHospital;
Way _way = Way.OneWay;
OrderService _orderService = OrderService.AMBULANCE;
@override
void initState() {
super.initState();
if (widget.patientER.direction != null) {
_direction = widget.patientER.direction == 0
? Direction.ToHospital
: Direction.FromHospital;
_way = widget.patientER.tripType == 1 ? Way.OneWay : Way.TwoWays;
_erTransportationMethod = widget.amRequestViewModel
.amRequestModeList[(widget.patientER.selectedAmbulate - 1)];
} else {
if (widget.amRequestViewModel.amRequestModeList.length != 0)
_erTransportationMethod = widget.amRequestViewModel.amRequestModeList[
widget.amRequestViewModel.amRequestModeList.length - 1];
}
}
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Texts('Select Transportation Method'),
...List.generate(
widget.amRequestViewModel.amRequestModeList.length,
(index) => InkWell(
onTap: () {
setState(() {
_erTransportationMethod =
widget.amRequestViewModel.amRequestModeList[index];
});
},
child: Container(
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
children: [
Expanded(
flex: 3,
child: ListTile(
title: Text(widget.amRequestViewModel
.amRequestModeList[index].title),
leading: Radio(
value: widget
.amRequestViewModel.amRequestModeList[index],
groupValue: _erTransportationMethod,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_erTransportationMethod = value;
});
},
),
),
),
Expanded(
flex: 1,
child: Texts(
'SR ${widget.amRequestViewModel.amRequestModeList[index].price}'),
)
],
),
),
),
),
SizedBox(
height: 12,
),
Texts('Select Direction'),
SizedBox(
height: 5,
),
Container(
width: double.maxFinite,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_direction = Direction.ToHospital;
});
},
child: Container(
width: double.maxFinite,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text('To Hospital'),
leading: Radio(
value: Direction.ToHospital,
groupValue: _direction,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_direction = value;
});
},
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_direction = Direction.FromHospital;
});
},
child: Container(
width: double.maxFinite,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: ListTile(
title: Text('Form Hospital'),
leading: Radio(
value: Direction.FromHospital,
groupValue: _direction,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_direction = value;
});
},
),
),
),
),
),
],
),
),
if (_direction == Direction.ToHospital)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 8,
),
Texts('Select Direction'),
SizedBox(
height: 5,
),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
setState(() {
_way = Way.OneWay;
});
},
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: Text('One Way'),
leading: Radio(
value: Way.OneWay,
groupValue: _way,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_way = value;
});
},
),
),
),
),
),
Expanded(
child: InkWell(
onTap: () {
setState(() {
_way = Way.TwoWays;
});
},
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: Text('Two Ways'),
leading: Radio(
value: Way.TwoWays,
groupValue: _way,
activeColor: Colors.red[800],
onChanged: (value) {
setState(() {
_way = 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(() {
widget.patientER.direction = _direction == Direction.ToHospital ? 0 : 1;
widget.patientER.tripType = _way == Way.TwoWays ? 2 : 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: 'Next',
),
)
],
),
),
);
}
}

@ -0,0 +1,105 @@
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
class Summary extends StatefulWidget {
final Function changeCurrentTab;
final PatientER patientER;
final AmRequestViewModel amRequestViewModel;
Summary({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel});
@override
_SummaryState createState() => _SummaryState();
}
class _SummaryState extends State<Summary> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Summary'),
SizedBox(height: 5,),
Container(
width: double.infinity,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Transportation Method',color: Colors.grey,),
Texts('${widget.patientER.patientERTransportationMethod.title}',bold: true,),
SizedBox(height: 8,),
Texts('Direction',color: Colors.grey,),
Texts('From Hospital',bold: true,),
SizedBox(height: 8,),
Texts('Pickup Location',color: Colors.grey,),
Texts('SZR Medical Center',bold: true,),
SizedBox(height: 8,),
Texts('Drop off location',color: Colors.grey,),
Texts('6199, Al Ameen wlfn nif',bold: true,),
SizedBox(height: 8,),
Texts('Select Ambulate',color: Colors.grey,),
Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,),
SizedBox(height: 8,),
Texts('Note',color: Colors.grey,),
Texts('${widget.patientER.requesterNote?? '---'}',bold: true,),
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(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts('Total amount payable:'),
Texts('SR ${widget.patientER.patientERTransportationMethod.totalPrice}')
],
),
),
SizedBox(height: 45,),
Container(
padding: EdgeInsets.all(15),
width: double.maxFinite,
height: 76,
child:SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
label: 'Next',
// onTap: ()=> widget.changeCurrentTab(2),
),
)
],
),
),
);
}
}

@ -0,0 +1,45 @@
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.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/material.dart';
class AvailableAppointmentsPage extends StatelessWidget {
final List<AppoitmentAllHistoryResultList> appointmentsAllHistoryList;
const AvailableAppointmentsPage({Key key, this.appointmentsAllHistoryList})
: super(key: key);
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: 'Available Appointments',
body: SingleChildScrollView(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Texts('Available Appointments'),
SizedBox(
height: 12,
),
...List.generate(
appointmentsAllHistoryList.length,
(index) => InkWell(
onTap: (){
Navigator.pop(context, appointmentsAllHistoryList[index]);
},
child: AppointmentCard(appointment: appointmentsAllHistoryList[index],),
),
)
],
),
),
),
);
}
}

@ -0,0 +1,62 @@
import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class OrderLogPage extends StatelessWidget {
final AmRequestViewModel amRequestViewModel;
OrderLogPage({Key key, @required this.amRequestViewModel});
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.all(10),
padding: EdgeInsets.all(8),
child: ListView.builder(
itemCount: amRequestViewModel.patientAllPresOrdersList.length,
itemBuilder: (context, index) => Container(
margin: EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(2),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
OrderLogItem(
title: 'Request ID',
value: amRequestViewModel.patientAllPresOrdersList[index].iD
.toString(),
),
OrderLogItem(
title: 'Status',
value: amRequestViewModel
.patientAllPresOrdersList[index].description,
),
OrderLogItem(
title: 'Pickup Date',
value: DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(amRequestViewModel
.patientAllPresOrdersList[index].createdOn)),
),
OrderLogItem(
title: 'Pickup Location',
value: amRequestViewModel
.patientAllPresOrdersList[index].pickupLocationName,
),
OrderLogItem(
title: 'Drop off Location',
value: amRequestViewModel
.patientAllPresOrdersList[index].dropoffLocationName,
),
],
),
),
),
);
}
}

@ -0,0 +1,47 @@
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class AppointmentCard extends StatelessWidget {
final AppoitmentAllHistoryResultList appointment;
const AppointmentCard({Key key, this.appointment}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
margin: EdgeInsets.all(8),
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
),
child: Row(
children: [
LargeAvatar(
url: appointment.doctorImageURL,
name: appointment.doctorNameObj,
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(appointment.doctorNameObj,bold: true,),
SizedBox(height: 4,),
Texts(appointment.projectName),
Texts(appointment.clinicName),
Texts(DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointment.bookDate))),
],
),
),
)
],
),
);
}
}

@ -0,0 +1,226 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class StepsWidget extends StatelessWidget {
final int index;
final Function changeCurrentTab;
StepsWidget({Key key, this.index, this.changeCurrentTab});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return projectViewModel.isArabic? Stack(
children: [
Container(
height: 50,
width: MediaQuery.of(context).size.width,
color: Colors.transparent,
child: Center(
child: Divider(
color: Colors.grey,
height: 0.75,
thickness: 0.75,
),
),
),
Positioned(
top: 10,
left: 0,
child: InkWell(
onTap: () => changeCurrentTab(0),
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle,
color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'1',
color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800],
),
),
),
),
),
Positioned(
top: 10,
left: MediaQuery.of(context).size.width * 0.3,
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle,
color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'2',
color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
),
),
),
),
),
Positioned(
top: 10,
left: MediaQuery.of(context).size.width * 0.6,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
shape: BoxShape.circle,
border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75),
color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'3',
color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
),
),
),
),
),
Positioned(
top: 10,
right: 0,
child: InkWell(
onTap: () => index == 2 ?changeCurrentTab(3):null,
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
border: Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle,
color: index == 3 ? Colors.grey[800] : Colors.white,
),
child: Center(
child: Texts(
'4',
color: index == 3 ? Colors.white : Colors.grey[800],
),
),
),
),
),
],
):Stack(
children: [
Container(
height: 50,
width: MediaQuery.of(context).size.width,
color: Colors.transparent,
child: Center(
child: Divider(
color: Colors.grey,
height: 0.75,
thickness: 0.75,
),
),
),
Positioned(
top: 10,
right: 0,
child: InkWell(
onTap: () => changeCurrentTab(0),
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
border: index > 0 ? null:Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle,
color: index == 0 ? Colors.grey[800] : index > 0 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'1',
color: index == 0 ? Colors.white : index > 0 ?Colors.white: Colors.grey[800],
),
),
),
),
),
Positioned(
top: 10,
right: MediaQuery.of(context).size.width * 0.3,
child: InkWell(
onTap: () => index >= 2 ? changeCurrentTab(1) : null,
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
border: index > 1 ? null:Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle,
color: index == 1 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'2',
color: index == 1? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
),
),
),
),
),
Positioned(
top: 10,
right: MediaQuery.of(context).size.width * 0.6,
child: InkWell(
onTap: () => index >= 3 ? changeCurrentTab(2) : null,
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
shape: BoxShape.circle,
border: index > 2 ? null:Border.all(color: Colors.black,width: 0.75),
color: index == 2 ? Colors.grey[800] : index > 1 ?Colors.green: Colors.white,
),
child: Center(
child: Texts(
'3',
color: index == 2? Colors.white : index > 1 ?Colors.white: Colors.grey[800],
),
),
),
),
),
Positioned(
top: 10,
left: 0,
child: InkWell(
onTap: () => index == 2 ?changeCurrentTab(3):null,
child: Container(
width: 35,
height: 35,
decoration: BoxDecoration(
border: Border.all(color: Colors.black,width: 0.75),
shape: BoxShape.circle,
color: index == 3 ? Colors.grey[800] : Colors.white,
),
child: Center(
child: Texts(
'4',
color: index == 3 ? Colors.white : Colors.grey[800],
),
),
),
),
),
],
);
}
}

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCardView.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCardView.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
@ -30,7 +32,7 @@ class _MyAppointmentsState extends State<MyAppointments>
TabController _tabController; TabController _tabController;
bool isDataLoaded = false; bool isDataLoaded = false;
var sharedPref = new AppSharedPreferences();
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 3, vsync: this); _tabController = new TabController(length: 3, vsync: this);
@ -203,100 +205,114 @@ class _MyAppointmentsState extends State<MyAppointments>
}); });
} }
openAppointmentsTab() { openAppointmentsTab() async {
if (widget._patientBookedAppointmentListHospital.length != 0) { var flag = await this.sharedPref.getInt(IS_SEARCH_APPO);
if (flag == 1) {
_tabController.index = 0; _tabController.index = 0;
} else if (widget._patientConfirmedAppointmentListHospital.length != 0) { } else if (flag == 2) {
_tabController.index = 1; _tabController.index = 1;
} else if (widget._patientArrivedAppointmentListHospital.length != 0) { } else if (flag == 3) {
_tabController.index = 2; _tabController.index = 2;
return; } else {
if (widget._patientBookedAppointmentListHospital.length != 0) {
_tabController.index = 0;
} else if (widget._patientConfirmedAppointmentListHospital.length != 0) {
_tabController.index = 1;
} else if (widget._patientArrivedAppointmentListHospital.length != 0) {
_tabController.index = 2;
return;
}
} }
} }
Widget getBookedAppointments() { Widget getBookedAppointments() {
return Container( return Container(
child: widget.bookedAppoList.length != 0 child: widget.bookedAppoList.length != 0
? new ListView.builder( ? new ListView.builder(
itemCount: widget.bookedAppoList.length, itemCount: widget.bookedAppoList.length,
itemBuilder: (context, i) { itemBuilder: (context, i) {
return AppointmentCard( return AppointmentCard(
appo: widget.bookedAppoList[i], appo: widget.bookedAppoList[i],
onReloadAppointmentHistory: getPatientAppointmentHistory, onReloadAppointmentHistory: getPatientAppointmentHistory,
); );
}, },
) )
: Container( : Container(
child: Center( child: Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Image.asset( // Image.asset(
"assets/images/new-design/noAppointmentIcon.png"), // "assets/images/new-design/noAppointmentIcon.png"),
Container( // Container(
margin: EdgeInsets.only(top: 10.0), // margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).noBookedAppointments, // child: Text(TranslationBase.of(context).noBookedAppointments,
style: TextStyle( // style: TextStyle(
fontSize: 16.0, // fontSize: 16.0,
)), // )),
), // ),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Container( child: Container(
child: widget.bookedAppoList.length != 0 child: widget.bookedAppoList.length != 0
? SingleChildScrollView( ? SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
...List.generate( ...List.generate(
widget._patientBookedAppointmentListHospital.length, widget._patientBookedAppointmentListHospital
.length,
(index) => AppExpandableNotifier( (index) => AppExpandableNotifier(
title: widget title: widget
._patientBookedAppointmentListHospital[index] ._patientBookedAppointmentListHospital[
.filterName, index]
bodyWidget: Column( .filterName,
crossAxisAlignment: CrossAxisAlignment.start, bodyWidget: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment:
children: widget CrossAxisAlignment.start,
._patientBookedAppointmentListHospital[index] mainAxisAlignment:
.patientDoctorAppointmentList MainAxisAlignment.spaceBetween,
.map((doctor) { children: widget
return AppointmentCard( ._patientBookedAppointmentListHospital[
appo: doctor, index]
onReloadAppointmentHistory: .patientDoctorAppointmentList
getPatientAppointmentHistory, .map((doctor) {
); return AppointmentCard(
}).toList(), appo: doctor,
)), onReloadAppointmentHistory:
) getPatientAppointmentHistory,
], );
), }).toList(),
) )),
: Container( )
child: Center( ],
child: Column( ),
mainAxisAlignment: MainAxisAlignment.center, )
crossAxisAlignment: CrossAxisAlignment.center, : Container(
children: <Widget>[ child: Center(
Image.asset( child: Column(
"assets/images/new-design/noAppointmentIcon.png"), mainAxisAlignment: MainAxisAlignment.center,
Container( crossAxisAlignment: CrossAxisAlignment.center,
margin: EdgeInsets.only(top: 10.0), children: <Widget>[
child: Text("No Booked Appointments", Image.asset(
style: TextStyle( "assets/images/new-design/noAppointmentIcon.png"),
fontSize: 16.0, Container(
)), margin: EdgeInsets.only(top: 10.0),
child: Text("No Booked Appointments",
style: TextStyle(
fontSize: 16.0,
)),
),
],
), ),
], ),
), ),
), ),
), )
), ],
) ))));
],
))));
} }
Widget getConfirmedAppointments() { Widget getConfirmedAppointments() {
@ -341,7 +357,8 @@ class _MyAppointmentsState extends State<MyAppointments>
Image.asset("assets/images/new-design/noAppointmentIcon.png"), Image.asset("assets/images/new-design/noAppointmentIcon.png"),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).noConfirmedAppointments , child: Text(
TranslationBase.of(context).noConfirmedAppointments,
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
)), )),
@ -363,23 +380,24 @@ class _MyAppointmentsState extends State<MyAppointments>
...List.generate( ...List.generate(
widget._patientArrivedAppointmentListHospital.length, widget._patientArrivedAppointmentListHospital.length,
(index) => AppExpandableNotifier( (index) => AppExpandableNotifier(
title: widget title: widget
._patientArrivedAppointmentListHospital[index]
.filterName,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: widget
._patientArrivedAppointmentListHospital[index] ._patientArrivedAppointmentListHospital[index]
.filterName, .patientDoctorAppointmentList
bodyWidget: Column( .map((doctor) {
crossAxisAlignment: CrossAxisAlignment.start, return AppointmentCard(
mainAxisAlignment: MainAxisAlignment.spaceBetween, appo: doctor,
children: widget onReloadAppointmentHistory:
._patientArrivedAppointmentListHospital[index] getPatientAppointmentHistory,
.patientDoctorAppointmentList );
.map((doctor) { }).toList(),
return AppointmentCard( ),
appo: doctor, ),
onReloadAppointmentHistory:
getPatientAppointmentHistory,
);
}).toList(),
)),
) )
], ],
), ),
@ -394,10 +412,11 @@ class _MyAppointmentsState extends State<MyAppointments>
Image.asset("assets/images/new-design/noAppointmentIcon.png"), Image.asset("assets/images/new-design/noAppointmentIcon.png"),
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).noArrivedAppointments, child:
style: TextStyle( Text(TranslationBase.of(context).noArrivedAppointments,
fontSize: 16.0, style: TextStyle(
)), fontSize: 16.0,
)),
), ),
], ],
), ),

@ -24,7 +24,7 @@ class _ApointmentCardState extends State<AppointmentCard> {
navigateToAppointmentDetails(context, widget.appo); navigateToAppointmentDetails(context, widget.appo);
}, },
child: Card( child: Card(
margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0), // margin: EdgeInsets.fromLTRB(10.0, 16.0, 10.0, 8.0),
color: Colors.white, color: Colors.white,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
@ -95,7 +95,8 @@ class _ApointmentCardState extends State<AppointmentCard> {
emptyIcon: Icons.star, emptyIcon: Icons.star,
), ),
Container( Container(
transform: Matrix4.translationValues(15.0, -40.0, 0.0), transform:
Matrix4.translationValues(15.0, -40.0, 0.0),
child: Image.asset( child: Image.asset(
"assets/images/new-design/arrow.png", "assets/images/new-design/arrow.png",
width: 25.0, width: 25.0,

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -19,10 +20,11 @@ class BaseView<T extends BaseViewModel> extends StatefulWidget {
class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> { class _BaseViewState<T extends BaseViewModel> extends State<BaseView<T>> {
T model = locator<T>(); T model = locator<T>();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@override @override
void initState() { void initState() {
if (widget.onModelReady != null) { if (widget.onModelReady != null && authenticatedUserObject.isLogin) {
widget.onModelReady(model); widget.onModelReady(model);
} }
super.initState(); super.initState();

@ -1,114 +1,358 @@
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_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/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
class MyFamily extends StatelessWidget { class MyFamily extends StatefulWidget {
//bool isLoading = true; @override
_MyFamily createState() => _MyFamily();
}
class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
final familyFileProvider = FamilyFilesProvider(); final familyFileProvider = FamilyFilesProvider();
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
var userID; var userID;
TabController _tabController;
@override
void initState() {
_tabController = new TabController(length: 2, vsync: this, initialIndex: 0);
super.initState();
}
bool expandFlag = false;
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return Scaffold(
appBarTitle: TranslationBase.of(context).myFamilyFiles, appBar: AppBar(
isShowAppBar: true, bottom: TabBar(
body: DefaultTabController( indicatorColor: Colors.red,
length: 2, tabs: [
child: SingleChildScrollView( Padding(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(6),
child: Container( child: AppText(
height: SizeConfig.realScreenHeight, TranslationBase.of(context).family,
width: SizeConfig.realScreenWidth, color: Colors.white,
child: Stack( )),
children: <Widget>[ Padding(
TabBar( padding: EdgeInsets.all(6),
indicatorColor: Colors.red, child: AppText(
tabs: [ TranslationBase.of(context).request,
Padding( color: Colors.white,
padding: EdgeInsets.all(6), )),
child: ],
Text(TranslationBase.of(context).family)), controller: _tabController,
Padding( ),
padding: EdgeInsets.all(6), title: AppText(TranslationBase.of(context).myFamilyFiles,
child: color: Colors.white)),
Text(TranslationBase.of(context).request)), body: TabBarView(
], // physics: NeverScrollableScrollPhysics(),
), children: [myFamilyDetails(context), myFamilyRequest(context)],
TabBarView( controller: _tabController),
children: [ bottomNavigationBar: BottomBarSearch());
myFamilyDetails(context),
myFamilyRequest(context) // AppScaffold(
], // appBarTitle: TranslationBase.of(context).myFamilyFiles,
) // isShowAppBar: true,
], // body: SingleChildScrollView(
))))); // child: Container(
// height: SizeConfig.screenHeight,
// width: SizeConfig.realScreenWidth,
// padding: EdgeInsets.all(20),
// child: Stack(
// children: <Widget>[
// TabBar(
// controller: _tabController,
// indicatorColor: Colors.red,
// tabs: [
// Padding(
// padding: EdgeInsets.all(6),
// child: Text(TranslationBase.of(context).family)),
// Padding(
// padding: EdgeInsets.all(6),
// child: Text(TranslationBase.of(context).request)),
// ],
// ),
// TabBarView(
// controller: _tabController,
// children: [
// myFamilyDetails(context),
// myFamilyRequest(context)
// ],
// )
// ],
// ))));
} }
Widget myFamilyDetails(context) { Widget myFamilyDetails(context) {
return // Padding( return Container(
//padding: EdgeInsets.only(top: 50), height: MediaQuery.of(context).size.height,
//child: margin: EdgeInsets.fromLTRB(20.0, 0, 20.0, 0.0),
Column( child: Column(
// mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[
children: <Widget>[ Expanded(
Expanded( flex: 4,
flex: 3, child: FutureBuilder(
child: FutureBuilder( future: getFamilyFiles(), // async work
future: getFamilyFiles(), // async work builder: (BuildContext context,
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) { snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text(snapshot.error));
else
return Padding( return Padding(
padding: EdgeInsets.only(top: 50), padding: EdgeInsets.only(top: 50),
child: Column(children: <Widget>[ child: Text('Loading....'));
Row( default:
mainAxisAlignment: MainAxisAlignment.spaceBetween, if (snapshot.hasError)
children: <Widget>[ return Padding(
Expanded( padding: EdgeInsets.all(10),
flex: 3, child: Text("No data found"));
child: Text( else
TranslationBase.of(context).request)), return Padding(
Expanded( padding: EdgeInsets.only(top: 50),
flex: 2, child: Column(children: <Widget>[
child: Text( Row(
TranslationBase.of(context).switchUser, mainAxisAlignment:
)), MainAxisAlignment.spaceBetween,
Expanded( children: <Widget>[
flex: 1, Expanded(
child: Text( flex: 3,
TranslationBase.of(context).deleteView, child: Text(
)), TranslationBase.of(context).request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context).switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context).deleteView,
)),
],
),
Column(
mainAxisAlignment: MainAxisAlignment.start,
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return result.status == 3
? Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(
result.patientName)),
Expanded(
flex: 2,
child: IconButton(
icon: Icon(Icons.group),
color: Colors.black,
onPressed: () {
switchUser(
result, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteFamily(
result, context);
},
)),
],
))
: SizedBox();
}).toList())
]));
}
},
),
),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).addFamilyMember,
() => {
Navigator.of(context)
.pushNamed(ADD_FAMILY_MEMBER_TYPE)
},
color: Colors.grey[900],
textColor: Colors.white,
))
],
),
],
),
)
],
));
}
Widget myFamilyRequest(context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 10.0),
child: Column(
children: <Widget>[
// SizedBox(height: 20.0),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userViewRequest,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work
builder: (BuildContext context,
AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text('No data found'));
else
return Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(TranslationBase.of(context)
.request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context)
.switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context)
.deleteView,
)),
],
),
Column(children: [
Row(children: [
Expanded(flex: 3, child: AppText('Name')),
Expanded(flex: 1, child: AppText('Allow')),
Expanded(flex: 1, child: AppText('Reject')),
]),
Column(
children: snapshot
.data['GetAllPendingRecordsList']
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child:
Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.check_circle,
color: Colors.black,
),
onPressed: () {
acceptRequest(
result, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteRequest(
result, context);
},
))
],
));
}).toList())
])
], ],
), );
Column( }
mainAxisAlignment: MainAxisAlignment.start, })
children: snapshot ],
.data.getAllSharedRecordsByStatusList ),
.map<Widget>((result) { ),
return result.status == 3 RoundedContainer(
? Padding( child: ExpansionTile(
title: Text(
TranslationBase.of(context).sentRequest,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getSentRequest(), // async work
builder: (BuildContext context,
AsyncSnapshot<GetAllSharedRecordsByStatusResponse>
snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text('No data found'));
else
return SingleChildScrollView(
child: Container(
height: SizeConfig.screenHeight * .3,
child: ListView(
children: snapshot
.data.getAllSharedRecordsByStatusList
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
@ -118,61 +362,102 @@ class MyFamily extends StatelessWidget {
Text(result.patientName)), Text(result.patientName)),
Expanded( Expanded(
flex: 2, flex: 2,
child: IconButton( child: AppText(
icon: Icon(Icons.group), result.statusDescription,
color: Colors.black, color: Colors.red,
onPressed: () {
switchUser(
result, context);
},
)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteFamily(
result, context);
},
)), )),
], ],
)) ));
: SizedBox(); }).toList(),
)));
}
})
],
)),
RoundedContainer(
child: ExpansionTile(
title: Text(
TranslationBase.of(context).userView,
style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
),
children: <Widget>[
FutureBuilder(
future: getUserViewRequest(), // async work
builder:
(BuildContext context, AsyncSnapshot<dynamic> snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
return Padding(
padding: EdgeInsets.all(10),
child: Text('No data found'));
else
return Column(
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 3,
child: Text(
TranslationBase.of(context).request)),
Expanded(
flex: 2,
child: Text(
TranslationBase.of(context).switchUser,
)),
Expanded(
flex: 1,
child: Text(
TranslationBase.of(context).deleteView,
)),
],
),
Column(children: [
Row(children: [
Expanded(flex: 3, child: AppText('Name')),
Expanded(flex: 1, child: AppText('Delete')),
]),
Column(
children: snapshot
.data['GetAllPendingRecordsList']
.map<Widget>((result) {
return Padding(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
flex: 3,
child: Text(result.patientName)),
Expanded(
flex: 1,
child: IconButton(
icon: Icon(
Icons.delete,
color: Colors.black,
),
onPressed: () {
deleteRequest(
result, context);
},
)),
],
));
}).toList()) }).toList())
])); ])
} ],
}, );
)), }
Expanded( })
flex: 1, ],
child: Column( ))
children: <Widget>[ ],
Row( ),
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).addFamilyMember,
() => {
Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER_TYPE)
},
color: Colors.grey[900],
textColor: Colors.white,
))
],
),
],
))
],
);
}
addMember() {}
Widget myFamilyRequest(context) {
return Column(
children: <Widget>[],
); );
} }
@ -186,6 +471,16 @@ class MyFamily extends StatelessWidget {
} }
} }
Future getUserViewRequest() async {
var user = await sharedPref.getObject(USER_PROFILE);
return familyFileProvider.getUserViewRequest(user['PatientID']);
}
Future<GetAllSharedRecordsByStatusResponse> getSentRequest() async {
// var user = await sharedPref.getObject(USER_PROFILE);
return familyFileProvider.getUserSentRequest();
}
deleteFamily(family, context) { deleteFamily(family, context) {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
@ -236,4 +531,7 @@ class MyFamily extends StatelessWidget {
HOME, HOME,
); );
} }
deleteRequest(result, context) {}
acceptRequest(result, context) {}
} }

@ -33,6 +33,7 @@ class _FeedbackHomePageState extends State<FeedbackHomePage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isBottomBar: false,
appBarTitle: 'Feedback', appBarTitle: 'Feedback',
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
@ -62,8 +63,7 @@ class _FeedbackHomePageState extends State<FeedbackHomePage>
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
color: Theme.of(context).dividerColor, color: Theme.of(context).dividerColor, width: 0.7),
width: 0.7),
), ),
color: Colors.white), color: Colors.white),
child: Center( child: Center(
@ -75,7 +75,7 @@ class _FeedbackHomePageState extends State<FeedbackHomePage>
indicatorColor: Colors.red[800], indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( Container(
@ -104,10 +104,7 @@ class _FeedbackHomePageState extends State<FeedbackHomePage>
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: <Widget>[ children: <Widget>[SendFeedbackPage(), StatusFeedbackPage()],
SendFeedbackPage(),
StatusFeedbackPage()
],
), ),
) )
], ],

@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/hmg_service.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart';
import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -35,6 +35,7 @@ class _HomePageState extends State<HomePage> {
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getPatientRadOrders(), onModelReady: (model) => model.getPatientRadOrders(),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
isShowDecPage: false,
body: Container( body: Container(
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(
@ -207,7 +208,7 @@ class _HomePageState extends State<HomePage> {
width: double.infinity, width: double.infinity,
height: 125, height: 125,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#A59E9E'), color: HexColor('#A59E9E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(
color: Colors.transparent, width: 0.5), color: Colors.transparent, width: 0.5),
@ -253,7 +254,7 @@ class _HomePageState extends State<HomePage> {
width: 90, width: 90,
height: 30, height: 30,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#D81A2E'), color: HexColor('#D81A2E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(
color: Colors.transparent, color: Colors.transparent,
@ -280,7 +281,7 @@ class _HomePageState extends State<HomePage> {
width: double.infinity, width: double.infinity,
height: 130, height: 130,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#A59E9E'), color: HexColor('#A59E9E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(
color: Colors.transparent, width: 0.5), color: Colors.transparent, width: 0.5),
@ -340,7 +341,7 @@ class _HomePageState extends State<HomePage> {
width: 90, width: 90,
height: 30, height: 30,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#D81A2E'), color: HexColor('#D81A2E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(
color: Colors.transparent, color: Colors.transparent,
@ -443,12 +444,12 @@ class _HomePageState extends State<HomePage> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
'assets/images/Dr_Schedule_report.png', 'assets/images/home_health_care_icon.png',
width: 50, width: 50,
height: 50, height: 50,
), ),
SizedBox( SizedBox(
height: 13.5, height: 3,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context)
@ -485,7 +486,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
bold: true, bold: true,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -506,21 +507,21 @@ class _HomePageState extends State<HomePage> {
height: 50, height: 50,
), ),
SizedBox( SizedBox(
height: 15, height: 3,
), ),
Texts( Texts(
TranslationBase.of(context).emergencyService, TranslationBase.of(context).emergencyService,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
bold: true, bold: true,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
), ),
), ),
height: MediaQuery.of(context).size.width * 0.4, height: MediaQuery.of(context).size.width * 0.4,
color: Hexcolor("#747C80"), color: HexColor("#747C80"),
imageName: 'emergency_service_image.png', imageName: 'emergency_service_image.png',
), ),
], ],
@ -549,7 +550,7 @@ class _HomePageState extends State<HomePage> {
height: 55, height: 55,
), ),
SizedBox( SizedBox(
height: 15, height: 5,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context)
@ -557,7 +558,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -581,7 +582,7 @@ class _HomePageState extends State<HomePage> {
height: 55, height: 55,
), ),
SizedBox( SizedBox(
height: 15, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context)
@ -589,7 +590,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -621,7 +622,7 @@ class _HomePageState extends State<HomePage> {
height: 50, height: 50,
), ),
SizedBox( SizedBox(
height: 15, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context)
@ -629,7 +630,7 @@ class _HomePageState extends State<HomePage> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
fontSize: SizeConfig.textMultiplier * 2.0, fontSize: SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -647,7 +648,7 @@ class _HomePageState extends State<HomePage> {
), ),
), ),
SizedBox( SizedBox(
height: 8, height: 5,
), ),
Container( Container(
margin: EdgeInsets.only(left: 15, right: 15), margin: EdgeInsets.only(left: 15, right: 15),
@ -685,7 +686,7 @@ class _HomePageState extends State<HomePage> {
), ),
), ),
height: 100, height: 100,
imageName: 'hmg_services_bg .png', imageName: 'hmg_services_bg.png',
opacity: 0.5, opacity: 0.5,
color: Colors.grey[700], color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
@ -697,7 +698,7 @@ class _HomePageState extends State<HomePage> {
// Navigator.push( // Navigator.push(
// context, FadePage(page: FeedbackHomePage())); // context, FadePage(page: FeedbackHomePage()));
Navigator.push( Navigator.push(
context, FadePage(page: HmgServicePage())); context, FadePage(page: ContactUsPage()));
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
@ -787,7 +788,9 @@ class DashboardItem extends StatelessWidget {
: MediaQuery.of(context).size.height * 0.35, : MediaQuery.of(context).size.height * 0.35,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !hasBorder color: !hasBorder
? color != null ? color : Hexcolor('#050705').withOpacity(opacity) ? color != null
? color
: HexColor('#050705').withOpacity(opacity)
: Colors.white, : Colors.white,
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),
border: hasBorder border: hasBorder
@ -795,7 +798,7 @@ class DashboardItem extends StatelessWidget {
: Border.all(width: 0.0, color: Colors.transparent), : Border.all(width: 0.0, color: Colors.transparent),
image: imageName != null image: imageName != null
? DecorationImage( ? DecorationImage(
image: AssetImage('assets/images/$imageName'), image: ExactAssetImage('assets/images/$imageName'),
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: new ColorFilter.mode( colorFilter: new ColorFilter.mode(
Colors.black.withOpacity(0.2), BlendMode.dstIn), Colors.black.withOpacity(0.2), BlendMode.dstIn),

@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -23,6 +24,7 @@ import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_svg/svg.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rxdart/rxdart.dart'; import 'package:rxdart/rxdart.dart';
@ -44,17 +46,19 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
ProjectViewModel projectProvider; ProjectViewModel projectProvider;
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
final authService = new AuthProvider(); final authService = new AuthProvider();
var event = RobotProvider();
void _requestIOSPermissions() { void _requestIOSPermissions() {
flutterLocalNotificationsPlugin flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation< .resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>() IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions( ?.requestPermissions(
alert: true, alert: true,
badge: true, badge: true,
sound: true, sound: true,
); );
} }
bool isPageNavigated = false; bool isPageNavigated = false;
_changeCurrentTab(int tab) { _changeCurrentTab(int tab) {
@ -138,123 +142,121 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
//_firebase Background message handler //_firebase Background message handler
_firebaseMessaging.configure( _firebaseMessaging.configure(
// onMessage: (Map<String, dynamic> message) async { // onMessage: (Map<String, dynamic> message) async {
// showDialog("onMessage: $message"); // showDialog("onMessage: $message");
// print("onMessage: $message"); // print("onMessage: $message");
// print(message); // print(message);
// print(message['name']); // print(message['name']);
// print(message['appointmentdate']); // print(message['appointmentdate']);
// //
// if (Platform.isIOS) { // if (Platform.isIOS) {
// if (message['is_call'] == "true") { // if (message['is_call'] == "true") {
// var route = ModalRoute.of(context); // var route = ModalRoute.of(context);
// //
// if (route != null) { // if (route != null) {
// print(route.settings.name); // print(route.settings.name);
// } // }
// //
// Map<String, dynamic> myMap = new Map<String, dynamic>.from(message); // Map<String, dynamic> myMap = new Map<String, dynamic>.from(message);
// print(myMap); // print(myMap);
// LandingPage.isOpenCallPage = true; // LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) { // if (!isPageNavigated) {
// isPageNavigated = true; // isPageNavigated = true;
// Navigator.push( // Navigator.push(
// context, // context,
// MaterialPageRoute( // MaterialPageRoute(
// builder: (context) => IncomingCall( // builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData))) // incomingCallData: LandingPage.incomingCallData)))
// .then((value) { // .then((value) {
// isPageNavigated = false; // isPageNavigated = false;
// }); // });
// } // }
// } else { // } else {
// print("Is Call Not Found iOS"); // print("Is Call Not Found iOS");
// } // }
// } else { // } else {
// print("Is Call Not Found iOS"); // print("Is Call Not Found iOS");
// } // }
// //
// if (Platform.isAndroid) { // if (Platform.isAndroid) {
// if (message['data'].containsKey("is_call")) { // if (message['data'].containsKey("is_call")) {
// var route = ModalRoute.of(context); // var route = ModalRoute.of(context);
// //
// if (route != null) { // if (route != null) {
// print(route.settings.name); // print(route.settings.name);
// } // }
// //
// Map<String, dynamic> myMap = // Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message['data']); // new Map<String, dynamic>.from(message['data']);
// print(myMap); // print(myMap);
// LandingPage.isOpenCallPage = true; // LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) { // if (!isPageNavigated) {
// isPageNavigated = true; // isPageNavigated = true;
// Navigator.push( // Navigator.push(
// context, // context,
// MaterialPageRoute( // MaterialPageRoute(
// builder: (context) => IncomingCall( // builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData))) // incomingCallData: LandingPage.incomingCallData)))
// .then((value) { // .then((value) {
// isPageNavigated = false; // isPageNavigated = false;
// }); // });
// } // }
// } else { // } else {
// print("Is Call Not Found Android"); // print("Is Call Not Found Android");
// } // }
// } else { // } else {
// print("Is Call Not Found Android"); // print("Is Call Not Found Android");
// } // }
// }, // },
// onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler, // onBackgroundMessage: Platform.isIOS ? null : myBackgroundMessageHandler,
// onLaunch: (Map<String, dynamic> message) async { // onLaunch: (Map<String, dynamic> message) async {
// print("onLaunch: $message"); // print("onLaunch: $message");
// showDialog("onLaunch: $message"); // showDialog("onLaunch: $message");
// }, // },
// onResume: (Map<String, dynamic> message) async { // onResume: (Map<String, dynamic> message) async {
// print("onResume: $message"); // print("onResume: $message");
// print(message); // print(message);
// print(message['name']); // print(message['name']);
// print(message['appointmentdate']); // print(message['appointmentdate']);
// //
// showDialog("onResume: $message"); // showDialog("onResume: $message");
// //
// if (Platform.isIOS) { // if (Platform.isIOS) {
// if (message['is_call'] == "true") { // if (message['is_call'] == "true") {
// var route = ModalRoute.of(context); // var route = ModalRoute.of(context);
// //
// if (route != null) { // if (route != null) {
// print(route.settings.name); // print(route.settings.name);
// } // }
// //
// Map<String, dynamic> myMap = // Map<String, dynamic> myMap =
// new Map<String, dynamic>.from(message); // new Map<String, dynamic>.from(message);
// print(myMap); // print(myMap);
// LandingPage.isOpenCallPage = true; // LandingPage.isOpenCallPage = true;
// LandingPage.incomingCallData = IncomingCallData.fromJson(myMap); // LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
// if (!isPageNavigated) { // if (!isPageNavigated) {
// isPageNavigated = true; // isPageNavigated = true;
// Navigator.push( // Navigator.push(
// context, // context,
// MaterialPageRoute( // MaterialPageRoute(
// builder: (context) => IncomingCall( // builder: (context) => IncomingCall(
// incomingCallData: LandingPage.incomingCallData))) // incomingCallData: LandingPage.incomingCallData)))
// .then((value) { // .then((value) {
// isPageNavigated = false; // isPageNavigated = false;
// }); // });
// } // }
// } else { // } else {
// print("Is Call Not Found iOS"); // print("Is Call Not Found iOS");
// } // }
// } else { // } else {
// print("Is Call Not Found iOS"); // print("Is Call Not Found iOS");
// } // }
// }, // },
); );
} }
showDialogs(String message) { showDialogs(String message) {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
@ -284,12 +286,11 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return; return;
} }
} }
} }
Future<void> _scheduleNotification() async { Future<void> _scheduleNotification() async {
var scheduledNotificationDateTime = var scheduledNotificationDateTime =
DateTime.now().add(Duration(seconds: 5)); DateTime.now().add(Duration(seconds: 5));
var vibrationPattern = Int64List(4); var vibrationPattern = Int64List(4);
vibrationPattern[0] = 0; vibrationPattern[0] = 0;
vibrationPattern[1] = 1000; vibrationPattern[1] = 1000;
@ -300,7 +301,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
'your other channel id', 'your other channel id',
'your other channel name', 'your other channel name',
'your other channel description', 'your other channel description',
// icon: 'secondary_icon', // icon: 'secondary_icon',
sound: RawResourceAndroidNotificationSound('slow_spring_board'), sound: RawResourceAndroidNotificationSound('slow_spring_board'),
largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'), largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'),
vibrationPattern: vibrationPattern, vibrationPattern: vibrationPattern,
@ -310,18 +311,17 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
ledOnMs: 1000, ledOnMs: 1000,
ledOffMs: 500); ledOffMs: 500);
var iOSPlatformChannelSpecifics = var iOSPlatformChannelSpecifics =
IOSNotificationDetails(sound: 'slow_spring_board.aiff'); IOSNotificationDetails(sound: 'slow_spring_board.aiff');
var platformChannelSpecifics = NotificationDetails( // var platformChannelSpecifics = NotificationDetails(
androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.schedule( // await flutterLocalNotificationsPlugin.schedule(
0, // 0,
'scheduled title', // 'scheduled title',
'scheduled body', // 'scheduled body',
scheduledNotificationDateTime, // scheduledNotificationDateTime,
platformChannelSpecifics); // platformChannelSpecifics);
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
//final searchValue = Provider.of<SearchProvider>(context); //final searchValue = Provider.of<SearchProvider>(context);
@ -345,6 +345,16 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
); );
}, },
), ),
actions: [
IconButton(
iconSize: 70,
icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
height: 100, width: 100, fit: BoxFit.cover),
onPressed: () {
triggerRobot();
} //do something,
)
],
centerTitle: true, centerTitle: true,
), ),
drawer: SafeArea(child: AppDrawer()), drawer: SafeArea(child: AppDrawer()),
@ -371,6 +381,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
); );
} }
triggerRobot() {
event.setValue({"isRobot": 'true'});
}
getText(currentTab) { getText(currentTab) {
switch (currentTab) { switch (currentTab) {
case 0: case 0:

@ -21,6 +21,7 @@ import 'package:diplomaticquarterapp/routes.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:local_auth/local_auth.dart'; import 'package:local_auth/local_auth.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class ConfirmLogin extends StatefulWidget { class ConfirmLogin extends StatefulWidget {
@override @override
@ -74,183 +75,171 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).confirm, appBarTitle: TranslationBase.of(context).confirm,
isShowAppBar: true, isShowAppBar: true,
body: isLoading == false isShowDecPage: false,
? SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
height: SizeConfig.realScreenHeight * .9, height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 3, flex: 3,
child: user != null && isMoreOption == false child: user != null && isMoreOption == false
? Column( ? Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceEvenly, MainAxisAlignment.spaceEvenly,
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ Image.asset(
Image.asset( 'assets/images/habib-logo.png',
'assets/images/habib-logo.png', height: 80,
height: 80, width: 80,
width: 80, ),
), AppText(
AppText( TranslationBase.of(context).welcomeBack +
TranslationBase.of(context) ' ' +
.welcomeBack + user.name,
' ' + fontSize: SizeConfig.textMultiplier * 3.5,
user.name, ),
fontSize: SizeConfig.textMultiplier * 4, AppText(
), TranslationBase.of(context).accountInfo,
AppText( fontSize: SizeConfig.textMultiplier * 2.5,
TranslationBase.of(context).accountInfo, ),
fontSize: SizeConfig.textMultiplier * 3, Card(
), color: Colors.grey[300],
Card( child: Row(
color: Colors.grey[300], children: <Widget>[
child: Row( Expanded(
children: <Widget>[ child: ListTile(
Expanded( title: Text(
child: ListTile( TranslationBase.of(context)
title: Text( .lastLoginAt,
TranslationBase.of(context) textAlign: TextAlign.center,
.lastLoginAt, ),
textAlign: TextAlign.center, subtitle: Text(
), user.editedOn != null
subtitle: Text( ? formatDate(DateUtil
user.editedOn != null .convertStringToDate(
? formatDate(DateUtil user.editedOn))
.convertStringToDate( : '--',
user.editedOn)) textAlign: TextAlign.center),
: '--', )),
textAlign: Expanded(
TextAlign.center), child: ListTile(
)), title: Text(
Expanded(
child: ListTile(
title: Text(
TranslationBase.of(context)
.lastLoginWith,
textAlign:
TextAlign.center),
subtitle: Text(
getType(user.logInType,
context),
textAlign:
TextAlign.center),
))
],
))
],
)
: Column(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/habib-logo.png',
height: 80,
width: 80,
),
this.onlySMSBox == false
? AppText(
TranslationBase.of(context)
.verifyLoginWith,
fontSize:
SizeConfig.textMultiplier *
3.5,
textAlign: TextAlign.left,
)
: AppText(
TranslationBase.of(context) TranslationBase.of(context)
.verifyFingerprint2, .lastLoginWith,
fontSize: textAlign: TextAlign.center),
SizeConfig.textMultiplier * subtitle: Text(
2.5, getType(
textAlign: TextAlign.left, user.logInType, context),
), textAlign: TextAlign.center),
])), ))
user != null && isMoreOption == false ],
? Expanded( ))
flex: 2, ],
child: Column( )
mainAxisAlignment: MainAxisAlignment.start, : Column(
crossAxisAlignment: mainAxisAlignment:
CrossAxisAlignment.start, MainAxisAlignment.spaceEvenly,
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
Row( children: <Widget>[
Image.asset(
'assets/images/habib-logo.png',
height: 80,
width: 80,
),
this.onlySMSBox == false
? AppText(
TranslationBase.of(context)
.verifyLoginWith,
fontSize:
SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left,
)
: AppText(
TranslationBase.of(context)
.verifyFingerprint2,
fontSize:
SizeConfig.textMultiplier * 2.5,
textAlign: TextAlign.left,
),
])),
user != null && isMoreOption == false
? Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: InkWell(
onTap: () => {
authenticateUser(
3,
BiometricType
.face.index)
},
child:
getButton(user.logInType))),
Expanded(child: getButton(5))
])
]))
: Expanded(
flex: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
onlySMSBox == false
? Row(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(child: getButton(3)),
child: InkWell( Expanded(child: getButton(2))
onTap: () => { ],
authenticateUser( )
3, : SizedBox(),
BiometricType Row(
.face.index) mainAxisAlignment: MainAxisAlignment.center,
},
child: getButton(
user.logInType))),
Expanded(child: getButton(5))
])
]))
: Expanded(
flex: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
onlySMSBox == false Expanded(child: getButton(1)),
? Row( Expanded(child: getButton(4))
mainAxisAlignment: ],
MainAxisAlignment.center, ),
children: <Widget>[ ]),
Expanded(child: getButton(3)), ),
Expanded(child: getButton(2)) Expanded(
], flex: 1,
) child: Column(
: SizedBox(), mainAxisAlignment: MainAxisAlignment.end,
Row( children: <Widget>[
mainAxisAlignment: user != null
MainAxisAlignment.center, ? Row(
children: <Widget>[ children: <Widget>[
Expanded(child: getButton(1)), Expanded(
Expanded(child: getButton(4)) child: DefaultButton(
], TranslationBase.of(context)
), .useAnotherAccount,
]), () => {
), Navigator.of(context).pushNamed(
Expanded( LOGIN_TYPE,
flex: 1, )
child: Column( },
mainAxisAlignment: MainAxisAlignment.end, )),
children: <Widget>[ ],
user != null )
? Row( : SizedBox(),
children: <Widget>[ ],
Expanded( ))
child: DefaultButton( ],
TranslationBase.of(context) ))));
.useAnotherAccount,
() => {
Navigator.of(context).pushNamed(
LOGIN_TYPE,
)
},
)),
],
)
: SizedBox(),
],
))
],
)))
: AppCircularProgressIndicator());
} }
Future<void> _getAvailableBiometrics() async { Future<void> _getAvailableBiometrics() async {
@ -314,32 +303,40 @@ class _ConfirmLogin extends State<ConfirmLogin> {
var request = CheckPatientAuthenticationReq.fromJson(req.toJson()); var request = CheckPatientAuthenticationReq.fromJson(req.toJson());
sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
authService.checkPatientAuthentication(request).then((value) => { authService
if (value['isSMSSent']) .checkPatientAuthentication(request)
{ .then((value) => {
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), if (value['isSMSSent'])
this.loginTokenID = value['LogInTokenID'], {
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request), sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
// Future.delayed(Duration(seconds: 1), () { this.loginTokenID = value['LogInTokenID'],
this.sendActivationCode(type) sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request),
// }) // Future.delayed(Duration(seconds: 1), () {
} this.sendActivationCode(type)
else // })
{ }
if (value['IsAuthenticated']) {this.checkActivationCode()} else
} {
}); if (value['IsAuthenticated']) {this.checkActivationCode()}
}
})
.catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
sendActivationCode(type) { sendActivationCode(type) async {
var request = this.getCommonRequest(); var request = this.getCommonRequest();
loading(true); // loading(true);
this.authService.sendActivationCode(request).then((result) => {
if (result != null && result['isSMSSent'] == true) await this.authService.sendActivationCode(request).then((result) => {
{loading(false), this.startSMSService(type)} if (result != null && result['isSMSSent'] == true)
else {this.startSMSService(type)}
{loading(false)} });
});
// SMSOTP.showLoadingDialog(context, false),
} }
startSMSService(type) { startSMSService(type) {
@ -370,42 +367,50 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
getMobileInfo(request) { getMobileInfo(request) {
this.authService.getLoginInfo(request).then((result) => { this
if (result['SMSLoginRequired'] == false) .authService
{ .getLoginInfo(request)
this.loginTokenID = result.logInTokenID, .then((result) => {
this.patientOutSA = result.patientOutSA, if (result['SMSLoginRequired'] == false)
// sms for register the biometric
if (result.isSMSSent)
{ {
this.onlySMSBox = false, this.loginTokenID = result.logInTokenID,
//this.button(); this.patientOutSA = result.patientOutSA,
// sms for register the biometric
if (result.isSMSSent)
{
this.onlySMSBox = false,
//this.button();
}
else
{checkActivationCode()}
} }
else else
{checkActivationCode()}
}
else
{
if (result['IsAuthenticated'] == true)
{ {
setState(() { if (result['IsAuthenticated'] == true)
isMoreOption = true; {
this.onlySMSBox = true; setState(() {
// this.fingrePrintBefore = true; isMoreOption = true;
}), this.onlySMSBox = true;
// this.fingrePrintBefore = true;
//sharedPref.setBool(ONLY_SMS, true), }),
// this.cs.sharedService.setSharedData(true, AuthenticationService.ONLY_SMS);
//this.cs.sharedService.setSharedData(this.selectedOption, AuthenticationService.FINGUREPRINT_BEFORE); //sharedPref.setBool(ONLY_SMS, true),
// this.cs.confirmLogin(); // this.cs.sharedService.setSharedData(true, AuthenticationService.ONLY_SMS);
//this.button(); //this.cs.sharedService.setSharedData(this.selectedOption, AuthenticationService.FINGUREPRINT_BEFORE);
// this.cs.confirmLogin();
//this.button();
}
// else
// {
// // this.cs.presentAlert(result.ErrorEndUserMessage);
// }
} }
// else })
// { .catchError((err) {
// // this.cs.presentAlert(result.ErrorEndUserMessage); print(err);
// } }).showProgressBar(
} text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}); ;
} }
setUser() async {} setUser() async {}
@ -426,9 +431,13 @@ class _ConfirmLogin extends State<ConfirmLogin> {
: int.parse(this.user.mobile); : int.parse(this.user.mobile);
this.zipCode = this.registerd_data != null this.zipCode = this.registerd_data != null
? this.registerd_data.zipCode ? this.registerd_data.zipCode
: this.user.outSA == true ? "971" : "966"; : this.user.outSA == true
? "971"
: "966";
this.patientOutSA = this.registerd_data != null this.patientOutSA = this.registerd_data != null
? this.registerd_data.zipCode == "966" ? 0 : 1 ? this.registerd_data.zipCode == "966"
? 0
: 1
: this.user.outSA; : this.user.outSA;
if (this.registerd_data != null) { if (this.registerd_data != null) {
this.loginTokenID = await sharedPref.getString(LOGIN_TOKEN_ID); this.loginTokenID = await sharedPref.getString(LOGIN_TOKEN_ID);
@ -476,43 +485,51 @@ class _ConfirmLogin extends State<ConfirmLogin> {
SMSOTP.showLoadingDialog(context, true); SMSOTP.showLoadingDialog(context, true);
var request = this.getCommonRequest().toJson(); var request = this.getCommonRequest().toJson();
this.authService.checkActivationCode(request, value).then((result) => { this
if (result is Map) .authService
{ .checkActivationCode(request, value)
result = CheckActivationCode.fromJson(result), .then((result) => {
if (this.registerd_data != null && if (result is Map)
this.registerd_data.isRegister == true)
{ {
Navigator.of(context).pushNamed( result = CheckActivationCode.fromJson(result),
REGISTER_INFO, if (this.registerd_data != null &&
) this.registerd_data.isRegister == true)
{
Navigator.of(context).pushNamed(
REGISTER_INFO,
)
}
else
{
this.userData = result
.list, //AuthenticatedUser.fromJson(result['List'][0]),
this.sharedPref.setObject(USER_PROFILE, result.list),
this.loginTokenID = result.logInTokenID,
this
.sharedPref
.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
this
.sharedPref
.setString(TOKEN, result.authenticationTokenID),
this.checkIfUserAgreedBefore(result),
// Navigator.of(context).pop(),
SMSOTP.showLoadingDialog(context, false),
}
} }
else else
{ {
this.userData = result
.list, //AuthenticatedUser.fromJson(result['List'][0]),
this.sharedPref.setObject(USER_PROFILE, result.list),
this.loginTokenID = result.logInTokenID,
this
.sharedPref
.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
this
.sharedPref
.setString(TOKEN, result.authenticationTokenID),
this.checkIfUserAgreedBefore(result),
// Navigator.of(context).pop(), // Navigator.of(context).pop(),
SMSOTP.showLoadingDialog(context, false), SMSOTP.showLoadingDialog(context, false),
Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: result);
}),
} }
} })
else .catchError((err) {
{ print(err);
// Navigator.of(context).pop(), }).showProgressBar(
SMSOTP.showLoadingDialog(context, false), text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
Future.delayed(Duration(seconds: 1), () { ;
AppToast.showErrorToast(message: result);
}),
}
});
} }
checkIfUserAgreedBefore(CheckActivationCode result) { checkIfUserAgreedBefore(CheckActivationCode result) {
@ -525,42 +542,17 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
insertIMEI() { insertIMEI() {
authService.insertDeviceImei(selectedOption).then((value) => {goToHome()}); authService
.insertDeviceImei(selectedOption)
.then((value) => {goToHome()})
.catchError((err) {
print(err);
});
} }
goToHome() { goToHome() {
// authService.insertDeviceImei().then((value) => print(value)); // authService.insertDeviceImei().then((value) => print(value));
Navigator.of(context).pushNamed(HOME); Navigator.of(context).pushNamed(HOME);
// const request = new LoginRequest();
// if (this.loginType === AuthenticationService.IDENTIFCIATION_LOGIN_TYPE) {
// request.PatientID = 0;
// } else {
// request.PatientID = Number(this.id);
// }
// this.newRating(request);
// }
// public newRating(request: any) {
// this.authService
// .checkIfRated(
// request,
// () => {
// this.gotoHome();
// },
// this.ts.trPK("general", "retry")
// )
// .subscribe((result: CheckUserRatingResponse) => {
// if (this.cs.validResponse(result)) {
// this.cs.sharedService.setSharedData(result, AuthenticationService.SURVEY_DATA);
// if (result.IsLastAppoitmentRatedList.length === 0) {
// this.cs.openHome();
// } else {
// this.ProjectID = result.IsLastAppoitmentRatedList[0].ProjectID;
// this.AppointmentNo = result.IsLastAppoitmentRatedList[0].AppointmentNo;
// this.cs.sharedService.setSharedData(true, "ratePage");
// this.showRateModal();
// }
// }
// });
} }
loading(flag) { loading(flag) {

@ -21,6 +21,7 @@ class _ForgotPassword extends State<ForgotPassword> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).forgotPassword, appBarTitle: TranslationBase.of(context).forgotPassword,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20), padding: EdgeInsets.only(top: 10, left: 20, right: 20),

@ -16,6 +16,7 @@ class LoginType extends StatelessWidget {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).welcome, appBarTitle: TranslationBase.of(context).welcome,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
body: Padding( body: Padding(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
child: Column( child: Column(
@ -23,7 +24,7 @@ class LoginType extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Image.asset( Image.asset(
@ -135,7 +136,7 @@ class LoginType extends StatelessWidget {
]), ]),
), ),
Expanded( Expanded(
flex: 2, flex: 1,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
@ -21,7 +22,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class Login extends StatefulWidget { class Login extends StatefulWidget {
@override @override
_Login createState() => _Login(); _Login createState() => _Login();
@ -40,6 +41,9 @@ class _Login extends State<Login> {
AppointmentRateViewModel appointmentRateViewModel = AppointmentRateViewModel appointmentRateViewModel =
locator<AppointmentRateViewModel>(); locator<AppointmentRateViewModel>();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@override @override
void initState() { void initState() {
// getDeviceToken(); // getDeviceToken();
@ -57,9 +61,8 @@ class _Login extends State<Login> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).login, appBarTitle: TranslationBase.of(context).login,
isShowAppBar: true, isShowAppBar: true,
body: isLoading == true isShowDecPage: false,
? AppCircularProgressIndicator() body: SingleChildScrollView(
: SingleChildScrollView(
child: Container( child: Container(
padding: padding:
EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
@ -84,6 +87,7 @@ class _Login extends State<Login> {
onCountryChange: (value) => countryCode = value), onCountryChange: (value) => countryCode = value),
Container( Container(
child: TextFields( child: TextFields(
fontWeight: FontWeight.normal,
controller: nationalIDorFile, controller: nationalIDorFile,
onChanged: (value) => {validateForm()}, onChanged: (value) => {validateForm()},
prefixIcon: Icon( prefixIcon: Icon(
@ -146,7 +150,7 @@ class _Login extends State<Login> {
} }
checkUserAuthentication() { checkUserAuthentication() {
showLoader(true); // showLoader(true);
var request = CheckPatientAuthenticationReq(); var request = CheckPatientAuthenticationReq();
request.isRegister = false; request.isRegister = false;
request.patientMobileNumber = int.parse(mobileNo); request.patientMobileNumber = int.parse(mobileNo);
@ -162,7 +166,7 @@ class _Login extends State<Login> {
} }
sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
authService.checkPatientAuthentication(request).then((value) => { authService.checkPatientAuthentication(request).then((value) => {
showLoader(false), //showLoader(false),
if (value['isSMSSent']) if (value['isSMSSent'])
{ {
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
@ -173,7 +177,11 @@ class _Login extends State<Login> {
{ {
if (value['IsAuthenticated']) {this.checkActivationCode()} if (value['IsAuthenticated']) {this.checkActivationCode()}
} }
}); }).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
// SMSOTP.showLoadingDialog(context, false),
} }
checkActivationCode({code}) async { checkActivationCode({code}) async {
@ -181,6 +189,8 @@ class _Login extends State<Login> {
// request.logInTokenID = await sharedPref.getString(LOGIN_TOKEN_ID); // request.logInTokenID = await sharedPref.getString(LOGIN_TOKEN_ID);
// request.activationCode = code ?? "0000"; // request.activationCode = code ?? "0000";
// request.isSilentLogin = code != null ? false : true; // request.isSilentLogin = code != null ? false : true;
if (code == null)
//showLoader(true);
request['PatientMobileNumber'] = int.parse(mobileNo); request['PatientMobileNumber'] = int.parse(mobileNo);
request['ZipCode'] = countryCode; request['ZipCode'] = countryCode;
request['SearchType'] = loginType; request['SearchType'] = loginType;
@ -195,6 +205,7 @@ class _Login extends State<Login> {
// request.isRegister = false; // request.isRegister = false;
this.authService.checkActivationCode(request, code).then((result) => { this.authService.checkActivationCode(request, code).then((result) => {
result = CheckActivationCode.fromJson(result), result = CheckActivationCode.fromJson(result),
authenticatedUserObject.getUser(),
this.sharedPref.setObject(USER_PROFILE, result.list), this.sharedPref.setObject(USER_PROFILE, result.list),
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID),
this.sharedPref.setString(TOKEN, result.authenticationTokenID), this.sharedPref.setString(TOKEN, result.authenticationTokenID),
@ -202,6 +213,7 @@ class _Login extends State<Login> {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
HOME, HOME,
), ),
//showLoader(false),
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()
.then((value) => { .then((value) => {
@ -223,14 +235,17 @@ class _Login extends State<Login> {
), ),
) )
} }
}) }).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
// SMSOTP.showLoadingDialog(context, false), // SMSOTP.showLoadingDialog(context, false),
}); });
} }
showLoader(bool isTrue) { // showLoader(bool isTrue) {
setState(() { // setState(() {
isLoading = isTrue; // isLoading = isTrue;
}); // });
} // }
} }

@ -39,6 +39,7 @@ class _RegisterInfo extends State<RegisterInfo> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).register, appBarTitle: TranslationBase.of(context).register,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),

@ -45,6 +45,7 @@ class _Register extends State<Register> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).register, appBarTitle: TranslationBase.of(context).register,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
body: isLoading == true body: isLoading == true
? AppCircularProgressIndicator() ? AppCircularProgressIndicator()
: SingleChildScrollView( : SingleChildScrollView(

@ -28,6 +28,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).welcome, appBarTitle: TranslationBase.of(context).welcome,
isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
body: Padding( body: Padding(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
@ -60,7 +61,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
textAlign: TextAlign.left, textAlign: TextAlign.left,
), ),
SizedBox( SizedBox(
height: SizeConfig.realScreenHeight * .2, height: SizeConfig.realScreenHeight * .15,
) )
]), ]),
), ),

@ -30,7 +30,7 @@ class DoctorResponse extends StatelessWidget {
height: 65, height: 65,
), ),
AppExpandableNotifier( AppExpandableNotifier(
header: Padding( headerWidget: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -110,7 +110,7 @@ class DoctorResponse extends StatelessWidget {
), ),
), ),
AppExpandableNotifier( AppExpandableNotifier(
header: Padding( headerWidget: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,

@ -38,7 +38,7 @@ class MyBalancePage extends StatelessWidget {
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#B61422'), color: HexColor('#B61422'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7), borderRadius: BorderRadius.circular(7),
), ),
@ -96,8 +96,7 @@ class MyBalancePage extends StatelessWidget {
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).createAdvancedPayment, label: TranslationBase.of(context).createAdvancedPayment,
onTap: () { onTap: () {
Navigator.push(context, Navigator.push(context, FadePage(page: AdvancePaymentPage()));
FadePage(page: AdvancePaymentPage()));
}, },
), ),
), ),

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save