add Not authenticated Page

merge-update-with-lab-changes
Mohammad Aljammal 6 years ago
parent 1ce55e687f
commit 06416b4934

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

@ -58,6 +58,7 @@ const GET_NEAREST_HOSPITAL=
///Er Nearest ///Er Nearest
const GET_AMBULANCE_REQUEST= 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; const GET_AMBULANCE_REQUEST= 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
const GET_PATIENT_ALL_PRES_ORDERS= 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const GET_PATIENT_ALL_PRES_ORDERS= 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID= 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID';
///FindUs ///FindUs
@ -118,8 +119,7 @@ const GET_PATIENT_SHARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history //URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY = const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory";
"Services/Doctors.svc/REST/PateintHasAppoimentHistory";
//URL to get patient appointment curfew history //URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =

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

@ -6,22 +6,55 @@ extension SelectedAmbulate on Ambulate {
String getAmbulateTitle(BuildContext context) { String getAmbulateTitle(BuildContext context) {
switch (this) { switch (this) {
case Ambulate.Wheelchair: case Ambulate.Wheelchair:
// TODO: Handle this case.
return 'Wheelchair'; return 'Wheelchair';
break; break;
case Ambulate.Walker: case Ambulate.Walker:
// TODO: Handle this case.
return 'Walker'; return 'Walker';
break; break;
case Ambulate.Stretcher: case Ambulate.Stretcher:
// TODO: Handle this case.
return 'Stretcher'; return 'Stretcher';
break; break;
case Ambulate.None: case Ambulate.None:
// TODO: Handle this case.
return 'None'; return 'None';
break; break;
} }
return 'None'; return 'None';
} }
int selectAmbulateNumber() {
switch (this) {
case Ambulate.Wheelchair:
return 0;
break;
case Ambulate.Walker:
return 1;
break;
case Ambulate.Stretcher:
return 2;
break;
case Ambulate.None:
return 3;
break;
}
return 3;
}
Ambulate getAmbulateById(int id) {
switch (id) {
case 0:
return Ambulate.Wheelchair;
break;
case 1:
return Ambulate.Walker;
break;
case 2:
return Ambulate.Stretcher;
break;
case 3:
return Ambulate.None;
break;
}
return Ambulate.None;
}
} }

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

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

@ -15,7 +15,7 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
///await BaseAppClient.post('', ///await BaseAppClient.post('',
/// onSuccess: (dynamic response, int statusCode) {}, /// onSuccess: (dynamic response, int statusCode) {},
/// onFailure: (String error, int statusCode) {}, /// onFailure: (String error, int statusCode) {},
/// body: null); /// body: Map();
class BaseAppClient { class BaseAppClient {
post(String endPoint, post(String endPoint,
@ -78,7 +78,7 @@ class BaseAppClient {
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
var asd="";
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(url.trim(), final response = await http.post(url.trim(),
body: json.encode(body), body: json.encode(body),

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

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

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

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/service/er/am_service.dart'; import 'package:diplomaticquarterapp/core/service/er/am_service.dart';
import 'package:diplomaticquarterapp/core/service/hospital_service.dart'; import 'package:diplomaticquarterapp/core/service/hospital_service.dart';
import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart'; import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart';
@ -14,14 +15,19 @@ class AmRequestViewModel extends BaseViewModel {
HospitalService _hospitalService = locator<HospitalService>(); HospitalService _hospitalService = locator<HospitalService>();
MedicalService _medicalService = locator<MedicalService>(); MedicalService _medicalService = locator<MedicalService>();
List<PatientERTransportationMethod> List<PatientERTransportationMethod> get amRequestModeList =>
get amRequestModeList => _amService.amModelList; _amService.amModelList;
List<PatientAllPresOrders> get patientAllPresOrdersList =>_amService.patientAllPresOrdersList; List<PatientAllPresOrders> get patientAllPresOrdersList =>
_amService.patientAllPresOrdersList;
List<AppoitmentAllHistoryResultList> get appoitmentAllHistoryResultList => List<AppoitmentAllHistoryResultList> get appoitmentAllHistoryResultList =>
_medicalService.appoitmentAllHistoryResultList; _medicalService.appoitmentAllHistoryResultList;
List<HospitalsModel> get hospitals => _hospitalService.hospitals;
bool get hasPendingOrder =>_amService.hasPendingOrder;
Future getAppointmentHistory() async { Future getAppointmentHistory() async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _medicalService.getAppointmentHistory(isActiveAppointment: true); await _medicalService.getAppointmentHistory(isActiveAppointment: true);
@ -32,8 +38,6 @@ class AmRequestViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getAmRequestOrders() async { Future getAmRequestOrders() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _amService.getAllTransportationOrders(); await _amService.getAllTransportationOrders();
@ -57,6 +61,18 @@ class AmRequestViewModel extends BaseViewModel {
Future getPatientAllPresOrdersList() async { Future getPatientAllPresOrdersList() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _amService.getPatientAllPresOrdersList(); await _amService.getPatientAllPresOrdersList();
if (_hospitalService.hasError) {
error = _hospitalService.error;
setState(ViewState.Error);
} else if (_amService.hasPendingOrder) {
getOrderDetails();
} else
setState(ViewState.Idle);
}
Future getOrderDetails() async {
setState(ViewState.Busy);
await _amService.getOrderDetails();
if (_hospitalService.hasError) { if (_hospitalService.hasError) {
error = _hospitalService.error; error = _hospitalService.error;
setState(ViewState.Error); setState(ViewState.Error);

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

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

@ -10,7 +10,8 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'AmbulanceRequestIndex.dart'; import 'AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart';
import 'OrderLogPage.dart';
class AmbulanceReq extends StatefulWidget { class AmbulanceReq extends StatefulWidget {
@override @override
@ -26,11 +27,13 @@ class _AmbulanceReqState extends State<AmbulanceReq>
super.initState(); super.initState();
_tabController = TabController(length: 2, vsync: this); _tabController = TabController(length: 2, vsync: this);
} }
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
_tabController.dispose(); _tabController.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<AmRequestViewModel>( return BaseView<AmRequestViewModel>(
@ -86,7 +89,8 @@ class _AmbulanceReqState extends State<AmbulanceReq>
Container( Container(
width: MediaQuery.of(context).size.width * 0.40, width: MediaQuery.of(context).size.width * 0.40,
child: Center( child: Center(
child: Texts("Ambulance Request"),//TranslationBase.of(context).prescriptions child: Texts(
"Ambulance Request"), //TranslationBase.of(context).prescriptions
), ),
), ),
Container( Container(
@ -110,8 +114,14 @@ class _AmbulanceReqState extends State<AmbulanceReq>
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
controller: _tabController, controller: _tabController,
children: <Widget>[ children: <Widget>[
AmbulanceRequestIndex(amRequestViewModel: model,), model.hasPendingOrder
Container() ? Container()
: AmbulanceRequestIndexPage(
amRequestViewModel: model,
),
OrderLogPage(
amRequestViewModel: model,
)
], ],
), ),
) )
@ -121,5 +131,4 @@ class _AmbulanceReqState extends State<AmbulanceReq>
), ),
); );
} }
} }

@ -9,16 +9,16 @@ import 'PickupLocation.dart';
import 'SelectTransportationMethod.dart'; import 'SelectTransportationMethod.dart';
import 'Summary.dart'; import 'Summary.dart';
class AmbulanceRequestIndex extends StatefulWidget { class AmbulanceRequestIndexPage extends StatefulWidget {
final AmRequestViewModel amRequestViewModel; final AmRequestViewModel amRequestViewModel;
AmbulanceRequestIndex({Key key, this.amRequestViewModel}); AmbulanceRequestIndexPage({Key key, this.amRequestViewModel});
@override @override
_AmbulanceRequestIndexState createState() => _AmbulanceRequestIndexState(); _AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState();
} }
class _AmbulanceRequestIndexState extends State<AmbulanceRequestIndex> { class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
int currentIndex = 0; int currentIndex = 0;
PageController pageController; PageController pageController;
PatientER _patientER = PatientER(); PatientER _patientER = PatientER();

@ -26,6 +26,22 @@ 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
void initState() {
if(widget.patientER.ambulate!=null)
{
setState(() {
_ambulate = widget.patientER.ambulate;
note = widget.patientER.requesterNote;
});
}
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return SingleChildScrollView(
@ -278,7 +294,7 @@ class _BillAmountState extends State<BillAmount> {
color: Colors.white, color: Colors.white,
), ),
child: ListTile( child: ListTile(
title: Text('Walker'), title: Text('None'),
leading: Radio( leading: Radio(
value: Ambulate.None, value: Ambulate.None,
groupValue: _ambulate, groupValue: _ambulate,
@ -320,6 +336,7 @@ class _BillAmountState extends State<BillAmount> {
setState(() { setState(() {
widget.patientER.ambulate = _ambulate; widget.patientER.ambulate = _ambulate;
widget.patientER.requesterNote = note; widget.patientER.requesterNote = note;
widget.patientER.selectedAmbulate = _ambulate.selectAmbulateNumber();
widget.changeCurrentTab(3); widget.changeCurrentTab(3);
}); });
}, },

@ -1,9 +1,12 @@
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/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/Blood/dialogs/SelectHospitalDialog.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -15,8 +18,8 @@ import 'package:geolocator/geolocator.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'AmbulanceReq.dart'; import '../AmbulanceReq.dart';
import 'AvailableAppointmentsPage.dart'; import '../AvailableAppointmentsPage.dart';
enum HaveAppointment { YES, NO } enum HaveAppointment { YES, NO }
@ -41,6 +44,8 @@ class _PickupLocationState extends State<PickupLocation> {
double _latitude; double _latitude;
double _longitude; double _longitude;
AppoitmentAllHistoryResultList myAppointment; AppoitmentAllHistoryResultList myAppointment;
HospitalsModel _selectedHospital;
PickResult _result;
@override @override
void initState() { void initState() {
@ -170,7 +175,6 @@ class _PickupLocationState extends State<PickupLocation> {
_haveAppointment = value; _haveAppointment = value;
}); });
} }
}, },
), ),
), ),
@ -212,7 +216,6 @@ class _PickupLocationState extends State<PickupLocation> {
), ),
], ],
), ),
if (myAppointment != null) if (myAppointment != null)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -220,10 +223,11 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
AppointmentCard(appointment: myAppointment,) AppointmentCard(
appointment: myAppointment,
)
], ],
), ),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -231,7 +235,12 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Container( InkWell(
onTap: () {
confirmSelectHospitalDialog(
widget.amRequestViewModel.hospitals);
},
child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -242,7 +251,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts('Pickup Location'), Texts(getHospitalName('Pickup Location')),
Icon( Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
size: 24, size: 24,
@ -251,9 +260,10 @@ class _PickupLocationState extends State<PickupLocation> {
], ],
), ),
), ),
),
], ],
), ),
if (widget.patientER.direction == 2) if (widget.patientER.direction == 1)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -263,21 +273,8 @@ class _PickupLocationState extends State<PickupLocation> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( confirmSelectHospitalDialog(
context, widget.amRequestViewModel.hospitals);
MaterialPageRoute(
builder: (context) => PlacePicker(
apiKey: 'AIzaSyCiD4YqVqLNYbt8-htvFy4Wp8XSph9E3wM',
// Put YOUR OWN KEY here.
onPlacePicked: (PickResult result) {
print(result.adrAddress);
Navigator.of(context).pop();
},
initialPosition: LatLng(_latitude, _longitude),
useCurrentLocation: true,
),
),
);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
@ -290,7 +287,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Texts('Pickup Location'), Texts(getHospitalName('Pickup Location')),
Icon( Icon(
Icons.arrow_drop_down, Icons.arrow_drop_down,
size: 24, size: 24,
@ -307,7 +304,28 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Container( InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PlacePicker(
apiKey: 'AIzaSyCiD4YqVqLNYbt8-htvFy4Wp8XSph9E3wM',
// Put YOUR OWN KEY here.
onPlacePicked: (PickResult result) {
print(result.adrAddress);
setState(() {
_result = result;
});
Navigator.of(context).pop();
},
initialPosition: LatLng(_latitude, _longitude),
useCurrentLocation: true,
),
),
);
},
child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -327,6 +345,7 @@ class _PickupLocationState extends State<PickupLocation> {
], ],
), ),
), ),
),
], ],
), ),
//TODO show dialog projects //TODO show dialog projects
@ -342,7 +361,41 @@ class _PickupLocationState extends State<PickupLocation> {
color: Colors.grey[800], color: Colors.grey[800],
textColor: Colors.white, textColor: Colors.white,
onTap: () { onTap: () {
if(_result==null || _selectedHospital == null)
AppToast.showErrorToast(message: 'please select all fields');
else
setState(() { setState(() {
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
if (widget.patientER.direction == 0) {
widget.patientER.pickupLocationLattitude = _result.geometry.location.lat.toString();
widget.patientER.pickupLocationLongitude = _result.geometry.location.lng.toString();
widget.patientER.dropoffLocationLattitude = _selectedHospital.latitude;
widget.patientER.dropoffLocationLongitude = _selectedHospital.longitude;
} else {
widget.patientER.pickupLocationLattitude = _selectedHospital.latitude;
widget.patientER.pickupLocationLongitude = _selectedHospital.longitude;
widget.patientER.dropoffLocationLattitude = _result.geometry.location.lat.toString();
widget.patientER.dropoffLocationLongitude = _result.geometry.location.lng.toString();
}
widget.patientER.latitude = widget.patientER.pickupLocationLattitude;
widget.patientER.longitude = widget.patientER.pickupLocationLongitude;
if(_haveAppointment == HaveAppointment.YES){
widget.patientER.appointmentNo = myAppointment.appointmentNo.toString();
widget.patientER.appointmentClinicName = myAppointment.clinicName;
widget.patientER.appointmentDoctorName = myAppointment.doctorNameObj;
widget.patientER.appointmentBranch = myAppointment.projectName;
widget.patientER.appointmentTime = myAppointment.appointmentDate;
}else{
widget.patientER.appointmentNo ="0";
widget.patientER.appointmentClinicName = null;
widget.patientER.appointmentDoctorName = null;
widget.patientER.appointmentBranch = null;
widget.patientER.appointmentTime = null;
}
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0; widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
widget.changeCurrentTab(2); widget.changeCurrentTab(2);
}); });
@ -356,12 +409,35 @@ class _PickupLocationState extends State<PickupLocation> {
); );
} }
void confirmSelectHospitalDialog(List<HospitalsModel> hospitals) {
showDialog(
context: context,
child: SelectHospitalDialog(
hospitals: hospitals,
selectedHospital: _selectedHospital,
onValueSelected: (value) {
setState(() {
_selectedHospital = value;
});
},
),
);
}
String getHospitalName(String title) {
return _selectedHospital == null ? title : _selectedHospital.name;
}
getAppointment() { getAppointment() {
ProgressDialogUtil.showProgressDialog(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.amRequestViewModel.appoitmentAllHistoryResultList.length > 0) { } else if (widget
.amRequestViewModel.appoitmentAllHistoryResultList.length >
0) {
ProgressDialogUtil.hideProgressDialog(context);
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -375,17 +451,23 @@ class _PickupLocationState extends State<PickupLocation> {
setState(() { setState(() {
myAppointment = value; myAppointment = value;
}); });
else else {
ProgressDialogUtil.hideProgressDialog(context);
setState(() { setState(() {
_haveAppointment = HaveAppointment.NO; _haveAppointment = HaveAppointment.NO;
}); });
}
}); });
} else { } else {
ProgressDialogUtil.hideProgressDialog(context);
setState(() { setState(() {
_haveAppointment = HaveAppointment.NO; _haveAppointment = HaveAppointment.NO;
}); });
AppToast.showErrorToast(message: 'You don\'t have any appointment'); AppToast.showErrorToast(message: 'You don\'t have any appointment');
} }
}).catchError((e) {
ProgressDialogUtil.hideProgressDialog(context);
AppToast.showErrorToast(message: e);
}); });
} }
} }

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart'; import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart'; import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
@ -32,11 +33,13 @@ class _SelectTransportationMethodState
Direction _direction = Direction.FromHospital; Direction _direction = Direction.FromHospital;
Way _way = Way.OneWay; Way _way = Way.OneWay;
OrderService _orderService = OrderService.AMBULANCE;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
if (widget.patientER.direction != null) { if (widget.patientER.direction != null) {
_direction = widget.patientER.direction == 1 _direction = widget.patientER.direction == 0
? Direction.ToHospital ? Direction.ToHospital
: Direction.FromHospital; : Direction.FromHospital;
_way = widget.patientER.tripType == 1 ? Way.OneWay : Way.TwoWays; _way = widget.patientER.tripType == 1 ? Way.OneWay : Way.TwoWays;
@ -278,15 +281,17 @@ class _SelectTransportationMethodState
textColor: Colors.white, textColor: Colors.white,
onTap: () { onTap: () {
setState(() { setState(() {
widget.patientER.direction = widget.patientER.direction = _direction == Direction.ToHospital ? 0 : 1;
_direction == Direction.ToHospital ? 1 : 2;
widget.patientER.tripType = _way == Way.TwoWays ? 2 : 1; widget.patientER.tripType = _way == Way.TwoWays ? 2 : 1;
widget.patientER.selectedAmbulate = (widget widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
.amRequestViewModel.amRequestModeList widget.patientER.patientERTransportationMethod = _erTransportationMethod;
.indexOf(_erTransportationMethod) + widget.patientER.orderServiceID = _orderService.getIdOrderService();
1); widget.patientER.pickupUrgency = 1;
widget.patientER.patientERTransportationMethod = widget.patientER.lineItemNo = 1;
_erTransportationMethod; widget.patientER.cost = _erTransportationMethod.price;
widget.patientER.vAT = _erTransportationMethod.vAT ?? 0;
widget.patientER.totalPrice = _erTransportationMethod.totalPrice;
widget.changeCurrentTab(1); widget.changeCurrentTab(1);
}); });
}, },

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

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

@ -34,6 +34,7 @@ class _HomePageState extends State<HomePage> {
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getPatientRadOrders(), onModelReady: (model) => model.getPatientRadOrders(),
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
isShowDecPage: false,
body: Container( body: Container(
width: double.infinity, width: double.infinity,
child: SingleChildScrollView( child: SingleChildScrollView(

@ -74,6 +74,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).confirm, appBarTitle: TranslationBase.of(context).confirm,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
body: isLoading == false body: isLoading == false
? SingleChildScrollView( ? SingleChildScrollView(
child: Container( child: Container(

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

@ -16,6 +16,7 @@ class LoginType extends StatelessWidget {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).welcome, appBarTitle: TranslationBase.of(context).welcome,
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false,
body: Padding( body: Padding(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
child: Column( child: Column(

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

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

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

@ -28,6 +28,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).welcome, appBarTitle: TranslationBase.of(context).welcome,
isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,
body: Padding( body: Padding(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),

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

@ -48,6 +48,7 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(), onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowDecPage: false,
baseViewModel: model, baseViewModel: model,
body: Container( body: Container(
child: SingleChildScrollView( child: SingleChildScrollView(

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

@ -1,12 +1,26 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ProgressDialogUtil{ AlertDialog _alert = AlertDialog(
content: Row(
static AlertDialog alert = AlertDialog(
content: new Row(
children: [ children: [
CircularProgressIndicator(), CircularProgressIndicator(),
Container(margin: EdgeInsets.only(left: 7), child: Text("Loading...")), Container(margin: EdgeInsets.only(left: 7), child: Text("Loading...")),
],), ],
),
);
class ProgressDialogUtil {
static showProgressDialog(BuildContext context) {
showDialog(
barrierDismissible: false,
context: context,
builder: (BuildContext context) {
return _alert;
},
); );
} }
static hideProgressDialog(BuildContext context) {
Navigator.pop(context);
}
}

@ -589,6 +589,10 @@ class TranslationBase {
String get all => localizedValues['All'][locale.languageCode]; String get all => localizedValues['All'][locale.languageCode];
String get questionHere => localizedValues['QuestionHere'][locale.languageCode]; String get questionHere => localizedValues['QuestionHere'][locale.languageCode];
String get viewDoctorResponses => localizedValues['ViewDoctorResponses'][locale.languageCode]; String get viewDoctorResponses => localizedValues['ViewDoctorResponses'][locale.languageCode];
String get serviceInformationButton => localizedValues['ServiceInformationButton'][locale.languageCode];
String get serviceInformationTitle => localizedValues['ServiceInformationTitle'][locale.languageCode];
String get infoLab => localizedValues['info-lab'][locale.languageCode];
String get infoRadiology => localizedValues['info-radiology'][locale.languageCode];
} }

@ -0,0 +1,32 @@
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class OrderLogItem extends StatelessWidget {
final String title;
final String value;
OrderLogItem({ this.title, this.value});
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(10),
width: double.maxFinite,
margin: EdgeInsets.only(bottom: 4,left: 4,right: 4),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(12),
bottomLeft: Radius.circular(12),
),
color: Colors.white
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(title,color: Colors.grey,),
SizedBox(height: 4,),
Texts(value??''),
],
),
);
}
}

@ -1,8 +1,10 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -12,10 +14,12 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../locator.dart';
import 'floating_button_search.dart'; import 'floating_button_search.dart';
import '../progress_indicator/app_loader_widget.dart'; import '../progress_indicator/app_loader_widget.dart';
import 'arrow_back.dart'; import 'arrow_back.dart';
import 'network_base_view.dart'; import 'network_base_view.dart';
import 'not_auh_page.dart';
class AppScaffold extends StatelessWidget { class AppScaffold extends StatelessWidget {
final String appBarTitle; final String appBarTitle;
@ -26,6 +30,12 @@ class AppScaffold extends StatelessWidget {
final bool hasAppBarParam; final bool hasAppBarParam;
final BaseViewModel baseViewModel; final BaseViewModel baseViewModel;
final Widget floatingActionButton; final Widget floatingActionButton;
final String title;
final String description;
final bool isShowDecPage;
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AppScaffold( AppScaffold(
{@required this.body, {@required this.body,
@ -34,7 +44,11 @@ class AppScaffold extends StatelessWidget {
this.isShowAppBar = false, this.isShowAppBar = false,
this.hasAppBarParam, this.hasAppBarParam,
this.bottomSheet, this.bottomSheet,
this.baseViewModel, this.floatingActionButton}); this.baseViewModel,
this.floatingActionButton,
this.title,
this.description,
this.isShowDecPage = true});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -47,10 +61,12 @@ class AppScaffold extends StatelessWidget {
elevation: 0, elevation: 0,
backgroundColor: Theme.of(context).appBarTheme.color, backgroundColor: Theme.of(context).appBarTheme.color,
textTheme: TextTheme( textTheme: TextTheme(
headline6: TextStyle( headline6:
color: Colors.white, fontWeight: FontWeight.bold), TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
), ),
title: Text(appBarTitle.toUpperCase()), title: Text(authenticatedUserObject.isLogin
? appBarTitle.toUpperCase()
: TranslationBase.of(context).serviceInformationTitle),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return ArrowBack(); return ArrowBack();
@ -68,7 +84,12 @@ class AppScaffold extends StatelessWidget {
], ],
) )
: null, : null,
body: baseViewModel != null body: (!authenticatedUserObject.isLogin && isShowDecPage)
? NotAutPage(
title: appBarTitle,
description: description,
)
: baseViewModel != null
? NetworkBaseView( ? NetworkBaseView(
child: buildBodyWidget(), child: buildBodyWidget(),
baseViewModel: baseViewModel, baseViewModel: baseViewModel,

@ -0,0 +1,79 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class NotAutPage extends StatelessWidget {
final String title;
final String description;
NotAutPage({@required this.title, @required this.description});
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Scaffold(
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Texts(
title ?? 'Service',
fontWeight: FontWeight.w800,
fontSize: 25,
bold: true,
color: Hexcolor("#60686b"),
),
SizedBox(
height: 12,
),
Texts(
description ?? 'Description',
fontWeight: FontWeight.normal,
fontSize: 17,
),
SizedBox(
height: 22,
),
Center(
child: SizedBox(
height: MediaQuery.of(context).size.height * 0.55,
width: MediaQuery.of(context).size.width * 0.50,
child: Image.asset(projectViewModel.isArabic
? 'assets/images/wifi-EN.png'
: 'assets/images/Wifi-AR.png'),
),
),
SizedBox(
height: 77,
),
],
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
onTap: () => Navigator.pushReplacement(
context, FadePage(page: LoginType())),
label: TranslationBase.of(context).serviceInformationButton,
textColor: Theme.of(context).backgroundColor),
),
],
),
),
);
}
}

@ -60,6 +60,9 @@ dependencies:
image_picker: ^0.6.7+1 image_picker: ^0.6.7+1
image_cropper: ^1.2.1 image_cropper: ^1.2.1
#GIF image
flutter_gifimage: ^1.0.1
# UI Reqs # UI Reqs
dotted_border: 1.0.5 dotted_border: 1.0.5
expandable: ^4.1.4 expandable: ^4.1.4

Loading…
Cancel
Save