add Not authenticated Page

er_location
Mohammad Aljammal 5 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
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_PICK_UP_REQUEST_BY_PRES_ORDER_ID= 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID';
///FindUs
@ -118,8 +119,7 @@ const GET_PATIENT_SHARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY =
"Services/Doctors.svc/REST/PateintHasAppoimentHistory";
const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory";
//URL to 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":"الكل"},
"QuestionHere":{"en":"Enter the question here...","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) {
switch (this) {
case Ambulate.Wheelchair:
// TODO: Handle this case.
return 'Wheelchair';
break;
case Ambulate.Walker:
// TODO: Handle this case.
return 'Walker';
break;
case Ambulate.Stretcher:
// TODO: Handle this case.
return 'Stretcher';
break;
case Ambulate.None:
// TODO: Handle this case.
return 'None';
break;
}
return 'None';
}
int selectAmbulateNumber() {
switch (this) {
case Ambulate.Wheelchair:
return 0;
break;
case Ambulate.Walker:
return 1;
break;
case Ambulate.Stretcher:
return 2;
break;
case Ambulate.None:
return 3;
break;
}
return 3;
}
Ambulate getAmbulateById(int id) {
switch (id) {
case 0:
return Ambulate.Wheelchair;
break;
case 1:
return Ambulate.Walker;
break;
case 2:
return Ambulate.Stretcher;
break;
case 3:
return Ambulate.None;
break;
}
return Ambulate.None;
}
}

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

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

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

@ -1,6 +1,8 @@
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/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:flutter/cupertino.dart';
class MedicalService extends BaseService {
List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList = List();
@ -26,4 +28,21 @@ class MedicalService extends BaseService {
super.error = error;
}, 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;
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
void setState(ViewState viewState) {
_state = viewState;

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

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

@ -1,4 +1,5 @@
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/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
@ -11,13 +12,15 @@ class MedicalViewModel extends BaseViewModel {
_medicalService.appoitmentAllHistoryResultList;
getAppointmentHistory() async {
setState(ViewState.Busy);
if (_medicalService.appoitmentAllHistoryResultList.length == 0)
await _medicalService.getAppointmentHistory();
if (_medicalService.hasError) {
error = _medicalService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
if (authenticatedUserObject.isLogin) {
setState(ViewState.Busy);
if (_medicalService.appoitmentAllHistoryResultList.length == 0)
await _medicalService.getAppointmentHistory();
if (_medicalService.hasError) {
error = _medicalService.error;
setState(ViewState.Error);
} else
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/others/app_scaffold_widget.dart';
import 'AmbulanceRequestIndex.dart';
import 'AmbulanceRequestIndexPages/AmbulanceRequestIndex.dart';
import 'OrderLogPage.dart';
class AmbulanceReq extends StatefulWidget {
@override
@ -26,11 +27,13 @@ class _AmbulanceReqState extends State<AmbulanceReq>
super.initState();
_tabController = TabController(length: 2, vsync: this);
}
@override
void dispose() {
super.dispose();
_tabController.dispose();
}
@override
Widget build(BuildContext context) {
return BaseView<AmRequestViewModel>(
@ -80,13 +83,14 @@ class _AmbulanceReqState extends State<AmbulanceReq>
indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor,
labelPadding:
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0),
unselectedLabelColor: Colors.grey[800],
tabs: [
Container(
width: MediaQuery.of(context).size.width * 0.40,
child: Center(
child: Texts("Ambulance Request"),//TranslationBase.of(context).prescriptions
child: Texts(
"Ambulance Request"), //TranslationBase.of(context).prescriptions
),
),
Container(
@ -110,8 +114,14 @@ class _AmbulanceReqState extends State<AmbulanceReq>
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
AmbulanceRequestIndex(amRequestViewModel: model,),
Container()
model.hasPendingOrder
? 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 'Summary.dart';
class AmbulanceRequestIndex extends StatefulWidget {
class AmbulanceRequestIndexPage extends StatefulWidget {
final AmRequestViewModel amRequestViewModel;
AmbulanceRequestIndex({Key key, this.amRequestViewModel});
AmbulanceRequestIndexPage({Key key, this.amRequestViewModel});
@override
_AmbulanceRequestIndexState createState() => _AmbulanceRequestIndexState();
_AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState();
}
class _AmbulanceRequestIndexState extends State<AmbulanceRequestIndex> {
class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
int currentIndex = 0;
PageController pageController;
PatientER _patientER = PatientER();

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

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/Blood/dialogs/SelectHospitalDialog.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/uitl/ProgressDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -15,8 +18,8 @@ import 'package:geolocator/geolocator.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'AmbulanceReq.dart';
import 'AvailableAppointmentsPage.dart';
import '../AmbulanceReq.dart';
import '../AvailableAppointmentsPage.dart';
enum HaveAppointment { YES, NO }
@ -41,6 +44,8 @@ class _PickupLocationState extends State<PickupLocation> {
double _latitude;
double _longitude;
AppoitmentAllHistoryResultList myAppointment;
HospitalsModel _selectedHospital;
PickResult _result;
@override
void initState() {
@ -142,7 +147,7 @@ class _PickupLocationState extends State<PickupLocation> {
Expanded(
child: InkWell(
onTap: () {
if(myAppointment == null) {
if (myAppointment == null) {
getAppointment();
setState(() {
_haveAppointment = HaveAppointment.YES;
@ -164,13 +169,12 @@ class _PickupLocationState extends State<PickupLocation> {
groupValue: _haveAppointment,
activeColor: Colors.red[800],
onChanged: (value) {
if(myAppointment == null) {
if (myAppointment == null) {
getAppointment();
setState(() {
_haveAppointment = value;
});
}
},
),
),
@ -212,18 +216,18 @@ class _PickupLocationState extends State<PickupLocation> {
),
],
),
if(myAppointment!=null)
if (myAppointment != null)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
AppointmentCard(appointment: myAppointment,)
AppointmentCard(
appointment: myAppointment,
)
],
),
SizedBox(
height: 12,
),
@ -231,29 +235,35 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox(
height: 8,
),
Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts('Pickup Location'),
Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
)
],
InkWell(
onTap: () {
confirmSelectHospitalDialog(
widget.amRequestViewModel.hospitals);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getHospitalName('Pickup Location')),
Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
)
],
),
),
),
],
),
if (widget.patientER.direction == 2)
if (widget.patientER.direction == 1)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -261,6 +271,39 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox(
height: 15,
),
InkWell(
onTap: () {
confirmSelectHospitalDialog(
widget.amRequestViewModel.hospitals);
},
child: Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(getHospitalName('Pickup Location')),
Icon(
Icons.arrow_drop_down,
size: 24,
color: Colors.black,
)
],
),
),
),
SizedBox(
height: 12,
),
Texts('Drop off Location'),
SizedBox(
height: 8,
),
InkWell(
onTap: () {
Navigator.push(
@ -271,6 +314,9 @@ class _PickupLocationState extends State<PickupLocation> {
// Put YOUR OWN KEY here.
onPlacePicked: (PickResult result) {
print(result.adrAddress);
setState(() {
_result = result;
});
Navigator.of(context).pop();
},
initialPosition: LatLng(_latitude, _longitude),
@ -290,9 +336,9 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts('Pickup Location'),
Texts('Select From Map'),
Icon(
Icons.arrow_drop_down,
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
@ -300,33 +346,6 @@ class _PickupLocationState extends State<PickupLocation> {
),
),
),
SizedBox(
height: 12,
),
Texts('Drop off Location'),
SizedBox(
height: 8,
),
Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts('Select From Map'),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
),
),
],
),
//TODO show dialog projects
@ -342,7 +361,41 @@ class _PickupLocationState extends State<PickupLocation> {
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
if(_result==null || _selectedHospital == null)
AppToast.showErrorToast(message: 'please select all fields');
else
setState(() {
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
if (widget.patientER.direction == 0) {
widget.patientER.pickupLocationLattitude = _result.geometry.location.lat.toString();
widget.patientER.pickupLocationLongitude = _result.geometry.location.lng.toString();
widget.patientER.dropoffLocationLattitude = _selectedHospital.latitude;
widget.patientER.dropoffLocationLongitude = _selectedHospital.longitude;
} else {
widget.patientER.pickupLocationLattitude = _selectedHospital.latitude;
widget.patientER.pickupLocationLongitude = _selectedHospital.longitude;
widget.patientER.dropoffLocationLattitude = _result.geometry.location.lat.toString();
widget.patientER.dropoffLocationLongitude = _result.geometry.location.lng.toString();
}
widget.patientER.latitude = widget.patientER.pickupLocationLattitude;
widget.patientER.longitude = widget.patientER.pickupLocationLongitude;
if(_haveAppointment == HaveAppointment.YES){
widget.patientER.appointmentNo = myAppointment.appointmentNo.toString();
widget.patientER.appointmentClinicName = myAppointment.clinicName;
widget.patientER.appointmentDoctorName = myAppointment.doctorNameObj;
widget.patientER.appointmentBranch = myAppointment.projectName;
widget.patientER.appointmentTime = myAppointment.appointmentDate;
}else{
widget.patientER.appointmentNo ="0";
widget.patientER.appointmentClinicName = null;
widget.patientER.appointmentDoctorName = null;
widget.patientER.appointmentBranch = null;
widget.patientER.appointmentTime = null;
}
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
widget.changeCurrentTab(2);
});
@ -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() {
ProgressDialogUtil.showProgressDialog(context);
widget.amRequestViewModel.getAppointmentHistory().then((value) {
if (widget.amRequestViewModel.state == ViewState.Error ||
widget.amRequestViewModel.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: widget.amRequestViewModel.error);
} else if (widget.amRequestViewModel.appoitmentAllHistoryResultList.length > 0) {
} else if (widget
.amRequestViewModel.appoitmentAllHistoryResultList.length >
0) {
ProgressDialogUtil.hideProgressDialog(context);
Navigator.push(
context,
MaterialPageRoute(
@ -375,17 +451,23 @@ class _PickupLocationState extends State<PickupLocation> {
setState(() {
myAppointment = value;
});
else
else {
ProgressDialogUtil.hideProgressDialog(context);
setState(() {
_haveAppointment = HaveAppointment.NO;
});
}
});
} else {
ProgressDialogUtil.hideProgressDialog(context);
setState(() {
_haveAppointment = HaveAppointment.NO;
});
AppToast.showErrorToast(message: 'You don\'t have any appointment');
}
}).catchError((e) {
ProgressDialogUtil.hideProgressDialog(context);
AppToast.showErrorToast(message: e);
});
}
}

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

@ -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:flutter/material.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>> {
T model = locator<T>();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@override
void initState() {
if (widget.onModelReady != null) {
if (widget.onModelReady != null && authenticatedUserObject.isLogin) {
widget.onModelReady(model);
}
super.initState();

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

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

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

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

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

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

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

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

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

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

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

@ -1,12 +1,26 @@
import 'package:flutter/material.dart';
class ProgressDialogUtil{
AlertDialog _alert = AlertDialog(
content: Row(
children: [
CircularProgressIndicator(),
Container(margin: EdgeInsets.only(left: 7), child: Text("Loading...")),
],
),
);
static AlertDialog alert = AlertDialog(
content: new Row(
children: [
CircularProgressIndicator(),
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 questionHere => localizedValues['QuestionHere'][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/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.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/progress_indicator/app_loader_widget.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:provider/provider.dart';
import '../../locator.dart';
import 'floating_button_search.dart';
import '../progress_indicator/app_loader_widget.dart';
import 'arrow_back.dart';
import 'network_base_view.dart';
import 'not_auh_page.dart';
class AppScaffold extends StatelessWidget {
final String appBarTitle;
@ -26,6 +30,12 @@ class AppScaffold extends StatelessWidget {
final bool hasAppBarParam;
final BaseViewModel baseViewModel;
final Widget floatingActionButton;
final String title;
final String description;
final bool isShowDecPage;
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AppScaffold(
{@required this.body,
@ -34,50 +44,61 @@ class AppScaffold extends StatelessWidget {
this.isShowAppBar = false,
this.hasAppBarParam,
this.bottomSheet,
this.baseViewModel, this.floatingActionButton});
this.baseViewModel,
this.floatingActionButton,
this.title,
this.description,
this.isShowDecPage = true});
@override
Widget build(BuildContext context) {
AppGlobal.context = context;
return Scaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar
? AppBar(
elevation: 0,
backgroundColor: Theme.of(context).appBarTheme.color,
textTheme: TextTheme(
headline6: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text(appBarTitle.toUpperCase()),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: isShowAppBar
? AppBar(
elevation: 0,
backgroundColor: Theme.of(context).appBarTheme.color,
textTheme: TextTheme(
headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text(authenticatedUserObject.isLogin
? appBarTitle.toUpperCase()
: TranslationBase.of(context).serviceInformationTitle),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
centerTitle: true,
actions: <Widget>[
IconButton(
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
Navigator.of(context).popUntil(ModalRoute.withName('/'));
},
),
centerTitle: true,
actions: <Widget>[
IconButton(
icon: Icon(FontAwesomeIcons.home),
color: Colors.white,
onPressed: () {
Navigator.of(context).popUntil(ModalRoute.withName('/'));
},
),
],
)
: null,
body: baseViewModel != null
? NetworkBaseView(
child: buildBodyWidget(),
baseViewModel: baseViewModel,
)
: buildBodyWidget(),
bottomSheet: bottomSheet,
// bottomNavigationBar: BottomBarSearch()
floatingActionButton: floatingActionButton??floatingActionButton,
);
],
)
: null,
body: (!authenticatedUserObject.isLogin && isShowDecPage)
? NotAutPage(
title: appBarTitle,
description: description,
)
: baseViewModel != null
? NetworkBaseView(
child: buildBodyWidget(),
baseViewModel: baseViewModel,
)
: buildBodyWidget(),
bottomSheet: bottomSheet,
// bottomNavigationBar: BottomBarSearch()
floatingActionButton: floatingActionButton ?? floatingActionButton,
);
}
buildAppLoaderWidget(bool isLoading) {
@ -85,6 +106,6 @@ class AppScaffold extends StatelessWidget {
}
buildBodyWidget() {
return body ;//Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
}
}

@ -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_cropper: ^1.2.1
#GIF image
flutter_gifimage: ^1.0.1
# UI Reqs
dotted_border: 1.0.5
expandable: ^4.1.4

Loading…
Cancel
Save