new home health service

merge-update-with-lab-changes
Mohammad Aljmma 6 years ago
parent 9126934ef4
commit d0ed776ff6

@ -6,7 +6,7 @@ import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
const MAX_SMALL_SCREEN = 660; const MAX_SMALL_SCREEN = 660;
const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://hmgwebservices.com/';
const GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';

@ -1,4 +1,4 @@
enum OrderService { AMBULANCE } enum OrderService { AMBULANCE,HOME_HEALTH_CARE,Comprehensive_Medical_Checkup }
extension SelectedOrderService on OrderService { extension SelectedOrderService on OrderService {
int getIdOrderService() { int getIdOrderService() {
@ -6,6 +6,13 @@ extension SelectedOrderService on OrderService {
case OrderService.AMBULANCE: case OrderService.AMBULANCE:
return 4; return 4;
break; break;
case OrderService.Comprehensive_Medical_Checkup:
return 3;
break;
case OrderService.HOME_HEALTH_CARE:
return 2;
break;
} }
return 4; return 4;
} }
@ -15,6 +22,12 @@ extension SelectedOrderService on OrderService {
case 4: case 4:
return OrderService.AMBULANCE; return OrderService.AMBULANCE;
break; break;
case 2:
return OrderService.HOME_HEALTH_CARE;
break;
case 3:
return OrderService.Comprehensive_Medical_Checkup;
break;
} }
return OrderService.AMBULANCE; return OrderService.AMBULANCE;

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

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hHC_all_pres_orders_request_model.dart';
@ -99,4 +100,16 @@ class CMCService extends BaseService {
super.error = error; super.error = error;
}, body: updatePresOrderRequestModel.toJson()); }, body: updatePresOrderRequestModel.toJson());
} }
Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) 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: order.toJson());
}
} }

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.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_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import '../base_service.dart'; import '../base_service.dart';
@ -68,8 +69,7 @@ class HomeHealthCareService extends BaseService {
}, body: body); }, body: body);
} }
Future updateHHCPresOrder( Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER, await baseAppClient.post(PATIENT_ER_UPDATE_PRES_ORDER,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
@ -79,4 +79,15 @@ class HomeHealthCareService extends BaseService {
super.error = error; super.error = error;
}, body: updatePresOrderRequestModel.toJson()); }, body: updatePresOrderRequestModel.toJson());
} }
Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) 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: order.toJson());
}
} }

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_get_items_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/get_cmc_service_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.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_request_model.dart';
@ -34,7 +36,7 @@ class CMCViewModel extends BaseViewModel {
.getCMCAllServices(); .getCMCAllServices();
CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: cmcAllServicesList[0].iD); CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: cmcAllServicesList[0].iD);
await getCheckupItems(cMCGetItemsRequestModel); await getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel,isFirst: true);
if (_cMCService.hasError) { if (_cMCService.hasError) {
error = _cMCService.error; error = _cMCService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -42,13 +44,16 @@ class CMCViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future getCheckupItems(CMCGetItemsRequestModel cMCGetItemsRequestModel) async { Future getCheckupItems({CMCGetItemsRequestModel cMCGetItemsRequestModel, bool isFirst = false}) async {
await _cMCService if(!isFirst)
.getCheckupItems(cMCGetItemsRequestModel); setState(ViewState.Busy);
await _cMCService.getCheckupItems(cMCGetItemsRequestModel);
if (_cMCService.hasError) { if (_cMCService.hasError) {
error = _cMCService.error; error = _cMCService.error;
setState(ViewState.Error); setState(ViewState.Error);
} }
if(!isFirst)
setState(ViewState.Idle);
} }
Future getCmcAllPresOrders() async { Future getCmcAllPresOrders() async {
@ -89,4 +94,17 @@ class CMCViewModel extends BaseViewModel {
await _cMCService await _cMCService
.getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel); .getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel);
} }
//TODO check it in uat
Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
setState(ViewState.Busy);
order.createdBy = user.patientID;
order.orderServiceID = OrderService.Comprehensive_Medical_Checkup.getIdOrderService();
await _cMCService.insertPresPresOrder(order: order);
if (_cMCService.hasError) {
error = _cMCService.error;
setState(ViewState.ErrorLocal);
} else {
getCmcAllPresOrders();
}
}
} }

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; 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_request_modle.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_response_model.dart';
@ -5,6 +6,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_model.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_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_order_detail_by_order_iD_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/home_health_care_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/home_health_care_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
@ -65,8 +67,7 @@ class HomeHealthCareViewModel extends BaseViewModel {
} }
} }
Future updateHHCPresOrder( Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _homeHealthCareService.updateHHCPresOrder( await _homeHealthCareService.updateHHCPresOrder(
updatePresOrderRequestModel); updatePresOrderRequestModel);
@ -78,6 +79,19 @@ class HomeHealthCareViewModel extends BaseViewModel {
} }
} }
Future insertPresPresOrder({PatientERInsertPresOrderRequestModel order}) async {
setState(ViewState.Busy);
order.createdBy = user.patientID;
order.orderServiceID = OrderService.HOME_HEALTH_CARE.getIdOrderService();
await _homeHealthCareService.insertPresPresOrder(order: order);
if (_homeHealthCareService.hasError) {
error = _homeHealthCareService.error;
setState(ViewState.ErrorLocal);
} else {
getHHCAllPresOrders();
}
}
} }

@ -4,14 +4,18 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_cancel_order_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/StepsWidget.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'new_cmc_step_one_page.dart'; import 'new_cmc_step_one_page.dart';
import 'new_cmc_step_three_page.dart';
import 'new_cmc_step_tow_page.dart';
class NewCMCPage extends StatefulWidget { class NewCMCPage extends StatefulWidget {
NewCMCPage({this.model}); NewCMCPage({this.model});
@ -27,7 +31,9 @@ class _NewCMCPageState extends State<NewCMCPage>
with TickerProviderStateMixin { with TickerProviderStateMixin {
PageController _controller; PageController _controller;
int _currentIndex = 1; int _currentIndex = 1;
int pageSelected = 2;
double _latitude;
double _longitude;
CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel; CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel;
@ -54,6 +60,18 @@ class _NewCMCPageState extends State<NewCMCPage>
: []); : []);
_controller = new PageController(); _controller = new PageController();
_getCurrentLocation();
}
_getCurrentLocation() async {
await getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
} }
@override @override
@ -94,216 +112,230 @@ class _NewCMCPageState extends State<NewCMCPage>
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.8, height: MediaQuery.of(context).size.height * 0.8,
child: PageView( child: Column(
physics: NeverScrollableScrollPhysics(), children: [
controller: _controller, Container(
onPageChanged: (index) { margin: EdgeInsets.only(left: MediaQuery.of(context).size.width*0.05, right: MediaQuery.of(context).size.width*0.05),
setState(() { child: StepsWidget(
_currentIndex = index; index: _currentIndex,
}); changeCurrentTab: changePageViewIndex,
}, ),
scrollDirection: Axis.horizontal, ),
children: <Widget>[ Expanded(
widget.model.cmcAllOrderDetail.length != 0 child: PageView(
? FractionallySizedBox( physics: NeverScrollableScrollPhysics(),
heightFactor: 0.8, controller: _controller,
widthFactor: 0.9, onPageChanged: (index) {
child: Container( setState(() {
width: double.infinity, _currentIndex = index;
margin: EdgeInsets.only(top: 15), });
decoration: BoxDecoration( },
border: scrollDirection: Axis.horizontal,
Border.all(color: Colors.grey, width: 1), children: <Widget>[
borderRadius: BorderRadius.circular(12), widget.model.cmcAllOrderDetail.length != 0
color: Colors.white), ? FractionallySizedBox(
child: Column( heightFactor: 0.8,
crossAxisAlignment: CrossAxisAlignment.start, widthFactor: 0.9,
children: [ child: Container(
SizedBox(
height: 12,
),
Container(
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only( margin: EdgeInsets.only(top: 15),
left: 15, bottom: 15, top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border( border:
bottom: BorderSide( Border.all(color: Colors.grey, width: 1),
color: Colors.grey, borderRadius: BorderRadius.circular(12),
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Colors.white),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Texts(
"Request ID",
bold: false,
fontSize: 13,
),
SizedBox( SizedBox(
height: 4, height: 12,
),
Texts(
widget.model.cmcAllOrderDetail[0].iD.toString(),
fontSize: 22,
), ),
], Container(
), width: double.infinity,
), padding: EdgeInsets.only(
Container( left: 15, bottom: 15, top: 15),
width: double.infinity, decoration: BoxDecoration(
padding: EdgeInsets.only( border: Border(
left: 15, bottom: 15, top: 15), bottom: BorderSide(
decoration: BoxDecoration( color: Colors.grey,
border: Border( width: 1.0,
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.cmcAllOrderDetail[0].iD.toString(),
fontSize: 22,
),
],
), ),
), ),
// borderRadius: BorderRadius.circular(12), Container(
color: Colors.white), width: double.infinity,
child: Column( padding: EdgeInsets.only(
crossAxisAlignment: left: 15, bottom: 15, top: 15),
CrossAxisAlignment.start, decoration: BoxDecoration(
children: [ border: Border(
Texts( bottom: BorderSide(
"Status", color: Colors.grey,
bold: false, width: 1.0,
fontSize: 13, ),
), ),
SizedBox( // borderRadius: BorderRadius.circular(12),
height: 4, color: Colors.white),
), child: Column(
Texts( crossAxisAlignment:
"Pending", CrossAxisAlignment.start,
fontSize: 22, children: [
Texts(
"Status",
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
"Pending",
fontSize: 22,
),
],
),
), ),
], Container(
), width: double.infinity,
), padding: EdgeInsets.only(
Container( left: 15, bottom: 15, top: 15),
width: double.infinity, decoration: BoxDecoration(
padding: EdgeInsets.only( border: Border(
left: 15, bottom: 15, top: 15), bottom: BorderSide(
decoration: BoxDecoration( color: Colors.grey,
border: Border( width: 1.0,
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.cmcAllOrderDetail[0]
.createdOn)),
fontSize: 22,
),
],
), ),
), ),
// borderRadius: BorderRadius.circular(12), Container(
color: Colors.white), width: double.infinity,
child: Column( padding: EdgeInsets.only(
crossAxisAlignment: left: 15, bottom: 15, top: 15),
CrossAxisAlignment.start, decoration: BoxDecoration(
children: [ border: Border(
Texts( bottom: BorderSide(
"Pickup Date", color: Colors.grey,
bold: false, width: 1.0,
fontSize: 13, ),
),
// 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.cmcAllOrderDetail[0].description
.toString() ??
widget.model.cmcAllOrderDetail[0]
.descriptionN
.toString(),
fontSize: 22,
),
],
),
), ),
SizedBox( SizedBox(
height: 4, height: 12,
),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(
widget.model.cmcAllOrderDetail[0]
.createdOn)),
fontSize: 22,
), ),
], Center(
), child: Container(
), width: MediaQuery
Container( .of(context)
width: double.infinity, .size
padding: EdgeInsets.only( .width *
left: 15, bottom: 15, top: 15), 0.85,
decoration: BoxDecoration( child: SecondaryButton(
border: Border( label: "Cancel".toUpperCase(),
bottom: BorderSide( onTap: () {
color: Colors.grey, showConfirmMessage(widget.model,
width: 1.0, widget.model.cmcAllOrderDetail[0]);
}
,
color: Colors.red[800],
disabled: false,
textColor: Theme
.of(context)
.backgroundColor),
), ),
), ),
// borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
"Service Name",
bold: false,
fontSize: 13,
),
SizedBox( SizedBox(
height: 4, height: 12,
),
Texts(
widget.model.cmcAllOrderDetail[0].description
.toString() ??
widget.model.cmcAllOrderDetail[0]
.descriptionN
.toString(),
fontSize: 22,
), ),
], ],
), ),
), ),
SizedBox( )
height: 12, : NewCMCStepOnePage(
), changePageViewIndex: changePageViewIndex,
Center( cMCInsertPresOrderRequestModel:
child: Container( cMCInsertPresOrderRequestModel,
width: MediaQuery model: widget.model,
.of(context) ),
.size NewCMCStepTowPage(
.width * longitude: _longitude,
0.85, latitude: _latitude,
child: SecondaryButton( changePageViewIndex: changePageViewIndex,
label: "Cancel".toUpperCase(), cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel,
onTap: () { model: widget.model,
showConfirmMessage(widget.model, ), NewCMCStepThreePage(
widget.model.cmcAllOrderDetail[0]); changePageViewIndex: changePageViewIndex,
} cmcInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel,
, model: widget.model,
color: Colors.red[800], ),
disabled: false, ],
textColor: Theme
.of(context)
.backgroundColor),
),
),
SizedBox(
height: 12,
),
],
),
), ),
)
: NewCMCStepOnePage(
changePageViewIndex: changePageViewIndex,
cMCInsertPresOrderRequestModel:
cMCInsertPresOrderRequestModel,
model: widget.model,
), ),
// NewEReferralStepTowPage(
// changePageViewIndex: changePageViewIndex,
// patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
//
// ),
// NewEReferralStepThreePage(
// changePageViewIndex: changePageViewIndex,
// patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
//
// ),
], ],
), ),
), ),

@ -20,12 +20,10 @@ class NewCMCStepOnePage extends StatefulWidget {
: super(key: key); : super(key: key);
@override @override
_NewCMCStepOnePageState createState() => _NewCMCStepOnePageState createState() => _NewCMCStepOnePageState();
_NewCMCStepOnePageState();
} }
class _NewCMCStepOnePageState class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
extends State<NewCMCStepOnePage> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -34,176 +32,200 @@ class _NewCMCStepOnePageState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: widget.model, baseViewModel: widget.model,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.all(12), margin: EdgeInsets.all(12),
child: Center( child: Center(
child: Column( child: Column(
children: [ children: [
FractionallySizedBox( FractionallySizedBox(
widthFactor: 0.94, widthFactor: 0.94,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 20, height: 20,
), ),
Texts( Texts(
// TranslationBase.of(context).advancePaymentLabel, "Select Home Health Care Services",
"Select Home Health Care Services", textAlign: TextAlign.center,
textAlign: TextAlign.center, ),
), Column(
Column( children:
children: widget.model.cmcAllServicesList.map(( widget.model.cmcAllServicesList.map((service) {
service) { return Container(
return Container( margin: EdgeInsets.only(top: 15),
margin: EdgeInsets.only(top: 15), decoration: BoxDecoration(
decoration: BoxDecoration( border:
border: Border.all(color: Colors.grey, width: 1),
Border.all(color: Colors.grey, width: 1), borderRadius: BorderRadius.circular(12),
borderRadius: BorderRadius.circular(12), color: Colors.white),
color: Colors.white), child: Column(
child: Column( children: [
children: [ Row(
Row( children: [
children: [ Radio(
Radio(
value: service.serviceID, value: service.serviceID,
activeColor: Colors.red[800], activeColor: Colors.red[800],
onChanged: (newValue) async { onChanged: (newValue) async {
PatientERCMCInsertServicesList patientERCMCInsertServicesList = PatientERCMCInsertServicesList
new PatientERCMCInsertServicesList( patientERCMCInsertServicesList =
price: service.price, new PatientERCMCInsertServicesList(
serviceID: service.serviceID price: service.price,
.toString(), serviceID: service.serviceID
selectedServiceName: service .toString(),
.description, selectedServiceName:
selectedServiceNameAR: service.description,
service.description, selectedServiceNameAR:
recordID: 1, service.description,
totalPrice: service.totalPrice, recordID: 1,
vAT: service.vAT); totalPrice:
service.totalPrice,
vAT: service.vAT);
setState(() { setState(() {
widget widget
.cMCInsertPresOrderRequestModel .cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList = .patientERCMCInsertServicesList = [
[patientERCMCInsertServicesList]; patientERCMCInsertServicesList
];
}); });
CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel (checkupType:newValue ); CMCGetItemsRequestModel
await widget.model.getCheckupItems(cMCGetItemsRequestModel); cMCGetItemsRequestModel =
new CMCGetItemsRequestModel(
checkupType: newValue);
await widget.model.getCheckupItems(
cMCGetItemsRequestModel:
cMCGetItemsRequestModel);
}, },
groupValue: widget groupValue: widget
.cMCInsertPresOrderRequestModel .cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList.length >0?int.parse(widget .patientERCMCInsertServicesList
.cMCInsertPresOrderRequestModel .length >
.patientERCMCInsertServicesList[0] 0
.serviceID):1), ? int.parse(widget
Expanded( .cMCInsertPresOrderRequestModel
child: Padding( .patientERCMCInsertServicesList[
padding: const EdgeInsets.all(20.0), 0]
child: Texts( .serviceID)
service.description, : 1),
fontSize: 15, Expanded(
), child: Padding(
padding: const EdgeInsets.all(20.0),
child: Texts(
service.description,
fontSize: 15,
), ),
), ),
],
),
],
),
);
}).toList(),
),
],
),
),
SizedBox(height: 30,),
Container(
color: Colors.white,
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: widget.model.checkupItems.map((item) {
return Center(
child: FractionallySizedBox(
widthFactor: 0.8,
child: Container(
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: 5, top: 5),
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(
item.itemName,
fontSize: 15,
),
],
),
),
SizedBox(
height: 12,
), ),
], ],
), ),
), ],
), ),
); );
}).toList()), }).toList(),
) ),
], ],
), ),
),
SizedBox(
height: 30,
),
Container(
color: Colors.white,
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: widget.model.checkupItems.map((item) {
return Center(
child: FractionallySizedBox(
widthFactor: 1,
child: Container(
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15, bottom: 5, top: 5),
decoration: BoxDecoration(
border: BorderDirectional(
bottom: BorderSide(
style: BorderStyle.solid,
width: 0.5,
color: Colors.grey)),
//borderRadius: ,
color: Colors.white),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
item.itemName,
fontSize: 15,
),
],
),
),
SizedBox(
height: 12,
),
],
),
),
),
);
}).toList()),
)
],
), ),
), ),
), ),
bottomSheet:Container( ),
height: MediaQuery.of(context).size.height * 0.10, bottomSheet: Container(
width: double.infinity, height: MediaQuery.of(context).size.height * 0.10,
child: Column( width: double.infinity,
children: <Widget>[ child: Column(
Container( children: <Widget>[
width: MediaQuery Container(
.of(context) width: MediaQuery.of(context).size.width * 0.9,
.size child: SecondaryButton(
.width * 0.9, label: "Next",
child: SecondaryButton( textColor: Theme.of(context).backgroundColor,
label: "Next", onTap: () {
// disabled: this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length ==0, if (widget.cMCInsertPresOrderRequestModel.patientERCMCInsertServicesList.length = null) {
textColor: Theme int index = widget.model.cmcAllServicesList.length;
.of(context) PatientERCMCInsertServicesList
.backgroundColor), patientERCMCInsertServicesList =
), new PatientERCMCInsertServicesList(
], price: widget.model.cmcAllServicesList[index-1].price,
), serviceID: widget.model.cmcAllServicesList[index-1].serviceID.toString(),
)); selectedServiceName: widget.model.cmcAllServicesList[index-1].description,
} selectedServiceNameAR: widget.model.cmcAllServicesList[index-1].description,
recordID: 1,
totalPrice: widget.model.cmcAllServicesList[index-1].totalPrice,
vAT: widget.model.cmcAllServicesList[index-1].vAT);
widget.cMCInsertPresOrderRequestModel
.patientERCMCInsertServicesList = [
patientERCMCInsertServicesList
];
widget.changePageViewIndex(1);
}
},
),
),
],
),
),
);
}
} }

@ -0,0 +1,165 @@
import 'dart:async';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
class NewCMCStepThreePage extends StatefulWidget {
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
final Function changePageViewIndex;
final CMCViewModel model;
NewCMCStepThreePage(
{Key key,
this.changePageViewIndex,
this.model,
this.cmcInsertPresOrderRequestModel});
@override
_NewCMCStepThreePageState createState() =>
_NewCMCStepThreePageState();
}
class _NewCMCStepThreePageState
extends State<NewCMCStepThreePage> {
Completer<GoogleMapController> _controller = Completer();
static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
final Set<Marker> markers = new Set();
@override
void initState() {
if (widget.cmcInsertPresOrderRequestModel.latitude != null) {
markers.clear();
markers.add(
Marker(
markerId: MarkerId(
widget.cmcInsertPresOrderRequestModel.latitude.hashCode
.toString(),
),
position: LatLng(
widget.cmcInsertPresOrderRequestModel.latitude,
widget.cmcInsertPresOrderRequestModel.longitude)),
);
_kGooglePlex = CameraPosition(
target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude,
widget.cmcInsertPresOrderRequestModel.longitude),
zoom: 14.4746,
);
}
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowDecPage: false,
baseViewModel: widget.model,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
height: 400,
width: double.maxFinite,
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Order Details'),
SizedBox(
height: 12,
),
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12)),
padding: EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Location :'),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
height: 200,
child: GoogleMap(
mapType: MapType.normal,
markers: markers,
initialCameraPosition: _kGooglePlex,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
),
),
),
SizedBox(
height: 12,
),
Texts('Selected Service :'),
...List.generate(
widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length,
(index) => Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
'Service Name :',
fontSize: 12,
),
SizedBox(
height: 5,
),
Texts(
widget
.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index]
.selectedServiceName,
fontSize: 15,
bold: true,
),
],
),
),
)
],
),
)
],
),
),
),
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(
label: "Confirm",
onTap: () async {
await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel);
if (widget.model.state != ViewState.ErrorLocal) {
widget.changePageViewIndex(0);
}
},
textColor: Theme.of(context).backgroundColor),
),
],
),
),
);
}
}

@ -0,0 +1,113 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.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/app_scaffold_widget.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 NewCMCStepTowPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
final double longitude;
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
final Function changePageViewIndex;
final CMCViewModel model;
const NewCMCStepTowPage(
{Key key,
this.onPick,
this.latitude,
this.longitude,
this.cmcInsertPresOrderRequestModel,
this.changePageViewIndex,
this.model})
: super(key: key);
@override
_NewCMCStepTowPageState createState() =>
_NewCMCStepTowPageState();
}
class _NewCMCStepTowPageState
extends State<NewCMCStepTowPage> {
double latitude = 0;
double longitude = 0;
@override
void initState() {
if (widget.cmcInsertPresOrderRequestModel.latitude == null) {
latitude = widget.latitude;
longitude = widget.longitude;
} else {
latitude = widget.cmcInsertPresOrderRequestModel.latitude;
longitude = widget.cmcInsertPresOrderRequestModel.longitude;
}
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
widget.changePageViewIndex(3);
},
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: () {
setState(() {
widget.cmcInsertPresOrderRequestModel
.latitude =
selectedPlace.geometry.location.lat;
widget.cmcInsertPresOrderRequestModel
.longitude =
selectedPlace.geometry.location.lng;
});
widget.changePageViewIndex(3);
},
label: TranslationBase.of(context).next,
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: true,
),
);
}
}

@ -6,8 +6,11 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/pickupLocation/PickupLocationFromMap.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:google_maps_place_picker/google_maps_place_picker.dart';
class NewHomeHealthCareStepOnePage extends StatefulWidget { class NewHomeHealthCareStepOnePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel final PatientERInsertPresOrderRequestModel
@ -27,135 +30,148 @@ class NewHomeHealthCareStepOnePage extends StatefulWidget {
_NewHomeHealthCareStepOnePageState(); _NewHomeHealthCareStepOnePageState();
} }
class _NewHomeHealthCareStepOnePageState class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOnePage> {
extends State<NewHomeHealthCareStepOnePage> {
@override
void initState() {
if(widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList==null)
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = [];
PickResult _result;
@override
void initState() {
if (widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList == null)
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList = [];
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: widget.model, baseViewModel: widget.model,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width * 0.05, left: MediaQuery.of(context).size.width * 0.05,
right: MediaQuery.of(context).size.width * 0.05), right: MediaQuery.of(context).size.width * 0.05),
child: Center( child: Center(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 1, widthFactor: 1,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 12, height: 12,
), ),
Texts( Texts(
"Select Home Health Care Services", "Select Home Health Care Services",
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
Column( Column(
children: widget.model.hhcAllServicesList.map((service) { children: widget.model.hhcAllServicesList.map((service) {
return Container( return Container(
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 1), border: Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
color: Colors.white), color: Colors.white),
child: Column( child: Column(
children: [ children: [
Row( Row(
children: [ children: [
Checkbox( Checkbox(
value: isServiceSelected( value: isServiceSelected(service.serviceID),
service.serviceID), activeColor: Colors.red[800],
activeColor: Colors.black38, onChanged: (bool newValue) {
onChanged: (bool newValue) { setState(() {
setState(() { if (!isServiceSelected(
if(!isServiceSelected(service.serviceID)) service.serviceID))
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add( PatientERHHCInsertServicesList( widget
recordID:widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length, .patientERInsertPresOrderRequestModel
serviceID: service.serviceID, .patientERHHCInsertServicesList
serviceName: service.description)); .add(PatientERHHCInsertServicesList(
else recordID: widget
removeSelected(service.serviceID); .patientERInsertPresOrderRequestModel
// widget.patientERInsertPresOrderRequestModel .patientERHHCInsertServicesList
// isPatientInsured = newValue; .length,
}); serviceID: service.serviceID,
}), serviceName:
Expanded( service.description));
child: Padding( else
padding: const EdgeInsets.all(20.0), removeSelected(service.serviceID);
child: Texts( // widget.patientERInsertPresOrderRequestModel
service.description, // isPatientInsured = newValue;
fontSize: 15, });
), }),
Expanded(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: Texts(
service.description,
fontSize: 15,
), ),
), ),
], ),
), ],
], ),
), ],
); ),
}).toList(), );
) }).toList(),
], )
), ],
), ),
), ),
), ),
), ),
bottomSheet: Container( ),
height: MediaQuery.of(context).size.height * 0.10, bottomSheet: Container(
width: double.infinity, height: MediaQuery.of(context).size.height * 0.10,
child: Column( width: double.infinity,
children: <Widget>[ child: Column(
Container( children: <Widget>[
width: MediaQuery.of(context).size.width * 0.9, Container(
child: SecondaryButton( width: MediaQuery.of(context).size.width * 0.9,
label: "Next", child: SecondaryButton(
disabled: this label: "Next",
.widget disabled: this
.patientERInsertPresOrderRequestModel .widget
.patientERHHCInsertServicesList .patientERInsertPresOrderRequestModel
.length == .patientERHHCInsertServicesList
0, .length == 0,
textColor: Theme.of(context).backgroundColor), onTap: (){
), widget.changePageViewIndex(1);
], },
), textColor: Theme.of(context).backgroundColor),
)); ),
],
),
),
);
} }
isServiceSelected(int serviceId) { isServiceSelected(int serviceId) {
Iterable <PatientERHHCInsertServicesList> patientERHHCInsertServicesList = widget Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList widget
.where((element) => serviceId == element.serviceID); .patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
if(patientERHHCInsertServicesList.length > 0) { .where((element) => serviceId == element.serviceID);
return true; if (patientERHHCInsertServicesList.length > 0) {
} return true;
return false; }
return false;
} }
removeSelected(int serviceId){ removeSelected(int serviceId) {
Iterable <PatientERHHCInsertServicesList> patientERHHCInsertServicesList = widget Iterable<PatientERHHCInsertServicesList> patientERHHCInsertServicesList =
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList widget
.where((element) => serviceId == element.serviceID); .patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.where((element) => serviceId == element.serviceID);
if(patientERHHCInsertServicesList.length > 0) if (patientERHHCInsertServicesList.length > 0)
setState(() { setState(() {
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.remove(patientERHHCInsertServicesList); widget
.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList
.remove(patientERHHCInsertServicesList.first);
}); });
} }
} }

@ -0,0 +1,172 @@
import 'dart:async';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.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:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
class NewHomeHealthCareStepThreePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel
patientERInsertPresOrderRequestModel;
final Function changePageViewIndex;
final HomeHealthCareViewModel model;
NewHomeHealthCareStepThreePage(
{Key key,
this.patientERInsertPresOrderRequestModel,
this.changePageViewIndex,
this.model});
@override
_NewHomeHealthCareStepThreePageState createState() =>
_NewHomeHealthCareStepThreePageState();
}
class _NewHomeHealthCareStepThreePageState
extends State<NewHomeHealthCareStepThreePage> {
Completer<GoogleMapController> _controller = Completer();
static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
final Set<Marker> markers = new Set();
@override
void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude != null) {
markers.clear();
markers.add(
Marker(
markerId: MarkerId(
widget.patientERInsertPresOrderRequestModel.latitude.hashCode
.toString(),
),
position: LatLng(
widget.patientERInsertPresOrderRequestModel.latitude,
widget.patientERInsertPresOrderRequestModel.longitude)),
);
_kGooglePlex = CameraPosition(
target: LatLng(widget.patientERInsertPresOrderRequestModel.latitude,
widget.patientERInsertPresOrderRequestModel.longitude),
zoom: 14.4746,
);
}
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowDecPage: false,
baseViewModel: widget.model,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
width: double.maxFinite,
margin: EdgeInsets.only(left: 12, right: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Order Details'),
SizedBox(
height: 12,
),
Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12)),
padding: EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts('Location :'),
SizedBox(
height: 12,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
height: 200,
child: GoogleMap(
mapType: MapType.normal,
markers: markers,
initialCameraPosition: _kGooglePlex,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
),
),
),
SizedBox(
height: 12,
),
Texts('Selected Service :'),
...List.generate(
widget.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList.length,
(index) => Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
'Service Name :',
fontSize: 12,
),
SizedBox(
height: 5,
),
Texts(
widget
.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList[index]
.serviceName,
fontSize: 15,
bold: true,
),
],
),
),
)
],
),
),
SizedBox(
height: 57,
),
],
),
),
),
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(
label: "Confirm",
disabled: widget.patientERInsertPresOrderRequestModel
.patientERHHCInsertServicesList.length ==
0,
onTap: () async {
await widget.model.insertPresPresOrder(
order: widget.patientERInsertPresOrderRequestModel);
if (widget.model.state != ViewState.ErrorLocal) {
widget.changePageViewIndex(0);
}
},
textColor: Theme.of(context).backgroundColor),
),
],
),
),
);
}
}

@ -0,0 +1,112 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.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/app_scaffold_widget.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 NewHomeHealthCareStepTowPage extends StatefulWidget {
final Function(PickResult) onPick;
final double latitude;
final double longitude;
final PatientERInsertPresOrderRequestModel
patientERInsertPresOrderRequestModel;
final Function changePageViewIndex;
final HomeHealthCareViewModel model;
const NewHomeHealthCareStepTowPage(
{Key key,
this.onPick,
this.latitude,
this.longitude,
this.patientERInsertPresOrderRequestModel,
this.changePageViewIndex,
this.model})
: super(key: key);
@override
_NewHomeHealthCareStepTowPageState createState() =>
_NewHomeHealthCareStepTowPageState();
}
class _NewHomeHealthCareStepTowPageState
extends State<NewHomeHealthCareStepTowPage> {
double latitude = 0;
double longitude = 0;
@override
void initState() {
if (widget.patientERInsertPresOrderRequestModel.latitude == null) {
latitude = widget.latitude;
longitude = widget.longitude;
} else {
latitude = widget.patientERInsertPresOrderRequestModel.latitude;
longitude = widget.patientERInsertPresOrderRequestModel.longitude;
}
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
body: PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
onPlacePicked: (PickResult result) {
print(result.adrAddress);
widget.changePageViewIndex(3);
},
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: () {
setState(() {
widget.patientERInsertPresOrderRequestModel
.latitude =
selectedPlace.geometry.location.lat;
widget.patientERInsertPresOrderRequestModel
.longitude =
selectedPlace.geometry.location.lng;
});
widget.changePageViewIndex(3);
},
label: TranslationBase.of(context).next,
),
),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: true,
),
);
}
}

@ -4,12 +4,15 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/Dialog/confirm_cancel_order_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import '../StepsWidget.dart'; import '../StepsWidget.dart';
import 'new_Home_health_care_step_one_page.dart'; import 'new_Home_health_care_step_one_page.dart';
@ -18,7 +21,6 @@ class NewHomeHealthCarePage extends StatefulWidget {
NewHomeHealthCarePage({this.model}); NewHomeHealthCarePage({this.model});
final HomeHealthCareViewModel model; final HomeHealthCareViewModel model;
@override @override
_NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState(); _NewHomeHealthCarePageState createState() => _NewHomeHealthCarePageState();
} }
@ -27,7 +29,8 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
with TickerProviderStateMixin { with TickerProviderStateMixin {
PageController _controller; PageController _controller;
int _currentIndex = 1; int _currentIndex = 1;
int pageSelected = 2; double _latitude;
double _longitude;
PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel = PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel =
new PatientERInsertPresOrderRequestModel(); new PatientERInsertPresOrderRequestModel();
@ -36,8 +39,19 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
void initState() { void initState() {
super.initState(); super.initState();
_controller = new PageController(); _controller = new PageController();
_getCurrentLocation();
} }
_getCurrentLocation() async {
await getLastKnownPosition().then((value) {
_latitude = value.latitude;
_longitude = value.longitude;
}).catchError((e) {
_longitude = 0;
_latitude = 0;
});
}
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
@ -285,6 +299,18 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage>
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
model: widget.model, model: widget.model,
), ),
NewHomeHealthCareStepTowPage(
latitude: _latitude,
longitude: _longitude,
changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
model: widget.model,
),
NewHomeHealthCareStepThreePage(
changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,
model: widget.model,
)
], ],
), ),

@ -13,7 +13,7 @@ class StepsWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return projectViewModel.isArabic? Stack( return !projectViewModel.isArabic? Stack(
children: [ children: [
Container( Container(
height: 50, height: 50,

@ -63,7 +63,6 @@ class _PickupLocationState extends State<PickupLocation> {
_longitude = 0; _longitude = 0;
_latitude = 0; _latitude = 0;
}); });
// currentLocation = LatLng(position.latitude, position.longitude);
} }
@override @override
@ -364,7 +363,6 @@ class _PickupLocationState extends State<PickupLocation> {
), ),
], ],
), ),
//TODO show dialog projects
SizedBox( SizedBox(
height: 45, height: 45,

@ -123,25 +123,25 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
AppGlobal.context = context; AppGlobal.context = context;
}); });
_requestIOSPermissions(); _requestIOSPermissions();
pageController = PageController(keepPage: true); pageController = PageController(keepPage: true);
_firebaseMessaging.setAutoInitEnabled(true); // _firebaseMessaging.setAutoInitEnabled(true);
//
if (Platform.isIOS) { // if (Platform.isIOS) {
_firebaseMessaging.requestNotificationPermissions(); // _firebaseMessaging.requestNotificationPermissions();
} // }
//
_firebaseMessaging.getToken().then((String token) { // _firebaseMessaging.getToken().then((String token) {
sharedPref.setString(PUSH_TOKEN, token); // sharedPref.setString(PUSH_TOKEN, token);
if (token != null) { // if (token != null) {
checkUserStatus(token); // checkUserStatus(token);
} // }
requestPermissions(); // requestPermissions();
}).catchError((err) { // }).catchError((err) {
print(err); // print(err);
}); // });
//_firebase Background message handler //_firebase Background message handler
_firebaseMessaging.configure( // _firebaseMessaging.configure(
// onMessage: (Map<String, dynamic> message) async { // onMessage: (Map<String, dynamic> message) async {
// showDialog("onMessage: $message"); // showDialog("onMessage: $message");
// print("onMessage: $message"); // print("onMessage: $message");
@ -254,7 +254,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// print("Is Call Not Found iOS"); // print("Is Call Not Found iOS");
// } // }
// }, // },
); // );
} }
showDialogs(String message) { showDialogs(String message) {

@ -34,9 +34,10 @@ class PickupLocationFromMap extends StatelessWidget {
body: PlacePicker( body: PlacePicker(
apiKey: GOOGLE_API_KEY, apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true, enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteLanguage: projectViewModel.currentLanguage, autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true, enableMapTypeButton: true,
selectInitialPosition: true,
onPlacePicked: (PickResult result) { onPlacePicked: (PickResult result) {
print(result.adrAddress); print(result.adrAddress);
onPick(result); onPick(result);

@ -75,6 +75,8 @@ dependencies:
# charts # charts
charts_flutter: ^0.9.0 charts_flutter: ^0.9.0
google_maps_flutter: ^1.0.3
# Qr code Scanner TODO fix it # Qr code Scanner TODO fix it
#barcode_scan: ^3.0.1 #barcode_scan: ^3.0.1

Loading…
Cancel
Save