|
|
|
|
@ -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,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|