Merge branch 'mirza_home_page' into development_new_design_2.0

merge-requests/390/head
Mirza.Shafique 4 years ago
commit a67c5afcfb

@ -23,12 +23,9 @@ class CMCService extends BaseService {
bool isOrderUpdated;
Future getCMCAllServices() async {
GetCMCServicesRequestModel getCMCServicesRequestModel= new GetCMCServicesRequestModel(genderID: user.gender, identificationNo: user.patientIdentificationNo);
GetCMCServicesRequestModel getCMCServicesRequestModel = new GetCMCServicesRequestModel(genderID: user.gender, identificationNo: user.patientIdentificationNo);
hasError = false;
await baseAppClient.post(HHC_GET_ALL_CMC_SERVICES,
onSuccess: (dynamic response, int statusCode) {
await baseAppClient.post(HHC_GET_ALL_CMC_SERVICES, onSuccess: (dynamic response, int statusCode) {
cmcAllServicesList.clear();
response['PatientER_CMC_GetAllServicesList'].forEach((data) {
cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data));
@ -39,79 +36,67 @@ class CMCService extends BaseService {
}, body: getCMCServicesRequestModel.toJson());
}
Future getCmcAllPresOrders() async {
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel= GetHHCAllPresOrdersRequestModel();
GetHHCAllPresOrdersRequestModel getHHCAllPresOrdersRequestModel = GetHHCAllPresOrdersRequestModel();
hasError = false;
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS,
onSuccess: (dynamic response, int statusCode) {
cmcAllPresOrdersList.clear();
cmcAllOrderDetail.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((data) {
if (data['ServiceID'] == OrderService.Comprehensive_Medical_Checkup.getIdOrderService())
cmcAllPresOrdersList
.add(GetHHCAllPresOrdersResponseModel.fromJson(data));
await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS, onSuccess: (dynamic response, int statusCode) {
cmcAllPresOrdersList.clear();
cmcAllOrderDetail.clear();
response['PatientER_GetPatientAllPresOrdersList'].forEach((data) {
if (data['ServiceID'] == OrderService.Comprehensive_Medical_Checkup.getIdOrderService()) cmcAllPresOrdersList.add(GetHHCAllPresOrdersResponseModel.fromJson(data));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getHHCAllPresOrdersRequestModel.toJson());
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getHHCAllPresOrdersRequestModel.toJson());
}
Future getOrderDetailByOrderID(GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel) async {
hasError = false;
await baseAppClient.post(GET_CMC_ORDER_DETAIL_BY_ID,
onSuccess: (dynamic response, int statusCode) {
cmcAllOrderDetail.clear();
response['PatientER_CMC_GetTransactionsForOrderList'].forEach((data) {
cmcAllOrderDetail.add(GetOrderDetailByOrderIDResponseModel.fromJson(data));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getOrderDetailByOrderIDRequestModel.toJson());
await baseAppClient.post(GET_CMC_ORDER_DETAIL_BY_ID, onSuccess: (dynamic response, int statusCode) {
cmcAllOrderDetail.clear();
response['PatientER_CMC_GetTransactionsForOrderList'].forEach((data) {
cmcAllOrderDetail.add(GetOrderDetailByOrderIDResponseModel.fromJson(data));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: getOrderDetailByOrderIDRequestModel.toJson());
}
Future getCheckupItems(CMCGetItemsRequestModel cMCGetItemsRequestModel) async {
hasError = false;
await baseAppClient.post(GET_CHECK_UP_ITEMS,
onSuccess: (dynamic response, int statusCode) {
checkupItemsList.clear();
response['GetCheckUpItemsList'].forEach((data) {
checkupItemsList.add(CMCGetItemsResponseModel.fromJson(data));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: cMCGetItemsRequestModel.toJson());
await baseAppClient.post(GET_CHECK_UP_ITEMS, onSuccess: (dynamic response, int statusCode) {
checkupItemsList.clear();
response['GetCheckUpItemsList'].forEach((data) {
checkupItemsList.add(CMCGetItemsResponseModel.fromJson(data));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: cMCGetItemsRequestModel.toJson());
}
Future updateCmcPresOrder(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());
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());
}
Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
Future<String> insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
hasError = false;
await baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER,
onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: order.toJson());
String reqId="";
await baseAppClient.post(PATIENT_ER_INSERT_PRES_ORDER, onSuccess: (dynamic response, int statusCode) {
isOrderUpdated = true;
reqId=response['RequestNo'].toString();
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: order.toJson());
return reqId;
}
}

@ -17,34 +17,28 @@ import '../../../locator.dart';
import 'add_new_address_Request_Model.dart';
class CMCViewModel extends BaseViewModel {
CMCService _cMCService =
locator<CMCService>();
CustomerAddressesService _customerAddressesService =
locator<CustomerAddressesService>();
List<AddressInfo> get addressesList =>
_customerAddressesService.addressesList;
List<GetCMCServicesResponseModel> get cmcAllServicesList =>
CMCService _cMCService = locator<CMCService>();
CustomerAddressesService _customerAddressesService = locator<CustomerAddressesService>();
_cMCService.cmcAllServicesList;
List<AddressInfo> get addressesList => _customerAddressesService.addressesList;
List<GetHHCAllPresOrdersResponseModel> get cmcAllPresOrders =>
_cMCService.cmcAllPresOrdersList;
List<GetCMCServicesResponseModel> get cmcAllServicesList => _cMCService.cmcAllServicesList;
List<GetOrderDetailByOrderIDResponseModel> get cmcAllOrderDetail =>
_cMCService.cmcAllOrderDetail;
List<CMCGetItemsResponseModel> get checkupItems =>
_cMCService.checkupItemsList;
List<GetHHCAllPresOrdersResponseModel> get cmcAllPresOrders => _cMCService.cmcAllPresOrdersList;
PharmacyModuleService _pharmacyModuleService = locator<PharmacyModuleService>();
List<GetOrderDetailByOrderIDResponseModel> get cmcAllOrderDetail => _cMCService.cmcAllOrderDetail;
List<CMCGetItemsResponseModel> get checkupItems => _cMCService.checkupItemsList;
PharmacyModuleService _pharmacyModuleService = locator<PharmacyModuleService>();
bool get isOrderUpdated => _cMCService.isOrderUpdated;
Future getCMCAllServices() async {
await _cMCService
.getCMCAllServices();
await _cMCService.getCMCAllServices();
CMCGetItemsRequestModel cMCGetItemsRequestModel = new CMCGetItemsRequestModel(checkupType: cmcAllServicesList[0].iD);
await getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel,isFirst: true);
await getCheckupItems(cMCGetItemsRequestModel: cMCGetItemsRequestModel, isFirst: true);
if (_cMCService.hasError) {
error = _cMCService.error;
setState(ViewState.Error);
@ -52,16 +46,15 @@ class CMCViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
Future getCheckupItems({CMCGetItemsRequestModel cMCGetItemsRequestModel, bool isFirst = false}) async {
if(!isFirst)
setState(ViewState.Busy);
if (!isFirst) setState(ViewState.Busy);
await _cMCService.getCheckupItems(cMCGetItemsRequestModel);
if (_cMCService.hasError) {
error = _cMCService.error;
setState(ViewState.Error);
}
if(!isFirst)
setState(ViewState.Idle);
if (!isFirst) setState(ViewState.Idle);
}
Future getCmcAllPresOrders() async {
@ -71,9 +64,7 @@ class CMCViewModel extends BaseViewModel {
error = _cMCService.error;
setState(ViewState.Error);
} else {
var pendingOrder = _cMCService.cmcAllPresOrdersList.firstWhere(
(element) => element.status == 1 || element.status == 2,
orElse: () => null);
var pendingOrder = _cMCService.cmcAllPresOrdersList.firstWhere((element) => element.status == 1 || element.status == 2, orElse: () => null);
if (pendingOrder != null) {
await getOrderDetailByOrderID(pendingOrder);
setState(ViewState.Idle);
@ -83,11 +74,9 @@ class CMCViewModel extends BaseViewModel {
}
}
Future updateCmcPresOrder(
UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
Future updateCmcPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async {
setState(ViewState.BusyLocal);
await _cMCService.updateCmcPresOrder(
updatePresOrderRequestModel);
await _cMCService.updateCmcPresOrder(updatePresOrderRequestModel);
if (_cMCService.hasError) {
error = _cMCService.error;
setState(ViewState.ErrorLocal);
@ -97,23 +86,24 @@ class CMCViewModel extends BaseViewModel {
}
Future getOrderDetailByOrderID(GetHHCAllPresOrdersResponseModel order) async {
GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel =
GetOrderDetailByOrderIDRequestModel(presOrderID: order.iD);
await _cMCService
.getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel);
GetOrderDetailByOrderIDRequestModel getOrderDetailByOrderIDRequestModel = GetOrderDetailByOrderIDRequestModel(presOrderID: order.iD);
await _cMCService.getOrderDetailByOrderID(getOrderDetailByOrderIDRequestModel);
}
//TODO check it in uat
Future insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
Future<String> insertPresPresOrder({CMCInsertPresOrderRequestModel order}) async {
setState(ViewState.Busy);
order.createdBy = user.patientID;
order.orderServiceID = OrderService.Comprehensive_Medical_Checkup.getIdOrderService();
await _cMCService.insertPresPresOrder(order: order);
String requestId = await _cMCService.insertPresPresOrder(order: order);
if (_cMCService.hasError) {
error = _cMCService.error;
setState(ViewState.ErrorLocal);
} else {
getCmcAllPresOrders();
}
return requestId;
}
Future getCustomerAddresses() async {
@ -129,7 +119,7 @@ class CMCViewModel extends BaseViewModel {
Future getCustomerInfo() async {
setState(ViewState.Busy);
await _pharmacyModuleService.generatePharmacyToken().then((value) async{
await _pharmacyModuleService.generatePharmacyToken().then((value) async {
await _customerAddressesService.getCustomerInfo();
});
if (_customerAddressesService.hasError) {
@ -140,14 +130,9 @@ class CMCViewModel extends BaseViewModel {
}
}
Future addAddressInfo(
{AddNewAddressRequestModel addNewAddressRequestModel}) async {
Future addAddressInfo({AddNewAddressRequestModel addNewAddressRequestModel}) async {
setState(ViewState.Busy);
await _customerAddressesService.addAddressInfo(
addNewAddressRequestModel: addNewAddressRequestModel
);
await _customerAddressesService.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel);
if (_customerAddressesService.hasError) {
error = _customerAddressesService.error;
setState(ViewState.ErrorLocal);
@ -155,4 +140,4 @@ class CMCViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
}
}
}

@ -10,9 +10,7 @@ class ConfirmCancelOrderDialog extends StatefulWidget {
final CMCViewModel model;
final Function onTap;
ConfirmCancelOrderDialog(
{Key key, this.model, this.onTap});
ConfirmCancelOrderDialog({Key key, this.model, this.onTap});
@override
_ConfirmCancelOrderDialogState createState() => _ConfirmCancelOrderDialogState();
@ -27,11 +25,13 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
@override
Widget build(BuildContext context) {
return SimpleDialog(
contentPadding: EdgeInsets.fromLTRB(28.0, 24.0, 28.0, 0.0),
title: Center(
child: Texts(
TranslationBase.of(context).confirm,
color: Colors.black,
contentPadding: EdgeInsets.fromLTRB(28.0, 2.0, 28.0, 0.0),
title: Text(
TranslationBase.of(context).confirm,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
letterSpacing: -0.46,
),
),
children: [
@ -39,13 +39,13 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
children: [
Divider(),
Center(
child: Texts(
TranslationBase.of(context).cancelOrderMsg ,
color: Colors.grey,
child: Text(
TranslationBase.of(context).cancelOrderMsg,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500, letterSpacing: -0.46, color: Colors.grey[600]),
),
),
SizedBox(
height: 5.0,
height: 12.0,
),
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -60,9 +60,14 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
child: Text(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w700,
letterSpacing: -0.46,
color: Colors.red,
),
),
),
),
@ -77,28 +82,32 @@ class _ConfirmCancelOrderDialogState extends State<ConfirmCancelOrderDialog> {
Expanded(
flex: 1,
child: InkWell(
onTap: () async{
onTap: () async {
widget.onTap();
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
child: Text(
TranslationBase.of(context).ok.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w700,
letterSpacing: -0.46,
),
)),
),
),
),
],
)
),
SizedBox(
height: 5.0,
),
],
)
],
);
}
}

@ -0,0 +1,98 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:flutter/material.dart';
import 'package:progress_hud_v2/generated/i18n.dart';
Future<void> showCMCConfirmDialog(BuildContext context, String requestId, {Function onClick}) async {
return showDialog<void>(
context: context,
barrierDismissible: false, // user must tap button!
builder: (BuildContext context) {
return Dialog(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ConfirmDialog(requestId,onClick: onClick,),
],
),
);
},
);
}
class ConfirmDialog extends StatelessWidget {
String requestId;
Function onClick;
ConfirmDialog(this.requestId, {this.onClick});
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
padding: EdgeInsets.all(20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
mFlex(1),
IconButton(
icon: Icon(
Icons.close,
),
onPressed: () {
onClick();
Navigator.pop(context);
},
),
],
),
Text(
"Request has been sent successfully. You will be contacted soon.",
textAlign: TextAlign.start,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.46,
),
),
mHeight(20),
Text(
"Request ID",
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
color: Colors.grey[600],
letterSpacing: -0.46,
),
),
Text(
requestId ?? "",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: Colors.black,
letterSpacing: -0.46,
),
),
mHeight(20),
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
label: TranslationBase.of(context).ok.toUpperCase(),
color: CustomColors.accentColor,
onTap: () async {
onClick();
Navigator.pop(context);
},
textColor: Theme.of(context).backgroundColor),
),
],
),
);
}
}

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/material.dart';
@ -47,19 +48,14 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
price: widget.model.cmcAllServicesList[0].price,
serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(),
selectedServiceName: widget.model.cmcAllServicesList[0].description,
selectedServiceNameAR:
widget.model.cmcAllServicesList[0].descriptionN,
selectedServiceNameAR: widget.model.cmcAllServicesList[0].descriptionN,
recordID: 1,
totalPrice: widget.model.cmcAllServicesList[0].totalPrice,
vAT: widget.model.cmcAllServicesList[0].vAT);
cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(
patientERCMCInsertServicesList: [patientERCMCInsertServicesList]);
cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: [patientERCMCInsertServicesList]);
}
cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(
patientERCMCInsertServicesList: patientERCMCInsertServicesList != null
? [patientERCMCInsertServicesList]
: []);
cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: patientERCMCInsertServicesList != null ? [patientERCMCInsertServicesList] : []);
_controller = new PageController();
@ -89,26 +85,18 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
void showConfirmMessage(
CMCViewModel model, GetOrderDetailByOrderIDResponseModel order) {
void showConfirmMessage(CMCViewModel model, GetOrderDetailByOrderIDResponseModel order) {
showDialog(
context: context,
child: ConfirmCancelOrderDialog(
model: model,
onTap: () async {
UpdatePresOrderRequestModel updatePresOrderRequestModel =
UpdatePresOrderRequestModel(
presOrderID: order.presOrderID,
rejectionReason: "",
presOrderStatus: 4,
editedBy: 3);
UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.presOrderID, rejectionReason: "", presOrderStatus: 4, editedBy: 3);
await model.updateCmcPresOrder(updatePresOrderRequestModel);
if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
AppToast.showSuccessToast(
message:
TranslationBase.of(context).processDoneSuccessfully);
AppToast.showSuccessToast(message: TranslationBase.of(context).processDoneSuccessfully);
await model.getCmcAllPresOrders();
}
},
@ -119,282 +107,118 @@ class _NewCMCPageState extends State<NewCMCPage> with TickerProviderStateMixin {
body: SafeArea(
child: SingleChildScrollView(
child: Container(
height: MediaQuery.of(context).size.height * 0.8,
child: Column(
children: [
Expanded(
child: PageView(
physics: NeverScrollableScrollPhysics(),
controller: _controller,
onPageChanged: (index) {
setState(() {
_currentIndex = index;
});
},
scrollDirection: Axis.horizontal,
children: <Widget>[
widget.model.cmcAllOrderDetail.length != 0
? FractionallySizedBox(
widthFactor: 0.9,
child: SingleChildScrollView(
child: Column(
child: widget.model.cmcAllOrderDetail.length != 0
? Column(
children: [
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: [
Text(
TranslationBase.of(context).OrderStatus +
' ' +
(projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0].descriptionN : widget.model.cmcAllOrderDetail[0].description),
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
color: Color(0xffcd9e1b),
fontWeight: FontWeight.w700,
),
),
mHeight(12),
Text(
TranslationBase.of(context).requestID + ' ' + widget.model.cmcAllOrderDetail[0].iD.toString(),
style: TextStyle(
fontSize: 16,
letterSpacing: -0.48,
fontWeight: FontWeight.w700,
),
),
Text(
TranslationBase.of(context).serviceName,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w500,
),
),
Text(
!projectViewModel.isArabic ? widget.model.cmcAllOrderDetail[0].description.toString() : widget.model.cmcAllOrderDetail[0].descriptionN.toString(),
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w700,
),
),
],
),
),
Column(
children: [
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration(
border: Border.all(
color: Colors.grey, width: 1),
borderRadius:
BorderRadius.circular(12),
color:
Theme.of(context).primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
SizedBox(
height: 12,
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Theme.of(context)
.primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.requestID,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
widget.model
.cmcAllOrderDetail[0].iD
.toString(),
fontSize: 22,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Theme.of(context)
.primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.OrderStatus,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
projectViewModel.isArabic
? widget
.model
.cmcAllOrderDetail[0]
.descriptionN
: widget
.model
.cmcAllOrderDetail[0]
.description,
fontSize: 22,
),
],
),
),
Container(
width: double.infinity,
padding: EdgeInsets.only(
left: 15,
bottom: 15,
top: 15,
right: 15),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: Colors.grey,
width: 1.0,
),
),
// borderRadius: BorderRadius.circular(12),
color: Theme.of(context)
.primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.pickupDate,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(
widget
.model
.cmcAllOrderDetail[
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,
),
),
// borderRadius: BorderRadius.circular(12),
color: Theme.of(context)
.primaryColor),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.serviceName,
bold: false,
fontSize: 13,
),
SizedBox(
height: 4,
),
Texts(
!projectViewModel.isArabic
? widget
.model
.cmcAllOrderDetail[0]
.description
.toString()
: widget
.model
.cmcAllOrderDetail[0]
.descriptionN
.toString(),
fontSize: 22,
),
],
),
),
SizedBox(
height: 12,
),
Center(
child: Container(
width: MediaQuery.of(context)
.size
.width *
0.85,
child: SecondaryButton(
label: TranslationBase.of(
context)
.cancel
.toUpperCase(),
onTap: () {
showConfirmMessage(
widget.model,
widget.model
.cmcAllOrderDetail[0]);
},
color: Colors.red[800],
disabled: false,
textColor: Theme.of(context)
.backgroundColor),
),
),
SizedBox(
height: 22,
),
],
Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.cmcAllOrderDetail[0].createdOn)),
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
fontWeight: FontWeight.w700,
),
),
SizedBox(
height: 22,
),
mHeight(8),
SecondaryButton(
onTap: () {
showConfirmMessage(widget.model, widget.model.cmcAllOrderDetail[0]);
},
label: TranslationBase.of(context).cancel,
color: Colors.red[900],
small: true,
)
],
),
),
)
: Container(
color: Colors.red,
child: NewCMCStepOnePage(
changePageViewIndex: changePageViewIndex,
cMCInsertPresOrderRequestModel:
cMCInsertPresOrderRequestModel,
model: widget.model,
),
],
),
),
NewCMCStepTowPage(
longitude: _longitude,
latitude: _latitude,
changePageViewIndex: changePageViewIndex,
cmcInsertPresOrderRequestModel:
cMCInsertPresOrderRequestModel,
model: widget.model,
),
NewCMCStepThreePage(
changePageViewIndex: changePageViewIndex,
cmcInsertPresOrderRequestModel:
cMCInsertPresOrderRequestModel,
model: widget.model,
),
),
],
)
: Container(
color: Colors.red,
child: NewCMCStepOnePage(
changePageViewIndex: changePageViewIndex,
cMCInsertPresOrderRequestModel: cMCInsertPresOrderRequestModel,
model: widget.model,
latitude: _latitude,
longitude: _longitude,
),
),
),
],
),
),
),
),

@ -14,12 +14,16 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'new_cmc_step_tow_page.dart';
class NewCMCStepOnePage extends StatefulWidget {
final CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel;
final Function changePageViewIndex;
final CMCViewModel model;
const NewCMCStepOnePage({Key key, this.cMCInsertPresOrderRequestModel, this.model, this.changePageViewIndex}) : super(key: key);
final double latitude;
final double longitude;
const NewCMCStepOnePage({Key key, this.cMCInsertPresOrderRequestModel, this.model, this.changePageViewIndex,this.latitude,this.longitude}) : super(key: key);
@override
_NewCMCStepOnePageState createState() => _NewCMCStepOnePageState();
@ -178,7 +182,13 @@ class _NewCMCStepOnePageState extends State<NewCMCStepOnePage> {
if (widget.model.state == ViewState.ErrorLocal) {
Utils.showErrorToast();
} else {
widget.changePageViewIndex(1);
navigateTo(context,NewCMCStepTowPage(
longitude: widget.longitude,
latitude: widget.latitude,
cmcInsertPresOrderRequestModel: widget.cMCInsertPresOrderRequestModel,
model: widget.model,
));
// widget.changePageViewIndex(1);
}
}
},

@ -2,9 +2,13 @@ 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/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.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';
@ -15,14 +19,9 @@ import 'package:provider/provider.dart';
class NewCMCStepThreePage extends StatefulWidget {
final CMCInsertPresOrderRequestModel cmcInsertPresOrderRequestModel;
final Function changePageViewIndex;
final CMCViewModel model;
NewCMCStepThreePage(
{Key key,
this.changePageViewIndex,
this.model,
this.cmcInsertPresOrderRequestModel});
NewCMCStepThreePage({Key key, this.model, this.cmcInsertPresOrderRequestModel});
@override
_NewCMCStepThreePageState createState() => _NewCMCStepThreePageState();
@ -44,15 +43,12 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
markers.add(
Marker(
markerId: MarkerId(
widget.cmcInsertPresOrderRequestModel.latitude.hashCode
.toString(),
widget.cmcInsertPresOrderRequestModel.latitude.hashCode.toString(),
),
position: LatLng(widget.cmcInsertPresOrderRequestModel.latitude,
widget.cmcInsertPresOrderRequestModel.longitude)),
position: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, widget.cmcInsertPresOrderRequestModel.longitude)),
);
_kGooglePlex = CameraPosition(
target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude,
widget.cmcInsertPresOrderRequestModel.longitude),
target: LatLng(widget.cmcInsertPresOrderRequestModel.latitude, widget.cmcInsertPresOrderRequestModel.longitude),
zoom: 14.4746,
);
}
@ -63,7 +59,15 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
isShowAppBar: true,
description: TranslationBase.of(context).infoCMC,
imagesInfo: [
ImagesInfo(imageAr: 'https://hmgwebservices.com/Images/MobileApp/CMC/ar/0.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/CMC/en/0.png'),
],
appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
baseViewModel: widget.model,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
@ -74,79 +78,93 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).orderDetails,
fontWeight: FontWeight.bold,
Text(
TranslationBase.of(context).orderSummary,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
letterSpacing: -0.46,
),
),
SizedBox(
height: 12,
),
Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(12)),
padding: EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).orderLocation + " : ",
fontWeight: FontWeight.bold,
),
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);
},
Card(
shape: cardRadius(12),
elevation: 4,
child: Container(
padding: EdgeInsets.all(8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
TranslationBase.of(context).orderDetails + " : ",
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.46,
color: CustomColors.grey,
),
),
),
SizedBox(
height: 12,
),
Texts(TranslationBase.of(context).selectedService),
...List.generate(
widget.cmcInsertPresOrderRequestModel
.patientERCMCInsertServicesList.length,
(index) => Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).serviceName,
fontSize: 12,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
Texts(
projectViewModel.isArabic
? widget
.cmcInsertPresOrderRequestModel
.patientERCMCInsertServicesList[index]
.selectedServiceNameAR
: widget
.cmcInsertPresOrderRequestModel
.patientERCMCInsertServicesList[index]
.selectedServiceName,
fontSize: 15,
bold: true,
SizedBox(
height: 6,
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
height: 200,
decoration: containerColorRadiusBorder(Colors.white, 12, Colors.grey),
clipBehavior: Clip.antiAlias,
child: Card(
shape: cardRadius(12),
clipBehavior: Clip.antiAlias,
elevation: 0,
margin: const EdgeInsets.all(0),
child: GoogleMap(
mapType: MapType.normal,
markers: markers,
initialCameraPosition: _kGooglePlex,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
),
],
),
),
),
SizedBox(
height: 12,
),
Text(
TranslationBase.of(context).selectedService,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
letterSpacing: -0.46,
color: CustomColors.grey,
),
),
)
],
...List.generate(
widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList.length,
(index) => Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
projectViewModel.isArabic
? widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index].selectedServiceNameAR
: widget.cmcInsertPresOrderRequestModel.patientERCMCInsertServicesList[index].selectedServiceName,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
letterSpacing: -0.46,
),
),
],
),
),
)
],
),
),
)
],
@ -156,18 +174,30 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.10,
width: double.infinity,
color: Colors.white,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: SecondaryButton(
label: TranslationBase.of(context).confirm,
color: Colors.grey[800],
color: CustomColors.green,
onTap: () async {
await widget.model.insertPresPresOrder(
order: widget.cmcInsertPresOrderRequestModel);
String requestId = await widget.model.insertPresPresOrder(order: widget.cmcInsertPresOrderRequestModel);
if (widget.model.state != ViewState.ErrorLocal) {
widget.changePageViewIndex(0);
//show scuccess dialog
showCMCConfirmDialog(
context,
requestId,
onClick: () {
Navigator.pop(context);
Navigator.pop(context);
},
);
} else {
}
},
textColor: Theme.of(context).backgroundColor),

@ -1,9 +1,14 @@
import 'dart:async';
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/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -18,24 +23,16 @@ import 'package:google_maps_place_picker/google_maps_place_picker.dart';
import 'package:provider/provider.dart';
import 'cmc_location_page.dart';
import 'new_cmc_step_three_page.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);
const NewCMCStepTowPage({Key key, this.onPick, this.latitude, this.longitude, this.cmcInsertPresOrderRequestModel, this.model}) : super(key: key);
@override
_NewCMCStepTowPageState createState() => _NewCMCStepTowPageState();
@ -47,6 +44,14 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
AddressInfo _selectedAddress;
bool showCurrentLocation = false;
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) {
@ -54,29 +59,43 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
} else {
latitude = widget.cmcInsertPresOrderRequestModel.latitude;
longitude = widget.cmcInsertPresOrderRequestModel.longitude;
setMap();
}
super.initState();
}
setLatitudeAndLongitude({bool isSetState = false, String latLong}) async {
if (latLong == null){
if(widget.model.addressesList.isEmpty) {
setMap() {
markers.clear();
markers.add(
Marker(
markerId: MarkerId(
latitude.hashCode.toString(),
),
position: LatLng(latitude, longitude)),
);
_kGooglePlex = CameraPosition(
target: LatLng(latitude, longitude),
zoom: 14.4746,
);
}
setLatitudeAndLongitude({bool isSetState = false, String latLong}) async {
if (latLong == null) {
if (widget.model.addressesList.isEmpty) {
setState(() {
showCurrentLocation = true;
});
} else {
latLong = widget
.model.addressesList[widget.model.addressesList.length - 1].latLong;
latLong = widget.model.addressesList[widget.model.addressesList.length - 1].latLong;
}
}
if(!showCurrentLocation) {
if (!showCurrentLocation) {
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
setMap();
}
}
@ -84,113 +103,119 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowDecPage: false,
body: Stack(
isShowAppBar: true,
description: TranslationBase.of(context).infoCMC,
imagesInfo: [
ImagesInfo(imageAr: 'https://hmgwebservices.com/Images/MobileApp/CMC/ar/0.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/CMC/en/0.png'),
],
appBarTitle: TranslationBase.of(context).comprehensiveMedicalCheckup,
showNewAppBar: true,
showNewAppBarTitle: true,
backgroundColor: CustomColors.appBackgroudGreyColor,
body: Column(
children: [
PlacePicker(
apiKey: GOOGLE_API_KEY,
enableMyLocationButton: true,
automaticallyImplyAppBarLeading: false,
autocompleteOnTrailingWhitespace: true,
selectInitialPosition: true,
autocompleteLanguage: projectViewModel.currentLanguage,
enableMapTypeButton: true,
searchForInitialValue: false,
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: Column(
children: [
SecondaryButton(
color: Colors.grey[800],
textColor: Colors.white,
onTap: () {
Navigator.push(
context,
FadePage(
page: CMCLocationPage(
latitude: latitude,
longitude: longitude,
),
),
);
},
label: TranslationBase.of(context)
.addNewAddress,
),
SizedBox(
height: 10,
),
SecondaryButton(
color: Colors.red[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).confirm,
),
],
)),
);
},
initialPosition: LatLng(latitude, longitude),
useCurrentLocation: showCurrentLocation,
),
if(widget.model.addressesList.isNotEmpty)
Container(
child: InkWell(
onTap: () =>
confirmSelectLocationDialog(widget.model.addressesList),
if (widget.model.addressesList.isNotEmpty)
Card(
margin: EdgeInsets.only(left: 12, right: 12, bottom: 12),
shape: cardRadius(12),
elevation: 3,
child: Container(
padding: EdgeInsets.all(10),
width: double.infinity,
// height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Theme.of(context).primaryColor),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Texts(
getAddressName(),
fontSize: 14,
),
child: InkWell(
onTap: () => confirmSelectLocationDialog(widget.model.addressesList),
child: Container(
padding: EdgeInsets.all(8),
width: double.infinity,
// height: 65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
getAddressName(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
letterSpacing: -0.45,
),
),
),
Icon(Icons.arrow_drop_down)
],
),
Icon(Icons.arrow_drop_down)
],
),
),
height: 50,
width: double.infinity,
),
),
InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: CMCLocationPage(
latitude: latitude,
longitude: longitude,
),
),
);
},
child: Padding(
padding: EdgeInsets.only(left: 12, right: 12, bottom: 16, top: 8),
child: Row(
children: [
Icon(Icons.add_circle_outline_sharp),
mWidth(12),
Text(
TranslationBase.of(context).addNewAddress,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
],
),
),
height: 56,
width: double.infinity,
color: Theme.of(context).scaffoldBackgroundColor,
)
),
Expanded(
child: GoogleMap(
mapType: MapType.normal,
markers: markers,
zoomControlsEnabled: false,
initialCameraPosition: _kGooglePlex,
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
),
),
Padding(
padding: const EdgeInsets.only(left: 20, right: 20, top: 14, bottom: 14),
child: SecondaryButton(
color: Colors.red[800],
textColor: Colors.white,
onTap: () {
setState(() {
widget.cmcInsertPresOrderRequestModel.latitude = latitude;
widget.cmcInsertPresOrderRequestModel.longitude = longitude;
});
// widget.changePageViewIndex(3);
navigateTo(
context,
NewCMCStepThreePage(
cmcInsertPresOrderRequestModel: widget.cmcInsertPresOrderRequestModel,
model: widget.model,
),
);
},
label: TranslationBase.of(context).continues,
),
),
],
),
);

@ -10,8 +10,7 @@ class SelectLocationDialog extends StatefulWidget {
final Function(AddressInfo) onValueSelected;
AddressInfo selectedAddress;
SelectLocationDialog(
{Key key, this.addresses, this.onValueSelected, this.selectedAddress});
SelectLocationDialog({Key key, this.addresses, this.onValueSelected, this.selectedAddress});
@override
_SelectLocationDialogState createState() => _SelectLocationDialogState();
@ -27,7 +26,14 @@ class _SelectLocationDialogState extends State<SelectLocationDialog> {
@override
Widget build(BuildContext context) {
return SimpleDialog(
title: Texts(TranslationBase.of(context).selectAddress),
title: Text(
TranslationBase.of(context).selectAddress,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
children: [
Column(
children: [
@ -39,7 +45,7 @@ class _SelectLocationDialogState extends State<SelectLocationDialog> {
Divider(),
...List.generate(
widget.addresses.length,
(index) => Column(
(index) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
@ -56,7 +62,13 @@ class _SelectLocationDialogState extends State<SelectLocationDialog> {
});
},
child: ListTile(
title: Text(widget.addresses[index].address1),
title: Text(
widget.addresses[index].address1,
style: TextStyle(
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
),
leading: Radio(
value: widget.addresses[index],
groupValue: widget.selectedAddress,
@ -98,9 +110,14 @@ class _SelectLocationDialogState extends State<SelectLocationDialog> {
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
child: Text(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
color: Colors.red,
),
),
),
),
@ -122,10 +139,14 @@ class _SelectLocationDialogState extends State<SelectLocationDialog> {
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
child: Text(
TranslationBase.of(context).ok.toUpperCase(),
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
letterSpacing: -0.46,
),
)),
),
),
),

@ -163,7 +163,7 @@ class _AppDrawerState extends State<AppDrawer> {
} else {
projectProvider.changeLanguage('ar');
}
var themeNotifier = Provider.of<ThemeNotifier>(context, listen: true);
var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false);
themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins'));
},
),

Loading…
Cancel
Save