Merge branch 'sultan_new_design' into 'development_new_design_2.0'

Sultan new design

See merge request Cloud_Solution/diplomatic-quarter!410
merge-update-with-lab-changes
Sultan khan 4 years ago
commit d3f564b896

@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products';
const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_CUSTOMER = '/api/customers';
const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
const PACKAGES_ORDERS = '/api/orders'; const PACKAGES_ORDERS = '/api/orders';
// const BASE_URL = 'https://uat.hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';

@ -20,6 +20,7 @@ class HomeHealthCareService extends BaseService {
dynamic hhcResponse; dynamic hhcResponse;
bool isOrderUpdated; bool isOrderUpdated;
CustomerInfo customerInfo; CustomerInfo customerInfo;
int requestNo;
Future getHHCAllServices(HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async { Future getHHCAllServices(HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async {
hasError = false; hasError = false;
await baseAppClient.post(HHC_GET_ALL_SERVICES, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(HHC_GET_ALL_SERVICES, onSuccess: (dynamic response, int statusCode) {
@ -77,6 +78,7 @@ class HomeHealthCareService extends BaseService {
hasError = false; hasError = false;
await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, onSuccess: (dynamic response, int statusCode) {
hhcResponse = response; hhcResponse = response;
requestNo = response['RequestNo'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -32,6 +32,7 @@ class HomeHealthCareViewModel extends BaseViewModel {
bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated; bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated;
int get orderId => _homeHealthCareService.requestNo;
GetHHCAllPresOrdersResponseModel pendingOrder; GetHHCAllPresOrdersResponseModel pendingOrder;
List<PatientERHHCInsertServicesList> patientERHHCInsertServicesList = List(); List<PatientERHHCInsertServicesList> patientERHHCInsertServicesList = List();
@ -112,8 +113,8 @@ class HomeHealthCareViewModel extends BaseViewModel {
// await _customerAddressesService.getCustomerInfo(); // await _customerAddressesService.getCustomerInfo();
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await _pharmacyModuleService.createUser(); // await _pharmacyModuleService.createUser();
// await _customerAddressesService.getCustomerInfo(); await _customerAddressesService.getCustomerInfo();
await getCustomerAddresses(); await getCustomerAddresses();
} }
} }

@ -107,15 +107,15 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
// if (widget.model.state == ViewState.ErrorLocal) { // if (widget.model.state == ViewState.ErrorLocal) {
// Utils.showErrorToast(); // Utils.showErrorToast();
// } else { // } else {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: NewHomeHealthCareStepTowPage( page: NewHomeHealthCareStepTowPage(
patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel, patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel,
model: widget.model, model: widget.model,
),
), ),
); ),
);
// } // }
}, },
disabledColor: Color(0xff575757), disabledColor: Color(0xff575757),

@ -15,6 +15,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
class NewHomeHealthCareStepThreePage extends StatefulWidget { class NewHomeHealthCareStepThreePage extends StatefulWidget {
final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel; final PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel;
@ -169,15 +171,18 @@ class _NewHomeHealthCareStepThreePageState extends State<NewHomeHealthCareStepTh
TranslationBase.of(context).confirm, TranslationBase.of(context).confirm,
() { () {
widget.model.setState(ViewState.Busy); widget.model.setState(ViewState.Busy);
widget.model.insertPresPresOrder(order: widget.patientERInsertPresOrderRequestModel).then((value) => { widget.model.insertPresPresOrder(order: widget.patientERInsertPresOrderRequestModel).then((value) {
widget.model.setState(ViewState.Idle), widget.model.setState(ViewState.Idle);
Navigator.push( if (widget.model.orderId != null) {
context, showCMCConfirmDialog(
FadePage( context,
page: HomeHealthCarePage(), widget.model.orderId.toString(),
), onClick: () {
) Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: HomeHealthCarePage));
}); },
);
}
});
}, },
color: CustomColors.green, color: CustomColors.green,
), ),

@ -72,8 +72,9 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
child: ConfirmCancelOrderDialog( child: ConfirmCancelOrderDialog(
model: model, model: model,
onTap: () async { onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.presOrderID, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
model.setState(ViewState.Busy); model.setState(ViewState.Busy);
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.presOrderID, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
await model.updateHHCPresOrder(updatePresOrderRequestModel); await model.updateHHCPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
@ -107,61 +108,59 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
children: <Widget>[ children: <Widget>[
widget.model.pendingOrder != null widget.model.pendingOrder != null
? FractionallySizedBox( ? ListView(padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), children: [
widthFactor: 0.9, (Container(
child: SingleChildScrollView( decoration: BoxDecoration(
child: Container( color: Color(0xffCC9B14),
// margin: EdgeInsets.all(10), borderRadius: BorderRadius.all(
child: Container( Radius.circular(10.0),
width: double.infinity, ),
padding: EdgeInsets.only(left: 12, right: 12, top: 12), boxShadow: [
child: Card( BoxShadow(
shape: cardRadius(12), color: Color(0xff000000).withOpacity(.05),
elevation: 2, blurRadius: 27,
margin: EdgeInsets.zero, offset: Offset(0, -3),
color: Color(0xffcd9e1b), ),
clipBehavior: Clip.antiAlias, ],
child: Container( ),
// decoration: containerColorRadiusLeft(Colors.white, 12), child: Container(
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0), // decoration: containerColorRadiusLeft(Colors.white, 12),
padding: EdgeInsets.all(12), margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
// color: Colors.white, padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, color: Colors.white,
color: Colors.white, border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0),
bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0), bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero, topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0),
), ),
), ),
// clipBehavior: Clip.antiAlias, // clipBehavior: Clip.antiAlias,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Text(
child: Column( (projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description),
mainAxisAlignment: MainAxisAlignment.start, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffCC9B14), letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 6),
Text(
'${TranslationBase.of(context).requestID}: ${widget.model.pendingOrder.iD.toString()}',
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).OrderStatus + TranslationBase.of(context).serviceName + ": ",
' ' + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
(projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description),
bold: false,
fontSize: 12,
color: Color(0xffcd9e1b),
fontWeight: FontWeight.bold,
),
Texts(
TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(),
fontWeight: FontWeight.w600,
fontSize: 18,
),
Texts(
TranslationBase.of(context).serviceName,
fontSize: 12,
fontWeight: FontWeight.w600,
), ),
...List.generate( ...List.generate(
widget.model.hhcAllOrderDetail.length, widget.model.hhcAllOrderDetail.length,
@ -172,29 +171,135 @@ class _NewHomeHealthCarePageState extends State<NewHomeHealthCarePage> with Tick
bold: false, bold: false,
), ),
), ),
), )
], ],
)), )
Column( ],
children: [ ),
Texts( ),
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)), Column(
fontSize: 14, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)),
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
),
SizedBox(height: 12),
if (widget.model.pendingOrder.status == 1 || widget.model.pendingOrder.status == 2)
InkWell(
onTap: () {
showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration(
color: Color(0xffD02127),
border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(10),
), ),
mHeight(8), child: Text(
// SecondaryButton( TranslationBase.of(context).cancel_nocaps,
// onTap: () { style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
// showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]); ),
// }, ),
// label: TranslationBase.of(context).cancel,
// color: Colors.red[900],
// small: true,
// )
],
), ),
], ],
))), ),
)))) ],
),
),
))
])
// FractionallySizedBox(
// widthFactor: 0.9,
// child: SingleChildScrollView(
// child: Container(
// // margin: EdgeInsets.all(10),
// child: Container(
// width: double.infinity,
// padding: EdgeInsets.only(left: 12, right: 12, top: 12),
// child: Card(
// shape: cardRadius(12),
// elevation: 2,
// margin: EdgeInsets.zero,
// color: Color(0xffcd9e1b),
// clipBehavior: Clip.antiAlias,
// child: Container(
// // decoration: containerColorRadiusLeft(Colors.white, 12),
// margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0),
// padding: EdgeInsets.all(12),
// // color: Colors.white,
// decoration: BoxDecoration(
// shape: BoxShape.rectangle,
// color: Colors.white,
// borderRadius: BorderRadius.only(
// topLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
// topRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
// bottomLeft: projectViewModel.isArabic ? Radius.zero : Radius.circular(12.0),
// bottomRight: projectViewModel.isArabic ? Radius.circular(12.0) : Radius.zero,
// ),
// ),
// // clipBehavior: Clip.antiAlias,
// child: Row(
// children: [
// Expanded(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Texts(
// TranslationBase.of(context).OrderStatus +
// ' ' +
// (projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description),
// bold: false,
// fontSize: 12,
// color: Color(0xffcd9e1b),
// fontWeight: FontWeight.bold,
// ),
// Texts(
// TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(),
// fontWeight: FontWeight.w600,
// fontSize: 18,
// ),
// Texts(
// TranslationBase.of(context).serviceName,
// fontSize: 12,
// fontWeight: FontWeight.w600,
// ),
// ...List.generate(
// widget.model.hhcAllOrderDetail.length,
// (index) => Container(
// child: Texts(
// projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description.capitalize(),
// fontSize: 13,
// bold: false,
// ),
// ),
// ),
// ],
// )),
// Column(
// children: [
// Texts(
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)),
// fontSize: 14,
// ),
// mHeight(8),
// // SecondaryButton(
// // onTap: () {
// // showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]);
// // },
// // label: TranslationBase.of(context).cancel,
// // color: Colors.red[900],
// // small: true,
// // )
// ],
// ),
// ],
// ))),
// ))))
: NewHomeHealthCareStepOnePage( : NewHomeHealthCareStepOnePage(
changePageViewIndex: _changeCurrentTab, changePageViewIndex: _changeCurrentTab,
patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel,

@ -14,6 +14,8 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
class RRTPlaceOrderPage extends StatelessWidget { class RRTPlaceOrderPage extends StatelessWidget {
TranslationBase localize; TranslationBase localize;

Loading…
Cancel
Save