cmc & hhc order log ui improvements.

merge-update-with-lab-changes
Sikander Saleem 4 years ago
parent 0955a22616
commit 5fda70decf

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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';
@ -40,455 +41,135 @@ class OrdersLogDetailsPage extends StatelessWidget {
await model.getCmcAllPresOrders(); await model.getCmcAllPresOrders();
} }
}, },
)); ),
);
} }
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: body: ListView.separated(
padding: EdgeInsets.all(21),
// ListView.separated( physics: BouncingScrollPhysics(),
// physics: BouncingScrollPhysics(), itemBuilder: (context, index) {
// padding: EdgeInsets.all(21), GetHHCAllPresOrdersResponseModel order = model.cmcAllPresOrders[index];
// separatorBuilder: (context, index) {
// return SizedBox(height: 12);
// },
// itemBuilder: (context, index) {
// int status = model.cmcAllPresOrders[index].status;
// String _statusDisp = projectViewModel.isArabic ? model.cmcAllPresOrders[index].descriptionN : model.cmcAllPresOrders[index].description;
// Color _color;
// if (status == 1) {
// //pending
// _color = Color(0xffCC9B14);
// } else if (status == 2) {
// //processing
// _color = Color(0xff2E303A);
// } else if (status == 3) {
// //completed
// _color = Color(0xff359846);
// } else if (status == 4) {
// //cancel // Rejected
// _color = Color(0xffD02127);
// }
//
// return InkWell(
// // onTap: () => Navigator.push(
// // context,
// // FadePage(
// // page: PrescriptionsHistoryDetailsPage(
// // prescriptionsOrder: prescriptionsViewModel.prescriptionsHistory[index],
// // ),
// // ),
// // ),
// child: Container(
// height: 65,
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.all(
// Radius.circular(10.0),
// ),
// boxShadow: [
// BoxShadow(
// color: Color(0xff000000).withOpacity(.05),
// blurRadius: 27,
// offset: Offset(0, -3),
// ),
// ],
// ),
// child: Row(
// mainAxisSize: MainAxisSize.min,
// children: [
// Container(
// width: 6,
// decoration: BoxDecoration(
// color: _color,
// borderRadius: BorderRadius.only(
// topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
// bottomLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
// topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
// bottomRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
// ),
// ),
// ),
// Expanded(
// child: Padding(
// padding: EdgeInsets.only(left: projectViewModel.isArabic ? 6 : 12, right: projectViewModel.isArabic ? 12 : 6),
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// mainAxisSize: MainAxisSize.min,
// children: [
// Expanded(
// child: Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// _statusDisp,
// style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
// ),
// Text(
// '${TranslationBase.of(context).orderNo}. ${model.cmcAllPresOrders[index].iD}',
// style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
// ),
// ],
// ),
// ),
// Column(
// mainAxisSize: MainAxisSize.min,
// crossAxisAlignment: CrossAxisAlignment.end,
// children: [
// Text(
// DateUtil.formatDateToDate(DateUtil.convertStringToDate(model.cmcAllPresOrders[index].createdOn), projectViewModel.isArabic),
// style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
// ),
// Text(
// DateUtil.formatDateToTime(DateUtil.convertStringToDate(model.cmcAllPresOrders[index].createdOn)),
// style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
// ),
// ],
// )
// ],
// ),
// ),
// ),
// Icon(
// Icons.arrow_forward_ios,
// size: 16,
// ),
// mWidth(6),
// ],
// ),
// ));
// },
// itemCount: model.cmcAllPresOrders.length,
// ),
SingleChildScrollView( int status = order.status;
physics: ScrollPhysics(), String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description;
child: Container( Color _color;
margin: EdgeInsets.all(10), if (status == 1) {
child: Center( //pending
child: FractionallySizedBox( _color = Color(0xffCC9B14);
widthFactor: 0.94, } else if (status == 2) {
child: Column( //processing
crossAxisAlignment: CrossAxisAlignment.start, _color = Color(0xff2E303A);
children: [ } else if (status == 3) {
Column( //completed
crossAxisAlignment: CrossAxisAlignment.start, _color = Color(0xff359846);
children: model.cmcAllPresOrders.map((order) { } else if (status == 4) {
//cancel // Rejected
_color = Color(0xffD02127);
}
return Container( return Container(
// margin: EdgeInsets.all(10), decoration: BoxDecoration(
child: Container( color: _color,
width: double.infinity, borderRadius: BorderRadius.all(
padding: EdgeInsets.only(left: 12, right: 12, top: 12), Radius.circular(10.0),
child: Card( ),
shape: cardRadius(12), boxShadow: [
elevation: 2, BoxShadow(
margin: EdgeInsets.zero, color: Color(0xff000000).withOpacity(.05),
color: order.status == 4 blurRadius: 27,
? Colors.red[900] offset: Offset(0, -3),
: order.status == 3 ),
? Colors.green[400] ],
: Color(0xffcd9e1b), ),
clipBehavior: Clip.antiAlias,
child: Container( child: Container(
// decoration: containerColorRadiusLeft(Colors.white, 12), // decoration: containerColorRadiusLeft(Colors.white, 12),
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0), margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.all(12), padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
// color: Colors.white,
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: [ children: [
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).OrderStatus + ' ' + (projectViewModel.isArabic ? order.descriptionN : order.description), _statusDisp,
bold: false, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
fontSize: 12,
color: order.status == 4
? Colors.red[900]
: order.status == 3
? Colors.green[400]
: Color(0xffcd9e1b),
fontWeight: FontWeight.bold,
), ),
Texts( SizedBox(height: 6),
TranslationBase.of(context).requestID + ' ' + order.iD.toString(), Text(
fontWeight: FontWeight.w600, '${TranslationBase.of(context).requestID}: ${order.iD}',
fontSize: 18, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
Column( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).orderLocation, TranslationBase.of(context).serviceName + ": ",
bold: false, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
fontSize: 13,
), ),
SizedBox( Expanded(
height: 4, child: Text(
!projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), ),
Texts(
!projectViewModel.isArabic ? order.nearestProjectDescription.toString() : order.nearestProjectDescriptionN.toString(),
fontSize: 13,
), ),
], ],
) )
], ],
)), ),
),
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Texts( Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)), DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.createdOn), projectViewModel.isArabic),
fontSize: 14, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
SizedBox(height: 8), SizedBox(height: 12),
(order.status == 1 || order.status == 2) if (order.status == 1 || order.status == 2)
? SecondaryButton( InkWell(
onTap: () { onTap: () {
showConfirmMessage(model, order); showConfirmMessage(model, order);
}, },
label: TranslationBase.of(context).cancel, child: Container(
color: Colors.red[900], padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
small: true, decoration: BoxDecoration(
) color: Color(0xffD02127),
: SizedBox() border: Border.all(color: Colors.white, width: 1),
], borderRadius: BorderRadius.circular(10),
), ),
], child: Text(
))), TranslationBase.of(context).cancel_nocaps,
)); style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
}).toList())
],
), ),
), ),
), ),
],
), ),
],
), ),
),
// SingleChildScrollView( );
// physics: ScrollPhysics(), },
// child: Container( separatorBuilder: (context, index) => SizedBox(height: 12),
// margin: EdgeInsets.all(12), itemCount: model.cmcAllPresOrders.length),
// child: Center(
// child: FractionallySizedBox(
// widthFactor: 0.94,
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: model.cmcAllPresOrders.map((order) {
// return Container(
// width: double.infinity,
// margin: EdgeInsets.only(top: 12),
// clipBehavior: Clip.antiAlias,
// 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: 6,
// ),
// Container(
// width: double.infinity,
// padding: EdgeInsets.only(left: 15, bottom: 15, top: 8, right: 15),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: Colors.grey,
// width: 1.0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// TranslationBase.of(context).requestID,
// style: TextStyle(
// fontSize: 13,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.45,
// ),
// ),
// SizedBox(
// height: 4,
// ),
// Text(
// order.iD.toString(),
// style: TextStyle(
// fontSize: 18,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.45,
// ),
// ),
// ],
// ),
// ),
// 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),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// TranslationBase.of(context).OrderStatus,
// style: TextStyle(
// fontSize: 13,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.45,
// ),
// ),
// SizedBox(
// height: 4,
// ),
// Text(
// projectViewModel.isArabic ? order.descriptionN : order.description,
// style: TextStyle(
// fontSize: 18,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.45,
// ),
// ),
// ],
// ),
// ),
// 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),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// TranslationBase.of(context).pickupDate,
// style: TextStyle(
// fontSize: 13,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.45,
// ),
// ),
// SizedBox(
// height: 4,
// ),
// Text(
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)),
// style: TextStyle(
// fontSize: 18,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.45,
// ),
// ),
// ],
// ),
// ),
// Container(
// width: double.infinity,
// clipBehavior: Clip.antiAlias,
// padding: EdgeInsets.only(left: 15, bottom: 15, top: 15, right: 15),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// color: (order.status == 1 || order.status == 2) ? Colors.grey : Colors.transparent,
// width: (order.status == 1 || order.status == 2) ? 1.0 : 0,
// ),
// ),
// // borderRadius: BorderRadius.circular(12),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text(
// TranslationBase.of(context).orderLocation,
// style: TextStyle(
// fontSize: 13,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.45,
// ),
// ),
// SizedBox(
// height: 4,
// ),
// Text(
// !projectViewModel.isArabic ? order.projectDescription.toString() : order.projectDescriptionN.toString(),
// style: TextStyle(
// fontSize: 13,
// fontWeight: FontWeight.w600,
// letterSpacing: -0.45,
// ),
// ),
// ],
// ),
// ),
// (order.status == 1 || order.status == 2)
// ? SizedBox(
// height: 12,
// )
// : Container(),
// if (order.status == 1 || order.status == 2)
// Center(
// child: Container(
// width: MediaQuery.of(context).size.width * 0.85,
// child: SecondaryButton(
// label: TranslationBase.of(context).cancel.toUpperCase(),
// onTap: () {
// showConfirmMessage(model, order);
// },
// color: Colors.red[800],
// disabled: false,
// textColor: Theme.of(context).backgroundColor),
// ),
// ),
// (order.status == 1 || order.status == 2)
// ? SizedBox(
// height: 12,
// )
// : SizedBox(
// height: 2,
// ),
// ],
// ),
// );
// }).toList())
// ],
// ),
// ),
// ),
// ),
// ),
); );
} }
} }

@ -1,4 +1,5 @@
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_response_model.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/PatientERHHCInsertServicesList.dart';
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_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/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart';
@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.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/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -45,86 +47,59 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
body: Column( body: Column(
children: [ children: [
Expanded( Expanded(
child: SingleChildScrollView( child: ListView.separated(
physics: ScrollPhysics(), physics: BouncingScrollPhysics(),
child: Container( padding: EdgeInsets.only(left: 21, right: 21, top: 12, bottom: 12),
margin: EdgeInsets.only(left: MediaQuery.of(context).size.width * 0.05, right: MediaQuery.of(context).size.width * 0.05, top: MediaQuery.of(context).size.width * 0.05), itemBuilder: (context, index) {
child: Center( HHCGetAllServicesResponseModel service = widget.model.hhcAllServicesList[index];
child: FractionallySizedBox(
widthFactor: 1, return Padding(
child: Column( padding: const EdgeInsets.only(top: 4, bottom: 4),
crossAxisAlignment: CrossAxisAlignment.start, child: Row(
children: [
// Texts(
// TranslationBase.of(context).selectHomeHealthCareServices,
// textAlign: TextAlign.center,
// ),
Column(
children: widget.model.hhcAllServicesList.map((service) {
return Container(
margin: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
// border: Border.all(color: Colors.grey, width: 1),
borderRadius: BorderRadius.circular(12),
),
child: Column(
children: [
Row(
children: [ children: [
Checkbox( Checkbox(
value: isServiceSelected(service.serviceID), value: isServiceSelected(service.serviceID),
activeColor: Colors.red[800], activeColor: Color(0xffD02127),
tristate: false, tristate: false,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onChanged: (bool newValue) { onChanged: (bool newValue) {
setState(() { setState(() {
if (!isServiceSelected(service.serviceID)) if (!isServiceSelected(service.serviceID))
widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add(PatientERHHCInsertServicesList( widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.add(PatientERHHCInsertServicesList(
recordID: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length, recordID: widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length, serviceID: service.serviceID, serviceName: service.description));
serviceID: service.serviceID,
serviceName: service.description));
else else
removeSelected(service.serviceID); removeSelected(service.serviceID);
// widget.patientERInsertPresOrderRequestModel // widget.patientERInsertPresOrderRequestModel
// isPatientInsured = newValue; // isPatientInsured = newValue;
}); });
}), }),
SizedBox(width: 6),
Expanded( Expanded(
child: Padding( child: Text(
padding: const EdgeInsets.only(left: 0.0, right: 10),
child: Texts(
projectViewModel.isArabic ? service.descriptionN : service.description.toLowerCase()?.capitalize(), projectViewModel.isArabic ? service.descriptionN : service.description.toLowerCase()?.capitalize(),
fontSize: 15, maxLines: 1,
style: 'letterSpacing: -0.48', overflow: TextOverflow.ellipsis,
fontWeight: FontWeight.bold, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64),
), ),
), ),
),
],
),
Divider(
height: 1,
color: Colors.grey,
)
], ],
), ),
); );
}).toList(), },
), separatorBuilder: (context, index) => Divider(
SizedBox(height: 20) height: 1,
], color: Color(0xffE5E5E5),
),
),
),
),
), ),
itemCount: widget.model.hhcAllServicesList.length),
), ),
Container( Container(
width: MediaQuery.of(context).size.width, color: Colors.white,
height: 70.0, padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
color: Theme.of(context).scaffoldBackgroundColor, child: DefaultButton(
margin: EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0), TranslationBase.of(context).next,
child: Button( (this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal)
onTap: () async { ? null
: () async {
widget.model.setState(ViewState.Busy); widget.model.setState(ViewState.Busy);
await widget.model.getCustomerInfo(); await widget.model.getCustomerInfo();
if (widget.model.state == ViewState.ErrorLocal) { if (widget.model.state == ViewState.ErrorLocal) {
@ -141,11 +116,8 @@ class _NewHomeHealthCareStepOnePageState extends State<NewHomeHealthCareStepOneP
); );
} }
}, },
label: TranslationBase.of(context).next, textColor: (this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal) ? Color(0xff000000) : Colors.white,
backgroundColor: disabledColor: Color(0xffEAEAEA),
(this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal) ? Colors.grey : Colors.red[900],
disabled: this.widget.patientERInsertPresOrderRequestModel.patientERHHCInsertServicesList.length == 0 || widget.model.state == ViewState.BusyLocal,
loading: widget.model.state == ViewState.BusyLocal,
), ),
), ),
], ],

@ -2,12 +2,14 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.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/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'NewHomeHealthCare/new_home_health_care_page.dart'; import 'NewHomeHealthCare/new_home_health_care_page.dart';
import 'orders_log_details_page.dart'; import 'orders_log_details_page.dart';
@ -34,6 +36,7 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage> with SingleTick
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<HomeHealthCareViewModel>( return BaseView<HomeHealthCareViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getHHCAllPresOrders(); model.getHHCAllPresOrders();
@ -45,51 +48,29 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage> with SingleTick
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
imagesInfo: [ImagesInfo(imageAr: 'https://hmgwebservices.com/Images/MobileApp/HHC/ar/0.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/HHC/en/0.png')], imagesInfo: [ImagesInfo(imageAr: 'https://hmgwebservices.com/Images/MobileApp/HHC/ar/0.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/HHC/en/0.png')],
body: Scaffold( body: Column(
extendBodyBehindAppBar: true,
appBar: PreferredSize(
preferredSize: Size.fromHeight(65.0),
child: Stack(
children: <Widget>[ children: <Widget>[
Center( TabBar(
child: Center(
child: TabBar(
isScrollable: true,
controller: _tabController, controller: _tabController,
indicatorWeight: 5.0, indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Colors.red[800], labelColor: Color(0xff2B353E),
labelColor: Theme.of(context).primaryColor, unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 4.0, left: 18.0, right: 18.0), labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
unselectedLabelColor: Colors.grey[800], labelStyle: TextStyle(
tabs: [ fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
Container( fontSize: 16,
width: MediaQuery.of(context).size.width * 0.37, fontWeight: FontWeight.w600,
child: Center( letterSpacing: -0.48,
child: Texts( ),
TranslationBase.of(context).homeHealthCare, unselectedLabelStyle: TextStyle(
color: Colors.black, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins',
), fontSize: 16,
), fontWeight: FontWeight.w600,
), letterSpacing: -0.48,
Container( ),
width: MediaQuery.of(context).size.width * 0.37, tabs: [Text(TranslationBase.of(context).homeHealthCare), Text(TranslationBase.of(context).orderLog)],
child: Center(
child: Texts(
TranslationBase.of(context).orderLog,
color: Colors.black,
),
),
),
],
), ),
),
),
],
),
),
body: Column(
children: <Widget>[
Expanded( Expanded(
child: TabBarView( child: TabBarView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -107,7 +88,6 @@ class _HomeHealthCarePageState extends State<HomeHealthCarePage> with SingleTick
], ],
), ),
), ),
),
); );
} }
} }

@ -42,127 +42,135 @@ class OrdersLogDetailsPage extends StatelessWidget {
// await model.getHHCAllServices(); // await model.getHHCAllServices();
} }
}, },
)); ),
);
} }
return AppScaffold( return AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: ListView.separated(
physics: ScrollPhysics(), padding: EdgeInsets.all(21),
child: Container( physics: BouncingScrollPhysics(),
margin: EdgeInsets.all(0), itemBuilder: (context, index) {
child: Center( GetHHCAllPresOrdersResponseModel order = model.hhcAllPresOrders[index];
child: FractionallySizedBox(
widthFactor: 0.94, int status = order.status;
child: Column( String _statusDisp = projectViewModel.isArabic ? order.descriptionN : order.description;
crossAxisAlignment: CrossAxisAlignment.start, Color _color;
children: [ if (status == 1) {
Column( //pending
crossAxisAlignment: CrossAxisAlignment.start, _color = Color(0xffCC9B14);
children: model.hhcAllPresOrders.map((order) { } else if (status == 2) {
//processing
_color = Color(0xff2E303A);
} else if (status == 3) {
//completed
_color = Color(0xff359846);
} else if (status == 4) {
//cancel // Rejected
_color = Color(0xffD02127);
}
return Container( return Container(
// margin: EdgeInsets.all(10), decoration: BoxDecoration(
child: Container( color: _color,
width: double.infinity, borderRadius: BorderRadius.all(
padding: EdgeInsets.only(left: 12, right: 12, top: 12), Radius.circular(10.0),
child: Card( ),
shape: cardRadius(12), boxShadow: [
elevation: 2, BoxShadow(
margin: EdgeInsets.zero, color: Color(0xff000000).withOpacity(.05),
color: order.status == 4 blurRadius: 27,
? Colors.red[900] offset: Offset(0, -3),
: order.status == 3 ),
? Colors.green[400] ],
: Color(0xffcd9e1b), ),
clipBehavior: Clip.antiAlias,
child: Container( child: Container(
// decoration: containerColorRadiusLeft(Colors.white, 12), // decoration: containerColorRadiusLeft(Colors.white, 12),
margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 8, right: projectViewModel.isArabic ? 8 : 0), margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0),
padding: EdgeInsets.all(12), padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12),
// color: Colors.white,
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: [ children: [
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Texts( Text(
TranslationBase.of(context).OrderStatus + ' ' + (projectViewModel.isArabic ? order.descriptionN : order.description), _statusDisp,
bold: false, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: _color, letterSpacing: -0.4, height: 16 / 10),
fontSize: 12,
color: order.status == 4
? Colors.red[900]
: order.status == 3
? Colors.green[400]
: Color(0xffcd9e1b),
fontWeight: FontWeight.bold,
),
Texts(
TranslationBase.of(context).requestID + ' ' + order.iD.toString(),
fontWeight: FontWeight.w600,
fontSize: 18,
), ),
Column( SizedBox(height: 6),
Text(
'${TranslationBase.of(context).requestID}: ${order.iD}',
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).orderLocation, TranslationBase.of(context).serviceName + ": ",
bold: false, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10),
fontSize: 13,
), ),
SizedBox( Expanded(
height: 4, child: Text(
!projectViewModel.isArabic ? order.nearestProjectDescription.trim().toString() : order.nearestProjectDescriptionN.toString(),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56),
), ),
Texts(
!projectViewModel.isArabic ? order.nearestProjectDescription.toString() : order.nearestProjectDescriptionN.toString(),
fontSize: 13,
), ),
], ],
) )
], ],
)), ),
),
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Texts( Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(order.createdOn)), DateUtil.formatDateToDate(DateUtil.convertStringToDate(order.createdOn), projectViewModel.isArabic),
fontSize: 14, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10),
), ),
SizedBox(height: 8), SizedBox(height: 12),
(order.status == 1 || order.status == 2) if (order.status == 1 || order.status == 2)
? SecondaryButton( InkWell(
onTap: () { onTap: () {
showConfirmMessage(model, order); showConfirmMessage(model, order);
}, },
label: TranslationBase.of(context).cancel, child: Container(
color: Colors.red[900], padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
small: true, decoration: BoxDecoration(
) color: Color(0xffD02127),
: SizedBox() border: Border.all(color: Colors.white, width: 1),
], borderRadius: BorderRadius.circular(10),
),
child: Text(
TranslationBase.of(context).cancel_nocaps,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
), ),
],
))),
));
}).toList())
],
), ),
), ),
],
), ),
],
), ),
), ),
); );
},
separatorBuilder: (context, index) => SizedBox(height: 12),
itemCount: model.hhcAllPresOrders.length),
);
} }
} }

Loading…
Cancel
Save