done ER service

er_location
jammal 5 years ago
parent 7dc55f3378
commit 9328f942ba

@ -73,7 +73,7 @@
android:value="2" />
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyDiXnCO00li4V7Ioa2YZ_M4ECxRsu_P9tA"/>
android:value="AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw"/>
</application>

@ -60,7 +60,8 @@ const GET_NEAREST_HOSPITAL =
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';
const UPDATE_PRESS_ORDER= 'Services/Patients.svc/REST/PatientER_UpdatePresOrder';
const UPDATE_PRESS_ORDER = 'Services/Patients.svc/REST/PatientER_UpdatePresOrder';
const INSERT_ER_INERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
///FindUs
const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
@ -334,6 +335,8 @@ const GET_CHECK_UP_ITEMS ="Services/Patients.svc/REST/GetCheckUpItems";
const TIMER_MIN = 10;
const GOOGLE_API_KEY = "AIzaSyCmevVlr2Bh-c8W1VUzo8gt8JRY7n5PANw";
class AppGlobal {
static var context;

@ -609,26 +609,7 @@ const Map<String, Map<String, String>> localizedValues = {
"en": "Order Log",
"ar": " سجل الطلبات"
},
"Power":{"en":"Power","ar":"القوة"},
"Diameter":{"en":"Diameter","ar":"القطر"},
"Remarks":{"en":"Remarks","ar":"ملاحضات"},
"ActiveMedications":{"en":"Active Medications","ar":"ادويتي النشطة"},
"ExpDate":{"en":"Active Exp Date :","VA":"تاريخ الإنتهاء"},
"Route":{"en":"Route :","ar":"الطريقة"},
"Frequency":{"en":"Frequency :","ar":"المعدل"},
"DailyQuantity":{"en":"Daily Quantity :","ar":"جرعات يومية"},
"AddReminder":{"en":"Add Reminder","ar":"إضافة تذكير"},
"reminderDes":{"en":"Please select treatment start day and time to be notified when it\'s time to take the medicine","ar":" يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء"},
"StartDay":{"en":"Start Day","ar":"يوم البداية"},
"EndDay":{"en":"End Day","ar":"يوم الانتهاء"},
"Days":{"en":"Days ","ar":"أيام"},
"ScheduleTime":{"en":"Schedule time","ar":"الجدول الزمني"},
"AskDoctor":{"en":"Ask Doctor","ar":"اسأل طبيبك"},
"DoctorResponses":{"en":"Doctor Responses","ar":"ردود الأطباء"},
"New":{"en":"New","ar":"جديد"},
"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": {

@ -18,7 +18,7 @@ class PatientERInsertPresOrderRequestModel {
double longitude;
int createdBy;
int orderServiceID;
List<PatientERHHCInsertServicesList> patientERHHCInsertServicesList;
List<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =List();
PatientERInsertPresOrderRequestModel(
{this.versionID,
@ -38,7 +38,7 @@ class PatientERInsertPresOrderRequestModel {
this.longitude,
this.createdBy,
this.orderServiceID,
this.patientERHHCInsertServicesList});
});
PatientERInsertPresOrderRequestModel.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID'];

@ -16,6 +16,7 @@ class HomeHealthCareService extends BaseService {
List<GetOrderDetailByOrderIDResponseModel> hhcAllOrderDetail = List();
bool isOrderUpdated;
Future getHHCAllServices(
HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async {
hasError = false;
@ -31,49 +32,51 @@ class HomeHealthCareService extends BaseService {
}, body: hHCGetAllServicesRequestModel.toJson());
}
Future getHHCAllPresOrders() async {
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel= GetHHCAllPresOrdersRequestModel();
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel =
GetHHCAllPresOrdersRequestModel();
hasError = false;
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS,
onSuccess: (dynamic response, int statusCode) {
hhcAllPresOrdersList.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((data) {
if(data['ServiceID'] == 2)
hhcAllPresOrdersList.add(GetHHCAllPresOrdersResponseModel.fromJson(data));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getHHCAllPresOrdersRequestModel.toJson());
hhcAllPresOrdersList.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((data) {
if (data['ServiceID'] == 2)
hhcAllPresOrdersList
.add(GetHHCAllPresOrdersResponseModel.fromJson(data));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getHHCAllPresOrdersRequestModel.toJson());
}
Future getOrderDetailByOrderID(GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel) async {
Future getOrderDetailByOrderID(int presOrderID) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PresOrderID'] = presOrderID;
body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_ORDER_DETAIL_BY_ID,
onSuccess: (dynamic response, int statusCode) {
hhcAllOrderDetail.clear();
response['PatientER_HHC_GetTransactionsForOrderList'].forEach((data) {
hhcAllOrderDetail.add(GetOrderDetailByOrderIDResponseModel.fromJson(data));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getOrderDetailByOrderIDRequestModel.toJson());
hhcAllOrderDetail.clear();
response['PatientER_HHC_GetTransactionsForOrderList'].forEach((data) {
hhcAllOrderDetail
.add(GetOrderDetailByOrderIDResponseModel.fromJson(data));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
Future updateHHCPresOrder(
UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
hasError = false;
await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER,
onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: updatePresOrderRequestModel.toJson());
isOrderUpdated = true;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: updatePresOrderRequestModel.toJson());
}
}

@ -83,6 +83,7 @@ class BaseAppClient {
print("URL : $url");
print("Body : ${json.encode(body)}");
var ss = json.encode(body);
if (await Utils.checkConnection()) {
final response = await http.post(url.trim(),

@ -2,6 +2,7 @@ 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/PatientER.dart';
import 'package:diplomaticquarterapp/core/model/er/PickUpRequestPresOrder.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
import 'package:flutter/cupertino.dart';
@ -91,4 +92,16 @@ class AmService extends BaseService {
super.error = error;
}, body: body);
}
Future insertERPressOrder({@required PatientER patientER}) async {
hasError = false;
await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: patientER.toJson());
}
}

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart';
@ -25,6 +26,10 @@ class HomeHealthCareViewModel extends BaseViewModel {
bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated;
GetHHCAllPresOrdersResponseModel pendingOrder;
List<PatientERHHCInsertServicesList> patientERHHCInsertServicesList = List();
Future getHHCAllServices() async {
HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel =
new HHCGetAllServicesRequestModel();
@ -40,17 +45,18 @@ class HomeHealthCareViewModel extends BaseViewModel {
}
Future getHHCAllPresOrders() async {
pendingOrder = null;
setState(ViewState.Busy);
await _homeHealthCareService.getHHCAllPresOrders();
if (_homeHealthCareService.hasError) {
error = _homeHealthCareService.error;
setState(ViewState.Error);
} else {
var pendingOrder = _homeHealthCareService.hhcAllPresOrdersList
pendingOrder = _homeHealthCareService.hhcAllPresOrdersList
.firstWhere((element) => element.status == 1 || element.status == 2,
orElse: () => null);
if (pendingOrder != null) {
await getOrderDetailByOrderID(pendingOrder);
await _homeHealthCareService.getOrderDetailByOrderID(pendingOrder.iD);
setState(ViewState.Idle);
} else {
getHHCAllServices();
@ -61,7 +67,7 @@ class HomeHealthCareViewModel extends BaseViewModel {
Future updateHHCPresOrder(
UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
setState(ViewState.BusyLocal);
setState(ViewState.Busy);
await _homeHealthCareService.updateHHCPresOrder(
updatePresOrderRequestModel);
if (_homeHealthCareService.hasError) {
@ -72,19 +78,6 @@ class HomeHealthCareViewModel extends BaseViewModel {
}
}
Future getOrderDetailByOrderID(GetHHCAllPresOrdersResponseModel order) async {
GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel = GetOrderDetailByOrderIDRequestModel(
presOrderID: order.iD);
// setState(ViewState.Busy);
await _homeHealthCareService.getOrderDetailByOrderID(
getOrderDetailByOrderIDRequestModel);
// if (_homeHealthCareService.hasError) {
// error = _homeHealthCareService.error;
// setState(ViewState.Error);
// } else {
// setState(ViewState.Idle);
// }
}
}

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart';
import 'package:diplomaticquarterapp/core/model/er/PatientER.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/hospitals/hospitals_model.dart';
@ -77,8 +78,8 @@ class AmRequestViewModel extends BaseViewModel {
Future getOrderDetails() async {
setState(ViewState.Busy);
await _amService.getOrderDetails();
if (_hospitalService.hasError) {
error = _hospitalService.error;
if (_amService.hasError) {
error = _amService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
@ -87,10 +88,21 @@ class AmRequestViewModel extends BaseViewModel {
Future updatePressOrder({@required int presOrderID}) async {
setState(ViewState.Busy);
await _amService.updatePressOrder(presOrderID: presOrderID);
if (_hospitalService.hasError) {
error = _hospitalService.error;
if (_amService.hasError) {
error = _amService.error;
setState(ViewState.Error);
} else
getPatientAllPresOrdersList();
}
Future insertERPressOrder({@required PatientER patientER}) async {
setState(ViewState.Busy);
await _amService.insertERPressOrder(patientER: patientER);
if (_amService.hasError) {
error = _amService.error;
setState(ViewState.ErrorLocal);
} else
getAmRequestOrders();
}
}

@ -23,7 +23,7 @@ class CMCIndexPage extends StatelessWidget {
"CMC",
fontWeight: FontWeight.normal,
fontSize: 25,
color: Hexcolor("#60686b"),
color: Color(0xff60686b),
),
SizedBox(
height: 12,

@ -14,10 +14,11 @@ class NewHomeHealthCareStepOnePage extends StatefulWidget {
patientERInsertPresOrderRequestModel;
final Function changePageViewIndex;
final HomeHealthCareViewModel model;
const NewHomeHealthCareStepOnePage(
{Key key,
this.patientERInsertPresOrderRequestModel,
this.model,
this.model,
this.changePageViewIndex})
: super(key: key);
@ -30,10 +31,10 @@ class _NewHomeHealthCareStepOnePageState
extends State<NewHomeHealthCareStepOnePage> {
@override
void initState() {
if(widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList==null)
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = [];
widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList =[];
super.initState();
}
@ -45,18 +46,19 @@ class _NewHomeHealthCareStepOnePageState
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
margin: EdgeInsets.all(12),
margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.05,
right: MediaQuery.of(context).size.width * 0.05),
child: Center(
child: FractionallySizedBox(
widthFactor: 0.94,
widthFactor: 1,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 20,
height: 12,
),
Texts(
// TranslationBase.of(context).advancePaymentLabel,
"Select Home Health Care Services",
textAlign: TextAlign.center,
),
@ -65,8 +67,7 @@ class _NewHomeHealthCareStepOnePageState
return Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border:
Border.all(color: Colors.grey, width: 1),
border: Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
@ -79,20 +80,13 @@ class _NewHomeHealthCareStepOnePageState
activeColor: Colors.black38,
onChanged: (bool newValue) {
setState(() {
this
.widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.add(new PatientERHHCInsertServicesList(
recordID: this
.widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length,
serviceID:
service.serviceID,
serviceName:
service.description));
if(!isServiceSelected(service.serviceID))
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add( PatientERHHCInsertServicesList(
recordID:widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length,
serviceID: service.serviceID,
serviceName: service.description));
else
removeSelected(service.serviceID);
// widget.patientERInsertPresOrderRequestModel
// isPatientInsured = newValue;
});
@ -119,22 +113,22 @@ class _NewHomeHealthCareStepOnePageState
),
),
),
bottomSheet:Container(
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,
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
label: "Next",
disabled: this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length ==0,
textColor: Theme
.of(context)
.backgroundColor),
disabled: this
.widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList
.length ==
0,
textColor: Theme.of(context).backgroundColor),
),
],
),
@ -150,4 +144,18 @@ class _NewHomeHealthCareStepOnePageState
}
return false;
}
removeSelected(int serviceId){
Iterable <PatientERHHCInsertServicesList> patientERHHCInsertServicesList = widget
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.where((element) => serviceId == element.serviceID);
if(patientERHHCInsertServicesList.length > 0)
setState(() {
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.remove(patientERHHCInsertServicesList);
});
}
}

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
import '../StepsWidget.dart';
import 'new_Home_health_care_step_one_page.dart';
class NewHomeHealthCarePage extends StatefulWidget {
@ -19,8 +20,7 @@ class NewHomeHealthCarePage extends StatefulWidget {
final HomeHealthCareViewModel model;
@override
_NewHomeHealthCarePageState createState() =>
_NewHomeHealthCarePageState();
_NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState();
}
class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
@ -29,8 +29,8 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
int _currentIndex = 1;
int pageSelected = 2;
PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel = new PatientERInsertPresOrderRequestModel();
PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel =
new PatientERInsertPresOrderRequestModel();
@override
void initState() {
@ -43,26 +43,31 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
super.dispose();
}
changePageViewIndex(pageIndex) {
_controller.jumpToPage(pageIndex);
_changeCurrentTab(int tab) {
setState(() {
_currentIndex = tab;
});
_controller.animateToPage(tab,
duration: Duration(milliseconds: 800), curve: Curves.easeOutQuart);
}
@override
Widget build(BuildContext context) {
void showConfirmMessage(
HomeHealthCareViewModel model, GetOrderDetailByOrderIDResponseModel order) {
void showConfirmMessage(HomeHealthCareViewModel model,
GetOrderDetailByOrderIDResponseModel order) {
showDialog(
context: context,
child: ConfirmCancelOrderDialog(
model: model,
onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel =
UpdatePresOrderRequestModel(
presOrderID: order.presOrderID,
rejectionReason: "",
presOrderStatus: 4, editedBy: 3);
UpdatePresOrderRequestModel(
presOrderID: order.presOrderID,
rejectionReason: "",
presOrderStatus: 4,
editedBy: 3);
await model.updateHHCPresOrder(updatePresOrderRequestModel);
if(model.state == ViewState.ErrorLocal) {
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(message: "Done Successfully");
@ -72,220 +77,218 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
},
));
}
return Scaffold(
body: SafeArea(
child: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.8,
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
widget.model.hhcAllOrderDetail.length != 0
? FractionallySizedBox(
heightFactor: 0.8,
widthFactor: 0.9,
child: Container(
width: double.infinity,
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border:
Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Request ID",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model.hhcAllOrderDetail[0].iD.toString(),
fontSize: 22,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Status",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
"Pending",
fontSize: 22,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Pickup Date",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(
widget.model.hhcAllOrderDetail[0]
.createdOn)),
fontSize: 22,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
child: Column(
children: [
Container(
margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05),
child: StepsWidget(
index: _currentIndex,
changeCurrentTab: _changeCurrentTab,
),
),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
widget.model.pendingOrder != null
? FractionallySizedBox(
widthFactor: 0.9,
child: SingleChildScrollView(
child: Container(
width: double.infinity,
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
"Request ID",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model.pendingOrder.iD.toString(),
fontSize: 22,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
"Status",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model.pendingOrder.description,
fontSize: 22,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
"Pickup Date",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(widget
.model.pendingOrder.createdOn)),
fontSize: 22,
),
],
),
),
...List.generate(
widget.model.hhcAllOrderDetail.length,
(index) => Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Service Name",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model.hhcAllOrderDetail[index]
.description,
fontSize: 22,
bold: true,
),
],
),
),
),
SizedBox(
height: 12,
),
Center(
child: Container(
width:
MediaQuery.of(context).size.width * 0.85,
child: SecondaryButton(
label: "Cancel".toUpperCase(),
onTap: () {
showConfirmMessage(widget.model,
widget.model.hhcAllOrderDetail[0]);
},
color: Colors.red[800],
disabled: false,
textColor:
Theme.of(context).backgroundColor),
),
),
SizedBox(
height: 12,
),
],
),
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Service Name",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model.hhcAllOrderDetail[0].description
.toString() ??
widget.model.hhcAllOrderDetail[0]
.descriptionN
.toString(),
fontSize: 22,
),
],
),
),
SizedBox(
height: 12,
),
Center(
child: Container(
width: MediaQuery
.of(context)
.size
.width *
0.85,
child: SecondaryButton(
label: "Cancel".toUpperCase(),
onTap: () {
showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
}
,
color: Colors.red[800],
disabled: false,
textColor: Theme
.of(context)
.backgroundColor),
),
),
SizedBox(
height: 12,
),
],
),
)
: NewHomeHealthCareStepOnePage(
changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
model: widget.model,
),
],
),
)
: NewHomeHealthCareStepOnePage(
changePageViewIndex: changePageViewIndex,
patientERInsertPresOrderRequestModel:
patientERInsertPresOrderRequestModel,
model: widget.model,
),
// NewEReferralStepTowPage(
// changePageViewIndex: changePageViewIndex,
// patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
//
// ),
// NewEReferralStepThreePage(
// changePageViewIndex: changePageViewIndex,
// patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
//
// ),
],
),
),

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

@ -24,7 +24,7 @@ class HomeHealthCareIndexPage extends StatelessWidget {
TranslationBase.of(context).homeHealthCare,
fontWeight: FontWeight.normal,
fontSize: 25,
color: Hexcolor("#60686b"),
color: Color(0xff60686b),
),
SizedBox(
height: 12,

@ -20,7 +20,8 @@ class AmbulanceRequestIndexPage extends StatefulWidget {
AmbulanceRequestIndexPage({Key key, this.amRequestViewModel});
@override
_AmbulanceRequestIndexPageState createState() => _AmbulanceRequestIndexPageState();
_AmbulanceRequestIndexPageState createState() =>
_AmbulanceRequestIndexPageState();
}
class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
@ -45,112 +46,124 @@ class _AmbulanceRequestIndexPageState extends State<AmbulanceRequestIndexPage> {
@override
Widget build(BuildContext context) {
return AppScaffold(
body: widget.amRequestViewModel.pickUpRequestPresOrder!=null
body: widget.amRequestViewModel.pickUpRequestPresOrder != null
? Column(
children: [
SizedBox(
height: 80,
),
Container(
margin: EdgeInsets.only(left: 18, right: 18),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(2),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
OrderLogItem(
title: 'Request ID',
value: widget.amRequestViewModel.pickUpRequestPresOrder.presOrderID.toString(),
),
OrderLogItem(
title: 'Status',
value: widget.amRequestViewModel.pickUpRequestPresOrder.ambulateDescription,
),
OrderLogItem(
title: 'Last edit time',
value: DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(widget.amRequestViewModel.pickUpRequestPresOrder.lastEditDate)),
),
OrderLogItem(
title: 'Pickup Location',
value: widget.amRequestViewModel.pickUpRequestPresOrder.pickupLocationName,
),
OrderLogItem(
title: 'Drop off Location',
value: widget.amRequestViewModel.pickUpRequestPresOrder.dropoffLocationName,
),
OrderLogItem(
title: 'Trasfaer way',
value: widget.amRequestViewModel.pickUpRequestPresOrder.title,
SizedBox(
height: 80,
),
Container(
padding: EdgeInsets.all(10),
width: double.maxFinite,
margin: EdgeInsets.only(bottom: 4,left: 4,right: 4),
margin: EdgeInsets.only(left: 18, right: 18),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(12),
bottomLeft: Radius.circular(12),
),
color: Colors.white
color: Colors.white,
borderRadius: BorderRadius.circular(2),
),
child: SecondaryButton(
color: Colors.red[900],
textColor: Colors.white,
label: TranslationBase.of(context).cancel,
onTap: () {
widget.amRequestViewModel.updatePressOrder(presOrderID:widget.amRequestViewModel.pickUpRequestPresOrder.presOrderID );
},
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
OrderLogItem(
title: 'Request ID',
value: widget.amRequestViewModel.pickUpRequestPresOrder
.presOrderID
.toString(),
),
OrderLogItem(
title: 'Status',
value: widget.amRequestViewModel.pickUpRequestPresOrder
.ambulateDescription,
),
OrderLogItem(
title: 'Last edit time',
value: DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(widget
.amRequestViewModel
.pickUpRequestPresOrder
.lastEditDate)),
),
OrderLogItem(
title: 'Pickup Location',
value: widget.amRequestViewModel.pickUpRequestPresOrder
.pickupLocationName,
),
OrderLogItem(
title: 'Drop off Location',
value: widget.amRequestViewModel.pickUpRequestPresOrder
.dropoffLocationName,
),
OrderLogItem(
title: 'Trasfaer way',
value: widget
.amRequestViewModel.pickUpRequestPresOrder.title,
),
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: SecondaryButton(
color: Colors.red[900],
textColor: Colors.white,
label: TranslationBase.of(context).cancel,
onTap: () {
widget.amRequestViewModel.updatePressOrder(
presOrderID: widget.amRequestViewModel
.pickUpRequestPresOrder.presOrderID);
},
),
)
],
),
)
],
),
),
],
):Column(
children: [
SizedBox(
height: 80,
),
Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: StepsWidget(
index: currentIndex,
changeCurrentTab: _changeCurrentTab,
)),
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: <Widget>[
//Container(),
SelectTransportationMethod(
changeCurrentTab: _changeCurrentTab,
patientER: _patientER,
amRequestViewModel: widget.amRequestViewModel,
),
PickupLocation(
changeCurrentTab: _changeCurrentTab,
patientER: _patientER,
amRequestViewModel: widget.amRequestViewModel,
],
)
: Column(
children: [
SizedBox(
height: 80,
),
BillAmount(
changeCurrentTab: _changeCurrentTab,
patientER: _patientER,
amRequestViewModel: widget.amRequestViewModel,
Container(
margin: EdgeInsets.only(left: 12, right: 12),
child: StepsWidget(
index: currentIndex,
changeCurrentTab: _changeCurrentTab,
),
),
Summary(
changeCurrentTab: _changeCurrentTab,
patientER: _patientER,
amRequestViewModel: widget.amRequestViewModel,
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: pageController,
children: <Widget>[
//Container(),
SelectTransportationMethod(
changeCurrentTab: _changeCurrentTab,
patientER: _patientER,
amRequestViewModel: widget.amRequestViewModel,
),
PickupLocation(
changeCurrentTab: _changeCurrentTab,
patientER: _patientER,
amRequestViewModel: widget.amRequestViewModel,
),
BillAmount(
changeCurrentTab: _changeCurrentTab,
patientER: _patientER,
amRequestViewModel: widget.amRequestViewModel,
),
Summary(
changeCurrentTab: _changeCurrentTab,
patientER: _patientER,
amRequestViewModel: widget.amRequestViewModel,
),
],
),
),
],
),
),
],
),
);
}
}

@ -8,8 +8,10 @@ import 'package:diplomaticquarterapp/pages/ErService/widgets/AppointmentCard.dar
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/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -73,7 +75,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (widget.patientER.direction == 0)
if (widget.patientER.direction == 1)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -81,24 +83,42 @@ class _PickupLocationState extends State<PickupLocation> {
SizedBox(
height: 15,
),
Container(
padding: EdgeInsets.all(12),
decoration: BoxDecoration(
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.grey, width: 0.5),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts('Select From Map'),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
InkWell(
onTap: (){
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PickupLocationFromMap(
latitude: _latitude,
longitude: _longitude,
onPick: (value) {
setState(() {
_result = value;
});
},
),
),
);
},
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(getSelectFromMapName()),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
color: Colors.black,
)
],
),
),
),
SizedBox(
@ -263,7 +283,7 @@ class _PickupLocationState extends State<PickupLocation> {
),
],
),
if (widget.patientER.direction == 1)
if (widget.patientER.direction == 0)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -309,41 +329,14 @@ class _PickupLocationState extends State<PickupLocation> {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PlacePicker(
apiKey: 'AIzaSyDiXnCO00li4V7Ioa2YZ_M4ECxRsu_P9tA',
// Put YOUR OWN KEY here.
onPlacePicked: (PickResult result) {
print(result.adrAddress);
builder: (context) => PickupLocationFromMap(
latitude: _latitude,
longitude: _longitude,
onPick: (value) {
setState(() {
_result = result;
_result = value;
});
Navigator.of(context).pop();
},
selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0, // MediaQuery.of(context) will cause rebuild. See MediaQuery document for the information.
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: RaisedButton(
child: Text("Pick Here"),
onPressed: () {
// IMPORTANT: You MUST manage selectedPlace data yourself as using this build will not invoke onPlacePicker as
// this will override default 'Select here' Button.
print("do something with [selectedPlace] data");
Navigator.of(context).pop();
},
),
);
},
initialPosition: LatLng(_latitude, _longitude),
useCurrentLocation: true,
),
),
);
@ -359,7 +352,7 @@ class _PickupLocationState extends State<PickupLocation> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts('Select From Map'),
Texts(getSelectFromMapName()),
Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 24,
@ -384,44 +377,57 @@ 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');
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();
}
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;
widget.patientER.latitude = widget.patientER.pickupLocationLattitude;
widget.patientER.longitude = widget.patientER.pickupLocationLongitude;
widget.patientER.dropoffLocationName = _selectedHospital.name;
widget.patientER.createdBy = widget.amRequestViewModel.user.patientID;
widget.patientER.isOutPatient = widget.amRequestViewModel.user.outSA;
widget.patientER.patientIdentificationID = widget.amRequestViewModel.user.patientIdentificationNo;
widget.patientER.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now());
widget.patientER.pickupLocationName = _result.formattedAddress;
widget.patientER.projectID = widget.amRequestViewModel.user.projectID;
widget.patientER.requesterFileNo = widget.amRequestViewModel.user.patientID;
widget.patientER.requesterIsOutSA = false;
widget.patientER.lineItemNo =0;
widget.patientER.requesterMobileNo = widget.amRequestViewModel.user.mobileNumber;
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;
}
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;
widget.patientER.haveAppointment = true;
} else {
widget.patientER.appointmentNo = "0";
widget.patientER.appointmentClinicName = null;
widget.patientER.appointmentDoctorName = null;
widget.patientER.appointmentBranch = null;
widget.patientER.appointmentTime = null;
widget.patientER.haveAppointment = false;
}
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
widget.changeCurrentTab(2);
});
widget.patientER.pickupSpot = _isInsideHome ? 1 : 0;
widget.changeCurrentTab(2);
});
},
label: 'Next',
),
@ -451,6 +457,10 @@ class _PickupLocationState extends State<PickupLocation> {
return _selectedHospital == null ? title : _selectedHospital.name;
}
String getSelectFromMapName() {
return _result != null ? _result.formattedAddress : 'Select From Map';
}
getAppointment() {
ProgressDialogUtil.showProgressDialog(context);
widget.amRequestViewModel.getAppointmentHistory().then((value) {

@ -284,8 +284,9 @@ class _SelectTransportationMethodState
textColor: Colors.white,
onTap: () {
setState(() {
widget.patientER.direction = _direction == Direction.ToHospital ? 0 : 1;
widget.patientER.tripType = _way == Way.TwoWays ? 2 : 1;
widget.patientER.transportationMethodId =(widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER.direction = _direction == Direction.ToHospital ? 1 : 0;
widget.patientER.tripType = _way == Way.TwoWays ? 0 : 1;
widget.patientER.selectedAmbulate = (widget.amRequestViewModel.amRequestModeList.indexOf(_erTransportationMethod) + 1);
widget.patientER.patientERTransportationMethod = _erTransportationMethod;
widget.patientER.orderServiceID = _orderService.getIdOrderService();

@ -17,6 +17,7 @@ class Summary extends StatefulWidget {
_SummaryState createState() => _SummaryState();
}
//TODO it should be dynamic
class _SummaryState extends State<Summary> {
@override
Widget build(BuildContext context) {
@ -30,7 +31,6 @@ class _SummaryState extends State<Summary> {
SizedBox(height: 5,),
Container(
width: double.infinity,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Colors.white,
@ -92,9 +92,11 @@ class _SummaryState extends State<Summary> {
child:SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
label: 'Next',
label: 'Send',
onTap: () async {
await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER);
// onTap: ()=> widget.changeCurrentTab(2),
}
),
)
],

@ -27,6 +27,14 @@ class DateUtil {
return start + "$milliseconds" + end;
}
static String convertDateToStringLocation(DateTime date) {
const start = "/Date(";
const end = ")/";
int milliseconds = date.millisecondsSinceEpoch;
return start + "$milliseconds" + end;
}
static String yearMonthDay(DateTime dateTime) {
String dateFormat = '${dateTime.year}-${dateTime.month}-${dateTime.day}';
return dateFormat;

@ -681,11 +681,7 @@ class TranslationBase {
String get homeHealthCareText => localizedValues['HomeHealthCareText'][locale.languageCode];
String get loginRegister => localizedValues['LoginRegister'][locale.languageCode];
String get orderLog => localizedValues['OrderLog'][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 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];

@ -16,7 +16,7 @@ class CloseBack extends StatelessWidget{
onTap: Feedback.wrapForTap(() {
onTap!=null ? onTap() : Navigator.pop(context);
}, context),
child: Icon(EvaIcons.close, color: Color.fromRGBO(78, 62, 253, 1.0)),
child: Icon(EvaIcons.close, color: Colors.white),
);
}
}

@ -0,0 +1,77 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/others/close_back.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart';
class PickupLocationFromMap extends StatelessWidget {
final Function(PickResult) onPick;
final double latitude;
final double longitude;
const PickupLocationFromMap({Key key, this.onPick, this.latitude, this.longitude})
: super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Scaffold(
appBar: AppBar(
elevation: 0,
textTheme: TextTheme(
headline6:
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text('Location'),
leading: CloseBack(),
centerTitle: true,
),
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
onPick(result);
Navigator.of(context).pop();
},
selectedPlaceWidgetBuilder:
(_, selectedPlace, state, isSearchBarFocused) {
print("state: $state, isSearchBarFocused: $isSearchBarFocused");
return isSearchBarFocused
? Container()
: FloatingCard(
bottomPosition: 0.0,
leftPosition: 0.0,
rightPosition: 0.0,
width: 500,
borderRadius: BorderRadius.circular(12.0),
child: state == SearchingState.Searching
? Center(child: CircularProgressIndicator())
: Container(
margin: EdgeInsets.all(12),
child: SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
onPick(selectedPlace);
Navigator.of(context).pop();
},
label: TranslationBase.of(context).next,
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: true,
),
);
}
}
Loading…
Cancel
Save