|
|
|
@ -2,13 +2,16 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/get_hhc_all_pres_orders_response_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/project_view_model.dart';
|
|
|
|
|
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/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/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import 'Dialog/confirm_cancel_order_dialog.dart';
|
|
|
|
|
|
|
|
|
@ -19,6 +22,8 @@ class OrdersLogDetailsPage extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectViewModel = Provider.of(context);
|
|
|
|
|
|
|
|
|
|
void showConfirmMessage(
|
|
|
|
|
HomeHealthCareViewModel model, GetHHCAllPresOrdersResponseModel order) {
|
|
|
|
|
showDialog(
|
|
|
|
@ -29,212 +34,219 @@ class OrdersLogDetailsPage extends StatelessWidget {
|
|
|
|
|
UpdatePresOrderRequestModel updatePresOrderRequestModel =
|
|
|
|
|
UpdatePresOrderRequestModel(
|
|
|
|
|
presOrderID: order.iD,
|
|
|
|
|
rejectionReason: "",
|
|
|
|
|
presOrderStatus: 4, editedBy: 3);
|
|
|
|
|
rejectionReason: "",
|
|
|
|
|
presOrderStatus: 4, editedBy: 3);
|
|
|
|
|
await model.updateHHCPresOrder(updatePresOrderRequestModel);
|
|
|
|
|
if(model.state == ViewState.ErrorLocal) {
|
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
|
Utils.showErrorToast(model.error);
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showSuccessToast(message: "Done Successfully");
|
|
|
|
|
await model.getHHCAllPresOrders();
|
|
|
|
|
// await model.getHHCAllServices();
|
|
|
|
|
// await model.getHHCAllServices();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(12),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.94,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 50,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: model.hhcAllPresOrders.map((order) {
|
|
|
|
|
return Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin: EdgeInsets.only(top: 15),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border:
|
|
|
|
|
Border.all(color: Colors.grey, width: 1),
|
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 15, bottom: 15, top: 15),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border(
|
|
|
|
|
bottom: BorderSide(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
width: 1.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// borderRadius: BorderRadius.circular(12),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"Request ID",
|
|
|
|
|
bold: false,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
order.iD.toString(),
|
|
|
|
|
fontSize: 22,
|
|
|
|
|
isShowAppBar: false,
|
|
|
|
|
baseViewModel: model,
|
|
|
|
|
body: SingleChildScrollView(
|
|
|
|
|
physics: ScrollPhysics(),
|
|
|
|
|
child: Container(
|
|
|
|
|
margin: EdgeInsets.all(12),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: FractionallySizedBox(
|
|
|
|
|
widthFactor: 0.94,
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 50,
|
|
|
|
|
),
|
|
|
|
|
Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: model.hhcAllPresOrders.map((order) {
|
|
|
|
|
return Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin: EdgeInsets.only(top: 15),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border:
|
|
|
|
|
Border.all(color: Colors.grey, width: 1),
|
|
|
|
|
borderRadius: BorderRadius.circular(12),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 15, bottom: 15, top: 15, right: 15),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border(
|
|
|
|
|
bottom: BorderSide(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
width: 1.0,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// borderRadius: BorderRadius.circular(12),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.requestID,
|
|
|
|
|
bold: false,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
order.iD.toString(),
|
|
|
|
|
fontSize: 22,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 15, bottom: 15, top: 15),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border(
|
|
|
|
|
bottom: BorderSide(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
width: 1.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// borderRadius: BorderRadius.circular(12),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"Status",
|
|
|
|
|
bold: false,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
order.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: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.OrderStatus,
|
|
|
|
|
bold: false,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
|
|
|
|
|
projectViewModel.isArabic ? order.descriptionN : order.description,
|
|
|
|
|
fontSize: 22,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
left: 15, bottom: 15, top: 15),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
border: Border(
|
|
|
|
|
bottom: BorderSide(
|
|
|
|
|
color: Colors.grey,
|
|
|
|
|
width: 1.0,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
// borderRadius: BorderRadius.circular(12),
|
|
|
|
|
color: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"Pickup Date",
|
|
|
|
|
bold: false,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
DateUtil.getDayMonthYearDateFormatted(
|
|
|
|
|
DateUtil.convertStringToDate(
|
|
|
|
|
order.createdOn)),
|
|
|
|
|
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: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
TranslationBase
|
|
|
|
|
.of(context)
|
|
|
|
|
.pickupDate,
|
|
|
|
|
bold: false,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
DateUtil.getDayMonthYearDateFormatted(
|
|
|
|
|
DateUtil.convertStringToDate(order.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: Colors.white),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
"Location",
|
|
|
|
|
bold: false,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
order.nearestProjectDescription
|
|
|
|
|
.toString() ??
|
|
|
|
|
order.nearestProjectDescriptionN
|
|
|
|
|
.toString(),
|
|
|
|
|
fontSize: 22,
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
if (order.status == 1 ||order.status == 2 )
|
|
|
|
|
Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
width: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.85,
|
|
|
|
|
child: SecondaryButton(
|
|
|
|
|
label: "Cancel".toUpperCase(),
|
|
|
|
|
onTap: () {
|
|
|
|
|
showConfirmMessage(model, order);
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
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(
|
|
|
|
|
TranslationBase.of(context).orderLocation,
|
|
|
|
|
bold: false,
|
|
|
|
|
fontSize: 13,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 4,
|
|
|
|
|
),
|
|
|
|
|
Texts(
|
|
|
|
|
!projectViewModel.isArabic ?order.nearestProjectDescription
|
|
|
|
|
.toString() :
|
|
|
|
|
order.nearestProjectDescriptionN
|
|
|
|
|
.toString(),
|
|
|
|
|
fontSize: 22,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
if (order.status == 1 ||order.status == 2 )
|
|
|
|
|
Center(
|
|
|
|
|
child: Container(
|
|
|
|
|
width: MediaQuery
|
|
|
|
|
.of(context)
|
|
|
|
|
.size
|
|
|
|
|
.width *
|
|
|
|
|
0.85,
|
|
|
|
|
child: SecondaryButton(
|
|
|
|
|
label: "Cancel".toUpperCase(),
|
|
|
|
|
onTap: () {
|
|
|
|
|
showConfirmMessage(model, order);
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
color: Colors.red[800],
|
|
|
|
|
disabled: false,
|
|
|
|
|
textColor: Theme
|
|
|
|
|
.of(context)
|
|
|
|
|
.backgroundColor),
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 12,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|