Merge branch 'development_new_design_2.0' into new_design_sikander

merge-requests/390/head
Sikander Saleem 5 years ago
commit 7df76842b2

@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -134,6 +134,11 @@ const INSERT_ER_INERT_PRES_ORDER =
/// ER RRT /// ER RRT
const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation'; const GET_ALL_RC_TRANSPORTATION = 'rc/api/Transportation/getalltransportation';
const GET_ALL_TRANSPORTATIONS_RC = 'rc/api/Transportation/getalltransportation'; const GET_ALL_TRANSPORTATIONS_RC = 'rc/api/Transportation/getalltransportation';
const GET_ALL_TRANSPORTATIONS_ORDERS = 'rc/api/Transportation/get';
const CANCEL_AMBULANCE_REQUEST = "rc/api/Transportation/update";
const GET_ALL_RRT_QUESTIONS = const GET_ALL_RRT_QUESTIONS =
'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions'; 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions';
const GET_RRT_SERVICE_PRICE = const GET_RRT_SERVICE_PRICE =

@ -411,6 +411,7 @@ const Map localizedValues = {
"phone-number": {"en": "Phone Number", "ar": "رقم الجوال"}, "phone-number": {"en": "Phone Number", "ar": "رقم الجوال"},
"country": {"en": "Country", "ar": "دولة"}, "country": {"en": "Country", "ar": "دولة"},
"Ok": {"en": "Ok", "ar": "حسنا"}, "Ok": {"en": "Ok", "ar": "حسنا"},
"averageWaitingTime": {"en": "Average Waiting Time:", "ar": "متوسط ​​وقت الانتظار:"},
"WaterConsumedInWeek": {"en": "Water consumed in a week", "ar": "معدل شرب الماء خلال الاسبوع"}, "WaterConsumedInWeek": {"en": "Water consumed in a week", "ar": "معدل شرب الماء خلال الاسبوع"},
"WaterConsumedInMonth": {"en": "Water consumed in a month", "ar": "معدل شرب الماء خلال الشهر"}, "WaterConsumedInMonth": {"en": "Water consumed in a month", "ar": "معدل شرب الماء خلال الشهر"},
"TheVerificationCodeExpiresIn": {"en": "The Verification Code Expires In", "ar": "تنتهي صلاحية رمز التحقق في"}, "TheVerificationCodeExpiresIn": {"en": "The Verification Code Expires In", "ar": "تنتهي صلاحية رمز التحقق في"},

@ -0,0 +1,319 @@
class AmbulanceRequestOrdersModel {
String statusText;
int paymentStatus;
dynamic clientRequestid;
dynamic paymentStatusText;
dynamic projectName;
String nearestProjectName;
double paymentAmount;
WFOrder wFOrder;
String serviceText;
bool isSentForApproval;
int exaCartOrderId;
bool isTimer;
int timeSeconds;
int totalPendingSeconds;
int timeMinute;
int timeHour;
int timeTotalSeconds;
int timeTotalMinute;
int timeTotalHour;
dynamic approvalStatus;
bool isActive;
int clickButton;
dynamic orderHistory;
String pickupLocation;
String dropOffLocation;
String clinicName;
String doctorName;
String branch;
String time;
dynamic notes;
int id;
String patientId;
int patientOutSa;
bool isOutPatient;
int projectId;
int nearestProjectId;
dynamic longitude;
dynamic latitude;
dynamic appointmentNo;
dynamic dischargeId;
int statusId;
int serviceId;
int channel;
Orderpayment orderpayment;
dynamic orderselectedservice;
dynamic wforder;
dynamic orderapprovalobj;
String created;
dynamic createdBy;
dynamic modified;
dynamic modifiedBy;
bool isDeleted;
AmbulanceRequestOrdersModel(
{this.statusText,
this.paymentStatus,
this.clientRequestid,
this.paymentStatusText,
this.projectName,
this.nearestProjectName,
this.paymentAmount,
this.wFOrder,
this.serviceText,
this.isSentForApproval,
this.exaCartOrderId,
this.isTimer,
this.timeSeconds,
this.totalPendingSeconds,
this.timeMinute,
this.timeHour,
this.timeTotalSeconds,
this.timeTotalMinute,
this.timeTotalHour,
this.approvalStatus,
this.isActive,
this.clickButton,
this.orderHistory,
this.pickupLocation,
this.dropOffLocation,
this.clinicName,
this.doctorName,
this.branch,
this.time,
this.notes,
this.id,
this.patientId,
this.patientOutSa,
this.isOutPatient,
this.projectId,
this.nearestProjectId,
this.longitude,
this.latitude,
this.appointmentNo,
this.dischargeId,
this.statusId,
this.serviceId,
this.channel,
this.orderpayment,
this.orderselectedservice,
this.wforder,
this.orderapprovalobj,
this.created,
this.createdBy,
this.modified,
this.modifiedBy,
this.isDeleted});
AmbulanceRequestOrdersModel.fromJson(Map<String, dynamic> json) {
statusText = json['statusText'];
paymentStatus = json['paymentStatus'];
clientRequestid = json['clientRequestid'];
paymentStatusText = json['paymentStatusText'];
projectName = json['projectName'];
nearestProjectName = json['nearestProjectName'];
paymentAmount = json['paymentAmount'];
wFOrder = json['wF_order'] != null ? new WFOrder.fromJson(json['wF_order']) : null;
serviceText = json['serviceText'];
isSentForApproval = json['isSentForApproval'];
exaCartOrderId = json['exaCart_OrderId'];
isTimer = json['isTimer'];
timeSeconds = json['timeSeconds'];
totalPendingSeconds = json['totalPendingSeconds'];
timeMinute = json['timeMinute'];
timeHour = json['timeHour'];
timeTotalSeconds = json['timeTotalSeconds'];
timeTotalMinute = json['timeTotalMinute'];
timeTotalHour = json['timeTotalHour'];
approvalStatus = json['approvalStatus'];
isActive = json['isActive'];
clickButton = json['clickButton'];
orderHistory = json['orderHistory'];
pickupLocation = json['pickupLocation'];
dropOffLocation = json['dropOffLocation'];
clinicName = json['clinicName'];
doctorName = json['doctorName'];
branch = json['branch'];
time = json['time'];
notes = json['notes'];
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'];
statusId = json['statusId'];
serviceId = json['serviceId'];
channel = json['channel'];
orderpayment = json['orderpayment'] != null ? new Orderpayment.fromJson(json['orderpayment']) : null;
orderselectedservice = json['orderselectedservice'];
wforder = json['wforder'];
orderapprovalobj = json['orderapprovalobj'];
created = json['created'];
createdBy = json['createdBy'];
modified = json['modified'];
modifiedBy = json['modifiedBy'];
isDeleted = json['isDeleted'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['statusText'] = this.statusText;
data['paymentStatus'] = this.paymentStatus;
data['clientRequestid'] = this.clientRequestid;
data['paymentStatusText'] = this.paymentStatusText;
data['projectName'] = this.projectName;
data['nearestProjectName'] = this.nearestProjectName;
data['paymentAmount'] = this.paymentAmount;
if (this.wFOrder != null) {
data['wF_order'] = this.wFOrder.toJson();
}
data['serviceText'] = this.serviceText;
data['isSentForApproval'] = this.isSentForApproval;
data['exaCart_OrderId'] = this.exaCartOrderId;
data['isTimer'] = this.isTimer;
data['timeSeconds'] = this.timeSeconds;
data['totalPendingSeconds'] = this.totalPendingSeconds;
data['timeMinute'] = this.timeMinute;
data['timeHour'] = this.timeHour;
data['timeTotalSeconds'] = this.timeTotalSeconds;
data['timeTotalMinute'] = this.timeTotalMinute;
data['timeTotalHour'] = this.timeTotalHour;
data['approvalStatus'] = this.approvalStatus;
data['isActive'] = this.isActive;
data['clickButton'] = this.clickButton;
data['orderHistory'] = this.orderHistory;
data['pickupLocation'] = this.pickupLocation;
data['dropOffLocation'] = this.dropOffLocation;
data['clinicName'] = this.clinicName;
data['doctorName'] = this.doctorName;
data['branch'] = this.branch;
data['time'] = this.time;
data['notes'] = this.notes;
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['statusId'] = this.statusId;
data['serviceId'] = this.serviceId;
data['channel'] = this.channel;
if (this.orderpayment != null) {
data['orderpayment'] = this.orderpayment.toJson();
}
data['orderselectedservice'] = this.orderselectedservice;
data['wforder'] = this.wforder;
data['orderapprovalobj'] = this.orderapprovalobj;
data['created'] = this.created;
data['createdBy'] = this.createdBy;
data['modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted;
return data;
}
}
class WFOrder {
dynamic wfButtonsDTO;
int id;
int orderId;
int previousStep;
int nextStep;
int serviceId;
dynamic order;
String created;
dynamic createdBy;
dynamic modified;
dynamic modifiedBy;
bool isDeleted;
WFOrder({this.wfButtonsDTO, this.id, this.orderId, this.previousStep, this.nextStep, this.serviceId, this.order, this.created, this.createdBy, this.modified, this.modifiedBy, this.isDeleted});
WFOrder.fromJson(Map<String, dynamic> json) {
wfButtonsDTO = json['wf_ButtonsDTO'];
id = json['id'];
orderId = json['orderId'];
previousStep = json['previousStep'];
nextStep = json['nextStep'];
serviceId = json['serviceId'];
order = json['order'];
created = json['created'];
createdBy = json['createdBy'];
modified = json['modified'];
modifiedBy = json['modifiedBy'];
isDeleted = json['isDeleted'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['wf_ButtonsDTO'] = this.wfButtonsDTO;
data['id'] = this.id;
data['orderId'] = this.orderId;
data['previousStep'] = this.previousStep;
data['nextStep'] = this.nextStep;
data['serviceId'] = this.serviceId;
data['order'] = this.order;
data['created'] = this.created;
data['createdBy'] = this.createdBy;
data['modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted;
return data;
}
}
class Orderpayment {
int id;
int orderId;
dynamic clientRequestId;
double totalAmount;
int paymentStatus;
dynamic order;
String created;
dynamic createdBy;
dynamic modified;
dynamic modifiedBy;
bool isDeleted;
Orderpayment({this.id, this.orderId, this.clientRequestId, this.totalAmount, this.paymentStatus, this.order, this.created, this.createdBy, this.modified, this.modifiedBy, this.isDeleted});
Orderpayment.fromJson(Map<String, dynamic> json) {
id = json['id'];
orderId = json['orderId'];
clientRequestId = json['clientRequestId'];
totalAmount = json['totalAmount'];
paymentStatus = json['paymentStatus'];
order = json['order'];
created = json['created'];
createdBy = json['createdBy'];
modified = json['modified'];
modifiedBy = json['modifiedBy'];
isDeleted = json['isDeleted'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['orderId'] = this.orderId;
data['clientRequestId'] = this.clientRequestId;
data['totalAmount'] = this.totalAmount;
data['paymentStatus'] = this.paymentStatus;
data['order'] = this.order;
data['created'] = this.created;
data['createdBy'] = this.createdBy;
data['modified'] = this.modified;
data['modifiedBy'] = this.modifiedBy;
data['isDeleted'] = this.isDeleted;
return data;
}
}

@ -0,0 +1,200 @@
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
class PatientER_RC {
double versionID;
int channel;
int languageID;
String iPAdress;
String generalid;
bool patientOutSA;
String sessionID;
bool isDentalAllowedBackend;
int deviceTypeID;
String patientID;
String tokenID;
int patientTypeID;
int patientType;
int orderServiceID;
String patientIdentificationID;
dynamic patientOutSa;
int projectID;
int lineItemNo;
TransportationDetails transportationDetails;
PatientERTransportationMethod patientERTransportationMethod;
PatientER_RC(
{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,
this.patientIdentificationID,
this.patientOutSa,
this.projectID,
this.lineItemNo,
this.transportationDetails});
PatientER_RC.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'];
patientOutSa = json['patientOutSa'];
projectID = json['projectID'];
lineItemNo = json['lineItemNo'];
transportationDetails = json['transportationDetails'] != null
? new TransportationDetails.fromJson(json['transportationDetails'])
: null;
}
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['patientOutSa'] = this.patientOutSa;
data['projectID'] = this.projectID;
data['lineItemNo'] = this.lineItemNo;
if (this.transportationDetails != null) {
data['transportationDetails'] = this.transportationDetails.toJson();
}
return data;
}
}
class TransportationDetails {
int direction;
int haveAppointment;
int tripType;
int pickupUrgency;
int pickupSpot;
String pickupDateTime;
String transportationType;
int ambulate;
String notes;
int requesterFileNo;
String requesterMobileNo;
bool requesterIsOutSA;
String pickupLocationName;
String dropoffLocationName;
String pickupLatitude;
String pickupLongitude;
String dropoffLatitude;
String dropoffLongitude;
String appointmentNo;
String appointmentClinicName;
String appointmentDoctorName;
String appointmentBranch;
String appointmentTime;
TransportationDetails(
{this.direction,
this.haveAppointment,
this.tripType,
this.pickupUrgency,
this.pickupSpot,
this.pickupDateTime,
this.transportationType,
this.ambulate,
this.notes,
this.requesterFileNo,
this.requesterMobileNo,
this.requesterIsOutSA,
this.pickupLocationName,
this.dropoffLocationName,
this.pickupLatitude,
this.pickupLongitude,
this.dropoffLatitude,
this.dropoffLongitude,
this.appointmentNo,
this.appointmentClinicName,
this.appointmentDoctorName,
this.appointmentBranch,
this.appointmentTime});
TransportationDetails.fromJson(Map<String, dynamic> json) {
direction = json['direction'];
haveAppointment = json['haveAppointment'];
tripType = json['tripType'];
pickupUrgency = json['pickupUrgency'];
pickupSpot = json['pickupSpot'];
pickupDateTime = json['pickupDateTime'];
transportationType = json['transportationType'];
ambulate = json['ambulate'];
notes = json['notes'];
requesterFileNo = json['requesterFileNo'];
requesterMobileNo = json['requesterMobileNo'];
requesterIsOutSA = json['requesterIsOutSA'];
pickupLocationName = json['pickupLocationName'];
dropoffLocationName = json['dropoffLocationName'];
pickupLatitude = json['pickup_Latitude'];
pickupLongitude = json['pickup_Longitude'];
dropoffLatitude = json['dropoff_Latitude'];
dropoffLongitude = json['dropoff_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['direction'] = this.direction;
data['haveAppointment'] = this.haveAppointment;
data['tripType'] = this.tripType;
data['pickupUrgency'] = this.pickupUrgency;
data['pickupSpot'] = this.pickupSpot;
data['pickupDateTime'] = this.pickupDateTime;
data['transportationType'] = this.transportationType;
data['ambulate'] = this.ambulate;
data['notes'] = this.notes;
data['requesterFileNo'] = this.requesterFileNo;
data['requesterMobileNo'] = this.requesterMobileNo;
data['requesterIsOutSA'] = this.requesterIsOutSA;
data['pickupLocationName'] = this.pickupLocationName;
data['dropoffLocationName'] = this.dropoffLocationName;
data['pickup_Latitude'] = this.pickupLatitude;
data['pickup_Longitude'] = this.pickupLongitude;
data['dropoff_Latitude'] = this.dropoffLatitude;
data['dropoff_Longitude'] = this.dropoffLongitude;
data['appointmentNo'] = this.appointmentNo;
data['appointmentClinicName'] = this.appointmentClinicName;
data['appointmentDoctorName'] = this.appointmentDoctorName;
data['appointmentBranch'] = this.appointmentBranch;
data['appointmentTime'] = this.appointmentTime;
return data;
}
}

@ -1,7 +1,8 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/er/AmbulanceRequestOrdersModel.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/model/er/PickUpRequestPresOrder.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 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -11,20 +12,23 @@ import '../base_service.dart';
class AmService extends BaseService { class AmService extends BaseService {
List<PatientERTransportationMethod> amModelList = List(); List<PatientERTransportationMethod> amModelList = List();
List<PatientAllPresOrders> patientAllPresOrdersList = List(); List<PatientAllPresOrders> patientAllPresOrdersList = List();
List<AmbulanceRequestOrdersModel> patientAmbulanceRequestOrdersList = List();
bool hasPendingOrder = false; bool hasPendingOrder = false;
int pendingOrderID = 0; int pendingOrderID = 0;
String pendingOrderStatus = ""; String pendingOrderStatus = "";
String pendingOrderStatusAR = ""; String pendingOrderStatusAR = "";
PickUpRequestPresOrder pickUpRequestPresOrder; PickUpRequestPresOrder pickUpRequestPresOrder;
AmbulanceRequestOrdersModel pendingAmbulanceRequestOrder;
Future getAllTransportationOrders() async { Future getAllTransportationOrders() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['IdentificationNo'] = user.patientIdentificationNo; body['IdentificationNo'] = user.patientIdentificationNo;
await baseAppClient.get( await baseAppClient.get(GET_ALL_TRANSPORTATIONS_RC + "?patientID=" + user.patientID.toString(), isExternal: false, onSuccess: (dynamic response, int statusCode) {
GET_ALL_TRANSPORTATIONS_RC + "?patientID=" + user.patientID.toString(),
isExternal: false, onSuccess: (dynamic response, int statusCode) {
amModelList.clear(); amModelList.clear();
response['data']['transportationservices'].forEach((item) { response['data']['transportationservices'].forEach((item) {
amModelList.add(PatientERTransportationMethod.fromJson(item)); amModelList.add(PatientERTransportationMethod.fromJson(item));
@ -33,24 +37,13 @@ class AmService extends BaseService {
hasError = true; hasError = true;
super.error = error; super.error = error;
}); });
// await baseAppClient.post(GET_AMBULANCE_REQUEST,
// onSuccess: (dynamic response, int statusCode) {
// amModelList.clear();
// response['PatientER_RRT_GetAllTransportationMethodList'].forEach((item) {
// amModelList.add(PatientERTransportationMethod.fromJson(item));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// }, body: body);
} }
Future getPatientAllPresOrdersList() async { Future getPatientAllPresOrdersList() async {
hasError = false; hasError = false;
hasPendingOrder = false; hasPendingOrder = false;
pickUpRequestPresOrder = null; pickUpRequestPresOrder = null;
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
patientAllPresOrdersList.clear(); patientAllPresOrdersList.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((item) { response['PatientER_GetPatientAllPresOrdersList'].forEach((item) {
if (item['ServiceID'] == OrderService.AMBULANCE.getIdOrderService()) { if (item['ServiceID'] == OrderService.AMBULANCE.getIdOrderService()) {
@ -70,15 +63,48 @@ class AmService extends BaseService {
}, body: Map()); }, body: Map());
} }
Future getPatientAllPresOrdersListRC(dynamic patientID) async {
hasError = false;
hasPendingOrder = false;
pickUpRequestPresOrder = null;
Map<String, dynamic> body = Map();
body['patientId'] = patientID.toString();
body['PatientID'] = patientID.toString();
await baseAppClient.post(GET_ALL_TRANSPORTATIONS_ORDERS, onSuccess: (dynamic response, int statusCode) {
patientAmbulanceRequestOrdersList.clear();
hasPendingOrder = false;
pendingOrderID = 0;
pendingAmbulanceRequestOrder = null;
response['data'].forEach((item) {
patientAmbulanceRequestOrdersList.add(AmbulanceRequestOrdersModel.fromJson(item));
if (item['statusId'] == 1) {
hasPendingOrder = true;
pendingOrderID = item['orderpayment']['id'];
pendingOrderStatus = item['statusText'];
pendingOrderStatusAR = item['statusText'];
pendingAmbulanceRequestOrder = AmbulanceRequestOrdersModel.fromJson(item);
}
});
print(patientAmbulanceRequestOrdersList.length);
print(hasPendingOrder);
print(pendingOrderID);
print(pendingOrderStatus);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future getOrderDetails() async { Future getOrderDetails() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PresOrderID'] = pendingOrderID; body['PresOrderID'] = pendingOrderID;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID, await baseAppClient.post(GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { response['PatientER_RRT_GetPickUpRequestByPresOrderIDList'].forEach((item) {
response['PatientER_RRT_GetPickUpRequestByPresOrderIDList']
.forEach((item) {
pickUpRequestPresOrder = PickUpRequestPresOrder.fromJson(item); pickUpRequestPresOrder = PickUpRequestPresOrder.fromJson(item);
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -95,22 +121,34 @@ class AmService extends BaseService {
body['RejectionReason'] = ''; body['RejectionReason'] = '';
body['PresOrderStatus'] = OrderService.AMBULANCE.getIdOrderService(); body['PresOrderStatus'] = OrderService.AMBULANCE.getIdOrderService();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_PRESS_ORDER, await baseAppClient.post(UPDATE_PRESS_ORDER, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
} }
Future insertERPressOrder({@required PatientER patientER}) async { Future updatePressOrderRC({@required int presOrderID, @required String patientID}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map();
body['Id'] = presOrderID;
body['StatusId'] = 6;
body['ClickButton'] = 14;
body['PatientID'] = patientID;
await baseAppClient.post(CANCEL_AMBULANCE_REQUEST, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future insertERPressOrder({@required PatientER_RC patientER}) async {
hasError = false;
var body = patientER.toJson();
print(body);
await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC, await baseAppClient.post(INSERT_TRANSPORTATION_ORDER_RC, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: patientER.toJson()); }, body: body);
} }
} }

@ -19,12 +19,10 @@ class MedicalService extends BaseService {
body['isDentalAllowedBackend'] = false; 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 {
appoitmentAllHistoryResultList.clear(); appoitmentAllHistoryResultList.clear();
response['AppoimentAllHistoryResultList'].forEach((appoitment) { response['AppoimentAllHistoryResultList'].forEach((appoitment) {
appoitmentAllHistoryResultList appoitmentAllHistoryResultList.add(AppoitmentAllHistoryResultList.fromJson(appoitment));
.add(AppoitmentAllHistoryResultList.fromJson(appoitment));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -39,9 +37,7 @@ class MedicalService extends BaseService {
body['RequesterFileNo'] = user.patientID; body['RequesterFileNo'] = user.patientID;
body['RequesterMobileNo'] = user.mobileNumber; body['RequesterMobileNo'] = user.mobileNumber;
body['RequesterIsOutSA'] = user.outSA; body['RequesterIsOutSA'] = user.outSA;
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async {}, onFailure: (String error, int statusCode) {
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
@ -49,35 +45,22 @@ class MedicalService extends BaseService {
getSchedule(DoctorList doctorRequest) async { getSchedule(DoctorList doctorRequest) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {'DoctorID': doctorRequest.doctorID, 'ProjectID': doctorRequest.projectID, 'ClinicID': doctorRequest.clinicID, 'DoctorWorkingHoursDays': 7};
'DoctorID': doctorRequest.doctorID,
'ProjectID': doctorRequest.projectID,
'ClinicID': doctorRequest.clinicID,
'DoctorWorkingHoursDays': 7
};
dynamic localRes; dynamic localRes;
await baseAppClient.post(DOCTOR_SCHEDULE_URL, await baseAppClient.post(DOCTOR_SCHEDULE_URL, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
doctorScheduleResponse.clear(); doctorScheduleResponse.clear();
localRes['List_DoctorWorkingHoursTable'].forEach((item) => localRes['List_DoctorWorkingHoursTable'].forEach((item) => {doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item))});
{doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item))});
} }
getFreeSlot(DoctorList doctorRequest) async { getFreeSlot(DoctorList doctorRequest) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {'DoctorID': doctorRequest.doctorID, 'ProjectID': doctorRequest.projectID, 'ClinicID': doctorRequest.clinicID, 'DoctorWorkingHoursDays': 7};
'DoctorID': doctorRequest.doctorID,
'ProjectID': doctorRequest.projectID,
'ClinicID': doctorRequest.clinicID,
'DoctorWorkingHoursDays': 7
};
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/AmbulanceRequestOrdersModel.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/model/er/PickUpRequestPresOrder.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 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
@ -27,12 +29,17 @@ class AmRequestViewModel extends BaseViewModel {
List<AppoitmentAllHistoryResultList> get appoitmentAllHistoryResultList => List<AppoitmentAllHistoryResultList> get appoitmentAllHistoryResultList =>
_medicalService.appoitmentAllHistoryResultList; _medicalService.appoitmentAllHistoryResultList;
List<AmbulanceRequestOrdersModel> get patientAmbulanceRequestOrdersList =>
_amService.patientAmbulanceRequestOrdersList;
List<HospitalsModel> get hospitals => _hospitalService.hospitals; List<HospitalsModel> get hospitals => _hospitalService.hospitals;
bool get hasPendingOrder =>_amService.hasPendingOrder; bool get hasPendingOrder =>_amService.hasPendingOrder;
PickUpRequestPresOrder get pickUpRequestPresOrder =>_amService.pickUpRequestPresOrder; PickUpRequestPresOrder get pickUpRequestPresOrder =>_amService.pickUpRequestPresOrder;
AmbulanceRequestOrdersModel get pendingAmbulanceRequestOrder =>_amService.pendingAmbulanceRequestOrder;
Future getAppointmentHistory() async { Future getAppointmentHistory() async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _medicalService.getAppointmentHistory(isActiveAppointment: true); await _medicalService.getAppointmentHistory(isActiveAppointment: true);
@ -60,7 +67,18 @@ class AmRequestViewModel extends BaseViewModel {
error = _hospitalService.error; error = _hospitalService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else
getPatientAllPresOrdersList(); // getPatientAllPresOrdersList();
getPatientAllPresOrdersListRC();
}
Future getPatientAllPresOrdersListRC() async {
setState(ViewState.Busy);
await _amService.getPatientAllPresOrdersListRC(authenticatedUserObject.user.patientID);
if (_hospitalService.hasError) {
error = _hospitalService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
} }
Future getPatientAllPresOrdersList() async { Future getPatientAllPresOrdersList() async {
@ -87,22 +105,23 @@ class AmRequestViewModel extends BaseViewModel {
Future updatePressOrder({@required int presOrderID}) async { Future updatePressOrder({@required int presOrderID}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _amService.updatePressOrder(presOrderID: presOrderID); // await _amService.updatePressOrder(presOrderID: presOrderID);
await _amService.updatePressOrderRC(presOrderID: presOrderID, patientID: authenticatedUserObject.user.patientID.toString());
if (_amService.hasError) { if (_amService.hasError) {
error = _amService.error; error = _amService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else
getPatientAllPresOrdersList(); getPatientAllPresOrdersListRC();
} }
Future insertERPressOrder({@required PatientER patientER}) async { Future insertERPressOrder({@required PatientER_RC patientER}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _amService.insertERPressOrder(patientER: patientER); await _amService.insertERPressOrder(patientER: patientER);
if (_amService.hasError) { if (_amService.hasError) {
error = _amService.error; error = _amService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else } else
getAmRequestOrders(); // getAmRequestOrders();
getPatientAllPresOrdersListRC();
} }
} }

@ -10,10 +10,8 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleR
class MedicalViewModel extends BaseViewModel { class MedicalViewModel extends BaseViewModel {
MedicalService _medicalService = locator<MedicalService>(); MedicalService _medicalService = locator<MedicalService>();
List<AppoitmentAllHistoryResultList> get appoitmentAllHistoryResultList => List<AppoitmentAllHistoryResultList> get appoitmentAllHistoryResultList => _medicalService.appoitmentAllHistoryResultList;
_medicalService.appoitmentAllHistoryResultList; List<DoctorScheduleResponse> get getDoctorScheduleList => _medicalService.doctorScheduleResponse;
List<DoctorScheduleResponse> get getDoctorScheduleList =>
_medicalService.doctorScheduleResponse;
List<String> get freeSlots => _medicalService.freeSlots; List<String> get freeSlots => _medicalService.freeSlots;
getAppointmentHistory() async { getAppointmentHistory() async {
if (authenticatedUserObject.isLogin) { if (authenticatedUserObject.isLogin) {
@ -28,26 +26,26 @@ class MedicalViewModel extends BaseViewModel {
} }
getDoctorSchedule(DoctorList doctorRequest) async { getDoctorSchedule(DoctorList doctorRequest) async {
if (authenticatedUserObject.isLogin) { //if (authenticatedUserObject.isLogin) {
setState(ViewState.Busy); setState(ViewState.Busy);
await _medicalService.getSchedule(doctorRequest); await _medicalService.getSchedule(doctorRequest);
if (_medicalService.hasError) { if (_medicalService.hasError) {
error = _medicalService.error; error = _medicalService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} //}
} }
getFreeSlots(DoctorList doctorRequest) async { getFreeSlots(DoctorList doctorRequest) async {
if (authenticatedUserObject.isLogin) { //if (authenticatedUserObject.isLogin) {
setState(ViewState.Busy); setState(ViewState.Busy);
await _medicalService.getFreeSlot(doctorRequest); await _medicalService.getFreeSlot(doctorRequest);
if (_medicalService.hasError) { if (_medicalService.hasError) {
error = _medicalService.error; error = _medicalService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
}
} }
//}
} }

@ -44,7 +44,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
TabController _tabController; TabController _tabController;
bool showFooterButton = false; bool showFooterButton = false;
var event = RobotProvider(); var event = RobotProvider();
dynamic doctorSchedule;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
List<DoctorRateDetails> doctorDetailsList = List(); List<DoctorRateDetails> doctorDetailsList = List();
@ -122,7 +122,11 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
FadePage( FadePage(
page: SchedulePage(doctorList: widget.doctor), page: SchedulePage(doctorList: widget.doctor),
), ),
); ).then((value) {
setState(() {
this.doctorSchedule = value;
});
});
}, },
onRatingAndReviewTap: () { onRatingAndReviewTap: () {
getDoctorRatingsDetails(); getDoctorRatingsDetails();
@ -170,7 +174,11 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
children: [ children: [
DoctorInformation(docProfileList: widget.docProfileList), DoctorInformation(docProfileList: widget.docProfileList),
DocAvailableAppointments(doctor: widget.doctor, isLiveCareAppointment: widget.isLiveCareAppointment), DocAvailableAppointments(
doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment,
doctorSchedule: doctorSchedule,
),
], ],
controller: _tabController, controller: _tabController,
), ),
@ -490,9 +498,15 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
Future navigateToBookConfirm(context) async { Future navigateToBookConfirm(context) async {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: BookConfirm( page: BookConfirm(
doctor: widget.doctor, isLiveCareAppointment: widget.isLiveCareAppointment, selectedDate: DocAvailableAppointments.selectedDate, selectedTime: DocAvailableAppointments.selectedTime))); doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment,
selectedDate: DocAvailableAppointments.selectedDate,
selectedTime: DocAvailableAppointments.selectedTime,
),
),
);
} }
} }

@ -57,8 +57,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// print("selectedTime "+selectedTime??""); // print("selectedTime "+selectedTime??"");
print("appoDateFormatted " + widget.appoDateFormatted ?? ""); print("appointmentNo1 " + widget.patientShareResponse.appointmentNo.toString() ?? "");
print("appoTimeFormatted " + widget.appoTimeFormatted ?? "");
return AppScaffold( return AppScaffold(
appBarTitle: widget.docObject.doctorTitle + " " + widget.docObject.name, appBarTitle: widget.docObject.doctorTitle + " " + widget.docObject.name,
isShowDecPage: false, isShowDecPage: false,
@ -194,15 +193,19 @@ class _BookReminderPageState extends State<BookReminderPage> {
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: CustomColors.green, disabledColor: CustomColors.green,
onPressed: () async { onPressed: () async {
if (await Permission.calendar.request().isGranted) { print(widget.patientShareResponse.appointmentNo);
_showReminderDialog(context); showReminderDialog(
} else { context,
requestPermissions().then((results) { widget.dateTime,
if (results[Permission.calendar].isGranted) { widget.docObject.name,
_showReminderDialog(context); widget.patientShareResponse.appointmentNo.toString(),
} widget.appoDateFormatted,
}); widget.appoTimeFormatted,
} onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
navigateToBookSuccess(context);
},
);
}, },
child: Text(TranslationBase.of(context).yes, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)), child: Text(TranslationBase.of(context).yes, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)),
), ),
@ -223,49 +226,6 @@ class _BookReminderPageState extends State<BookReminderPage> {
BookSuccess(docObject: widget.docObject, patientShareResponse: widget.patientShareResponse, appoDateFormatted: widget.appoDateFormatted, appoTimeFormatted: widget.appoTimeFormatted))); BookSuccess(docObject: widget.docObject, patientShareResponse: widget.patientShareResponse, appoDateFormatted: widget.appoDateFormatted, appoTimeFormatted: widget.appoTimeFormatted)));
} }
Future<void> _showReminderDialog(BuildContext context) async {
return showDialog<void>(
context: context,
barrierDismissible: true, // user must tap button!
builder: (BuildContext context) {
return Dialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), //this right here
child: ReminderDialog(
onClick: (int i) async {
if (i == 0) {
// Before 30 mints
widget.dateTime = Jiffy(widget.dateTime).subtract(minutes: 30);
// dateTime.add(new Duration(minutes: -30));
} else if (i == 1) {
// Before 1 hour
// dateTime.add(new Duration(minutes: -60));
widget.dateTime = Jiffy(widget.dateTime).subtract(hours: 1);
} else if (i == 2) {
// Before 1 hour and 30 mints
// dateTime.add(new Duration(minutes: -90));
widget.dateTime = Jiffy(widget.dateTime).subtract(hours: 1, minutes: 30);
} else if (i == 3) {
// Before 2 hours
// dateTime.add(new Duration(minutes: -120));
widget.dateTime = Jiffy(widget.dateTime).subtract(hours: 2);
}
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
calendarUtils
.createOrUpdateEvent(
title: TranslationBase.of(context).reminderTitle + " " + widget.docObject.name,
description: "At " + widget.appoDateFormatted + " " + widget.appoTimeFormatted,
scheduleDateTime: widget.dateTime)
.then((value) {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
navigateToBookSuccess(context);
});
},
),
);
},
);
}
Future<Map<Permission, PermissionStatus>> requestPermissions() async { Future<Map<Permission, PermissionStatus>> requestPermissions() async {
var permissionResults = [Permission.calendar].request(); var permissionResults = [Permission.calendar].request();
return permissionResults; return permissionResults;

@ -24,10 +24,7 @@ class DocAvailableAppointments extends StatefulWidget {
static String selectedTime; static String selectedTime;
bool isLiveCareAppointment; bool isLiveCareAppointment;
final dynamic doctorSchedule; final dynamic doctorSchedule;
DocAvailableAppointments( DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment});
{@required this.doctor,
this.doctorSchedule,
@required this.isLiveCareAppointment});
@override @override
_DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState(); _DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState();
@ -55,6 +52,15 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
var language; var language;
@override
void didUpdateWidget(covariant DocAvailableAppointments oldWidget) {
if (oldWidget.doctorSchedule != widget.doctorSchedule) {
_calendarController.setSelectedDay(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), isProgrammatic: true);
_onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), List());
}
super.didUpdateWidget(oldWidget);
}
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
@ -121,7 +127,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
children: <Widget>[ children: <Widget>[
_buildTableCalendarWithBuilders(), _buildTableCalendarWithBuilders(),
Padding( Padding(
padding: const EdgeInsets.only(left: 16,right: 16,bottom: 16), padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
child: Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)), child: Text(selectedDate, style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
), ),
Container( Container(
@ -132,12 +138,12 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
itemCount: dayEvents.length, itemCount: dayEvents.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
margin: EdgeInsets.only(right: (index==dayEvents.length-1)?16:5.0,left: index==0?16:5), margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 16 : 5.0, left: index == 0 ? 16 : 5),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0), borderRadius: BorderRadius.circular(5.0),
side: BorderSide( side: BorderSide(
color:index == selectedButtonIndex ? CustomColors.green:Colors.black, //Color of the border color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border
style: BorderStyle.solid, //Style of the border style: BorderStyle.solid, //Style of the border
width: 1.5, //width of the border width: 1.5, //width of the border
), ),
@ -345,14 +351,8 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
_events = value, _events = value,
if (widget.doctorSchedule != null) if (widget.doctorSchedule != null)
{ {
_calendarController.setSelectedDay( _calendarController.setSelectedDay(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), isProgrammatic: true),
DateUtil.convertStringToDate( _onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date']), List())
widget.doctorSchedule['Date']),
isProgrammatic: true),
_onDaySelected(
DateUtil.convertStringToDate(
widget.doctorSchedule['Date']),
List())
} }
}); });
}); });

@ -24,7 +24,7 @@ class DoctorView extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return InkWell( return InkWell(
onTap: () { onTap: () {
if (isShowFlag) getDoctorsProfile(context, doctor); if (isShowFlag) getDoctorsProfile(context, doctor,isAppo: true);
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(

@ -1,6 +1,87 @@
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:jiffy/jiffy.dart';
import 'package:manage_calendar_events/manage_calendar_events.dart';
import 'package:permission_handler/permission_handler.dart';
Future<Map<Permission, PermissionStatus>> requestPermissions() async {
var permissionResults = [Permission.calendar].request();
return permissionResults;
}
showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted, {Function onSuccess}) async {
if (await Permission.calendar.request().isGranted) {
_showReminderDialog(
context,
dateTime,
doctorName,
eventId,
appoDateFormatted,
appoTimeFormatted,
onSuccess: onSuccess,
);
} else {
requestPermissions().then((results) {
if (results[Permission.calendar].isGranted) {
_showReminderDialog(
context,
dateTime,
doctorName,
eventId,
appoDateFormatted,
appoTimeFormatted,
onSuccess: onSuccess,
);
}
});
}
}
final CalendarPlugin _myPlugin = CalendarPlugin();
Future<void> _showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted, {Function onSuccess}) async {
return showDialog<void>(
context: context,
barrierDismissible: true, // user must tap button!
builder: (BuildContext context) {
return Dialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12.0)), //this right here
child: ReminderDialog(
onClick: (int i) async {
if (i == 0) {
// Before 30 mints
dateTime = Jiffy(dateTime).subtract(minutes: 30);
// dateTime.add(new Duration(minutes: -30));
} else if (i == 1) {
// Before 1 hour
// dateTime.add(new Duration(minutes: -60));
dateTime = Jiffy(dateTime).subtract(hours: 1);
} else if (i == 2) {
// Before 1 hour and 30 mints
// dateTime.add(new Duration(minutes: -90));
dateTime = Jiffy(dateTime).subtract(hours: 1, minutes: 30);
} else if (i == 3) {
// Before 2 hours
// dateTime.add(new Duration(minutes: -120));
dateTime = Jiffy(dateTime).subtract(hours: 2);
}
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
calendarUtils
.createOrUpdateEvent(
title: TranslationBase.of(context).reminderTitle + " " + doctorName, description: "At " + appoDateFormatted + " " + appoTimeFormatted, scheduleDateTime: dateTime, eventId: eventId)
.then((value) {});
onSuccess();
},
),
);
},
);
}
class ReminderDialog extends StatefulWidget { class ReminderDialog extends StatefulWidget {
Function onClick; Function onClick;

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/StepsWidget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -29,6 +30,10 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
PageController pageController; PageController pageController;
PatientER _patientER = PatientER(); PatientER _patientER = PatientER();
PatientER_RC _patientER_RC = PatientER_RC();
TransportationDetails transportationDetails = new TransportationDetails();
_changeCurrentTab(int tab) { _changeCurrentTab(int tab) {
setState(() { setState(() {
currentIndex = tab; currentIndex = tab;
@ -41,12 +46,13 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
void initState() { void initState() {
super.initState(); super.initState();
pageController = new PageController(); pageController = new PageController();
_patientER_RC.transportationDetails = transportationDetails;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
body: widget.amRequestViewModel.pickUpRequestPresOrder != null body: widget.amRequestViewModel.pendingAmbulanceRequestOrder != null
? SingleChildScrollView( ? SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
@ -64,36 +70,32 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
children: [ children: [
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).reqId, title: TranslationBase.of(context).reqId,
value: widget.amRequestViewModel.pickUpRequestPresOrder value: widget.amRequestViewModel.pendingAmbulanceRequestOrder
.presOrderID .id
.toString(), .toString(),
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).status, title: TranslationBase.of(context).status,
value: widget.amRequestViewModel.pickUpRequestPresOrder.status ==0?TranslationBase.of(context).pending:'', value: widget.amRequestViewModel.pendingAmbulanceRequestOrder.statusText,
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).pickupDate, title: TranslationBase.of(context).pickupDate,
value: DateUtil.getDayMonthYearDateFormatted( value: getDate(widget.amRequestViewModel.pendingAmbulanceRequestOrder.created),
DateUtil.convertStringToDate(widget
.amRequestViewModel
.pickUpRequestPresOrder
.lastEditDate)),
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).pickupLocation, title: TranslationBase.of(context).pickupLocation,
value: widget.amRequestViewModel.pickUpRequestPresOrder value: widget.amRequestViewModel.pendingAmbulanceRequestOrder
.pickupLocationName, .pickupLocation,
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).dropoffLocation, title: TranslationBase.of(context).dropoffLocation,
value: widget.amRequestViewModel.pickUpRequestPresOrder value: widget.amRequestViewModel.pendingAmbulanceRequestOrder
.dropoffLocationName, .dropOffLocation,
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).transportMethod, title: TranslationBase.of(context).transportMethod,
value: widget value: widget
.amRequestViewModel.pickUpRequestPresOrder.title, .amRequestViewModel.pendingAmbulanceRequestOrder.serviceText,
), ),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
@ -112,7 +114,7 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
onTap: () { onTap: () {
widget.amRequestViewModel.updatePressOrder( widget.amRequestViewModel.updatePressOrder(
presOrderID: widget.amRequestViewModel presOrderID: widget.amRequestViewModel
.pickUpRequestPresOrder.presOrderID); .pendingAmbulanceRequestOrder.id);
}, },
), ),
) )
@ -143,21 +145,25 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
SelectTransportationMethod( SelectTransportationMethod(
changeCurrentTab: _changeCurrentTab, changeCurrentTab: _changeCurrentTab,
patientER: _patientER, patientER: _patientER,
patientER_RC: _patientER_RC,
amRequestViewModel: widget.amRequestViewModel, amRequestViewModel: widget.amRequestViewModel,
), ),
PickupLocation( PickupLocation(
changeCurrentTab: _changeCurrentTab, changeCurrentTab: _changeCurrentTab,
patientER: _patientER, patientER: _patientER,
patientER_RC: _patientER_RC,
amRequestViewModel: widget.amRequestViewModel, amRequestViewModel: widget.amRequestViewModel,
), ),
BillAmount( BillAmount(
changeCurrentTab: _changeCurrentTab, changeCurrentTab: _changeCurrentTab,
patientER: _patientER, patientER: _patientER,
patientER_RC: _patientER_RC,
amRequestViewModel: widget.amRequestViewModel, amRequestViewModel: widget.amRequestViewModel,
), ),
Summary( Summary(
changeCurrentTab: _changeCurrentTab, changeCurrentTab: _changeCurrentTab,
patientER: _patientER, patientER: _patientER,
patientER_RC: _patientER_RC,
amRequestViewModel: widget.amRequestViewModel, amRequestViewModel: widget.amRequestViewModel,
), ),
], ],
@ -167,4 +173,9 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
), ),
); );
} }
String getDate(String date) {
return date.split("T")[0];
}
} }

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/enum/Ambulate.dart'; import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart'; import 'package:diplomaticquarterapp/pages/Blood/new_text_Field.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -9,17 +10,13 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class BillAmount extends StatefulWidget { class BillAmount extends StatefulWidget {
final Function changeCurrentTab; final Function changeCurrentTab;
final PatientER patientER; final PatientER patientER;
final PatientER_RC patientER_RC;
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
BillAmount( BillAmount({Key key, this.changeCurrentTab, this.patientER, this.patientER_RC, this.amRequestViewModel});
{Key key,
this.changeCurrentTab,
this.patientER,
this.amRequestViewModel});
@override @override
_BillAmountState createState() => _BillAmountState(); _BillAmountState createState() => _BillAmountState();
@ -27,23 +24,19 @@ class BillAmount extends StatefulWidget {
class _BillAmountState extends State<BillAmount> { class _BillAmountState extends State<BillAmount> {
Ambulate _ambulate = Ambulate.None; Ambulate _ambulate = Ambulate.None;
String note =""; String note = "";
@override @override
void initState() { void initState() {
// if (widget.patientER_RC.transportationDetails.ambulate != null) {
if(widget.patientER.ambulate!=null) // setState(() {
{ // _ambulate = widget.patientER.ambulate;
setState(() { // note = widget.patientER.requesterNote;
_ambulate = widget.patientER.ambulate; // });
note = widget.patientER.requesterNote; // }
});
}
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
@ -61,9 +54,7 @@ class _BillAmountState extends State<BillAmount> {
height: 10, height: 10,
), ),
Table( Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(inside: BorderSide(width: 1.0, color: Colors.grey[300]), outside: BorderSide(width: 1.0, color: Colors.grey[300])),
inside: BorderSide(width: 1.0, color: Colors.grey[300]),
outside: BorderSide(width: 1.0, color: Colors.grey[300])),
children: [ children: [
TableRow( TableRow(
children: [ children: [
@ -96,7 +87,7 @@ class _BillAmountState extends State<BillAmount> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.price}', TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.price}',
color: Colors.black, color: Colors.black,
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontSize: 15, fontSize: 15,
@ -126,7 +117,7 @@ class _BillAmountState extends State<BillAmount> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.priceVAT}', TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceVAT}',
color: Colors.black, color: Colors.black,
fontSize: 15, fontSize: 15,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -167,7 +158,7 @@ class _BillAmountState extends State<BillAmount> {
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Texts( child: Texts(
TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.priceTotal}', TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}',
color: Colors.black, color: Colors.black,
fontSize: 15, fontSize: 15,
textAlign: TextAlign.start, textAlign: TextAlign.start,
@ -181,8 +172,13 @@ class _BillAmountState extends State<BillAmount> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Texts(TranslationBase.of(context).selectAmbulate,bold: true,), Texts(
SizedBox(height: 5,), TranslationBase.of(context).selectAmbulate,
bold: true,
),
SizedBox(
height: 5,
),
Row( Row(
children: [ children: [
Expanded( Expanded(
@ -196,8 +192,7 @@ class _BillAmountState extends State<BillAmount> {
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
@ -226,8 +221,7 @@ class _BillAmountState extends State<BillAmount> {
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
@ -235,7 +229,6 @@ class _BillAmountState extends State<BillAmount> {
leading: Radio( leading: Radio(
value: Ambulate.Walker, value: Ambulate.Walker,
groupValue: _ambulate, groupValue: _ambulate,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_ambulate = value; _ambulate = value;
@ -248,7 +241,9 @@ class _BillAmountState extends State<BillAmount> {
), ),
], ],
), ),
SizedBox(height: 5,), SizedBox(
height: 5,
),
Row( Row(
children: [ children: [
Expanded( Expanded(
@ -262,8 +257,7 @@ class _BillAmountState extends State<BillAmount> {
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
@ -271,7 +265,6 @@ class _BillAmountState extends State<BillAmount> {
leading: Radio( leading: Radio(
value: Ambulate.Stretcher, value: Ambulate.Stretcher,
groupValue: _ambulate, groupValue: _ambulate,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_ambulate = value; _ambulate = value;
@ -293,8 +286,7 @@ class _BillAmountState extends State<BillAmount> {
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
@ -302,7 +294,6 @@ class _BillAmountState extends State<BillAmount> {
leading: Radio( leading: Radio(
value: Ambulate.None, value: Ambulate.None,
groupValue: _ambulate, groupValue: _ambulate,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
_ambulate = value; _ambulate = value;
@ -315,17 +306,18 @@ class _BillAmountState extends State<BillAmount> {
), ),
], ],
), ),
SizedBox(height: 12,), SizedBox(
height: 12,
),
NewTextFields( NewTextFields(
hintText: TranslationBase.of(context).notes, hintText: TranslationBase.of(context).notes,
initialValue: note, initialValue: note,
onChanged: (value){ onChanged: (value) {
setState(() { setState(() {
note = value; note = value;
}); });
}, },
), ),
SizedBox( SizedBox(
height: 100, height: 100,
), ),
@ -342,9 +334,9 @@ class _BillAmountState extends State<BillAmount> {
textColor: Colors.white, textColor: Colors.white,
onTap: () { onTap: () {
setState(() { setState(() {
widget.patientER.ambulate = _ambulate; widget.patientER_RC.transportationDetails.ambulate = _ambulate.selectAmbulateNumber();
widget.patientER.requesterNote = note; widget.patientER_RC.transportationDetails.notes = note;
widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber(); // widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber();
widget.changeCurrentTab(3); widget.changeCurrentTab(3);
}); });
}, },

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
@ -28,13 +29,10 @@ enum HaveAppointment { YES, NO }
class PickupLocation extends StatefulWidget { class PickupLocation extends StatefulWidget {
final Function changeCurrentTab; final Function changeCurrentTab;
final PatientER patientER; final PatientER patientER;
final PatientER_RC patientER_RC;
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
PickupLocation( PickupLocation({Key key, this.changeCurrentTab, this.patientER, this.patientER_RC, this.amRequestViewModel});
{Key key,
this.changeCurrentTab,
this.patientER,
this.amRequestViewModel});
@override @override
_PickupLocationState createState() => _PickupLocationState(); _PickupLocationState createState() => _PickupLocationState();
@ -77,7 +75,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (widget.patientER.direction == 1) if (widget.patientER_RC.transportationDetails.direction == 1)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -112,8 +110,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(child: Texts(getSelectFromMapName(context))),
child: Texts(getSelectFromMapName(context))),
Icon( Icon(
FontAwesomeIcons.mapMarkerAlt, FontAwesomeIcons.mapMarkerAlt,
size: 24, size: 24,
@ -179,8 +176,7 @@ class _PickupLocationState extends State<PickupLocation> {
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
@ -213,8 +209,7 @@ class _PickupLocationState extends State<PickupLocation> {
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
@ -254,11 +249,9 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 8, height: 8,
), ),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectHospitalDialog( confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals);
widget.amRequestViewModel.hospitals);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
@ -271,8 +264,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName( Texts(getHospitalName(TranslationBase.of(context).pickupLocation)),
TranslationBase.of(context).pickupLocation)),
Icon( Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
size: 24, size: 24,
@ -284,7 +276,7 @@ class _PickupLocationState extends State<PickupLocation> {
), ),
], ],
), ),
if (widget.patientER.direction == 0) if (widget.patientER_RC.transportationDetails.direction == 0)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -294,8 +286,7 @@ class _PickupLocationState extends State<PickupLocation> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectHospitalDialog( confirmSelectHospitalDialog(widget.amRequestViewModel.hospitals);
widget.amRequestViewModel.hospitals);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
@ -308,8 +299,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(getHospitalName( Texts(getHospitalName(TranslationBase.of(context).pickupLocation)),
TranslationBase.of(context).pickupLocation)),
Icon( Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
size: 24, size: 24,
@ -354,8 +344,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(child: Texts(getSelectFromMapName(context))),
child: Texts(getSelectFromMapName(context))),
Icon( Icon(
FontAwesomeIcons.mapMarkerAlt, FontAwesomeIcons.mapMarkerAlt,
size: 24, size: 24,
@ -387,77 +376,59 @@ class _PickupLocationState extends State<PickupLocation> {
textColor: Colors.white, textColor: Colors.white,
onTap: () { onTap: () {
if (_result == null || _selectedHospital == null) if (_result == null || _selectedHospital == null)
AppToast.showErrorToast( AppToast.showErrorToast(message: TranslationBase.of(context).selectAll);
message: TranslationBase.of(context).selectAll);
else else
setState(() { setState(() {
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; widget.patientER_RC.transportationDetails.pickupSpot = _isInsideHome ? 1 : 0;
if (widget.patientER.direction == 0) { if (widget.patientER_RC.transportationDetails.direction == 0) {
widget.patientER_RC.transportationDetails.dropoffLatitude = _result.geometry.location.lat.toString();
widget.patientER.dropoffLocationLattitude = widget.patientER_RC.transportationDetails.dropoffLongitude = _result.geometry.location.lng.toString();
_result.geometry.location.lat.toString(); widget.patientER_RC.transportationDetails.pickupLatitude = _selectedHospital.latitude;
widget.patientER.dropoffLocationLongitude = widget.patientER_RC.transportationDetails.pickupLongitude = _selectedHospital.longitude;
_result.geometry.location.lng.toString();
widget.patientER.pickupLocationLattitude =
_selectedHospital.latitude;
widget.patientER.pickupLocationLongitude =
_selectedHospital.longitude;
} else { } else {
widget.patientER.pickupLocationLattitude = widget.patientER_RC.transportationDetails.pickupLatitude = _selectedHospital.latitude;
_selectedHospital.latitude; widget.patientER_RC.transportationDetails.pickupLongitude = _selectedHospital.longitude;
widget.patientER.pickupLocationLongitude = widget.patientER_RC.transportationDetails.dropoffLatitude = _result.geometry.location.lat.toString();
_selectedHospital.longitude; widget.patientER_RC.transportationDetails.dropoffLongitude = _result.geometry.location.lng.toString();
widget.patientER.dropoffLocationLattitude =
_result.geometry.location.lat.toString();
widget.patientER.dropoffLocationLongitude =
_result.geometry.location.lng.toString();
} }
widget.patientER.latitude = // widget.patientER.latitude =
widget.patientER.pickupLocationLattitude; // widget.patientER.pickupLocationLattitude;
widget.patientER.longitude = // widget.patientER.longitude =
widget.patientER.pickupLocationLongitude; // widget.patientER.pickupLocationLongitude;
widget.patientER.dropoffLocationName = widget.patientER.direction == 0?_result.formattedAddress:_selectedHospital.name;
widget.patientER.createdBy = widget.patientER_RC.transportationDetails.dropoffLocationName = widget.patientER.direction == 0 ? _result.formattedAddress : _selectedHospital.name;
widget.amRequestViewModel.user.patientID; // widget.patientER_RC.crea =
widget.patientER.isOutPatient = // widget.amRequestViewModel.user.patientID;
widget.amRequestViewModel.user.outSA; widget.patientER_RC.patientOutSA = widget.amRequestViewModel.user.outSA == 0 ? true : false;
widget.patientER.patientIdentificationID = widget.patientER_RC.patientOutSa = widget.amRequestViewModel.user.outSA;
widget.amRequestViewModel.user.patientIdentificationNo;
widget.patientER.pickupDateTime = widget.patientER_RC.patientIdentificationID = widget.amRequestViewModel.user.patientIdentificationNo;
DateUtil.convertDateToStringLocation(DateTime.now()); widget.patientER_RC.transportationDetails.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now());
widget.patientER.pickupLocationName = widget.patientER.direction == 0?_selectedHospital.name:_result.formattedAddress; widget.patientER_RC.transportationDetails.pickupLocationName = widget.patientER.direction == 0 ? _selectedHospital.name : _result.formattedAddress;
widget.patientER.projectID = widget.patientER_RC.projectID = widget.amRequestViewModel.user.projectID;
widget.amRequestViewModel.user.projectID; widget.patientER_RC.patientID = widget.amRequestViewModel.user.patientID.toString();
widget.patientER.requesterFileNo = widget.patientER_RC.transportationDetails.requesterIsOutSA = false;
widget.amRequestViewModel.user.patientID; // widget.patientER.lineItemNo = 0;
widget.patientER.requesterIsOutSA = false; widget.patientER_RC.transportationDetails.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber;
widget.patientER.lineItemNo = 0;
widget.patientER.requesterMobileNo =
widget.amRequestViewModel.user.mobileNumber;
if (_haveAppointment == HaveAppointment.YES) { if (_haveAppointment == HaveAppointment.YES) {
widget.patientER.appointmentNo = widget.patientER_RC.transportationDetails.appointmentNo = myAppointment.appointmentNo.toString();
myAppointment.appointmentNo.toString(); widget.patientER_RC.transportationDetails.appointmentClinicName = myAppointment.clinicName;
widget.patientER.appointmentClinicName = widget.patientER_RC.transportationDetails.appointmentDoctorName = myAppointment.doctorNameObj;
myAppointment.clinicName; widget.patientER_RC.transportationDetails.appointmentBranch = myAppointment.projectName;
widget.patientER.appointmentDoctorName = widget.patientER_RC.transportationDetails.appointmentTime = myAppointment.appointmentDate;
myAppointment.doctorNameObj; widget.patientER_RC.transportationDetails.haveAppointment = 1;
widget.patientER.appointmentBranch =
myAppointment.projectName;
widget.patientER.appointmentTime =
myAppointment.appointmentDate;
widget.patientER.haveAppointment = true;
} else { } else {
widget.patientER.appointmentNo = "0"; widget.patientER_RC.transportationDetails.appointmentNo = "0";
widget.patientER.appointmentClinicName = null; widget.patientER_RC.transportationDetails.appointmentClinicName = "";
widget.patientER.appointmentDoctorName = null; widget.patientER_RC.transportationDetails.appointmentDoctorName = "";
widget.patientER.appointmentBranch = null; widget.patientER_RC.transportationDetails.appointmentBranch = "";
widget.patientER.appointmentTime = null; widget.patientER_RC.transportationDetails.appointmentTime = "";
widget.patientER.haveAppointment = false; widget.patientER_RC.transportationDetails.haveAppointment = 0;
} }
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; widget.patientER_RC.transportationDetails.pickupSpot = _isInsideHome ? 1 : 0;
widget.changeCurrentTab(2); widget.changeCurrentTab(2);
}); });
}, },
@ -487,27 +458,21 @@ class _PickupLocationState extends State<PickupLocation> {
} }
String getSelectFromMapName(context) { String getSelectFromMapName(context) {
return _result != null return _result != null ? _result.formattedAddress : TranslationBase.of(context).selectMap;
? _result.formattedAddress
: TranslationBase.of(context).selectMap;
} }
getAppointment() { getAppointment() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.amRequestViewModel.getAppointmentHistory().then((value) { widget.amRequestViewModel.getAppointmentHistory().then((value) {
if (widget.amRequestViewModel.state == ViewState.Error || if (widget.amRequestViewModel.state == ViewState.Error || widget.amRequestViewModel.state == ViewState.ErrorLocal) {
widget.amRequestViewModel.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: widget.amRequestViewModel.error); AppToast.showErrorToast(message: widget.amRequestViewModel.error);
} else if (widget } else if (widget.amRequestViewModel.appoitmentAllHistoryResultList.length > 0) {
.amRequestViewModel.appoitmentAllHistoryResultList.length >
0) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: AvailableAppointmentsPage( page: AvailableAppointmentsPage(
appointmentsAllHistoryList: appointmentsAllHistoryList: widget.amRequestViewModel.appoitmentAllHistoryResultList,
widget.amRequestViewModel.appoitmentAllHistoryResultList,
), ),
), ),
).then((value) { ).then((value) {
@ -527,8 +492,7 @@ class _PickupLocationState extends State<PickupLocation> {
setState(() { setState(() {
_haveAppointment = HaveAppointment.NO; _haveAppointment = HaveAppointment.NO;
}); });
AppToast.showErrorToast( AppToast.showErrorToast(message: TranslationBase.of(context).noAppointment);
message: TranslationBase.of(context).noAppointment);
} }
}).catchError((e) { }).catchError((e) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -17,23 +18,17 @@ enum Way { OneWay, TwoWays }
class SelectTransportationMethod extends StatefulWidget { class SelectTransportationMethod extends StatefulWidget {
final Function changeCurrentTab; final Function changeCurrentTab;
final PatientER patientER; final PatientER patientER;
final PatientER_RC patientER_RC;
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
SelectTransportationMethod( SelectTransportationMethod({Key key, this.changeCurrentTab, this.patientER, this.patientER_RC, this.amRequestViewModel});
{Key key,
this.changeCurrentTab,
this.patientER,
this.amRequestViewModel});
@override @override
_SelectTransportationMethodState createState() => _SelectTransportationMethodState createState() => _SelectTransportationMethodState();
_SelectTransportationMethodState();
} }
class _SelectTransportationMethodState class _SelectTransportationMethodState extends State<SelectTransportationMethod> {
extends State<SelectTransportationMethod> { PatientERTransportationMethod _erTransportationMethod = PatientERTransportationMethod();
PatientERTransportationMethod _erTransportationMethod =
PatientERTransportationMethod();
Direction _direction = Direction.FromHospital; Direction _direction = Direction.FromHospital;
Way _way = Way.OneWay; Way _way = Way.OneWay;
@ -42,18 +37,23 @@ class _SelectTransportationMethodState
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if (widget.patientER.direction != null) { // if (widget.patientER.direction != null) {
_direction = widget.patientER.direction == 0 // _direction = widget.patientER.direction == 0 ? Direction.ToHospital : Direction.FromHospital;
? Direction.ToHospital // _way = widget.patientER.tripType == 1 ? Way.OneWay : Way.TwoWays;
: Direction.FromHospital; // _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[(widget.patientER.selectedAmbulate - 1)];
_way = widget.patientER.tripType == 1 ? Way.OneWay : Way.TwoWays; // } else {
_erTransportationMethod = widget.amRequestViewModel // if (widget.amRequestViewModel.amRequestModeList.length != 0) _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[widget.amRequestViewModel.amRequestModeList.length - 1];
.amRequestModeList[(widget.patientER.selectedAmbulate - 1)]; // }
//RC API Revamp
if (widget.patientER_RC.transportationDetails.direction != null) {
_direction = widget.patientER_RC.transportationDetails.direction == 0 ? Direction.ToHospital : Direction.FromHospital;
_way = widget.patientER_RC.transportationDetails.tripType == 1 ? Way.OneWay : Way.TwoWays;
_erTransportationMethod = widget.amRequestViewModel.amRequestModeList[(widget.patientER_RC.transportationDetails.ambulate - 1)];
} else { } else {
if (widget.amRequestViewModel.amRequestModeList.length != 0) if (widget.amRequestViewModel.amRequestModeList.length != 0) _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[widget.amRequestViewModel.amRequestModeList.length - 1];
_erTransportationMethod = widget.amRequestViewModel.amRequestModeList[
widget.amRequestViewModel.amRequestModeList.length - 1];
} }
} }
@override @override
@ -78,8 +78,7 @@ class _SelectTransportationMethodState
(index) => InkWell( (index) => InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
_erTransportationMethod = _erTransportationMethod = widget.amRequestViewModel.amRequestModeList[index];
widget.amRequestViewModel.amRequestModeList[index];
}); });
}, },
child: Container( child: Container(
@ -95,14 +94,9 @@ class _SelectTransportationMethodState
Expanded( Expanded(
flex: 3, flex: 3,
child: ListTile( child: ListTile(
title: Texts(projectViewModel.isArabic title: Texts(projectViewModel.isArabic ? widget.amRequestViewModel.amRequestModeList[index].textN : widget.amRequestViewModel.amRequestModeList[index].text),
? widget.amRequestViewModel
.amRequestModeList[index].textN
: widget.amRequestViewModel
.amRequestModeList[index].text),
leading: Radio( leading: Radio(
value: widget value: widget.amRequestViewModel.amRequestModeList[index],
.amRequestViewModel.amRequestModeList[index],
groupValue: _erTransportationMethod, groupValue: _erTransportationMethod,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
@ -114,8 +108,7 @@ class _SelectTransportationMethodState
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: Texts(TranslationBase.of(context).sar + child: Texts(TranslationBase.of(context).sar + ' ${widget.amRequestViewModel.amRequestModeList[index].price}'),
' ${widget.amRequestViewModel.amRequestModeList[index].price}'),
) )
], ],
), ),
@ -181,8 +174,7 @@ class _SelectTransportationMethodState
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: title: Texts(TranslationBase.of(context).fromHospital),
Texts(TranslationBase.of(context).fromHospital),
leading: Radio( leading: Radio(
value: Direction.FromHospital, value: Direction.FromHospital,
groupValue: _direction, groupValue: _direction,
@ -211,7 +203,7 @@ class _SelectTransportationMethodState
height: 5, height: 5,
), ),
Container( Container(
margin: EdgeInsets.only(bottom:65 ), margin: EdgeInsets.only(bottom: 65),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
@ -225,13 +217,11 @@ class _SelectTransportationMethodState
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: title: Texts(TranslationBase.of(context).oneDirec),
Texts(TranslationBase.of(context).oneDirec),
leading: Radio( leading: Radio(
value: Way.OneWay, value: Way.OneWay,
groupValue: _way, groupValue: _way,
@ -256,13 +246,11 @@ class _SelectTransportationMethodState
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: border: Border.all(color: Colors.grey, width: 0.5),
Border.all(color: Colors.grey, width: 0.5),
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: title: Texts(TranslationBase.of(context).twoDirec),
Texts(TranslationBase.of(context).twoDirec),
leading: Radio( leading: Radio(
value: Way.TwoWays, value: Way.TwoWays,
groupValue: _way, groupValue: _way,
@ -300,28 +288,33 @@ class _SelectTransportationMethodState
textColor: Colors.white, textColor: Colors.white,
onTap: () { onTap: () {
setState(() { setState(() {
widget.patientER.transportationMethodId = (widget // widget.patientER.transportationMethodId = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
.amRequestViewModel.amRequestModeList // widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 0;
.indexOf(_erTransportationMethod) + // widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1;
1); // widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER.direction = // widget.patientER.patientERTransportationMethod = _erTransportationMethod;
_direction == Direction.ToHospital ? 1 : 0; // widget.patientER.orderServiceID = _orderService.getIdOrderService();
widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1; // widget.patientER.pickupUrgency = 1;
widget.patientER.selectedAmbulate = (widget // widget.patientER.lineItemNo = 1;
.amRequestViewModel.amRequestModeList // widget.patientER.cost = _erTransportationMethod.price.toDouble();
.indexOf(_erTransportationMethod) + // widget.patientER.vAT = _erTransportationMethod.priceVAT ?? 0;
1); // widget.patientER.totalPrice = _erTransportationMethod.priceTotal.toDouble();
widget.patientER.patientERTransportationMethod = // widget.changeCurrentTab(1);
_erTransportationMethod;
widget.patientER.orderServiceID = // widget.patientER_RC.transportationDetails.id = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
_orderService.getIdOrderService(); widget.patientER_RC.transportationDetails.direction = _direction == Direction.ToHospital ? 1 : 0;
widget.patientER.pickupUrgency = 1; widget.patientER_RC.transportationDetails.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER.lineItemNo = 1; widget.patientER_RC.transportationDetails.ambulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER.cost = _erTransportationMethod.price.toDouble(); widget.patientER_RC.transportationDetails.transportationType = _erTransportationMethod.id.toString();
widget.patientER.vAT = _erTransportationMethod.priceVAT ?? 0; widget.patientER_RC.patientERTransportationMethod = _erTransportationMethod;
widget.patientER.totalPrice = widget.patientER_RC.transportationDetails.pickupUrgency = 1;
_erTransportationMethod.priceTotal.toDouble(); // widget.patientER.orderServiceID = _orderService.getIdOrderService();
// widget.patientER.lineItemNo = 1;
// widget.patientER.cost = _erTransportationMethod.price.toDouble();
// widget.patientER.vAT = _erTransportationMethod.priceVAT ?? 0;
// widget.patientER.totalPrice = _erTransportationMethod.priceTotal.toDouble();
widget.changeCurrentTab(1); widget.changeCurrentTab(1);
}); });
}, },
label: TranslationBase.of(context).next, label: TranslationBase.of(context).next,

@ -1,4 +1,6 @@
import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER_RC.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -6,14 +8,14 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
class Summary extends StatefulWidget { class Summary extends StatefulWidget {
final Function changeCurrentTab; final Function changeCurrentTab;
final PatientER patientER; final PatientER patientER;
final PatientER_RC patientER_RC;
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
Summary({Key key, this.changeCurrentTab, this.patientER, this.amRequestViewModel}); Summary({Key key, this.changeCurrentTab, this.patientER, this.patientER_RC, this.amRequestViewModel});
@override @override
_SummaryState createState() => _SummaryState(); _SummaryState createState() => _SummaryState();
@ -43,29 +45,72 @@ class _SummaryState extends State<Summary> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts(TranslationBase.of(context).transportMethod,color: Colors.grey,), Texts(
Texts('${widget.patientER.patientERTransportationMethod.text}',bold: true,), TranslationBase.of(context).transportMethod,
SizedBox(height: 8,), color: Colors.grey,
),
Texts(TranslationBase.of(context).directions,color: Colors.grey,), Texts(
Texts(widget.patientER.direction ==0? TranslationBase.of(context).toHospital:TranslationBase.of(context).fromHospital,bold: true,), '${widget.patientER_RC.patientERTransportationMethod.text}',
SizedBox(height: 8,), bold: true,
),
Texts(TranslationBase.of(context).pickupLocation,color: Colors.grey,), SizedBox(
Texts('${widget.patientER.pickupLocationName}',bold: true,), height: 8,
SizedBox(height: 8,), ),
Texts(
Texts(TranslationBase.of(context).dropoffLocation,color: Colors.grey,), TranslationBase.of(context).directions,
Texts('${widget.patientER.dropoffLocationName}',bold: true,), color: Colors.grey,
SizedBox(height: 8,), ),
Texts(
Texts(TranslationBase.of(context).selectAmbulate,color: Colors.grey,), widget.patientER_RC.transportationDetails.direction == 0 ? TranslationBase.of(context).toHospital : TranslationBase.of(context).fromHospital,
Texts('${widget.patientER.ambulate.getAmbulateTitle(context)}',bold: true,), bold: true,
SizedBox(height: 8,), ),
SizedBox(
Texts(TranslationBase.of(context).notes,color: Colors.grey,), height: 8,
Texts('${widget.patientER.requesterNote?? '---'}',bold: true,), ),
SizedBox(height: 8,), Texts(
TranslationBase.of(context).pickupLocation,
color: Colors.grey,
),
Texts(
'${widget.patientER_RC.transportationDetails.pickupLocationName}',
bold: true,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).dropoffLocation,
color: Colors.grey,
),
Texts(
'${widget.patientER_RC.transportationDetails.dropoffLocationName}',
bold: true,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).selectAmbulate,
color: Colors.grey,
),
Texts(
'${widget.patientER_RC.transportationDetails.ambulate}',
bold: true,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context).notes,
color: Colors.grey,
),
Texts(
'${widget.patientER_RC.transportationDetails.notes ?? '---'}',
bold: true,
),
SizedBox(
height: 8,
),
], ],
), ),
), ),
@ -73,7 +118,6 @@ class _SummaryState extends State<Summary> {
Texts(TranslationBase.of(context).billAmount,textAlign: TextAlign.start,), Texts(TranslationBase.of(context).billAmount,textAlign: TextAlign.start,),
SizedBox(height: 5,), SizedBox(height: 5,),
Container( Container(
height: 55, height: 55,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -82,15 +126,10 @@ class _SummaryState extends State<Summary> {
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [Texts(TranslationBase.of(context).patientShareTotal + ':'), Texts(TranslationBase.of(context).sar + ' ${widget.patientER_RC.patientERTransportationMethod.priceTotal}')],
Texts(TranslationBase.of(context).patientShareTotal+':'),
Texts(TranslationBase.of(context).sar+' ${widget.patientER.patientERTransportationMethod.priceTotal}')
],
), ),
), ),
SizedBox(height: 130), SizedBox(height: 130),
], ],
), ),
), ),
@ -104,10 +143,8 @@ class _SummaryState extends State<Summary> {
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).send, label: TranslationBase.of(context).send,
onTap: () async { onTap: () async {
await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER); await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER_RC);
}),
}
),
), ),
); );
} }

@ -60,16 +60,17 @@ class NearestEr extends StatelessWidget {
children: List.generate(7, (index) { children: List.generate(7, (index) {
return Container( return Container(
child: CardPosition( child: CardPosition(
waitingTime: mode
.ProjectAvgERWaitingTimeModeList[index]
.avgTimeInHHMM
.toString(),
text: mode text: mode
.ProjectAvgERWaitingTimeModeList[index] .ProjectAvgERWaitingTimeModeList[index]
.projectName .projectName
.toString(), .toString(),
image: image:
'assets/images/new-design/find_us_icon.png', 'assets/images/new-design/find_us_icon.png',
subText: mode subText: '${mode.ProjectAvgERWaitingTimeModeList[index].distanceInKilometers ?? 0.0} ${TranslationBase.of(context).km_}',
.ProjectAvgERWaitingTimeModeList[index]
.distanceInKilometers
.toString(),
type: mode type: mode
.ProjectAvgERWaitingTimeModeList[index].iD .ProjectAvgERWaitingTimeModeList[index].iD
.toString(), .toString(),

@ -1,9 +1,6 @@
import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart'; import 'package:diplomaticquarterapp/widgets/others/OrderLogItem.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -19,7 +16,7 @@ class OrderLogPage extends StatelessWidget {
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
child: ListView.builder( child: ListView.builder(
itemCount: amRequestViewModel.patientAllPresOrdersList.length, itemCount: amRequestViewModel.patientAmbulanceRequestOrdersList.length,
itemBuilder: (context, index) => Container( itemBuilder: (context, index) => Container(
margin: EdgeInsets.all(8), margin: EdgeInsets.all(8),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -31,49 +28,41 @@ class OrderLogPage extends StatelessWidget {
children: [ children: [
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).reqId, title: TranslationBase.of(context).reqId,
value: amRequestViewModel.patientAllPresOrdersList[index].iD value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].id.toString(),
.toString(),
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).orderStatus, title: TranslationBase.of(context).orderStatus,
value: amRequestViewModel value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].statusText,
.patientAllPresOrdersList[index].description,
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).pickupDate, title: TranslationBase.of(context).pickupDate,
value: DateUtil.getDayMonthYearDateFormatted( value: getDate(amRequestViewModel.patientAmbulanceRequestOrdersList[index].created),
DateUtil.convertStringToDate(amRequestViewModel
.patientAllPresOrdersList[index].createdOn)),
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).pickupLocation, title: TranslationBase.of(context).pickupLocation,
value: amRequestViewModel value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].pickupLocation,
.patientAllPresOrdersList[index].pickupLocationName,
), ),
OrderLogItem( OrderLogItem(
title: TranslationBase.of(context).dropoffLocation, title: TranslationBase.of(context).dropoffLocation,
value: amRequestViewModel value: amRequestViewModel.patientAmbulanceRequestOrdersList[index].dropOffLocation,
.patientAllPresOrdersList[index].dropoffLocationName,
), ),
if(amRequestViewModel.patientAllPresOrdersList[index].status==1) if (amRequestViewModel.patientAmbulanceRequestOrdersList[index].statusId == 1)
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
width: double.maxFinite, width: double.maxFinite,
margin: EdgeInsets.only(bottom: 4,left: 4,right: 4), margin: EdgeInsets.only(bottom: 4, left: 4, right: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
bottomRight: Radius.circular(12), bottomRight: Radius.circular(12),
bottomLeft: Radius.circular(12), bottomLeft: Radius.circular(12),
), ),
color: Colors.white color: Colors.white),
),
child: SecondaryButton( child: SecondaryButton(
color: Colors.red[900], color: Colors.red[900],
textColor: Colors.white, textColor: Colors.white,
label: TranslationBase.of(context).cancel, label: TranslationBase.of(context).cancel,
onTap: () { onTap: () {
amRequestViewModel.updatePressOrder(presOrderID:amRequestViewModel.pickUpRequestPresOrder.presOrderID ); amRequestViewModel.updatePressOrder(presOrderID: amRequestViewModel.pendingAmbulanceRequestOrder.id);
}, },
), ),
) )
@ -83,4 +72,8 @@ class OrderLogPage extends StatelessWidget {
), ),
); );
} }
String getDate(String date) {
return date.split("T")[0];
}
} }

@ -1,6 +1,7 @@
//import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; //import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:giffy_dialog/giffy_dialog.dart'; import 'package:giffy_dialog/giffy_dialog.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
@ -20,6 +21,7 @@ class CardPosition extends StatelessWidget {
final longitude; final longitude;
final projectname; final projectname;
final cardSize; final cardSize;
final String waitingTime;
const CardPosition( const CardPosition(
{ {
@ -32,7 +34,8 @@ class CardPosition extends StatelessWidget {
@required this.latitude, @required this.latitude,
@required this.longitude, @required this.longitude,
@required this.projectname , @required this.projectname ,
@required this.cardSize , @required this.cardSize,
@required this.waitingTime ,
}); });
@override @override
@ -83,31 +86,26 @@ class CardPosition extends StatelessWidget {
} }
Future navigateToSearch(context, type,telephone,networkImage,latitude,longitude,projectname) async { Future navigateToSearch(context, type,telephone,networkImage,latitude,longitude,projectname) async {
var localize = TranslationBase.of(context);
showDialog( showDialog(
context: context,builder: (_) => AssetGiffyDialog( context: context,builder: (_) => AssetGiffyDialog(
title: Text(projectname, entryAnimation: EntryAnimation.BOTTOM,
style: TextStyle( image:Image.network(networkImage, fit: BoxFit.cover,),
fontSize: 22.0, fontWeight: FontWeight.w600), title: Text(projectname,
),image:Image.network(networkImage, fit: BoxFit.cover,), style: TextStyle(
fontSize: 22.0, fontWeight: FontWeight.w600),
buttonOkText:Text("LOCATION"), ),
buttonOkColor: Colors.grey, description: Text("${localize.averageWaitingTime}\n\n$waitingTime ${localize.minute}", textAlign: TextAlign.center,),
buttonCancelText:Text('CAll') , buttonOkText:Text("LOCATION", style: TextStyle(color: Colors.white),),
buttonCancelColor: Colors.grey, buttonOkColor: Colors.grey,
onOkButtonPressed: () { MapsLauncher.launchCoordinates(double.parse(latitude),double.parse(longitude),projectname);}, buttonCancelText:Text('CAll', style: TextStyle(color: Colors.white),) ,
onCancelButtonPressed :() {launch("tel://" +telephone);} buttonCancelColor: Colors.grey,
onOkButtonPressed: () { MapsLauncher.launchCoordinates(double.parse(latitude),double.parse(longitude),projectname);},
onCancelButtonPressed :() {launch("tel://" +telephone);}
));
) );
} }
} }

@ -28,7 +28,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
class AppointmentDetails extends StatefulWidget { class AppointmentDetails extends StatefulWidget {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
static bool isLoading = false; static bool isLoading = false;
final dynamic doctorSchedule; dynamic doctorSchedule;
static bool showFooterButton = false; static bool showFooterButton = false;
final int parentIndex; final int parentIndex;
@ -182,9 +182,13 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: SchedulePage(doctorList: doctorList), page: SchedulePage(doctorList: doctorList, appo: widget.appo),
), ),
); ).then((value) {
setState(() {
widget.doctorSchedule = value;
});
});
}, },
), ),
SizedBox(height: 10), SizedBox(height: 10),
@ -586,7 +590,13 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
} }
void openSchedule() { void openSchedule() {
Navigator.push(context, FadePage(page: SchedulePage(doctorList: getDoctorObject()))); Navigator.push(
context,
FadePage(
page: SchedulePage(
doctorList: getDoctorObject(),
appo: widget.appo,
)));
} }
setTab() async { setTab() async {

@ -17,8 +17,8 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
class SchedulePage extends StatefulWidget { class SchedulePage extends StatefulWidget {
final DoctorList doctorList; DoctorList doctorList;
final AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
SchedulePage({ SchedulePage({
this.appo, this.appo,
this.doctorList, this.doctorList,
@ -51,8 +51,10 @@ class _SchedulePageState extends State<SchedulePage> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getDoctorSchedule(doctorList), onModelReady: (model) => model.getDoctorSchedule(doctorList),
allowAny: true,
builder: (_, model, widget) => BaseView<MedicalViewModel>( builder: (_, model, widget) => BaseView<MedicalViewModel>(
onModelReady: (model2) => model2.getFreeSlots(doctorList), onModelReady: (model2) => model2.getFreeSlots(doctorList),
allowAny: true,
builder: (_, model2, widget2) { builder: (_, model2, widget2) {
if (model.freeSlots.length > 0 && isPageChange == false) { if (model.freeSlots.length > 0 && isPageChange == false) {
this.freeSlots = model.freeSlots; this.freeSlots = model.freeSlots;
@ -84,101 +86,59 @@ class _SchedulePageState extends State<SchedulePage> {
return Container( return Container(
child: ListView.builder( child: ListView.builder(
itemCount: weeks[index].length, itemCount: weeks[index].length,
itemBuilder: (context, index2) => itemBuilder: (context, index2) => InkWell(
InkWell( onTap: () {
onTap: () { openBookAppointment(weeks[index][index2]);
openBookAppointment( },
weeks[index][index2]); child: Row(
}, children: [
child: Row( Expanded(
children: [ flex: 1,
Expanded( child: Padding(
flex: 1, padding: EdgeInsets.only(left: 20),
child: Padding( child: Row(children: [
padding: Column(
EdgeInsets.only( children: [
left: 20), Texts(
weeks[index][index2]['DayName'],
fontSize: 13,
),
Texts(
getDayMonths(
DateUtil.convertStringToDate(
weeks[index][index2]['Date'],
),
),
fontWeight: FontWeight.bold,
fontSize: 18,
)
],
)
])),
),
Expanded(
flex: 3,
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(20.0)),
child: Container(
padding: EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20),
margin: EdgeInsets.only(left: 20, right: 20, top: 7, bottom: 7),
decoration: BoxDecoration(boxShadow: [
weeks[index][index2]['fullDay'] == false ? BoxShadow(color: Colors.green, offset: Offset(-5, 0)) : BoxShadow(),
], borderRadius: const BorderRadius.all(Radius.circular(10.0)), color: Colors.white),
child: Row( child: Row(
children: [ children: [
Column( Expanded(
children: [ child: Texts(
Texts( weeks[index][index2]['WorkingHours'],
weeks[index][index2] fontWeight: FontWeight.w400,
[ ),
'DayName'], )
fontSize: ],
13, ))),
), )
Texts( ],
getDayMonths( ))));
DateUtil
.convertStringToDate(
weeks[index][index2]['Date'],
),
),
fontWeight:
FontWeight.bold,
fontSize:
18,
)
],
)
])),
),
Expanded(
flex: 3,
child: ClipRRect(
borderRadius:
const BorderRadius
.all(
Radius.circular(
20.0)),
child: Container(
padding:
EdgeInsets.only(
left:
10,
right:
10,
top: 20,
bottom:
20),
margin: EdgeInsets.only(
left: 20,
right: 20,
top: 7,
bottom: 7),
decoration: BoxDecoration(
boxShadow: [
weeks[index][index2]['fullDay'] ==
false
? BoxShadow(
color: Colors.green,
offset: Offset(-5, 0))
: BoxShadow(),
],
borderRadius:
const BorderRadius.all(Radius.circular(
10.0)),
color: Colors
.white),
child: Row(
children: [
Expanded(
child:
Texts(
weeks[index][index2]
[
'WorkingHours'],
fontWeight:
FontWeight.w400,
),
)
],
))),
)
],
))));
}, },
)), )),
PageViewIndicator( PageViewIndicator(
@ -213,9 +173,7 @@ class _SchedulePageState extends State<SchedulePage> {
var newWeekSchedule = []; var newWeekSchedule = [];
for (var workDay in this.doctorScheduleResponse) { for (var workDay in this.doctorScheduleResponse) {
Map<String, dynamic> newWorkDay = Map(); Map<String, dynamic> newWorkDay = Map();
newWorkDay['Date'] = DateUtil.convertDateMSToJsonDate( newWorkDay['Date'] = DateUtil.convertDateMSToJsonDate(DateUtil.convertStringToDate(workDay.date).millisecondsSinceEpoch + weekMSOffset);
DateUtil.convertStringToDate(workDay.date).millisecondsSinceEpoch +
weekMSOffset);
newWorkDay['DayName'] = workDay.dayName; newWorkDay['DayName'] = workDay.dayName;
newWorkDay['WorkingHours'] = workDay.workingHours; newWorkDay['WorkingHours'] = workDay.workingHours;
newWeekSchedule.add(newWorkDay); newWeekSchedule.add(newWorkDay);
@ -238,21 +196,21 @@ class _SchedulePageState extends State<SchedulePage> {
} }
String getDayMonths(DateTime dateTime) { String getDayMonths(DateTime dateTime) {
String dateFormat = String dateFormat = '${dateTime.day} ${DateUtil.getMonth(dateTime.month).toString().substring(0, 3)}';
'${dateTime.day} ${DateUtil.getMonth(dateTime.month).toString().substring(0, 3)}';
return dateFormat; return dateFormat;
} }
openBookAppointment(selectedDate) { openBookAppointment(selectedDate) {
//sharedPref.setObject(DOCTOR_SCHEDULE_DATE_SEL, selectedDate); //sharedPref.setObject(DOCTOR_SCHEDULE_DATE_SEL, selectedDate);
Navigator.push( Navigator.of(context).pop(selectedDate);
context, // Navigator.push(
FadePage( // context,
page: AppointmentDetails( // FadePage(
appo: widget.appo, // page: AppointmentDetails(
doctorSchedule: selectedDate, // appo: widget.appo,
), // doctorSchedule: selectedDate,
), // ),
); // ),
// );
} }
} }

@ -6,7 +6,8 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_mode
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart'; import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AskDocRequestTypeModel.dart';
@ -17,6 +18,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/ConfirmedButton
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/PrescriptionReport.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/PrescriptionReport.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/askDocDialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback_home_page.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/labs/laboratory_result_page.dart'; import 'package:diplomaticquarterapp/pages/medical/labs/laboratory_result_page.dart';
@ -24,7 +26,9 @@ import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_p
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart'; import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_screen.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
@ -153,7 +157,6 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
_handleButtonClicks(AppoDetailsButton) { _handleButtonClicks(AppoDetailsButton) {
switch (AppoDetailsButton.caller) { switch (AppoDetailsButton.caller) {
case "openReschedule": case "openReschedule":
widget.tabController.animateTo((widget.tabController.index + 1) % 2); widget.tabController.animateTo((widget.tabController.index + 1) % 2);
@ -182,7 +185,18 @@ class _AppointmentActionsState extends State<AppointmentActions> {
break; break;
case "addReminder": case "addReminder":
showReminderDialog(widget.appo); // showReminderDialog(widget.appo);
showReminderDialog(
context,
DateUtil.convertStringToDate(widget.appo.appointmentDate),
widget.appo.doctorNameObj,
"",
DateUtil.formatDateToDate(DateUtil.convertStringToDate(widget.appo.appointmentDate)),
DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.appo.appointmentDate)),
onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
},
);
break; break;
case "goToTodoList": case "goToTodoList":
@ -502,32 +516,35 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
} }
showReminderDialog(AppoitmentAllHistoryResultList appo) { // showReminderDialog(AppoitmentAllHistoryResultList appo) {
showGeneralDialog( //
barrierColor: Colors.black.withOpacity(0.5), //
transitionBuilder: (context, a1, a2, widget) { // //old reminder dialog having location
final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; // showGeneralDialog(
return Transform( // barrierColor: Colors.black.withOpacity(0.5),
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), // transitionBuilder: (context, a1, a2, widget) {
child: Opacity( // final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0;
opacity: a1.value, // return Transform(
child: ReminderDialog( // transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
eventId: appo.appointmentNo.toString(), // child: Opacity(
title: "Doctor Appointment", // opacity: a1.value,
description: "You have an appointment with " + appo.doctorTitle + " " + appo.doctorNameObj, // child: ReminderDialog(
startDate: appo.appointmentDate, // eventId: appo.appointmentNo.toString(),
endDate: appo.appointmentDate, // title: "Doctor Appointment",
location: appo.projectName, // description: "You have an appointment with " + appo.doctorTitle + " " + appo.doctorNameObj,
), // startDate: appo.appointmentDate,
), // endDate: appo.appointmentDate,
); // location: appo.projectName,
}, // ),
transitionDuration: Duration(milliseconds: 500), // ),
barrierDismissible: true, // );
barrierLabel: '', // },
context: context, // transitionDuration: Duration(milliseconds: 500),
pageBuilder: (context, animation1, animation2) {}); // barrierDismissible: true,
} // barrierLabel: '',
// context: context,
// pageBuilder: (context, animation1, animation2) {});
// }
askYourDoc() { askYourDoc() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);

@ -46,14 +46,19 @@ class CalendarUtils {
}); });
} }
Future createOrUpdateEvent({ String title, String description, DateTime scheduleDateTime}) async { Future createOrUpdateEvent({ String title, String description, DateTime scheduleDateTime,String eventId}) async {
RecurrenceRule recurrenceRule = RecurrenceRule( RecurrenceRule recurrenceRule = RecurrenceRule(
RecurrenceFrequency.Daily, RecurrenceFrequency.Daily,
// daysOfWeek: daysOfWeek, // daysOfWeek: daysOfWeek,
endDate: scheduleDateTime, endDate: scheduleDateTime,
); );
print("eventId "+eventId);
Event event = Event(writableCalendars.id, recurrenceRule: recurrenceRule, start: scheduleDateTime, end: scheduleDateTime.add(Duration(minutes: 30)), title: title, description: description); Event event = Event(writableCalendars.id, recurrenceRule: recurrenceRule, start: scheduleDateTime, end: scheduleDateTime.add(Duration(minutes: 30)), title: title, description: description);
deviceCalendarPlugin.createOrUpdateEvent(event); deviceCalendarPlugin.createOrUpdateEvent(event).catchError((e){
print("catchError "+e.toString());
}).whenComplete(() {
print("whenComplete "+eventId);
});
} }
deleteEvent(Calendar _calendar, Event _event) async { deleteEvent(Calendar _calendar, Event _event) async {
@ -67,6 +72,8 @@ class CalendarUtils {
return await deviceCalendarPlugin.retrieveEvents(calendarId, retrieveEventsParams); return await deviceCalendarPlugin.retrieveEvents(calendarId, retrieveEventsParams);
} }
Future createCalendar( Future createCalendar(
String calendarName, { String calendarName, {
Color calendarColor, Color calendarColor,

@ -724,11 +724,11 @@ class TranslationBase {
String get sentRequest => localizedValues['sent-requests'][locale.languageCode]; String get sentRequest => localizedValues['sent-requests'][locale.languageCode];
String get km => localizedValues['km'][locale.languageCode]; String get km => localizedValues['km'][locale.languageCode];
String get km_ => localizedValues['km_'][locale.languageCode];
String get patientHealthSummaryReport => localizedValues['PatientHealthSummaryReport'][locale.languageCode]; String get patientHealthSummaryReport =>
localizedValues['PatientHealthSummaryReport'][locale.languageCode];
String get toViewTheTermsAndConditions => localizedValues['ToViewTheTermsAndConditions'][locale.languageCode]; String get toViewTheTermsAndConditions =>
localizedValues['ToViewTheTermsAndConditions'][locale.languageCode];
String get clickHere => localizedValues['ClickHere'][locale.languageCode]; String get clickHere => localizedValues['ClickHere'][locale.languageCode];
String get iAgreeToTheTermsAndConditions => localizedValues['IAgreeToTheTermsAndConditions'][locale.languageCode]; String get iAgreeToTheTermsAndConditions => localizedValues['IAgreeToTheTermsAndConditions'][locale.languageCode];
@ -802,7 +802,7 @@ class TranslationBase {
String get country => localizedValues['country'][locale.languageCode]; String get country => localizedValues['country'][locale.languageCode];
String get ok => localizedValues['Ok'][locale.languageCode]; String get ok => localizedValues['Ok'][locale.languageCode];
String get averageWaitingTime => localizedValues['averageWaitingTime'][locale.languageCode];
String get waterConsumedInWeek => localizedValues['WaterConsumedInWeek'][locale.languageCode]; String get waterConsumedInWeek => localizedValues['WaterConsumedInWeek'][locale.languageCode];
String get waterConsumedInMonth => localizedValues['WaterConsumedInMonth'][locale.languageCode]; String get waterConsumedInMonth => localizedValues['WaterConsumedInMonth'][locale.languageCode];

Loading…
Cancel
Save