Conflicts:
	lib/config/config.dart
	lib/config/shared_pref_kay.dart
	lib/core/service/client/base_app_client.dart
	lib/pages/AlHabibMedicalService/​ health_calculators.dart
	lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart
	lib/pages/MyAppointments/widgets/AppointmentCardView.dart
	lib/pages/login/confirm-login.dart
	lib/pages/login/login.dart
	lib/services/appointment_services/GetDoctorsList.dart
	lib/uitl/translations_delegate_base.dart
	lib/widgets/drawer/app_drawer_widget.dart
	lib/widgets/others/app_scaffold_widget.dart
er_location
Mohammad Aljammal 6 years ago
commit 29f0402cbd

@ -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

@ -17,6 +17,9 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CALENDAR" /> <uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" /> <uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<application <application
android:name="io.flutter.app.FlutterApplication" android:name="io.flutter.app.FlutterApplication"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
@ -69,6 +72,9 @@
android:name="flutterEmbedding" android:name="flutterEmbedding"
android:value="2" /> android:value="2" />
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCiD4YqVqLNYbt8-htvFy4Wp8XSph9E3wM"/>
</application> </application>
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />

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: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict/> <dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist> </plist>

@ -57,8 +57,9 @@ 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 = 'Services/Lists.svc/REST/Get_HMG_Locations'; const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
@ -138,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 =
@ -149,6 +149,9 @@ const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
const CONFIRM_APPOINTMENT = const CONFIRM_APPOINTMENT =
"Services/MobileNotifications.svc/REST/ConfirmAppointment"; "Services/MobileNotifications.svc/REST/ConfirmAppointment";
const INSERT_VIDA_REQUEST =
"Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart";
//URL to cancel appointment //URL to cancel appointment
const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment"; const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment";
@ -178,6 +181,22 @@ const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_LIVECARE_CLINICS = const GET_LIVECARE_CLINICS =
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics'; 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics';
const GET_LIVECARE_SCHEDULE_CLINICS =
'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule';
const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST =
'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID';
const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS =
'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots';
const INSERT_LIVECARE_SCHEDULE_APPOINTMENT =
'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule';
const GET_PATIENT_SHARE_LIVECARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare";
const GET_LIVECARE_CLINIC_TIMING = const GET_LIVECARE_CLINIC_TIMING =
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule'; 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
@ -243,6 +262,14 @@ const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment';
const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter';
const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation';
const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
///My Trackers ///My Trackers
const GET_DIABETIC_RESULT_AVERAGE = const GET_DIABETIC_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
@ -296,6 +323,7 @@ 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 {
@ -318,6 +346,7 @@ class AppGlobal {
request.TokenID = "@dm!n"; request.TokenID = "@dm!n";
request.isDentalAllowedBackend = false; request.isDentalAllowedBackend = false;
request.DeviceTypeID = Platform.isIOS ? 1 : 2; request.DeviceTypeID = Platform.isIOS ? 1 : 2;
request.DeviceType = Platform.isIOS ? "iOS" : "Android";
return request; return request;
} }

@ -47,6 +47,8 @@ const Map<String, Map<String, String>> localizedValues = {
}, },
'confirmAppo': {'en': 'Confirm Appointment', 'ar': 'تأكيد الموعد'}, 'confirmAppo': {'en': 'Confirm Appointment', 'ar': 'تأكيد الموعد'},
'confirm': {'en': 'Confirm', 'ar': 'تأكيد'}, 'confirm': {'en': 'Confirm', 'ar': 'تأكيد'},
'confirmLiveCare': {'en': 'Confirm LiveCare', 'ar': 'تأكيد لايف كير'},
'waitingForDoctor': {'en': 'Waiting for doctor', 'ar': 'في انتظار الطبيب'},
'appointment': {'en': 'Appointment', 'ar': 'الموعد'}, 'appointment': {'en': 'Appointment', 'ar': 'الموعد'},
'confirmLater': {'en': 'Confirm Later', 'ar': 'تأكيد لاحقا'}, 'confirmLater': {'en': 'Confirm Later', 'ar': 'تأكيد لاحقا'},
'todoList': {'en': 'Todo List', 'ar': 'مهامي'}, 'todoList': {'en': 'Todo List', 'ar': 'مهامي'},
@ -58,6 +60,7 @@ const Map<String, Map<String, String>> localizedValues = {
'viewQR': {'en': 'View QR Code', 'ar': 'عرض رمز الاستجابة السريعة'}, 'viewQR': {'en': 'View QR Code', 'ar': 'عرض رمز الاستجابة السريعة'},
'instruction': {'en': 'Instructions', 'ar': 'تعليمات'}, 'instruction': {'en': 'Instructions', 'ar': 'تعليمات'},
'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'}, 'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'},
'livecareAppo': {'en': 'LiveCare Appointment', 'ar': 'الموعد لايف كير'},
'cancelAppoMsg': { 'cancelAppoMsg': {
'en': 'Are you sure you want to cancel this appointment?', 'en': 'Are you sure you want to cancel this appointment?',
'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟' 'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'
@ -576,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": "خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل."
},
}; };

@ -15,3 +15,4 @@ 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_SEARCH_APPO = 'is-search-appo';
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,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();
} }

@ -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,
@ -84,7 +84,6 @@ class BaseAppClient {
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),

@ -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,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 {
setState(ViewState.Busy);
await _amService.getAllTransportationOrders();
if (_amService.hasError) {
error = _amService.error; 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,6 +21,7 @@ class LabsViewModel extends BaseViewModel {
: _patientLabOrdersListHospital; : _patientLabOrdersListHospital;
void getLabs() async { void getLabs() async {
if (authenticatedUserObject.isLogin) {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabOrdersList(); await _labsService.getPatientLabOrdersList();
if (_labsService.hasError) { if (_labsService.hasError) {
@ -69,6 +70,7 @@ class LabsViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
}
setFilterType(FilterType filterType) { setFilterType(FilterType filterType) {
this.filterType = filterType; this.filterType = filterType;

@ -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,6 +12,7 @@ class MedicalViewModel extends BaseViewModel {
_medicalService.appoitmentAllHistoryResultList; _medicalService.appoitmentAllHistoryResultList;
getAppointmentHistory() async { getAppointmentHistory() async {
if (authenticatedUserObject.isLogin) {
setState(ViewState.Busy); setState(ViewState.Busy);
if (_medicalService.appoitmentAllHistoryResultList.length == 0) if (_medicalService.appoitmentAllHistoryResultList.length == 0)
await _medicalService.getAppointmentHistory(); await _medicalService.getAppointmentHistory();
@ -20,4 +22,5 @@ class MedicalViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
}
} }

@ -64,6 +64,7 @@ class AppoitmentAllHistoryResultList {
String qR; String qR;
int remaniningHoursTocanPay; int remaniningHoursTocanPay;
bool sMSButtonVisable; bool sMSButtonVisable;
int serviceID;
AppoitmentAllHistoryResultList( AppoitmentAllHistoryResultList(
{this.setupID, {this.setupID,
@ -130,7 +131,8 @@ class AppoitmentAllHistoryResultList {
this.projectName, this.projectName,
this.qR, this.qR,
this.remaniningHoursTocanPay, this.remaniningHoursTocanPay,
this.sMSButtonVisable}); this.sMSButtonVisable,
this.serviceID});
AppoitmentAllHistoryResultList.fromJson(Map<String, dynamic> json) { AppoitmentAllHistoryResultList.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];
@ -173,7 +175,9 @@ class AppoitmentAllHistoryResultList {
doctorImageURL = json['DoctorImageURL']; doctorImageURL = json['DoctorImageURL'];
doctorNameObj = json['DoctorNameObj']; doctorNameObj = json['DoctorNameObj'];
doctorRate = json['DoctorRate']; doctorRate = json['DoctorRate'];
doctorSpeciality = json['DoctorSpeciality'] != null ?json['DoctorSpeciality'].cast<String>() : ["null"]; doctorSpeciality = json['DoctorSpeciality'] != null
? json['DoctorSpeciality'].cast<String>()
: ["null"];
doctorTitle = json['DoctorTitle']; doctorTitle = json['DoctorTitle'];
gender = json['Gender']; gender = json['Gender'];
genderDescription = json['GenderDescription']; genderDescription = json['GenderDescription'];
@ -199,6 +203,7 @@ class AppoitmentAllHistoryResultList {
qR = json['QR']; qR = json['QR'];
remaniningHoursTocanPay = json['RemaniningHoursTocanPay']; remaniningHoursTocanPay = json['RemaniningHoursTocanPay'];
sMSButtonVisable = json['SMSButtonVisable']; sMSButtonVisable = json['SMSButtonVisable'];
serviceID = json['ServiceID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -269,6 +274,7 @@ class AppoitmentAllHistoryResultList {
data['QR'] = this.qR; data['QR'] = this.qR;
data['RemaniningHoursTocanPay'] = this.remaniningHoursTocanPay; data['RemaniningHoursTocanPay'] = this.remaniningHoursTocanPay;
data['SMSButtonVisable'] = this.sMSButtonVisable; data['SMSButtonVisable'] = this.sMSButtonVisable;
data['ServiceID'] = this.serviceID;
return data; return data;
} }
} }
@ -278,7 +284,8 @@ class PatientAppointmentList {
List<AppoitmentAllHistoryResultList> patientDoctorAppointmentList = List(); List<AppoitmentAllHistoryResultList> patientDoctorAppointmentList = List();
PatientAppointmentList( PatientAppointmentList(
{this.filterName, AppoitmentAllHistoryResultList patientDoctorAppointment}) { {this.filterName,
AppoitmentAllHistoryResultList patientDoctorAppointment}) {
patientDoctorAppointmentList.add(patientDoctorAppointment); patientDoctorAppointmentList.add(patientDoctorAppointment);
} }
} }

@ -13,7 +13,6 @@ class InsertAppointmentRequest extends Request {
bool IsVirtual; bool IsVirtual;
List<String> GeneralProcedureList; List<String> GeneralProcedureList;
String DeviceToken; String DeviceToken;
String DeviceType;
bool IsForLiveCare; bool IsForLiveCare;
String OriginalClinicID; String OriginalClinicID;
String OriginalProjectID; String OriginalProjectID;

@ -1,52 +1,54 @@
class PatientShareResponse { class PatientShareResponse {
int advanceNumber; int advanceNumber;
String appointmentDate; dynamic appointmentDate;
int appointmentNo; int appointmentNo;
int cashPrice; int cashPrice;
int cashPriceTax; int cashPriceTax;
int cashPriceWithTax; int cashPriceWithTax;
int clinicID; int clinicID;
String clinicName; dynamic clinicName;
int companyId; int companyId;
String companyName; dynamic companyName;
int companyShareWithTax; int companyShareWithTax;
String doctorImageURL; dynamic doctorImageURL;
String doctorNameObj; dynamic doctorNameObj;
List<String> doctorSpeciality; int doctorID;
Null errCode; List<dynamic> doctorSpeciality;
dynamic errCode;
int groupID; int groupID;
bool iSAllowOnlineCheckedIN; bool iSAllowOnlineCheckedIN;
Null insurancePolicyNo; dynamic insurancePolicyNo;
bool isExcludedForOnlineCheckin; bool isExcludedForOnlineCheckin;
int isFollowup; int isFollowup;
bool isLiveCareAppointment; bool isLiveCareAppointment;
bool isOnlineCheckedIN; bool isOnlineCheckedIN;
String message; dynamic message;
int nextAction; int nextAction;
Null patientCardID; dynamic patientCardID;
int patientID; int patientID;
dynamic patientShare; dynamic patientShare;
dynamic patientShareWithTax; dynamic patientShareWithTax;
int patientStatusType; int patientStatusType;
dynamic patientTaxAmount; dynamic patientTaxAmount;
String patientType; dynamic patientType;
int paymentAmount; int paymentAmount;
String paymentDate; dynamic paymentDate;
Null paymentMethodName; dynamic paymentMethodName;
Null paymentReferenceNumber; dynamic paymentReferenceNumber;
int policyId; int policyId;
String policyName; dynamic policyName;
String procedureName; dynamic procedureName;
int projectID; int projectID;
String projectName; dynamic projectName;
Null setupID; dynamic setupID;
int sourceType; int sourceType;
String startTime; dynamic startTime;
int status; int status;
int statusCode; int statusCode;
Null statusDesc; dynamic statusDesc;
Null subPolicyNo; dynamic subPolicyNo;
int userID; int userID;
int serviceID;
PatientShareResponse( PatientShareResponse(
{this.advanceNumber, {this.advanceNumber,
@ -60,6 +62,7 @@ class PatientShareResponse {
this.companyId, this.companyId,
this.companyName, this.companyName,
this.companyShareWithTax, this.companyShareWithTax,
this.doctorID,
this.doctorImageURL, this.doctorImageURL,
this.doctorNameObj, this.doctorNameObj,
this.doctorSpeciality, this.doctorSpeciality,
@ -96,9 +99,10 @@ class PatientShareResponse {
this.statusCode, this.statusCode,
this.statusDesc, this.statusDesc,
this.subPolicyNo, this.subPolicyNo,
this.userID}); this.userID,
this.serviceID});
PatientShareResponse.fromJson(Map<String, dynamic> json) { PatientShareResponse.fromJson(Map<dynamic, dynamic> json) {
advanceNumber = json['AdvanceNumber']; advanceNumber = json['AdvanceNumber'];
appointmentDate = json['AppointmentDate']; appointmentDate = json['AppointmentDate'];
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];
@ -110,9 +114,10 @@ class PatientShareResponse {
companyId = json['CompanyId']; companyId = json['CompanyId'];
companyName = json['CompanyName']; companyName = json['CompanyName'];
companyShareWithTax = json['CompanyShareWithTax']; companyShareWithTax = json['CompanyShareWithTax'];
doctorID = json['DoctorID'];
doctorImageURL = json['DoctorImageURL']; doctorImageURL = json['DoctorImageURL'];
doctorNameObj = json['DoctorNameObj']; doctorNameObj = json['DoctorNameObj'];
doctorSpeciality = json['DoctorSpeciality'].cast<String>(); // doctorSpeciality = json['DoctorSpeciality'].cast<dynamic>();
errCode = json['ErrCode']; errCode = json['ErrCode'];
groupID = json['GroupID']; groupID = json['GroupID'];
iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN']; iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN'];
@ -147,10 +152,11 @@ class PatientShareResponse {
statusDesc = json['StatusDesc']; statusDesc = json['StatusDesc'];
subPolicyNo = json['SubPolicyNo']; subPolicyNo = json['SubPolicyNo'];
userID = json['UserID']; userID = json['UserID'];
serviceID = json['ServiceID'];
} }
Map<String, dynamic> toJson() { Map<dynamic, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<dynamic, dynamic> data = new Map<dynamic, dynamic>();
data['AdvanceNumber'] = this.advanceNumber; data['AdvanceNumber'] = this.advanceNumber;
data['AppointmentDate'] = this.appointmentDate; data['AppointmentDate'] = this.appointmentDate;
data['AppointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
@ -162,6 +168,7 @@ class PatientShareResponse {
data['CompanyId'] = this.companyId; data['CompanyId'] = this.companyId;
data['CompanyName'] = this.companyName; data['CompanyName'] = this.companyName;
data['CompanyShareWithTax'] = this.companyShareWithTax; data['CompanyShareWithTax'] = this.companyShareWithTax;
data['DoctorID'] = this.doctorID;
data['DoctorImageURL'] = this.doctorImageURL; data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorNameObj'] = this.doctorNameObj; data['DoctorNameObj'] = this.doctorNameObj;
data['DoctorSpeciality'] = this.doctorSpeciality; data['DoctorSpeciality'] = this.doctorSpeciality;
@ -199,6 +206,7 @@ class PatientShareResponse {
data['StatusDesc'] = this.statusDesc; data['StatusDesc'] = this.statusDesc;
data['SubPolicyNo'] = this.subPolicyNo; data['SubPolicyNo'] = this.subPolicyNo;
data['UserID'] = this.userID; data['UserID'] = this.userID;
data['ServiceID'] = this.serviceID;
return data; return data;
} }
} }

@ -0,0 +1,96 @@
class CovidPaymentInfoResponse {
dynamic propertyChanged;
dynamic cashPriceField;
dynamic cashPriceTaxField;
dynamic cashPriceWithTaxField;
dynamic companyIdField;
String companyNameField;
dynamic companyShareWithTaxField;
dynamic errCodeField;
dynamic groupIDField;
dynamic insurancePolicyNoField;
String messageField;
dynamic patientCardIDField;
dynamic patientShareField;
dynamic patientShareWithTaxField;
dynamic patientTaxAmountField;
dynamic policyIdField;
dynamic policyNameField;
String procedureNameField;
dynamic setupIDField;
dynamic statusCodeField;
dynamic subPolicyNoField;
CovidPaymentInfoResponse(
{this.propertyChanged,
this.cashPriceField,
this.cashPriceTaxField,
this.cashPriceWithTaxField,
this.companyIdField,
this.companyNameField,
this.companyShareWithTaxField,
this.errCodeField,
this.groupIDField,
this.insurancePolicyNoField,
this.messageField,
this.patientCardIDField,
this.patientShareField,
this.patientShareWithTaxField,
this.patientTaxAmountField,
this.policyIdField,
this.policyNameField,
this.procedureNameField,
this.setupIDField,
this.statusCodeField,
this.subPolicyNoField});
CovidPaymentInfoResponse.fromJson(Map<String, dynamic> json) {
propertyChanged = json['PropertyChanged'];
cashPriceField = json['cashPriceField'];
cashPriceTaxField = json['cashPriceTaxField'];
cashPriceWithTaxField = json['cashPriceWithTaxField'];
companyIdField = json['companyIdField'];
companyNameField = json['companyNameField'];
companyShareWithTaxField = json['companyShareWithTaxField'];
errCodeField = json['errCodeField'];
groupIDField = json['groupIDField'];
insurancePolicyNoField = json['insurancePolicyNoField'];
messageField = json['messageField'];
patientCardIDField = json['patientCardIDField'];
patientShareField = json['patientShareField'];
patientShareWithTaxField = json['patientShareWithTaxField'];
patientTaxAmountField = json['patientTaxAmountField'];
policyIdField = json['policyIdField'];
policyNameField = json['policyNameField'];
procedureNameField = json['procedureNameField'];
setupIDField = json['setupIDField'];
statusCodeField = json['statusCodeField'];
subPolicyNoField = json['subPolicyNoField'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PropertyChanged'] = this.propertyChanged;
data['cashPriceField'] = this.cashPriceField;
data['cashPriceTaxField'] = this.cashPriceTaxField;
data['cashPriceWithTaxField'] = this.cashPriceWithTaxField;
data['companyIdField'] = this.companyIdField;
data['companyNameField'] = this.companyNameField;
data['companyShareWithTaxField'] = this.companyShareWithTaxField;
data['errCodeField'] = this.errCodeField;
data['groupIDField'] = this.groupIDField;
data['insurancePolicyNoField'] = this.insurancePolicyNoField;
data['messageField'] = this.messageField;
data['patientCardIDField'] = this.patientCardIDField;
data['patientShareField'] = this.patientShareField;
data['patientShareWithTaxField'] = this.patientShareWithTaxField;
data['patientTaxAmountField'] = this.patientTaxAmountField;
data['policyIdField'] = this.policyIdField;
data['policyNameField'] = this.policyNameField;
data['procedureNameField'] = this.procedureNameField;
data['setupIDField'] = this.setupIDField;
data['statusCodeField'] = this.statusCodeField;
data['subPolicyNoField'] = this.subPolicyNoField;
return data;
}
}

@ -0,0 +1,68 @@
class DriveThroughTestingCenterModel {
int rowID;
int iD;
int projectID;
String setupID;
double longitude;
double latitude;
int numberOfTracks;
bool isActive;
int createdBy;
String createdOn;
dynamic editedBy;
dynamic editedON;
dynamic projectName;
dynamic projectNameN;
DriveThroughTestingCenterModel(
{this.rowID,
this.iD,
this.projectID,
this.setupID,
this.longitude,
this.latitude,
this.numberOfTracks,
this.isActive,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedON,
this.projectName,
this.projectNameN});
DriveThroughTestingCenterModel.fromJson(Map<String, dynamic> json) {
rowID = json['RowID'];
iD = json['ID'];
projectID = json['ProjectID'];
setupID = json['SetupID'];
longitude = json['Longitude'];
latitude = json['Latitude'];
numberOfTracks = json['NumberOfTracks'];
isActive = json['IsActive'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedON = json['EditedON'];
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['RowID'] = this.rowID;
data['ID'] = this.iD;
data['ProjectID'] = this.projectID;
data['SetupID'] = this.setupID;
data['Longitude'] = this.longitude;
data['Latitude'] = this.latitude;
data['NumberOfTracks'] = this.numberOfTracks;
data['IsActive'] = this.isActive;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedON'] = this.editedON;
data['ProjectName'] = this.projectName;
data['ProjectNameN'] = this.projectNameN;
return data;
}
}

@ -0,0 +1,64 @@
class LiveCareScheduleClinicsListResponse {
List<ClinicsHaveScheduleList> clinicsHaveScheduleList;
LiveCareScheduleClinicsListResponse({this.clinicsHaveScheduleList});
LiveCareScheduleClinicsListResponse.fromJson(Map<String, dynamic> json) {
if (json['ClinicsHaveScheduleList'] != null) {
clinicsHaveScheduleList = new List<ClinicsHaveScheduleList>();
json['ClinicsHaveScheduleList'].forEach((v) {
clinicsHaveScheduleList.add(new ClinicsHaveScheduleList.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.clinicsHaveScheduleList != null) {
data['ClinicsHaveScheduleList'] =
this.clinicsHaveScheduleList.map((v) => v.toJson()).toList();
}
return data;
}
}
class ClinicsHaveScheduleList {
int clinicID;
int serviceID;
int projectID;
String clinicDesc;
String clinicDescN;
String projectDesc;
String projectDescN;
ClinicsHaveScheduleList(
{this.clinicID,
this.serviceID,
this.projectID,
this.clinicDesc,
this.clinicDescN,
this.projectDesc,
this.projectDescN});
ClinicsHaveScheduleList.fromJson(Map<String, dynamic> json) {
clinicID = json['ClinicID'];
serviceID = json['ServiceID'];
projectID = json['ProjectID'];
clinicDesc = json['ClinicDesc'];
clinicDescN = json['ClinicDescN'];
projectDesc = json['ProjectDesc'];
projectDescN = json['ProjectDescN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ClinicID'] = this.clinicID;
data['ServiceID'] = this.serviceID;
data['ProjectID'] = this.projectID;
data['ClinicDesc'] = this.clinicDesc;
data['ClinicDescN'] = this.clinicDescN;
data['ProjectDesc'] = this.projectDesc;
data['ProjectDescN'] = this.projectDescN;
return data;
}
}

@ -0,0 +1,92 @@
class insertVIDARequest {
int patientID;
int acceptedBy;
int appointmentNo;
String deviceToken;
double latitude;
double longitude;
int serviceID;
int projectID;
int clinicID;
String deviceType;
String voipToken;
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
int patientOutSA;
String sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
insertVIDARequest(
{this.patientID,
this.acceptedBy,
this.appointmentNo,
this.deviceToken,
this.latitude,
this.longitude,
this.serviceID,
this.projectID,
this.clinicID,
this.deviceType,
this.voipToken,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID});
insertVIDARequest.fromJson(Map<String, dynamic> json) {
patientID = json['PatientID'];
acceptedBy = json['AcceptedBy'];
appointmentNo = json['AppointmentNo'];
deviceToken = json['DeviceToken'];
latitude = json['Latitude'];
longitude = json['Longitude'];
serviceID = json['ServiceID'];
projectID = json['ProjectID'];
clinicID = json['ClinicID'];
deviceType = json['DeviceType'];
voipToken = json['VoipToken'];
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'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientID'] = this.patientID;
data['AcceptedBy'] = this.acceptedBy;
data['AppointmentNo'] = this.appointmentNo;
data['DeviceToken'] = this.deviceToken;
data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude;
data['ServiceID'] = this.serviceID;
data['ProjectID'] = this.projectID;
data['ClinicID'] = this.clinicID;
data['DeviceType'] = this.deviceType;
data['VoipToken'] = this.voipToken;
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;
return data;
}
}

@ -5,6 +5,7 @@ class Request {
var ProjectID; var ProjectID;
var LanguageID; var LanguageID;
var DeviceTypeID; var DeviceTypeID;
var DeviceType;
var AppointmentNo; var AppointmentNo;
var IPAdress; var IPAdress;
var VersionID; var VersionID;

@ -42,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(

@ -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);

@ -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);

@ -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);

@ -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();

@ -96,7 +96,7 @@ class _DeliveryDueState extends State<DeliveryDue> {
children: [ children: [
Row( Row(
children: [ children: [
Icon(Icons.date_range_rounded), Icon(Icons.date_range),
Texts('Date'), Texts('Date'),
], ],
), ),

@ -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);

@ -1,4 +1,3 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.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';
@ -7,6 +6,8 @@ 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:intl/intl.dart'; import 'package:intl/intl.dart';
import 'ovulation_result_page.dart';
class OvulationPeriod extends StatefulWidget { class OvulationPeriod extends StatefulWidget {
@override @override
_OvulationPeriodState createState() => _OvulationPeriodState(); _OvulationPeriodState createState() => _OvulationPeriodState();

@ -190,7 +190,7 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
child: TextFormField( child: TextFormField(
controller: textController, controller: textController,
inputFormatters: <TextInputFormatter>[ inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.digitsOnly // FilteringTextInputFormatter.digitsOnly
], ],
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: InputDecoration( decoration: InputDecoration(

@ -192,7 +192,7 @@ class _BloodSugarState extends State<BloodSugar> {
child: TextFormField( child: TextFormField(
controller: textController, controller: textController,
inputFormatters: <TextInputFormatter>[ inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.digitsOnly // FilteringTextInputFormatter.digitsOnly
], ],
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: InputDecoration( decoration: InputDecoration(

@ -188,7 +188,7 @@ class _TriglyceridesState extends State<Triglycerides> {
child: TextFormField( child: TextFormField(
controller: textController, controller: textController,
inputFormatters: <TextInputFormatter>[ inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.digitsOnly // FilteringTextInputFormatter.digitsOnly
], ],
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: InputDecoration( decoration: InputDecoration(

@ -1,5 +1,5 @@
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart';
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/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/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart';
@ -9,7 +9,9 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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/delivery_due/delivery_due.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';

@ -24,10 +24,12 @@ class BookConfirm extends StatefulWidget {
String appoDateFormatted = ""; String appoDateFormatted = "";
String appoTimeFormatted = ""; String appoTimeFormatted = "";
bool isLiveCareAppointment;
BookConfirm( BookConfirm(
{@required this.doctor, {@required this.doctor,
@required this.selectedDate, @required this.selectedDate,
@required this.isLiveCareAppointment,
@required this.selectedTime}); @required this.selectedTime});
DoctorsListService service; DoctorsListService service;
@ -208,11 +210,13 @@ class _BookConfirmState extends State<BookConfirm> {
"assets/images/new-design/icon_hospital.png"), "assets/images/new-design/icon_hospital.png"),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.7,
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0), margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text( child: Text(
TranslationBase.of(context).clinic + TranslationBase.of(context).clinic +
": " + ": " +
widget.doctor.clinicName, widget.doctor.clinicName,
overflow: TextOverflow.clip,
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
color: Colors.grey[700], color: Colors.grey[700],
@ -338,6 +342,9 @@ class _BookConfirmState extends State<BookConfirm> {
), ),
), ),
), ),
SizedBox(
height: 120.0,
),
], ],
), ),
), ),
@ -358,7 +365,11 @@ class _BookConfirmState extends State<BookConfirm> {
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
onPressed: () { onPressed: () {
if (!widget.isLiveCareAppointment) {
insertAppointment(context, widget.doctor); insertAppointment(context, widget.doctor);
} else {
insertLiveCareScheduledAppointment(context, widget.doctor);
}
}, },
child: Text(TranslationBase.of(context).bookNow, child: Text(TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 18.0)), style: TextStyle(fontSize: 18.0)),
@ -375,7 +386,11 @@ class _BookConfirmState extends State<BookConfirm> {
service.cancelAppointment(appo, context).then((res) { service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () { Future.delayed(new Duration(milliseconds: 1500), () {
insertAppointment(context, docObject); if (!widget.isLiveCareAppointment) {
insertAppointment(context, widget.doctor);
} else {
insertLiveCareScheduledAppointment(context, widget.doctor);
}
}); });
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
@ -434,6 +449,55 @@ class _BookConfirmState extends State<BookConfirm> {
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
insertLiveCareScheduledAppointment(context, DoctorList docObject) {
AppoitmentAllHistoryResultList appo;
widget.service
.insertLiveCareScheduleAppointment(
docObject.doctorID,
docObject.clinicID,
docObject.projectID,
docObject.serviceID,
widget.selectedTime,
widget.selectedDate,
context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
print(res['AppointmentNo']);
Future.delayed(new Duration(milliseconds: 1800), () {
getLiveCareAppointmentPatientShare(context, res['AppointmentNo'],
docObject.clinicID, docObject.projectID, docObject);
});
} else {
appo = new AppoitmentAllHistoryResultList();
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
appo.projectID = res['SameClinicApptList'][0]['ProjectID'];
appo.endTime = res['SameClinicApptList'][0]['EndTime'];
appo.startTime = res['SameClinicApptList'][0]['StartTime'];
appo.doctorID = res['SameClinicApptList'][0]['DoctorID'];
appo.isLiveCareAppointment = true;
appo.originalClinicID = 0;
appo.originalProjectID = 0;
appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate'];
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: res['ErrorEndUserMessage'],
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {cancelAppointment(docObject, appo, context)},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
}).catchError((err) {
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
getPatientShare(context, String appointmentNo, int clinicID, int projectID, getPatientShare(context, String appointmentNo, int clinicID, int projectID,
DoctorList docObject) { DoctorList docObject) {
widget.service widget.service
@ -448,6 +512,21 @@ class _BookConfirmState extends State<BookConfirm> {
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
getLiveCareAppointmentPatientShare(context, String appointmentNo,
int clinicID, int projectID, DoctorList docObject) {
widget.service
.getLiveCareAppointmentPatientShare(
appointmentNo, clinicID, projectID, context)
.then((res) {
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
String getTime(DateTime dateTime) { String getTime(DateTime dateTime) {
final DateFormat formatter = DateFormat('HH:mm'); final DateFormat formatter = DateFormat('HH:mm');
setState(() { setState(() {
@ -502,7 +581,6 @@ class _BookConfirmState extends State<BookConfirm> {
Future navigateToBookSuccess(context, DoctorList docObject, Future navigateToBookSuccess(context, DoctorList docObject,
PatientShareResponse patientShareResponse) async { PatientShareResponse patientShareResponse) async {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(

@ -39,12 +39,6 @@ class _BookSuccessState extends State<BookSuccess> {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; AuthenticatedUser authUser;
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -184,6 +178,9 @@ class _BookSuccessState extends State<BookSuccess> {
case 30: case 30:
return _getQRAppo(); return _getQRAppo();
break; break;
case 50:
return _getConfirmAppo();
break;
} }
} }
@ -204,6 +201,9 @@ class _BookSuccessState extends State<BookSuccess> {
case 30: case 30:
return 'QR Code'; return 'QR Code';
break; break;
case 50:
return 'Confirm LiveCare';
break;
} }
} }
@ -286,8 +286,24 @@ class _BookSuccessState extends State<BookSuccess> {
textColor: Colors.white, textColor: Colors.white,
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
onPressed: () {}, onPressed: () {
child: Text(TranslationBase.of(context).confirm.toUpperCase(), AppoitmentAllHistoryResultList appo =
new AppoitmentAllHistoryResultList();
appo.clinicID = widget.docObject.clinicID;
appo.projectID = widget.docObject.projectID;
appo.appointmentNo =
widget.patientShareResponse.appointmentNo;
appo.serviceID = widget.patientShareResponse.serviceID;
appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
appo.doctorID = widget.patientShareResponse.doctorID;
confirmAppointment(appo);
},
child: Text(
widget.patientShareResponse.isLiveCareAppointment
? TranslationBase.of(context)
.confirmLiveCare
.toUpperCase()
: TranslationBase.of(context).confirm.toUpperCase(),
style: TextStyle(fontSize: 18.0)), style: TextStyle(fontSize: 18.0)),
), ),
), ),
@ -321,6 +337,50 @@ class _BookSuccessState extends State<BookSuccess> {
return Container(); return Container();
} }
confirmAppointment(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service
.confirmAppointment(
appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
if (appo.isLiveCareAppointment) {
insertLiveCareVIDARequest(appo);
} else {
navigateToHome(context);
}
});
}
insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.serviceID, appo.doctorID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
navigateToHome(context);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Widget _getPayNowAppo() { Widget _getPayNowAppo() {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -543,7 +603,8 @@ class _BookSuccessState extends State<BookSuccess> {
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
@ -560,22 +621,12 @@ class _BookSuccessState extends State<BookSuccess> {
appo.appointmentNo.toString()); appo.appointmentNo.toString());
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); }).showProgressBar(
} text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
// }
// Future navigateToQR(
// context, String appoQR, PatientShareResponse patientShareResponse) async { addAdvancedNumberRequest(
// Navigator.push( String advanceNumber, String paymentReference, String appointmentID) {
// context,
// MaterialPageRoute(
// builder: (context) => QRCode(
// patientShareResponse: patientShareResponse,
// appoQR: appoQR,
// ))).then((value) {});
// }
addAdvancedNumberRequest(String advanceNumber, String paymentReference,
String appointmentID) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.addAdvancedNumberRequest( .addAdvancedNumberRequest(
@ -585,7 +636,8 @@ class _BookSuccessState extends State<BookSuccess> {
getAppoQR(context); getAppoQR(context);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Widget _getQRAppo() { Widget _getQRAppo() {
@ -730,7 +782,7 @@ class _BookSuccessState extends State<BookSuccess> {
} }
Future navigateToHome(context) async { Future navigateToHome(context) async {
Navigator.of(context).pushNamed(HOME); Navigator.of(context).popAndPushNamed(HOME);
} }
getAppoQR(context) { getAppoQR(context) {
@ -742,7 +794,8 @@ class _BookSuccessState extends State<BookSuccess> {
navigateToQR(context, res['AppointmentQR']); navigateToQR(context, res['AppointmentQR']);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Future navigateToQR(context, String appoQR) async { Future navigateToQR(context, String appoQR) async {

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -10,7 +11,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'BookConfirm.dart'; import 'BookConfirm.dart';
import 'components/DocAvailableAppointments.dart'; import 'components/DocAvailableAppointments.dart';
import 'components/DocInfo.dart'; import 'components/DocInfo.dart';
@ -19,9 +20,12 @@ class DoctorProfile extends StatefulWidget {
DoctorList doctor; DoctorList doctor;
DoctorProfileList docProfileList; DoctorProfileList docProfileList;
final bool isOpenAppt; final bool isOpenAppt;
bool isLiveCareAppointment;
DoctorProfile( DoctorProfile(
{@required this.doctor, {@required this.doctor,
@required this.docProfileList, @required this.docProfileList,
@required this.isLiveCareAppointment,
this.isOpenAppt = false}); this.isOpenAppt = false});
AuthenticatedUser authUser; AuthenticatedUser authUser;
@ -35,6 +39,7 @@ class _DoctorProfileState extends State<DoctorProfile>
TabController _tabController; TabController _tabController;
bool showFooterButton = false; bool showFooterButton = false;
var event = RobotProvider(); var event = RobotProvider();
@override @override
void initState() { void initState() {
_tabController = new TabController( _tabController = new TabController(
@ -54,6 +59,7 @@ class _DoctorProfileState extends State<DoctorProfile>
// }); // });
_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;
getPatientData(); getPatientData();
super.initState(); super.initState();
} }
@ -190,7 +196,9 @@ class _DoctorProfileState extends State<DoctorProfile>
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
children: [ children: [
DoctorInformation(docProfileList: widget.docProfileList), DoctorInformation(docProfileList: widget.docProfileList),
DocAvailableAppointments(doctor: widget.doctor) DocAvailableAppointments(
doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment)
], ],
controller: _tabController, controller: _tabController,
), ),
@ -245,6 +253,7 @@ class _DoctorProfileState extends State<DoctorProfile>
MaterialPageRoute( MaterialPageRoute(
builder: (context) => BookConfirm( builder: (context) => BookConfirm(
doctor: widget.doctor, doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment,
selectedDate: DocAvailableAppointments.selectedDate, selectedDate: DocAvailableAppointments.selectedDate,
selectedTime: DocAvailableAppointments.selectedTime))); selectedTime: DocAvailableAppointments.selectedTime)));
} }

@ -9,9 +9,10 @@ import 'package:flutter/material.dart';
class SearchResults extends StatefulWidget { class SearchResults extends StatefulWidget {
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital; List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
bool isLiveCareAppointment;
SearchResults( SearchResults(
{@required this.doctorsList, this.patientDoctorAppointmentListHospital}); {@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
@override @override
_SearchResultsState createState() => _SearchResultsState(); _SearchResultsState createState() => _SearchResultsState();
@ -52,6 +53,7 @@ class _SearchResultsState extends State<SearchResults> {
.map((doctor) { .map((doctor) {
return DoctorView( return DoctorView(
doctor: doctor, doctor: doctor,
isLiveCareAppointment: widget.isLiveCareAppointment,
); );
}).toList(), }).toList(),
)), )),

@ -2,12 +2,13 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/timeSlot.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:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:table_calendar/table_calendar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:table_calendar/table_calendar.dart';
import '../../../uitl/date_uitl.dart'; import '../../../uitl/date_uitl.dart';
@ -17,8 +18,10 @@ class DocAvailableAppointments extends StatefulWidget {
static DateTime selectedAppoDateTime; static DateTime selectedAppoDateTime;
static String selectedDate; static String selectedDate;
static String selectedTime; static String selectedTime;
bool isLiveCareAppointment;
DocAvailableAppointments({@required this.doctor}); DocAvailableAppointments(
{@required this.doctor, @required this.isLiveCareAppointment});
@override @override
_DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState createState() =>
@ -31,6 +34,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
AnimationController _animationController; AnimationController _animationController;
CalendarController _calendarController; CalendarController _calendarController;
AppSharedPreferences sharedPref = new AppSharedPreferences();
var selectedDate = ""; var selectedDate = "";
dynamic selectedDateJSON; dynamic selectedDateJSON;
dynamic jsonFreeSlots; dynamic jsonFreeSlots;
@ -56,8 +61,13 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
_selectedDay: ['Event A0'] _selectedDay: ['Event A0']
}; };
WidgetsBinding.instance WidgetsBinding.instance.addPostFrameCallback((_) async {
.addPostFrameCallback((_) => getDoctorFreeSlots(context, widget.doctor)); if (widget.isLiveCareAppointment)
getDoctorScheduledFreeSlots(context, widget.doctor);
else {
getDoctorFreeSlots(context, widget.doctor);
}
});
_calendarController = CalendarController(); _calendarController = CalendarController();
_animationController = AnimationController( _animationController = AnimationController(
@ -323,8 +333,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
getDoctorFreeSlots(context, DoctorList docObject) { getDoctorFreeSlots(context, DoctorList docObject) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.getDoctorFreeSlots( .getDoctorFreeSlots(docObject.doctorID, docObject.clinicID,
docObject.doctorID, docObject.clinicID, docObject.projectID, context) docObject.projectID, context)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) { if (res['FreeTimeSlots'].length != 0) {
@ -340,7 +350,32 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
getDoctorScheduledFreeSlots(context, DoctorList docObject) {
DoctorsListService service = new DoctorsListService();
service
.getDoctorScheduledFreeSlots(docObject.doctorID, docObject.clinicID,
docObject.projectID, docObject.serviceID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
if (res['PatientER_DoctorFreeSlots'].length != 0) {
freeSlotsResponse = res['PatientER_DoctorFreeSlots'];
print("res['PatientER_DoctorFreeSlots']");
print(res['PatientER_DoctorFreeSlots'].length);
_getJSONSlots().then((value) => {
setState(() => {_events.clear(), _events = value})
});
} else {}
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Widget _buildEventsMarker(DateTime date, List events) { Widget _buildEventsMarker(DateTime date, List events) {

@ -162,6 +162,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => SearchResults( builder: (context) => SearchResults(
isLiveCareAppointment: false,
doctorsList: docList, doctorsList: docList,
patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital))); patientDoctorAppointmentListHospital)));

@ -148,8 +148,8 @@ class _ExpandableListViewState extends State<ExpandableListView> {
widget.doctorsList2[index].projectName.toString() widget.doctorsList2[index].projectName.toString()
? DoctorView( ? DoctorView(
//AJ note //AJ note
doctor: widget.doctorsList2[index] doctor: widget.doctorsList2[index],
isLiveCareAppointment: false,
// widget.doctorsList2[index] // widget.doctorsList2[index]
) )
: Container(); : Container();

@ -11,10 +11,11 @@ import '../DoctorProfile.dart';
class DoctorView extends StatelessWidget { class DoctorView extends StatelessWidget {
final DoctorList doctor; final DoctorList doctor;
bool isLiveCareAppointment;
DoctorView({@required this.doctor}); DoctorView({@required this.doctor, @required this.isLiveCareAppointment});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -186,6 +187,7 @@ class DoctorView extends StatelessWidget {
MaterialPageRoute( MaterialPageRoute(
builder: (context) => DoctorProfile( builder: (context) => DoctorProfile(
doctor: docObject, doctor: docObject,
isLiveCareAppointment: isLiveCareAppointment,
docProfileList: docProfile, docProfileList: docProfile,
isOpenAppt: isAppo, isOpenAppt: isAppo,
))); )));

@ -138,7 +138,7 @@ class _HospitalsLiveChatPageState extends State<HospitalsLiveChatPage> {
))), //model.cOCItemList[index].cOCTitl ))), //model.cOCItemList[index].cOCTitl
IconButton( IconButton(
icon: Icon( icon: Icon(
Icons.arrow_forward, Icons.arrow_forward_ios,
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(

@ -0,0 +1,599 @@
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:intl/intl.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import 'package:table_calendar/table_calendar.dart';
class CovidTimeSlots extends StatefulWidget {
int projectID;
static bool areSlotsAvailable = false;
static DateTime selectedAppoDateTime;
static String selectedDate;
static String selectedTime;
int selectedClinicID;
int selectedDoctorID;
PatientShareResponse patientShareResponse;
CovidTimeSlots({@required this.projectID});
@override
_CovidTimeSlotsState createState() => _CovidTimeSlotsState();
}
class _CovidTimeSlotsState extends State<CovidTimeSlots>
with TickerProviderStateMixin {
Map<DateTime, List> _events;
AnimationController _animationController;
CalendarController _calendarController;
AppSharedPreferences sharedPref = new AppSharedPreferences();
var selectedDate = "";
dynamic selectedDateJSON;
dynamic jsonFreeSlots;
List<TimeSlot> docFreeSlots = [];
List<TimeSlot> dayEvents = [];
int selectedButtonIndex = 0;
dynamic freeSlotsResponse;
ScrollController _scrollController;
@override
void initState() {
final _selectedDay = DateTime.now();
widget.patientShareResponse = new PatientShareResponse();
_scrollController = new ScrollController();
_events = {
_selectedDay: ['Event A0']
};
WidgetsBinding.instance.addPostFrameCallback(
(_) => getCovidFreeSlots(context, widget.projectID));
_calendarController = CalendarController();
_animationController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 50),
);
_animationController.forward();
super.initState();
}
@override
void dispose() {
_animationController.dispose();
_calendarController.dispose();
super.dispose();
}
void _onDaySelected(DateTime day, List events) {
final DateFormat formatter = DateFormat('yyyy-MM-dd');
setState(() {
this.selectedDate = DateUtil.getMonthDayYearDateFormatted(day);
openTimeSlotsPickerForDate(day, docFreeSlots);
CovidTimeSlots.selectedDate = formatter.format(day);
print(CovidTimeSlots.selectedDate);
});
}
void _onVisibleDaysChanged(
DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onVisibleDaysChanged');
}
void _onCalendarCreated(
DateTime first, DateTime last, CalendarFormat format) {
print('CALLBACK: _onCalendarCreated');
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "COVID-19 TEST",
isShowAppBar: true,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
height: 150.0,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
"assets/images/new-design/covid-19-big-banner-bg.png"),
fit: BoxFit.fill,
),
color: Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(Radius.circular(10))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin:
EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg',
width: 90.0,
height: 90.0),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(
left: 20.0, right: 20.0, top: 40.0),
child: Text("COVID-19 TEST",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 24.0)),
),
Container(
margin: EdgeInsets.only(
left: 20.0, right: 20.0, top: 10.0),
child: Text("Drive-Thru",
style: TextStyle(
color: Colors.white, fontSize: 24.0)),
),
],
),
],
),
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: Colors.white),
margin: EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 5.0),
padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0),
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * 0.65,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.all(10.0),
child: Text(
"Kindly select one of the available appointments from below: ",
style:
TextStyle(color: Colors.black, fontSize: 16.0)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text(selectedDate,
style: TextStyle(
fontSize: 18.0, fontWeight: FontWeight.bold)),
),
Container(
height: 50,
margin: EdgeInsets.all(20.0),
child: ListView.builder(
controller: _scrollController,
scrollDirection: Axis.horizontal,
itemCount: dayEvents.length,
itemBuilder: (context, index) {
return Container(
margin: EdgeInsets.only(right: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0),
side: BorderSide(
color: Colors.blue[400],
//Color of the border
style: BorderStyle.solid,
//Style of the border
width: 1.5, //width of the border
),
),
minWidth:
MediaQuery.of(context).size.width * 0.2,
child: index == selectedButtonIndex
? getSelectedButton(index)
: getNormalButton(index)),
);
},
),
),
_buildTableCalendarWithBuilders(),
],
),
),
SizedBox(
height: 100.0,
),
],
),
),
),
bottomSheet: Container(
margin: EdgeInsets.all(10.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
bookCovidTestAppointment();
},
child: Text("BOOK", style: TextStyle(fontSize: 18.0)),
),
),
),
),
],
),
),
);
}
Widget _buildTableCalendarWithBuilders() {
return TableCalendar(
locale: 'en_US',
calendarController: _calendarController,
events: _events,
initialCalendarFormat: CalendarFormat.month,
startDay: DateTime.now(),
formatAnimation: FormatAnimation.slide,
startingDayOfWeek: StartingDayOfWeek.sunday,
weekendDays: [DateTime.friday, DateTime.saturday],
availableGestures: AvailableGestures.horizontalSwipe,
availableCalendarFormats: const {
CalendarFormat.month: '',
CalendarFormat.week: '',
},
calendarStyle: CalendarStyle(
outsideDaysVisible: false,
weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
),
daysOfWeekStyle: DaysOfWeekStyle(
weekendStyle: TextStyle().copyWith(color: Colors.blue[600]),
),
headerStyle: HeaderStyle(
centerHeaderTitle: true,
formatButtonVisible: false,
),
builders: CalendarBuilders(
selectedDayBuilder: (context, date, _) {
return FadeTransition(
opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
child: Container(
margin: const EdgeInsets.all(4.0),
padding: const EdgeInsets.only(top: 5.0, left: 6.0),
color: Colors.transparent,
width: 0,
height: 0,
child: Text(
'${date.day}',
style: TextStyle().copyWith(fontSize: 16.0),
),
),
);
},
todayDayBuilder: (context, date, _) {
return Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _calendarController.isSelected(date)
? Colors.green[400]
: _calendarController.isToday(date)
? Colors.brown[300]
: Colors.blue[400],
),
width: 40.0,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 14.0,
),
),
),
);
},
markersBuilder: (context, date, events, holidays) {
final children = <Widget>[];
if (events.isNotEmpty) {
children.add(
Positioned(
right: 4,
bottom: 4,
child: _buildEventsMarker(date, events),
),
);
}
return children;
},
),
onDaySelected: (date, events) {
_onDaySelected(date, events);
_animationController.forward(from: 0.0);
},
onVisibleDaysChanged: _onVisibleDaysChanged,
onCalendarCreated: _onCalendarCreated,
);
}
openTimeSlotsPickerForDate(DateTime dateStart, List<TimeSlot> freeSlots) {
dayEvents.clear();
DateTime dateStartObj = new DateTime(
dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
freeSlots.forEach((v) {
if (v.start == dateStartObj) dayEvents.add(v);
});
setState(() {
if (dayEvents.length != 0)
CovidTimeSlots.areSlotsAvailable = true;
else
CovidTimeSlots.areSlotsAvailable = false;
selectedButtonIndex = 0;
CovidTimeSlots.selectedTime = dayEvents[selectedButtonIndex].isoTime;
});
}
Future<Map<DateTime, List>> _getJSONSlots() async {
Map<DateTime, List> _eventsParsed;
List<FreeSlot> slotsList = [];
DateTime date;
final DateFormat formatter = DateFormat('HH:mm');
final DateFormat dateFormatter = DateFormat('yyyy-MM-dd');
for (var i = 0; i < freeSlotsResponse.length; i++) {
date =
DateUtil.convertStringToDate(freeSlotsResponse[i]['FreeTimeSlots']);
slotsList.add(FreeSlot(date, ['slot']));
docFreeSlots.add(TimeSlot(
isoTime: formatter.format(date),
start: new DateTime(date.year, date.month, date.day, 0, 0, 0, 0),
end: date));
}
_eventsParsed =
Map.fromIterable(slotsList, key: (e) => e.slot, value: (e) => e.event);
setState(() {
CovidTimeSlots.selectedDate = dateFormatter.format(
DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots']));
selectedDate = DateUtil.getMonthDayYearDateFormatted(
DateUtil.convertStringToDate(freeSlotsResponse[0]['FreeTimeSlots']));
selectedDateJSON = freeSlotsResponse[0]['FreeTimeSlots'];
});
openTimeSlotsPickerForDate(
DateUtil.convertStringToDate(selectedDateJSON), docFreeSlots);
_calendarController
.setFocusedDay(DateUtil.convertStringToDate(selectedDateJSON));
return _eventsParsed;
}
Widget _buildEventsMarker(DateTime date, List events) {
return Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _calendarController.isSelected(date)
? Colors.green[400]
: _calendarController.isToday(date)
? Colors.brown[300]
: Colors.blue[400],
),
width: 40.0,
height: 40.0,
child: Center(
child: Text(
'${date.day}',
style: TextStyle().copyWith(
color: Colors.white,
fontSize: 14.0,
),
),
),
);
}
Widget getNormalButton(int index) {
return RaisedButton(
color: Colors.white,
textColor: new Color(0xFF60686b),
onPressed: () {
setState(() {
selectedButtonIndex = index;
CovidTimeSlots.selectedTime = dayEvents[index].isoTime;
print(CovidTimeSlots.selectedTime);
});
},
child: Text(dayEvents[index].isoTime,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
);
}
Widget getSelectedButton(int index) {
return RaisedButton(
color: Colors.blue[400],
textColor: Colors.white,
onPressed: () {
setState(() {
selectedButtonIndex = index;
CovidTimeSlots.selectedTime = dayEvents[index].isoTime;
print(CovidTimeSlots.selectedTime);
});
},
child: Text(dayEvents[index].isoTime,
style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold)),
);
}
bookCovidTestAppointment() {
// Navigator.push(context,
// MaterialPageRoute(builder: (context) => CovidPaymentAlert()));
DoctorList docObject = new DoctorList();
docObject.doctorID = widget.selectedDoctorID;
docObject.clinicID = widget.selectedClinicID;
docObject.projectID = widget.projectID;
insertAppointmentCovidTest(context, docObject);
}
insertAppointmentCovidTest(context, DoctorList docObject) {
DoctorsListService service = new DoctorsListService();
AppoitmentAllHistoryResultList appo;
service
.insertAppointment(
docObject.doctorID,
docObject.clinicID,
docObject.projectID,
CovidTimeSlots.selectedTime,
CovidTimeSlots.selectedDate,
context)
.then((res) {
print(res);
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Appointment Booked Successfully");
Future.delayed(new Duration(milliseconds: 1800), () {
getPatientShare(context, res['AppointmentNo'], docObject.clinicID,
docObject.projectID, docObject);
});
} else {
appo = new AppoitmentAllHistoryResultList();
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
appo.projectID = res['SameClinicApptList'][0]['ProjectID'];
appo.endTime = res['SameClinicApptList'][0]['EndTime'];
appo.startTime = res['SameClinicApptList'][0]['StartTime'];
appo.doctorID = res['SameClinicApptList'][0]['DoctorID'];
appo.isLiveCareAppointment = false;
appo.originalClinicID = 0;
appo.originalProjectID = 0;
appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate'];
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: res['ErrorEndUserMessage'],
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {cancelAppointment(docObject, appo, context)},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
}).catchError((err) {
AppToast.showErrorToast(message: err);
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo,
BuildContext context) {
ConfirmDialog.closeAlertDialog(context);
DoctorsListService service = new DoctorsListService();
service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () {
insertAppointmentCovidTest(context, docObject);
});
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
getPatientShare(context, String appointmentNo, int clinicID, int projectID,
DoctorList docObject) {
DoctorsListService service = new DoctorsListService();
service
.getPatientShare(appointmentNo, clinicID, projectID, context)
.then((res) {
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
navigateToPaymentAlert();
});
}
navigateToPaymentAlert() {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CovidPaymentAlert(
patientShareResponse: widget.patientShareResponse)));
}
getCovidFreeSlots(BuildContext context, int projectID) {
CovidDriveThruService service = new CovidDriveThruService();
service.getCovidFreeSlots(context, projectID).then((res) {
print(res['COVID19_FreeTimeSlots']);
if (res['MessageStatus'] == 1) {
if (res['COVID19_FreeTimeSlots'].length != 0) {
freeSlotsResponse = res['COVID19_FreeTimeSlots'];
print(res['COVID19_FreeTimeSlots'].length);
_getJSONSlots().then((value) => {
setState(() => {
widget.selectedClinicID =
freeSlotsResponse[0]['ClinicID'],
widget.selectedDoctorID =
freeSlotsResponse[0]['DoctorID'],
_events.clear(),
_events = value
})
});
} else {}
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
}

@ -0,0 +1,305 @@
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/DriveThroughTestingCenterModel.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-details.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class CovidDrivethruLocation extends StatefulWidget {
@override
_CovidDrivethruLocationState createState() => _CovidDrivethruLocationState();
}
class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
String projectDropdownValue;
List<DriveThroughTestingCenterModel> projectsList = [];
bool isLocationSelected = false;
String projectLat = "";
String projectLong = "";
String projectName = "";
String projectID = "";
@override
void initState() {
WidgetsBinding.instance
.addPostFrameCallback((_) => getProjectsList(context));
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "COVID-19 TEST",
isShowAppBar: true,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
child: Column(
children: <Widget>[
Container(
alignment: Alignment.centerLeft,
child: Text("Get The Result During 8 Hours",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 22.0,
color: Colors.black)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(
"We are using the advance technology to test COVID-19, The sample for examination is taking between the nose and mouth (nasopharyngeal swab), the examination is done by ELITE In Genius of the company ELITECH GROUP MOLECULAR DIAGNOSTICS, Note that the device belongs to an Italian company and is manufactured in Japan with RC- PCR",
style: TextStyle(fontSize: 16.0, color: Colors.black)),
),
Container(
margin: EdgeInsets.only(top: 20.0),
alignment: Alignment.centerLeft,
child: Text("Select Location",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
letterSpacing: 0.8,
color: Colors.grey[700])),
),
Container(
height: 60.0,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: Colors.grey[400],
width: 1.0,
),
borderRadius: BorderRadius.circular(10),
),
padding: EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(top: 15.0),
child: DropdownButtonHideUnderline(
child: DropdownButton<String>(
hint: new Text("Select Address"),
value: projectDropdownValue,
items: projectsList.map((item) {
return new DropdownMenuItem<String>(
value: item.iD.toString(),
child: new Text(item.projectName),
);
}).toList(),
onChanged: (newValue) {
setState(() {
projectDropdownValue = newValue;
setProjectLocation(newValue);
});
},
),
)),
isLocationSelected
? Container(
margin: EdgeInsets.only(top: 15.0),
alignment: Alignment.centerLeft,
child: Text("Selected Location",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
letterSpacing: 0.8,
color: Colors.black)),
)
: Container(),
isLocationSelected
? Container(
margin: EdgeInsets.only(top: 5.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey[400], width: 1.0),
),
child: Image.network(
"https://maps.googleapis.com/maps/api/staticmap?center=" +
this.projectLat +
"," +
this.projectLong +
"&zoom=15&size=800x400&maptype=roadmap&markers=color:red%7C" +
this.projectLat +
"," +
this.projectLong +
"&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8"),
)
: Container(),
],
),
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.15,
width: double.infinity,
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(top: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.91,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.red[300],
onPressed: () {
getDirections();
},
child:
Text("GET DIRECTIONS", style: TextStyle(fontSize: 18.0)),
),
),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 5.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
back();
},
child: Text("BACK", style: TextStyle(fontSize: 18.0)),
),
),
),
),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
next();
},
child: Text("NEXT", style: TextStyle(fontSize: 18.0)),
),
),
),
),
],
),
),
],
),
),
);
}
getDirections() {
if (isLocationSelected) {
MapsLauncher.launchCoordinates(double.parse(projectLat),
double.parse(projectLong), this.projectName);
} else {
Utils.showErrorToast(
"Please select address from the dropdown menu to get directions");
}
}
next() {
if (isLocationSelected) {
getPaymentInfo(context, projectID);
} else {
Utils.showErrorToast(
"Please select address from the dropdown menu to continue");
}
}
back() {
Navigator.of(context).popAndPushNamed(HOME);
}
setProjectLocation(newValue) {
print(newValue);
setState(() {
this.projectLat =
projectsList[(int.parse(newValue) - 1)].latitude.toString();
this.projectLong =
projectsList[(int.parse(newValue) - 1)].longitude.toString();
this.projectName = projectsList[(int.parse(newValue) - 1)].projectName;
this.projectID =
projectsList[(int.parse(newValue) - 1)].projectID.toString();
isLocationSelected = true;
});
}
getPaymentInfo(BuildContext context, String projectID) {
CovidDriveThruService service = new CovidDriveThruService();
CovidPaymentInfoResponse covidPaymentInfoResponse =
new CovidPaymentInfoResponse();
service
.getCovidPaymentInformation(context, int.parse(projectID))
.then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
covidPaymentInfoResponse = CovidPaymentInfoResponse.fromJson(
res['COVID19_PatientShare']);
print(covidPaymentInfoResponse.procedureNameField);
});
} else {}
})
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CovidPaymentDetails(
covidPaymentInfoResponse: covidPaymentInfoResponse,
projectID: int.parse(projectID),
)));
});
}
getProjectsList(BuildContext context) {
CovidDriveThruService service = new CovidDriveThruService();
service.getCovidProjectsList(context).then((res) {
print(res);
if (res['MessageStatus'] == 1) {
print(res);
setState(() {
res['List_COVID19_ProjectDriveThroughTestingCenter'].forEach((v) {
projectsList.add(new DriveThroughTestingCenterModel.fromJson(v));
});
});
} else {}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
}

@ -0,0 +1,288 @@
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class CovidPaymentAlert extends StatefulWidget {
PatientShareResponse patientShareResponse;
CovidPaymentAlert({@required this.patientShareResponse});
@override
_CovidPaymentAlertState createState() => _CovidPaymentAlertState();
}
class _CovidPaymentAlertState extends State<CovidPaymentAlert> {
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "COVID-19 TEST",
isShowAppBar: true,
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
height: 200.0,
color: new Color(0xFFc5272d),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 50.0),
child: SvgPicture.asset(
'assets/images/new-design/alert_icon.svg',
width: 80.0,
height: 80.0),
),
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 30.0, right: 20.0),
child: Text("Alert",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 24.0)),
),
Container(
width: MediaQuery.of(context).size.width * 0.55,
margin: EdgeInsets.only(
left: 30.0, right: 20.0, top: 5.0),
child: Text(
"Pay With-in 15 mins to confirm the appointment",
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.white, fontSize: 20.0)),
),
],
),
),
],
),
),
Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 30.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
alignment: Alignment.center,
child: Text("Pay With-in 15 mins",
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xFFc5272d),
fontSize: 24.0,
fontWeight: FontWeight.bold)),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 15.0),
child: Text(
"Payment for Covid-19 Test should Be made with-in 15 mins otherwise The system will Cancel the Scheduled appointment automatically.",
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.grey[700],
fontSize: 18.0,
letterSpacing: 0.8)),
),
Container(
margin: EdgeInsets.only(
top: 40.0, bottom: 10.0, left: 0.0, right: 20.0),
child: Text(TranslationBase.of(context).appoInfo,
style: TextStyle(
fontSize: 18.0,
color: Colors.grey[700],
fontWeight: FontWeight.bold)),
),
Container(
margin: EdgeInsets.only(left: 0.0, bottom: 20.0),
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.grey[200],
boxShadow: [
BoxShadow(color: Colors.grey, spreadRadius: 2),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text("COVID-19 TEST",
style: TextStyle(
fontSize: 18.0,
color: Colors.black,
fontWeight: FontWeight.bold)),
),
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Row(
children: <Widget>[
Container(
margin:
EdgeInsets.only(left: 20.0, right: 20.0),
child: Icon(
Icons.local_hospital,
size: 24,
color: Colors.grey[700],
)),
Container(
child: Text(
widget.patientShareResponse.projectName !=
null
? widget.patientShareResponse.projectName
: "NULL",
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
),
],
),
),
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Row(
children: <Widget>[
Container(
margin:
EdgeInsets.only(left: 20.0, right: 20.0),
child: Icon(
Icons.date_range,
size: 24,
color: Colors.grey[700],
)),
Container(
child: Text(
widget.patientShareResponse.appointmentDate !=
null
? getDate(widget.patientShareResponse
.appointmentDate)
.split(" ")[0]
: "NULL",
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
),
],
),
),
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Row(
children: <Widget>[
Container(
margin:
EdgeInsets.only(left: 20.0, right: 20.0),
child: Icon(
Icons.access_time,
size: 24,
color: Colors.grey[700],
)),
Container(
child: Text(
widget.patientShareResponse.appointmentDate !=
null
? getDate(widget.patientShareResponse
.appointmentDate)
.split(" ")[1]
: "NULL",
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
),
],
),
),
Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Row(
children: <Widget>[
Container(
margin:
EdgeInsets.only(left: 20.0, right: 20.0),
child: SvgPicture.asset(
"assets/images/new-design/track_icon.svg",
width: 20.0,
height: 20.0)),
Container(
child: Text(
widget.patientShareResponse.doctorNameObj !=
null
? widget
.patientShareResponse.doctorNameObj
: "NULL",
style: TextStyle(
fontSize: 18.0, color: Colors.grey[700])),
),
],
),
),
],
),
),
],
),
),
],
),
),
bottomSheet: Container(
margin: EdgeInsets.all(10.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
// bookCovidTestAppointment();
},
child: Text("NEXT", style: TextStyle(fontSize: 18.0)),
),
),
),
),
],
),
),
);
}
String getDate(String appoDate) {
var appoDateFormatted = "";
var dateObj = DateUtil.convertStringToDate(appoDate);
setState(() {
appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) +
", " +
dateObj.day.toString() +
" " +
DateUtil.getMonth(dateObj.month) +
" " +
dateObj.year.toString() +
" " +
dateObj.hour.toString() +
":" +
dateObj.minute.toString() +
":00";
});
return appoDateFormatted;
}
}

@ -0,0 +1,257 @@
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class CovidPaymentDetails extends StatefulWidget {
CovidPaymentInfoResponse covidPaymentInfoResponse;
int projectID;
CovidPaymentDetails(
{@required this.covidPaymentInfoResponse, @required this.projectID});
@override
_CovidPaymentDetailsState createState() => _CovidPaymentDetailsState();
}
class _CovidPaymentDetailsState extends State<CovidPaymentDetails> {
bool isAgree = false;
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "COVID-19 TEST",
isShowAppBar: true,
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
height: 150.0,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
"assets/images/new-design/covid-19-big-banner-bg.png"),
fit: BoxFit.fill,
),
color: Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(Radius.circular(10))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin:
EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg',
width: 90.0,
height: 90.0),
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(
left: 20.0, right: 20.0, top: 40.0),
child: Text("COVID-19 TEST",
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 24.0)),
),
Container(
margin: EdgeInsets.only(
left: 20.0, right: 20.0, top: 10.0),
child: Text("Drive-Thru",
style: TextStyle(
color: Colors.white, fontSize: 24.0)),
),
],
),
],
),
),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.0),
color: Colors.white),
margin: EdgeInsets.fromLTRB(0.0, 30.0, 0.0, 5.0),
padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0),
child: Column(
children: <Widget>[
Container(
alignment: Alignment.center,
margin:
EdgeInsets.only(left: 0.0, right: 20.0, top: 30.0),
child: Text("Test Fees",
style: TextStyle(
color: Colors.black,
fontSize: 22.0,
fontWeight: FontWeight.bold)),
),
Table(
children: [
TableRow(children: [
TableCell(
child: _getNormalText(TranslationBase.of(context)
.patientShareToDo)),
TableCell(
child: _getNormalText(widget
.covidPaymentInfoResponse.patientShareField
.toString())),
]),
TableRow(children: [
TableCell(
child: _getNormalText(
TranslationBase.of(context).patientTaxToDo)),
TableCell(
child: _getNormalText(widget
.covidPaymentInfoResponse
.patientTaxAmountField
.toString())),
]),
TableRow(children: [
TableCell(
child: _getNormalText(TranslationBase.of(context)
.patientShareTotalToDo)),
TableCell(
child: _getNormalText(widget
.covidPaymentInfoResponse
.patientShareWithTaxField
.toString())),
]),
],
),
],
),
),
Container(
margin: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 5.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Checkbox(
value: isAgree,
onChanged: (value) {
setState(() {
isAgree = !isAgree;
});
},
activeColor: Colors.blue,
),
Texts(TranslationBase.of(context)
.iAgreeToTheTermsAndConditions),
],
),
),
Divider(
color: Colors.grey,
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(20.0, 15.0, 20.0, 5.0),
child: Text("You can pay by following options: ",
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.bold,
fontFamily: "Open-Sans")),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 5.0),
child: Image.asset(
"assets/images/new-design/payment_options_invoice_confirmation.png",
width: 300),
),
],
),
),
),
bottomSheet: Container(
margin: EdgeInsets.fromLTRB(10.0, 5.0, 10.0, 20.0),
child: Flex(
direction: Axis.horizontal,
children: <Widget>[
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: () {
cancel();
},
child: Text("CANCEL", style: TextStyle(fontSize: 18.0)),
),
),
),
),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.grey[500],
onPressed: isAgree ? next : null,
child: Text("NEXT", style: TextStyle(fontSize: 18.0)),
),
),
),
),
],
),
),
);
}
void next() {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CovidTimeSlots(
projectID: widget.projectID,
)));
}
cancel() {
Navigator.pop(context);
}
_getNormalText(text) {
return Container(
margin: EdgeInsets.only(top: 20.0, right: 10.0),
child: Text(text,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 15,
fontFamily: 'Open-Sans',
letterSpacing: 0.5,
color: Colors.grey[700])),
);
}
}

@ -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(
@ -82,7 +89,8 @@ class _AmbulanceReqState extends State<AmbulanceReq>
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(
amRequestViewModel: model,
), ),
PrescriptionsHistoryPage( OrderLogPage(
prescriptionsViewModel: model, 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,306 @@
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],
),
),
),
),
),
],
);
}
}

@ -352,18 +352,24 @@ class _AppointmentActionsState extends State<AppointmentActions> {
cancelAppointment() { cancelAppointment() {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.cancelAppointment(widget.appo, context).then((res) { service
.cancelAppointment(widget.appo, context)
.then((res) {
print(res); print(res);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop();
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { })
.catchError((err) {
print(err); print(err);
}).showProgressBar( })
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); .showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
Navigator.of(context).pop();
});
} }
openAppointmentRadiology() { openAppointmentRadiology() {
@ -468,8 +474,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
AppToast.showErrorToast( AppToast.showErrorToast(message: err);
message: err);
}).showProgressBar( }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
@ -540,7 +545,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, .confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID,
widget.appo.projectID, context) widget.appo.projectID, widget.appo.isLiveCareAppointment, context)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);

@ -24,7 +24,7 @@ class _ApointmentCardState extends State<AppointmentCard> {
navigateToAppointmentDetails(context, widget.appo); navigateToAppointmentDetails(context, widget.appo);
}, },
child: Card( child: Card(
// margin: EdgeInsets.fromLTRB(20.0, 16.0, 20.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),

@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.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 'package:flutter_svg/flutter_svg.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart'; import 'package:smart_progress_bar/smart_progress_bar.dart';
@ -37,8 +38,6 @@ class _ToDoState extends State<ToDo> {
@override @override
void initState() { void initState() {
// authUser = authProvider.getAuthenticatedUser();
print("initState!!!!!");
widget.patientShareResponse = new PatientShareResponse(); widget.patientShareResponse = new PatientShareResponse();
WidgetsBinding.instance WidgetsBinding.instance
.addPostFrameCallback((_) => getPatientAppointmentHistory()); .addPostFrameCallback((_) => getPatientAppointmentHistory());
@ -50,7 +49,9 @@ class _ToDoState extends State<ToDo> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).todoList, appBarTitle: TranslationBase.of(context).todoList,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Column(
children: <Widget>[
Container(
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
@ -80,20 +81,33 @@ class _ToDoState extends State<ToDo> {
width: 20.0, width: 20.0,
height: 20.0), height: 20.0),
Container( Container(
margin: EdgeInsets.only(left: 10.0, right: 30.0), margin:
EdgeInsets.only(left: 5.0, right: 25.0),
child: Text( child: Text(
getDate( getDate(widget
widget.appoList[index].appointmentDate), .appoList[index].appointmentDate),
style: TextStyle(fontSize: 12.0)), style: TextStyle(fontSize: 11.0)),
), ),
Image.asset( widget.appoList[index].isLiveCareAppointment
? SvgPicture.asset(
"assets/images/new-design/liveCare_logo_icon.svg",
width: 20.0,
height: 20.0)
: Image.asset(
"assets/images/new-design/hospital_address_icon.png", "assets/images/new-design/hospital_address_icon.png",
width: 20.0, width: 20.0,
height: 20.0), height: 20.0),
Container( Container(
margin: EdgeInsets.only(left: 10.0, right: 10.0), margin:
child: Text(widget.appoList[index].projectName, EdgeInsets.only(left: 5.0, right: 5.0),
style: TextStyle(fontSize: 12.0)), child: widget
.appoList[index].isLiveCareAppointment
? Text(
TranslationBase.of(context)
.liveCareAppo,
style: TextStyle(fontSize: 12.0))
: Text(widget.appoList[index].projectName != null ? widget.appoList[index].projectName : "-",
style: TextStyle(fontSize: 11.0)),
), ),
], ],
), ),
@ -109,11 +123,12 @@ class _ToDoState extends State<ToDo> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: height: MediaQuery.of(context).size.height *
MediaQuery.of(context).size.height * 0.1, 0.1,
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(100.0), borderRadius:
BorderRadius.circular(100.0),
child: Image.network( child: Image.network(
widget.appoList[index].doctorImageURL, widget.appoList[index].doctorImageURL,
fit: BoxFit.fill), fit: BoxFit.fill),
@ -126,13 +141,14 @@ class _ToDoState extends State<ToDo> {
margin: EdgeInsets.only( margin: EdgeInsets.only(
top: 20.0, left: 20.0, right: 20.0), top: 20.0, left: 20.0, right: 20.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
widget.appoList[index].doctorTitle + widget.appoList[index].doctorTitle +
" " + " " +
widget widget.appoList[index]
.appoList[index].doctorNameObj, .doctorNameObj,
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
color: Colors.black, color: Colors.black,
@ -158,7 +174,8 @@ class _ToDoState extends State<ToDo> {
children: <Widget>[ children: <Widget>[
RatingBar.readOnly( RatingBar.readOnly(
initialRating: widget initialRating: widget
.appoList[index].actualDoctorRate .appoList[index]
.actualDoctorRate
.toDouble(), .toDouble(),
size: 20.0, size: 20.0,
filledColor: Colors.yellow[700], filledColor: Colors.yellow[700],
@ -177,8 +194,8 @@ class _ToDoState extends State<ToDo> {
Expanded( Expanded(
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () => onTap: () => performNextAction(
performNextAction(widget.appoList[index]), widget.appoList[index]),
child: Container( child: Container(
margin: EdgeInsets.only(top: 20.0), margin: EdgeInsets.only(top: 20.0),
child: Column( child: Column(
@ -192,9 +209,11 @@ class _ToDoState extends State<ToDo> {
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),
child: Text( child: Text(
getNextActionText(widget getNextActionText(widget
.appoList[index].nextAction), .appoList[index]
.nextAction),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 12.0)), style:
TextStyle(fontSize: 12.0)),
) )
], ],
), ),
@ -250,6 +269,11 @@ class _ToDoState extends State<ToDo> {
}, },
), ),
), ),
SizedBox(
height: 120.0,
),
],
),
), ),
); );
} }
@ -284,7 +308,11 @@ class _ToDoState extends State<ToDo> {
break; break;
case 50: case 50:
return "assets/images/new-design/liveCare_logo_icon.png"; return "assets/images/new-design/confirm_button.png";
break;
case 60:
return "assets/images/new-design/waiting_for_doctor.png";
break; break;
default: default:
@ -297,14 +325,17 @@ class _ToDoState extends State<ToDo> {
case 10: case 10:
confirmAppointment(appo); confirmAppointment(appo);
break; break;
case 20: case 20:
getPatientShare(context, appo); getPatientShare(context, appo);
break; break;
case 30: case 30:
getAppoQR(context, appo); getAppoQR(context, appo);
break; break;
case 50:
confirmAppointment(appo);
break;
case 60:
break;
} }
} }
@ -334,7 +365,11 @@ class _ToDoState extends State<ToDo> {
break; break;
case 50: case 50:
return TranslationBase.of(context).livecare; return TranslationBase.of(context).confirmLiveCare;
break;
case 60:
return TranslationBase.of(context).waitingForDoctor;
break; break;
default: default:
@ -371,6 +406,10 @@ class _ToDoState extends State<ToDo> {
return TranslationBase.of(context).upcomingLivecare; return TranslationBase.of(context).upcomingLivecare;
break; break;
case 60:
return TranslationBase.of(context).waitingForDoctor;
break;
default: default:
return ""; return "";
} }
@ -427,7 +466,6 @@ class _ToDoState extends State<ToDo> {
getPatientAppointmentHistory() { getPatientAppointmentHistory() {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true, context).then((res) { service.getPatientAppointmentHistory(true, context).then((res) {
print(res['AppoimentAllHistoryResultList']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) { if (res['AppoimentAllHistoryResultList'].length != 0) {
@ -438,13 +476,18 @@ class _ToDoState extends State<ToDo> {
}); });
} else {} } else {}
}); });
widget.appoList.forEach((element) {
print(element.isLiveCareAppointment);
print(element.nextAction);
});
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
getPatientShare(context, AppoitmentAllHistoryResultList appo) { getPatientShare(context, AppoitmentAllHistoryResultList appo) {
@ -457,7 +500,8 @@ class _ToDoState extends State<ToDo> {
openPaymentDialog(appo, widget.patientShareResponse); openPaymentDialog(appo, widget.patientShareResponse);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
getAppoQR(context, AppoitmentAllHistoryResultList appo) { getAppoQR(context, AppoitmentAllHistoryResultList appo) {
@ -478,7 +522,8 @@ class _ToDoState extends State<ToDo> {
navigateToQR(context, res['AppointmentQR'], patientShareResponse); navigateToQR(context, res['AppointmentQR'], patientShareResponse);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Future navigateToQR( Future navigateToQR(
@ -592,7 +637,8 @@ class _ToDoState extends State<ToDo> {
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
@ -610,7 +656,8 @@ class _ToDoState extends State<ToDo> {
appo); appo);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
addAdvancedNumberRequest(String advanceNumber, String paymentReference, addAdvancedNumberRequest(String advanceNumber, String paymentReference,
@ -624,7 +671,8 @@ class _ToDoState extends State<ToDo> {
getAppoQR(context, appo); getAppoQR(context, appo);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); }).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
Future navigateToPaymentMethod( Future navigateToPaymentMethod(
@ -659,8 +707,8 @@ class _ToDoState extends State<ToDo> {
confirmAppointment(AppoitmentAllHistoryResultList appo) { confirmAppointment(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.confirmAppointment( .confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.appointmentNo, appo.clinicID, appo.projectID, context) appo.isLiveCareAppointment, context)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
@ -668,8 +716,40 @@ class _ToDoState extends State<ToDo> {
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
}).catchError((err) { })
.catchError((err) {
print(err);
})
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
if (appo.isLiveCareAppointment) {
insertLiveCareVIDARequest(appo);
} else {
getPatientAppointmentHistory();
}
});
}
insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID,
appo.serviceID, appo.doctorID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
})
.catchError((err) {
print(err); print(err);
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); })
.showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
.then((value) {
getPatientAppointmentHistory();
});
} }
} }

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
class TodoListCard extends StatefulWidget { class TodoListCard extends StatefulWidget {
@ -12,7 +13,6 @@ class TodoListCard extends StatefulWidget {
var languageID; var languageID;
final VoidCallback onListUpdated; final VoidCallback onListUpdated;
TodoListCard({@required this.appo, this.onListUpdated}); TodoListCard({@required this.appo, this.onListUpdated});
@override @override
@ -54,13 +54,21 @@ class _TodoListCardState extends State<TodoListCard> {
child: Text(getDate(widget.appo.appointmentDate), child: Text(getDate(widget.appo.appointmentDate),
style: TextStyle(fontSize: 12.0)), style: TextStyle(fontSize: 12.0)),
), ),
Image.asset( widget.appo.isLiveCareAppointment
? SvgPicture.asset(
"assets/images/new-design/liveCare_logo_icon.svg",
width: 20.0,
height: 20.0)
: Image.asset(
"assets/images/new-design/hospital_address_icon.png", "assets/images/new-design/hospital_address_icon.png",
width: 20.0, width: 20.0,
height: 20.0), height: 20.0),
Container( Container(
margin: EdgeInsets.only(left: 10.0, right: 10.0), margin: EdgeInsets.only(left: 10.0, right: 10.0),
child: Text(widget.appo.projectName, child: widget.appo.isLiveCareAppointment
? Text(TranslationBase.of(context).upcomingLivecare,
style: TextStyle(fontSize: 12.0))
: Text(widget.appo.projectName,
style: TextStyle(fontSize: 12.0)), style: TextStyle(fontSize: 12.0)),
), ),
], ],
@ -105,7 +113,10 @@ class _TodoListCardState extends State<TodoListCard> {
letterSpacing: 1.0)), letterSpacing: 1.0)),
Container( Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0), margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text(getDoctorSpeciality(widget.appo.doctorSpeciality).trim(), child: Text(
getDoctorSpeciality(
widget.appo.doctorSpeciality)
.trim(),
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
color: Colors.grey[600], color: Colors.grey[600],
@ -323,14 +334,13 @@ class _TodoListCardState extends State<TodoListCard> {
} }
String getMinute(DateTime dateObj) { String getMinute(DateTime dateObj) {
if(dateObj.minute == 0) { if (dateObj.minute == 0) {
return dateObj.minute.toString() + "0"; return dateObj.minute.toString() + "0";
} else { } else {
return dateObj.minute.toString(); return dateObj.minute.toString();
} }
} }
String getDoctorSpeciality(List<String> docSpecial) { String getDoctorSpeciality(List<String> docSpecial) {
String docSpeciality = ""; String docSpeciality = "";
docSpecial.forEach((v) { docSpecial.forEach((v) {

@ -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();

@ -2,19 +2,20 @@ 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/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';
import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -34,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(
@ -56,44 +58,127 @@ class _HomePageState extends State<HomePage> {
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
Positioned( Positioned(
top: 30, top: 15,
left: 15, left: 5,
right: 15, right: 5,
child: Container( child: Container(
width: width:
MediaQuery.of(context).size.width * 0.8, MediaQuery.of(context).size.width * 0.8,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: InkWell(
onTap: () => Navigator.push(context,
FadePage(page: LiveCareHome())),
child: Container( child: Container(
height: 110, height: 120,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(5),
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white image: DecorationImage(
.withOpacity(0.3), image: AssetImage(
"assets/images/new-design/covid_bg_transparent.png"),
fit: BoxFit.fill,
),
color:
Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(5))), Radius.circular(5))),
child: Image.asset( child: Container(
'assets/images/livecare_white_logo.png', margin: EdgeInsets.only(top: 10.0),
child: Column(
children: <Widget>[
Text("COVID-19 TEST",
style: TextStyle(
color: Colors.white,
fontWeight:
FontWeight.bold,
fontSize: 18.0)),
Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(
top: 15.0, left: 3.5, right: 3.5),
child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg',
width: 45.0,
height: 45.0),
),
Container(
margin: EdgeInsets.only(
left: 10.0,
top: 10.0),
child: Column(
children: <Widget>[
Text("Drive-Thru",
style: TextStyle(
color: Colors
.white,
fontWeight:
FontWeight
.bold,
fontSize:
16.0)),
ButtonTheme(
shape:
RoundedRectangleBorder(
borderRadius:
BorderRadius
.circular(
5.0),
),
minWidth: MediaQuery.of(
context)
.size
.width *
0.15,
height: 25.0,
child: RaisedButton(
color: Colors
.red[800],
textColor:
Colors.white,
disabledTextColor:
Colors.white,
disabledColor:
new Color(
0xFFbcc2c4),
onPressed: () {
navigateToCovidDriveThru();
},
child: Text(
"BOOK NOW",
style: TextStyle(
fontSize:
12.0)),
),
),
],
),
),
],
),
],
), ),
), ),
), ),
), ),
Expanded( Expanded(
child: InkWell(
onTap: () => Navigator.push(context,
FadePage(page: LiveCareHome())),
child: Container( child: Container(
height: 110, height: 120,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: color: Colors.white
Colors.white.withOpacity(0.3), .withOpacity(0.3),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(5))), Radius.circular(5))),
// child: Image.asset('assets/images/livecare_white_logo.png',), child: SvgPicture.asset(
projectViewModel.isArabic
? 'assets/images/new-design/livecare_arabic_logo.svg'
: 'assets/images/new-design/liveCare_white_logo.svg',
),
),
), ),
), ),
], ],
@ -359,7 +444,7 @@ 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,
), ),
@ -613,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,
@ -662,6 +747,11 @@ class _HomePageState extends State<HomePage> {
), ),
); );
} }
navigateToCovidDriveThru() {
Navigator.push(context,
MaterialPageRoute(builder: (context) => CovidDrivethruLocation()));
}
} }
class DashboardItem extends StatelessWidget { class DashboardItem extends StatelessWidget {

@ -8,6 +8,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.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';
import 'livecare_type_select.dart';
class LiveCareHome extends StatefulWidget { class LiveCareHome extends StatefulWidget {
static bool showFooterButton = true; static bool showFooterButton = true;

@ -0,0 +1,51 @@
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart';
import 'package:flutter/material.dart';
class ScheduleClinicCard extends StatefulWidget {
bool isSelected;
final ClinicsHaveScheduleList clinicsHaveScheduleList;
var languageID;
ScheduleClinicCard(
{this.isSelected,
this.languageID,
@required this.clinicsHaveScheduleList});
@override
_ScheduleClinicCardState createState() => _ScheduleClinicCardState();
}
class _ScheduleClinicCardState extends State<ScheduleClinicCard> {
@override
Widget build(BuildContext context) {
return Container(
child: Card(
margin: EdgeInsets.fromLTRB(15.0, 10.0, 15.0, 8.0),
color: widget.isSelected ? Colors.blue : Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
padding: EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
child: Text(
widget.languageID == 'ar'
? widget.clinicsHaveScheduleList.clinicDescN
: widget.clinicsHaveScheduleList.clinicDesc,
style: TextStyle(
fontSize: 16.0,
color:
widget.isSelected ? Colors.white : Colors.black)),
),
],
),
),
),
);
}
}

@ -0,0 +1,227 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class LiveCareTypeSelect extends StatefulWidget {
@override
_LiveCareTypeSelectState createState() => _LiveCareTypeSelectState();
}
class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
var languageID;
AppSharedPreferences sharedPref = AppSharedPreferences();
@override
void initState() {
getLanguageID();
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: InkWell(
onTap: () {
Navigator.pop(context, null);
},
child: Icon(
Icons.close,
color: Colors.white,
),
),
title: Text(TranslationBase.of(context).bookAppo,
style: TextStyle(color: Colors.white)),
),
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0),
child: Column(
children: <Widget>[
Container(
alignment: Alignment.center,
margin: EdgeInsets.only(top: 15.0, bottom: 10.0),
child: Image.asset(
languageID == 'ar'
? "assets/images/new-design/liveCare_ar_bg.png"
: "assets/images/new-design/liveCare_en_bg.png",
width: 120),
),
Container(
alignment: Alignment.center,
child: Text("LiveCare Service",
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20.0))),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.center,
child: Text(
"is to obtain medical advice with a specialist doctor Via a video call",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 18.0))),
Container(
margin: EdgeInsets.only(top: 15.0),
alignment: Alignment.centerLeft,
child: Text("WHY LIVECARE?",
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20.0))),
Container(
margin: EdgeInsets.only(top: 20.0, left: 20.0),
child: Row(
children: <Widget>[
SvgPicture.asset("assets/images/new-design/check_icon.svg",
width: 25),
Container(
width: MediaQuery.of(context).size.width * 0.72,
margin: EdgeInsets.all(10.0),
child: Text(
"No need to wait, you will get Medical consultation immediately via Video call.",
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 14.0)),
)
],
),
),
Container(
margin: EdgeInsets.only(top: 5.0, left: 20.0),
child: Row(
children: <Widget>[
SvgPicture.asset("assets/images/new-design/check_icon.svg",
width: 25),
Container(
width: MediaQuery.of(context).size.width * 0.72,
margin: EdgeInsets.all(10.0),
child: Text("The doctor will see your medical file.",
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 14.0)),
)
],
),
),
Container(
margin: EdgeInsets.only(top: 5.0, left: 20.0),
child: Row(
children: <Widget>[
SvgPicture.asset("assets/images/new-design/check_icon.svg",
width: 25),
Container(
width: MediaQuery.of(context).size.width * 0.72,
margin: EdgeInsets.all(10.0),
child: Text("Free Prescription delivery service.",
overflow: TextOverflow.clip,
style: TextStyle(fontSize: 14.0)),
)
],
),
),
Container(
margin: EdgeInsets.only(top: 20.0),
child: Text(
"** The service is included with some insurance companies according to the terms and conditions With our best wishes for health and wellness",
style: TextStyle(fontSize: 16.0))),
InkWell(
onTap: (){
Navigator.pop(context, "immediate");
},
child: Container(
decoration: BoxDecoration(
color: Colors.red[900],
borderRadius: BorderRadius.all(Radius.circular(10.0))),
height: 120.0,
margin: EdgeInsets.only(top: 20.0),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 20.0),
child: SvgPicture.asset(
"assets/images/new-design/liveCare_logo_icon_white.svg",
width: 80),
),
Container(
width: MediaQuery.of(context).size.width * 0.56,
margin: EdgeInsets.fromLTRB(30.0, 20.0, 0.0, 0.0),
child: Column(
children: <Widget>[
Text("Get Medical consultation immediately",
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
color: Colors.white)),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.centerLeft,
child: Text("Instant video call",
style: TextStyle(
fontSize: 18.0, color: Colors.white)),
)
],
),
),
],
)),
),
InkWell(
onTap: (){
Navigator.pop(context, "schedule");
},
child: Container(
decoration: BoxDecoration(
color: Colors.grey[700],
borderRadius: BorderRadius.all(Radius.circular(10.0))),
height: 120.0,
margin: EdgeInsets.only(top: 20.0),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 20.0),
child: Image.asset(
"assets/images/new-design/calendar.png",
width: 70),
),
Container(
width: MediaQuery.of(context).size.width * 0.58,
margin: EdgeInsets.fromLTRB(30.0, 30.0, 0.0, 0.0),
child: Column(
children: <Widget>[
Container(
alignment: Alignment.centerLeft,
child: Text("Book Appointment",
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18.0,
color: Colors.white)),
),
Container(
margin: EdgeInsets.only(top: 10.0),
alignment: Alignment.centerLeft,
child: Text("Schedule Video Call",
style: TextStyle(
fontSize: 18.0, color: Colors.white)),
)
],
),
),
],
)),
),
SizedBox(
height: 40.0,
),
],
),
),
),
);
}
getLanguageID() async {
var languageID = await sharedPref.getString(APP_LANGUAGE);
setState(() {
this.languageID = languageID;
});
}
}

@ -1,9 +1,14 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; 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/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart';
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart';
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_scheduling/schedule_clinic_card.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_type_select.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareInfoDialog.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareInfoDialog.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePaymentDialog.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCarePaymentDialog.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart';
@ -30,8 +35,11 @@ class _clinic_listState extends State<ClinicList> {
int currentSelectedIndex = 0; int currentSelectedIndex = 0;
LiveCareClinicsListResponse liveCareClinicsListResponse; LiveCareClinicsListResponse liveCareClinicsListResponse;
LiveCareScheduleClinicsListResponse liveCareScheduleClinicsListResponse;
bool isDataLoaded = false; bool isDataLoaded = false;
var languageID; var languageID;
var currentSelectedLiveCareType;
int selectedClinicID = 1; int selectedClinicID = 1;
String selectedClinicName = "-"; String selectedClinicName = "-";
@ -46,11 +54,13 @@ class _clinic_listState extends State<ClinicList> {
@override @override
void initState() { void initState() {
liveCareClinicsListResponse = new LiveCareClinicsListResponse(); liveCareClinicsListResponse = new LiveCareClinicsListResponse();
liveCareScheduleClinicsListResponse =
new LiveCareScheduleClinicsListResponse();
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
// Future.delayed(new Duration(milliseconds: 1200), () { openLiveCareSelectionDialog();
getLiveCareClinicsList();
// });
}); });
getLanguageID(); getLanguageID();
super.initState(); super.initState();
} }
@ -58,77 +68,9 @@ class _clinic_listState extends State<ClinicList> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return SingleChildScrollView(
child: Column( child: currentSelectedLiveCareType == "immediate"
children: <Widget>[ ? getLiveCareImmediateClinicList()
isDataLoaded : getLiveCareScheduleClinicList());
? Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.all(15.0),
child: Text("Online Clinics: ",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: liveCareClinicsListResponse
.patientERGetClinicsList.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
updateSelectedIndex(liveCareClinicsListResponse
.patientERGetClinicsList[index]);
},
child: ClinicCard(
isSelected: selectedClinicID ==
liveCareClinicsListResponse
.patientERGetClinicsList[index]
.serviceID
? true
: false,
patientERGetClinicsList:
liveCareClinicsListResponse
.patientERGetClinicsList[index],
languageID: languageID,
),
);
},
),
Container(
height: 10.0,
),
],
),
)
: Container(),
isDataLoaded ? Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: startLiveCare,
child: Text("Start", style: TextStyle(fontSize: 18.0)),
),
),
) : Container(),
],
),
);
} }
void startLiveCare() { void startLiveCare() {
@ -388,10 +330,298 @@ class _clinic_listState extends State<ClinicList> {
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6)); text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
} }
getLiveCareScheduleClinicsList() {
isDataLoaded = false;
LiveCareService service = new LiveCareService();
service.getLiveCareScheduledClinics(context).then((res) {
print(res['ClinicsHaveScheduleList'].length);
if (res['MessageStatus'] == 1) {
setState(() {
liveCareScheduleClinicsListResponse =
LiveCareScheduleClinicsListResponse.fromJson(res);
print(liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList.length);
selectedClinicID = liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList[0].serviceID;
selectedClinicName = liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList[0].clinicDesc;
isDataLoaded = true;
});
} else {
isDataLoaded = true;
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
openLiveCareSelectionDialog() {
Navigator.of(context)
.push(new MaterialPageRoute<String>(
builder: (BuildContext context) {
return LiveCareTypeSelect();
},
fullscreenDialog: true))
.then((value) {
if (value == null) {
Navigator.pop(context);
} else {
print(value);
if (value == "immediate") {
setState(() {
currentSelectedLiveCareType = "immediate";
});
getLiveCareClinicsList();
}
if (value == "schedule") {
setState(() {
currentSelectedLiveCareType = "schedule";
});
getLiveCareScheduleClinicsList();
}
}
});
}
Widget getLiveCareScheduleClinicList() {
return Column(
children: <Widget>[
isDataLoaded
? Container(
height: MediaQuery.of(context).size.height * 0.7,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// Container(
// margin: EdgeInsets.all(15.0),
// child: Text("Online Clinics: ",
// style: TextStyle(
// fontSize: 20.0, fontWeight: FontWeight.bold)),
// ),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
updateSelectedScheduleIndex(
liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList[index]);
},
child: ScheduleClinicCard(
isSelected: selectedClinicID ==
liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList[index]
.serviceID
? true
: false,
clinicsHaveScheduleList:
liveCareScheduleClinicsListResponse
.clinicsHaveScheduleList[index],
languageID: languageID,
),
);
},
),
Container(
height: 10.0,
),
],
),
)
: Container(),
isDataLoaded
? Align(
alignment: FractionalOffset.bottomCenter,
child: Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: startScheduleLiveCare,
child: Text("Start", style: TextStyle(fontSize: 18.0)),
),
),
),
)
: Container(),
],
);
}
Widget getLiveCareImmediateClinicList() {
return Column(
children: <Widget>[
isDataLoaded
? Container(
height: MediaQuery.of(context).size.height * 0.7,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.all(15.0),
child: Text("Online Clinics: ",
style: TextStyle(
fontSize: 20.0, fontWeight: FontWeight.bold)),
),
ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0),
itemCount: liveCareClinicsListResponse
.patientERGetClinicsList.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
updateSelectedIndex(liveCareClinicsListResponse
.patientERGetClinicsList[index]);
},
child: ClinicCard(
isSelected: selectedClinicID ==
liveCareClinicsListResponse
.patientERGetClinicsList[index]
.serviceID
? true
: false,
patientERGetClinicsList: liveCareClinicsListResponse
.patientERGetClinicsList[index],
languageID: languageID,
),
);
},
),
Container(
height: 10.0,
),
],
),
)
: Container(),
isDataLoaded
? Align(
alignment: FractionalOffset.bottomCenter,
child: Container(
width: MediaQuery.of(context).size.width,
height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: startLiveCare,
child: Text("Start", style: TextStyle(fontSize: 18.0)),
),
),
),
)
: Container(),
],
);
}
void startScheduleLiveCare() {
List<DoctorList> doctorsList = [];
LiveCareService service = new LiveCareService();
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital =
List();
service
.getLiveCareScheduledDoctorList(context, selectedClinicID)
.then((res) {
print(res['DoctorByClinicIDList']);
print(res['DoctorByClinicIDList'].length);
if (res['MessageStatus'] == 1) {
setState(() {
if (res['DoctorByClinicIDList'].length != 0) {
res['DoctorByClinicIDList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital =
_patientDoctorAppointmentListHospital
.where(
(elementClinic) =>
elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[
_patientDoctorAppointmentListHospital
.indexOf(doctorByHospital[0])]
.patientDoctorAppointmentList
.add(element);
} else {
_patientDoctorAppointmentListHospital.add(
PatientDoctorAppointmentList(
filterName: element.projectName,
distanceInKMs:
element.projectDistanceInKiloMeters.toString(),
patientDoctorAppointment: element));
}
});
} else {}
});
this.sharedPref.setBool(IS_LIVECARE_APPOINTMENT, true);
navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital);
} else {}
}).catchError((err) {
print(err);
}).showProgressBar(
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Future navigateToSearchResults(
context,
List<DoctorList> docList,
List<PatientDoctorAppointmentList>
patientDoctorAppointmentListHospital) async {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => SearchResults(
doctorsList: docList,
isLiveCareAppointment: true,
patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital)));
}
updateSelectedIndex(PatientERGetClinicsList patientERGetClinicsList) { updateSelectedIndex(PatientERGetClinicsList patientERGetClinicsList) {
setState(() { setState(() {
selectedClinicID = patientERGetClinicsList.serviceID; selectedClinicID = patientERGetClinicsList.serviceID;
selectedClinicName = patientERGetClinicsList.serviceName; selectedClinicName = patientERGetClinicsList.serviceName;
}); });
} }
updateSelectedScheduleIndex(ClinicsHaveScheduleList patientERGetClinicsList) {
setState(() {
selectedClinicID = patientERGetClinicsList.serviceID;
selectedClinicName = patientERGetClinicsList.clinicDesc;
});
}
} }

@ -75,6 +75,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).confirm, appBarTitle: TranslationBase.of(context).confirm,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),

@ -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(

@ -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';
@ -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,6 +61,7 @@ class _Login extends State<Login> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).login, appBarTitle: TranslationBase.of(context).login,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
padding: padding:
@ -200,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),

@ -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),

@ -20,6 +20,7 @@ class LabsHomePage extends StatelessWidget {
builder: (context, LabsViewModel model, widget) => AppScaffold( builder: (context, LabsViewModel model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
description: TranslationBase.of(context).infoLab,
appBarTitle: TranslationBase.of(context).labOrders, appBarTitle: TranslationBase.of(context).labOrders,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),

@ -48,6 +48,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(), onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowDecPage: false,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
child: SingleChildScrollView( child: SingleChildScrollView(
@ -73,6 +74,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
fit: BoxFit.cover, fit: BoxFit.cover,
width: double.infinity, width: double.infinity,
), ),
if(model.authenticatedUserObject.isLogin)
ListView.builder( ListView.builder(
itemBuilder: (context, index) => TimeLineWidget( itemBuilder: (context, index) => TimeLineWidget(
isUp: index % 2 == 1, isUp: index % 2 == 1,

@ -20,6 +20,7 @@ class RadiologyHomePage extends StatelessWidget {
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).radiology, appBarTitle: TranslationBase.of(context).radiology,
baseViewModel: model, baseViewModel: model,
description: TranslationBase.of(context).infoRadiology,
body: FractionallySizedBox( body: FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
child: ListView( child: ListView(

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/insertVIDARequest.dart';
import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -21,11 +22,12 @@ class DoctorsListService extends BaseService {
double lat; double lat;
double long; double long;
String deviceToken;
String tokenID;
Future<Map> getDoctorsList( Future<Map> getDoctorsList(
int clinicID, int projectID, bool isNearest, BuildContext context, int clinicID, int projectID, bool isNearest, BuildContext context,
{doctorId, doctorName}) async { {doctorId, doctorName}) async {
//Utils.showProgressDialog(context);
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -48,7 +50,7 @@ class DoctorsListService extends BaseService {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958', "generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0, "PatientOutSA": authUser.outSA,
"TokenID": "", "TokenID": "",
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"SessionID": "YckwoXhUmWBsnHKEKig", "SessionID": "YckwoXhUmWBsnHKEKig",
@ -111,7 +113,7 @@ class DoctorsListService extends BaseService {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958', "generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0, "PatientOutSA": authUser.outSA,
"TokenID": "", "TokenID": "",
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"SessionID": null, "SessionID": null,
@ -151,7 +153,7 @@ class DoctorsListService extends BaseService {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958', "generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0, "PatientOutSA": authUser.outSA,
"TokenID": "", "TokenID": "",
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"SessionID": null, "SessionID": null,
@ -193,7 +195,7 @@ class DoctorsListService extends BaseService {
"LanguageID": languageID == 'ar' ? 1 : 2, "LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958", "generalid": "Cs2020@2016\$2958",
"PatientOutSA": 0, "PatientOutSA": authUser.outSA,
"SessionID": null, "SessionID": null,
"isDentalAllowedBackend": false, "isDentalAllowedBackend": false,
"DeviceTypeID": 1 "DeviceTypeID": 1
@ -210,6 +212,42 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getDoctorScheduledFreeSlots(
int docID, int clinicID, int projectID, int serviceID, BuildContext context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"DoctorID": docID,
"IsBookingForLiveCare": 1,
"ClinicID": clinicID,
"ProjectID": projectID,
"OriginalClinicID": clinicID,
"ServiceID": serviceID,
"days": 50,
"isReschadual": false,
"VersionID": req.VersionID,
"Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958",
"PatientOutSA": authUser.outSA,
"SessionID": null,
"isDentalAllowedBackend": false,
"DeviceTypeID": 1
};
dynamic localRes;
await baseAppClient.post(GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> insertAppointment(int docID, int clinicID, int projectID, Future<Map> insertAppointment(int docID, int clinicID, int projectID,
String selectedTime, String selectedDate, BuildContext context) async { String selectedTime, String selectedDate, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
@ -263,6 +301,60 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID,
String selectedTime, String selectedDate, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"IsForLiveCare": true,
"ProjectID": projectID,
"ClinicID": clinicID,
"DoctorID": docID,
"ServiceID": serviceID,
"StartTime": selectedTime,
"SelectedTime": selectedTime,
"EndTime": selectedTime,
"InitialSlotDuration": 0,
"StrAppointmentDate": selectedDate,
"IsVirtual": false,
"DeviceType": Platform.isIOS ? 'iOS' : 'Android',
"BookedBy": 102,
"VisitType": 1,
"VisitFor": 1,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(INSERT_LIVECARE_SCHEDULE_APPOINTMENT,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientShare( Future<Map> getPatientShare(
String appoID, int clinicID, int projectID, BuildContext context) async { String appoID, int clinicID, int projectID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
@ -307,6 +399,51 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getLiveCareAppointmentPatientShare(
String appoID, int clinicID, int projectID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"ProjectID": projectID,
"ClinicID": clinicID,
"AppointmentNo": appoID,
"IsActiveAppointment": true,
"IsForLiveCare": true,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"TokenID": "@dm!n",
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_SHARE_LIVECARE,
onSuccess: (response, statusCode) async {
localRes = response['OnlineCheckInAppointments'][0];
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientAppointmentHistory( Future<Map> getPatientAppointmentHistory(
bool isActiveAppointment, BuildContext context) async { bool isActiveAppointment, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
@ -383,7 +520,7 @@ class DoctorsListService extends BaseService {
} }
Future<Map> confirmAppointment( Future<Map> confirmAppointment(
int appoNo, int clinicID, int projectID, BuildContext context) async { int appoNo, int clinicID, int projectID, bool isLiveCare, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -397,6 +534,7 @@ class DoctorsListService extends BaseService {
request = { request = {
"AppointmentNumber": appoNo, "AppointmentNumber": appoNo,
"IsLiveCareAppointment": isLiveCare,
"ClinicID": clinicID, "ClinicID": clinicID,
"ProjectID": projectID, "ProjectID": projectID,
"ConfirmationBy": 102, "ConfirmationBy": 102,
@ -426,6 +564,62 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> insertVIDARequest(
int appoNo, int clinicID, int projectID, int serviceID, int docID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(
await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
deviceToken = await sharedPref.getString(PUSH_TOKEN);
if (await this.sharedPref.getDouble(USER_LAT) != null &&
await this.sharedPref.getDouble(USER_LONG) != null) {
lat = await this.sharedPref.getDouble(USER_LAT);
long = await this.sharedPref.getDouble(USER_LONG);
}
var languageID = await sharedPref.getString(APP_LANGUAGE);
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentNo": appoNo,
"ClinicID": clinicID,
"ProjectID": projectID,
"ServiceID": serviceID,
"AcceptedBy": docID,
"DeviceToken": deviceToken,
"Latitude": lat,
"Longitude": long,
"DeviceType": req.DeviceType,
"VersionID": req.VersionID,
"Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
"PatientOutSA": authUser.outSA,
"isDentalAllowedBackend": false,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes;
await baseAppClient.post(INSERT_VIDA_REQUEST,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> cancelAppointment( Future<Map> cancelAppointment(
AppoitmentAllHistoryResultList appo, BuildContext context) async { AppoitmentAllHistoryResultList appo, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;

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

Loading…
Cancel
Save