From d6f51f6c823ba43b3c4493e81e16d5d0d294192e Mon Sep 17 00:00:00 2001 From: devamirsaleemahmad Date: Wed, 8 Nov 2023 16:40:07 +0300 Subject: [PATCH] changes --- .../AlHabibMedicalService/cmc_service.dart | 2 +- .../home_health_care_service.dart | 1 + .../AlHabibMedicalService/cmc_view_model.dart | 7 +- .../home_health_care_view_model.dart | 164 +++++++++++++++- lib/main.dart | 2 +- .../NewCMC/new_cmc_page.dart | 37 ++-- .../NewCMC/new_cmc_step_one_page.dart | 2 +- .../new_Home_health_care_step_one_page.dart | 39 ++-- .../new_home_health_care_page.dart | 183 +++++++++--------- lib/pages/livecare/widgets/clinic_list.dart | 3 +- lib/uitl/location_util.dart | 4 +- 11 files changed, 298 insertions(+), 146 deletions(-) diff --git a/lib/core/service/AlHabibMedicalService/cmc_service.dart b/lib/core/service/AlHabibMedicalService/cmc_service.dart index ddaaf969..c94abaf6 100644 --- a/lib/core/service/AlHabibMedicalService/cmc_service.dart +++ b/lib/core/service/AlHabibMedicalService/cmc_service.dart @@ -24,7 +24,7 @@ class CMCService extends BaseService { Future getCMCAllServices() async { GetCMCServicesRequestModel getCMCServicesRequestModel = - new GetCMCServicesRequestModel(genderID: authenticatedUserObject.user!.gender, identificationNo: authenticatedUserObject.user!.patientIdentificationNo); + GetCMCServicesRequestModel(genderID: authenticatedUserObject.user.gender, identificationNo: authenticatedUserObject.user.patientIdentificationNo); hasError = false; // RC IMPLEMENTATION diff --git a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart index 1f671d96..41418060 100644 --- a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart +++ b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart @@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; +import 'package:diplomaticquarterapp/main.dart'; import '../base_service.dart'; diff --git a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart index 0d450526..629f2918 100644 --- a/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/cmc_view_model.dart @@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/cmc_serv import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +import 'package:diplomaticquarterapp/main.dart'; import '../../../locator.dart'; import 'add_new_address_Request_Model.dart'; @@ -66,7 +67,7 @@ class CMCViewModel extends BaseViewModel { setState(ViewState.Error); } else { pendingOrder = _cMCService.cmcAllPresOrdersList.firstWhere((element) => element.statusId == 1 || element.statusId == 2, orElse: () => GetCMCAllOrdersResponseModel()); - if (pendingOrder != null) { + if (pendingOrder != null && pendingOrder!.serviceText != null) { // await getOrderDetailByOrderID(pendingOrder); setState(ViewState.Idle); } else { @@ -94,7 +95,7 @@ class CMCViewModel extends BaseViewModel { Future insertPresPresOrder({required CMCInsertPresOrderRequestModel order}) async { setState(ViewState.Busy); - order.createdBy = user!.patientID; + order.createdBy = user.patientID; order.orderServiceID = OrderService.Comprehensive_Medical_Checkup.getIdOrderService(); String requestId = await _cMCService.insertPresPresOrder(order: order); if (_cMCService.hasError) { @@ -108,7 +109,7 @@ class CMCViewModel extends BaseViewModel { Future insertCMCOrderRC({required CMCInsertPresOrderRequestModel order}) async { setState(ViewState.Busy); - order.createdBy = user!.patientID; + order.createdBy = user.patientID; order.orderServiceID = OrderService.Comprehensive_Medical_Checkup.getIdOrderService(); String requestId = await _cMCService.insertCMCOrderRC(order: order); if (_cMCService.hasError) { diff --git a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart index 52091f28..0d617b6a 100644 --- a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart @@ -32,12 +32,12 @@ class HomeHealthCareViewModel extends BaseViewModel { PharmacyModuleService _pharmacyModuleService = locator(); - bool? get isOrderUpdated => _homeHealthCareService.isOrderUpdated; + bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated ?? false; - int? get orderId => _homeHealthCareService.requestNo; - GetCMCAllOrdersResponseModel? pendingOrder; + int get orderId => _homeHealthCareService.requestNo ?? 0; + late GetCMCAllOrdersResponseModel pendingOrder; - List patientERHHCInsertServicesList =[]; + List patientERHHCInsertServicesList = []; dynamic get hhcResponse => _homeHealthCareService.hhcResponse; @@ -54,7 +54,7 @@ class HomeHealthCareViewModel extends BaseViewModel { } Future getHHCAllPresOrders() async { - pendingOrder = null; + pendingOrder = GetCMCAllOrdersResponseModel(); setState(ViewState.Busy); await _homeHealthCareService.getHHCAllPresOrdersRC(); if (_homeHealthCareService.hasError) { @@ -62,7 +62,7 @@ class HomeHealthCareViewModel extends BaseViewModel { setState(ViewState.Error); } else { pendingOrder = _homeHealthCareService.hhcAllPresOrdersList.firstWhere((element) => element.statusId == 1 || element.statusId == 2, orElse: () => GetCMCAllOrdersResponseModel()); - if (pendingOrder != null) { + if (pendingOrder != null && pendingOrder.serviceText != null) { // await _homeHealthCareService.getOrderDetailByOrderID(pendingOrder.iD); setState(ViewState.Idle); } else { @@ -83,9 +83,9 @@ class HomeHealthCareViewModel extends BaseViewModel { } } - Future insertPresPresOrder({required PatientERInsertPresOrderRequestModel order}) async { + Future insertPresPresOrder({PatientERInsertPresOrderRequestModel? order}) async { setState(ViewState.Busy); - order.createdBy = user!.patientID; + order!.createdBy = user.patientID; order.orderServiceID = OrderService.HOME_HEALTH_CARE.getIdOrderService(); // await _homeHealthCareService.insertPresPresOrder(order: order); await _homeHealthCareService.insertHHCOrderRC(order: order); @@ -125,7 +125,7 @@ class HomeHealthCareViewModel extends BaseViewModel { return Future.value(1); } - Future addAddressInfo({required AddNewAddressRequestModel addNewAddressRequestModel}) async { + Future addAddressInfo({AddNewAddressRequestModel? addNewAddressRequestModel}) async { setState(ViewState.Busy); // await _pharmacyModuleService.generatePharmacyToken().then((value) async { @@ -140,3 +140,149 @@ class HomeHealthCareViewModel extends BaseViewModel { } } } + +// import 'dart:async'; +// +// import 'package:diplomaticquarterapp/core/enum/OrderService.dart'; +// import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; +// import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; +// import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/HHC_get_all_services_request_modle.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/get_order_detail_by_order_iD_response_model.dart'; +// import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/patient_er_insert_pres_order_request_model.dart'; +// import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; +// import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; +// import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/home_health_care_service.dart'; +// import 'package:diplomaticquarterapp/core/service/parmacyModule/parmacy_module_service.dart'; +// import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; +// import 'package:diplomaticquarterapp/main.dart'; +// +// import '../../../locator.dart'; +// import 'add_new_address_Request_Model.dart'; +// +// class HomeHealthCareViewModel extends BaseViewModel { +// HomeHealthCareService _homeHealthCareService = locator(); +// +// CustomerAddressesService _customerAddressesService = locator(); +// +// List get hhcAllServicesList => _homeHealthCareService.hhcAllServicesList; +// +// List get addressesList => _customerAddressesService.addressesList; +// +// List get hhcAllPresOrders => _homeHealthCareService.hhcAllPresOrdersList; +// +// List get hhcAllOrderDetail => _homeHealthCareService.hhcAllOrderDetail; +// +// PharmacyModuleService _pharmacyModuleService = locator(); +// +// bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated!; +// +// int get orderId => _homeHealthCareService.requestNo!; +// late GetCMCAllOrdersResponseModel pendingOrder; +// +// List patientERHHCInsertServicesList =[]; +// +// dynamic get hhcResponse => _homeHealthCareService.hhcResponse; +// +// Future getHHCAllServices() async { +// HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel = new HHCGetAllServicesRequestModel(); +// // await _homeHealthCareService.getHHCAllServices(hHCGetAllServicesRequestModel); +// await _homeHealthCareService.getHHCAllServicesRC(hHCGetAllServicesRequestModel); +// +// if (_homeHealthCareService.hasError) { +// error = _homeHealthCareService.error!; +// setState(ViewState.Error); +// } else { +// setState(ViewState.Idle); +// } +// } +// +// Future getHHCAllPresOrders() async { +// pendingOrder = GetCMCAllOrdersResponseModel(); +// setState(ViewState.Busy); +// await _homeHealthCareService.getHHCAllPresOrdersRC(); +// if (_homeHealthCareService.hasError) { +// error = _homeHealthCareService.error!; +// setState(ViewState.Error); +// } else { +// pendingOrder = _homeHealthCareService.hhcAllPresOrdersList.firstWhere((element) => element.statusId == 1 || element.statusId == 2, orElse: () => GetCMCAllOrdersResponseModel()); +// if (pendingOrder != null) { +// logger.d(pendingOrder); +// // await _homeHealthCareService.getOrderDetailByOrderID(pendingOrder.iD); +// setState(ViewState.Idle); +// } else { +// getHHCAllServices(); +// } +// } +// } +// +// Future updateHHCPresOrder(UpdatePresOrderRequestModel updatePresOrderRequestModel) async { +// setState(ViewState.Busy); +// // await _homeHealthCareService.updateHHCPresOrder(updatePresOrderRequestModel); +// await _homeHealthCareService.updateHHCPresOrderRC(updatePresOrderRequestModel); +// if (_homeHealthCareService.hasError) { +// error = _homeHealthCareService.error!; +// setState(ViewState.ErrorLocal); +// } else { +// setState(ViewState.Idle); +// } +// } +// +// Future insertPresPresOrder({required PatientERInsertPresOrderRequestModel order}) async { +// setState(ViewState.Busy); +// order.createdBy = user!.patientID; +// order.orderServiceID = OrderService.HOME_HEALTH_CARE.getIdOrderService(); +// // await _homeHealthCareService.insertPresPresOrder(order: order); +// await _homeHealthCareService.insertHHCOrderRC(order: order); +// if (_homeHealthCareService.hasError) { +// error = _homeHealthCareService.error!; +// setState(ViewState.ErrorLocal); +// } else { +// getHHCAllPresOrders(); +// } +// } +// +// Future getCustomerAddresses() async { +// setState(ViewState.Busy); +// await _customerAddressesService.getCustomerAddresses(); +// if (_customerAddressesService.hasError) { +// error = _customerAddressesService.error!; +// setState(ViewState.ErrorLocal); +// } else { +// setState(ViewState.Idle); +// } +// } +// +// Future getCustomerInfo() async { +// setState(ViewState.Busy); +// await _pharmacyModuleService.generatePharmacyToken(); +// +// if (_customerAddressesService.hasError) { +// error = _customerAddressesService.error!; +// await _pharmacyModuleService.createUser(); +// setState(ViewState.ErrorLocal); +// } else { +// await _pharmacyModuleService.createUser().then((value) async { +// if (!_pharmacyModuleService.hasError) await getCustomerAddresses(); +// setState(ViewState.Idle); +// }).catchError((err) {}); +// } +// return Future.value(1); +// } +// +// Future addAddressInfo({required AddNewAddressRequestModel addNewAddressRequestModel}) async { +// setState(ViewState.Busy); +// +// // await _pharmacyModuleService.generatePharmacyToken().then((value) async { +// await _customerAddressesService.addAddressInfo(addNewAddressRequestModel: addNewAddressRequestModel); +// // }); +// +// if (_customerAddressesService.hasError) { +// error = _customerAddressesService.error!; +// setState(ViewState.ErrorLocal); +// } else { +// setState(ViewState.Idle); +// } +// } +// } diff --git a/lib/main.dart b/lib/main.dart index a03e54b4..332dc8ff 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -79,7 +79,7 @@ class _MyApp extends State { // print("checkForUpdate!!!"); // print(info.toString()); // if (info.immediateUpdateAllowed) { - // print("Immediate Allowed!!!"); + // print("Immediate567184134 Allowed!!!"); // InAppUpdate.performImmediateUpdate().then((value) {}).catchError((e) => print(e.toString())); // } // }).catchError((e) { diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart index c8467c6b..1b467242 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/Comprehens import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealthCare/update_pres_oreder_request_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/main.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; @@ -30,8 +31,8 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { late PageController _controller; int _currentIndex = 1; - late double _latitude; - late double _longitude; + double _latitude = 0; + double _longitude = 0; late CMCInsertPresOrderRequestModel cMCInsertPresOrderRequestModel; @@ -42,22 +43,21 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { super.initState(); PatientERCMCInsertServicesList patientERCMCInsertServicesList; if (widget.model.cmcAllServicesList.length > 0) { - patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( - price: widget.model.cmcAllServicesList[0].price, - serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(), - selectedServiceName: widget.model.cmcAllServicesList[0].text, - selectedServiceNameAR: widget.model.cmcAllServicesList[0].textN, - recordID: 1, - totalPrice: widget.model.cmcAllServicesList[0].priceTotal, - vAT: widget.model.cmcAllServicesList[0].priceVAT); - cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: [patientERCMCInsertServicesList]); + patientERCMCInsertServicesList = PatientERCMCInsertServicesList( + price: widget.model.cmcAllServicesList[0].price, + serviceID: widget.model.cmcAllServicesList[0].serviceID.toString(), + selectedServiceName: widget.model.cmcAllServicesList[0].text, + selectedServiceNameAR: widget.model.cmcAllServicesList[0].textN, + recordID: 1, + totalPrice: widget.model.cmcAllServicesList[0].priceTotal, + vAT: widget.model.cmcAllServicesList[0].priceVAT, + ); + cMCInsertPresOrderRequestModel = CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: [patientERCMCInsertServicesList]); } else { - cMCInsertPresOrderRequestModel = new CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: []); + cMCInsertPresOrderRequestModel = CMCInsertPresOrderRequestModel(patientERCMCInsertServicesList: []); //changed By Aamir } - _controller = new PageController(); - // _getCurrentLocation(); } @@ -84,7 +84,6 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { Widget build(BuildContext context) { _context = context; ProjectViewModel projectViewModel = Provider.of(context); - void showConfirmMessage(CMCViewModel model, GetCMCAllOrdersResponseModel order) { showDialog( context: context, @@ -108,9 +107,9 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { )); } - int status = widget.model.pendingOrder != null ? widget.model.pendingOrder!.statusId! : 0; - String _statusDisp = widget.model.pendingOrder != null ? widget.model.pendingOrder!.statusText! : ""; - late Color _color; + int status = widget.model.pendingOrder != null && widget.model.pendingOrder!.statusId != null ? widget.model.pendingOrder!.statusId! : 0; + String _statusDisp = widget.model.pendingOrder != null && widget.model.pendingOrder!.statusText != null ? widget.model.pendingOrder!.statusText! : ""; + Color? _color; if (status == 1) { //pending _color = Color(0xffCC9B14); @@ -128,7 +127,7 @@ class _NewCMCPageState extends State with TickerProviderStateMixin { return Scaffold( body: SafeArea( child: Container( - child: widget.model.pendingOrder != null + child: widget.model.pendingOrder != null && widget.model.pendingOrder!.serviceText != null ? Column( children: [ Container( diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart index b55d6846..43350f2d 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart @@ -66,7 +66,7 @@ class _NewCMCStepOnePageState extends State { activeColor: Colors.red[800], onChanged: (newValue) async { selectedItem = index; - PatientERCMCInsertServicesList patientERCMCInsertServicesList = new PatientERCMCInsertServicesList( + PatientERCMCInsertServicesList patientERCMCInsertServicesList = PatientERCMCInsertServicesList( price: widget.model.cmcAllServicesList[index].price, serviceID: widget.model.cmcAllServicesList[index].serviceID, selectedServiceName: widget.model.cmcAllServicesList[index].text, diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 0971756a..14085fd9 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HomeHealth 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/project_view_model.dart'; +import 'package:diplomaticquarterapp/main.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -34,24 +35,24 @@ class _NewHomeHealthCareStepOnePageState extends State Divider( - height: 1, - color: Color(0xffE5E5E5), - ), + height: 1, + color: Color(0xffE5E5E5), + ), itemCount: widget.model.hhcAllServicesList.length), ), Container( @@ -99,19 +100,19 @@ class _NewHomeHealthCareStepOnePageState extends State with Tick late double _latitude; late double _longitude; - PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel = new PatientERInsertPresOrderRequestModel(); + PatientERInsertPresOrderRequestModel patientERInsertPresOrderRequestModel = PatientERInsertPresOrderRequestModel(); @override void initState() { super.initState(); _controller = new PageController(); - // _getCurrentLocation(); + _getCurrentLocation(); } _getCurrentLocation() async { @@ -129,106 +129,109 @@ class _NewHomeHealthCarePageState extends State with Tick }, scrollDirection: Axis.horizontal, children: [ - widget.model.pendingOrder != null - ? ListView(padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), children: [ - (Container( - decoration: BoxDecoration( - color: Color(0xffCC9B14), - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - boxShadow: [ - BoxShadow( - color: Color(0xff000000).withOpacity(.05), - blurRadius: 27, - offset: Offset(0, -3), - ), - ], - ), - child: Container( - // decoration: containerColorRadiusLeft(Colors.white, 12), - margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0), - padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12), + widget.model.pendingOrder != null && widget.model.pendingOrder.serviceText != null + ? ListView( + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 15), + children: [ + (Container( decoration: BoxDecoration( - color: Colors.white, - border: Border.all(color: Colors.white, width: 1), - borderRadius: BorderRadius.only( - bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), - topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), - bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), - topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), + color: Color(0xffCC9B14), + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), + boxShadow: [ + BoxShadow( + color: Color(0xff000000).withOpacity(.05), + blurRadius: 27, + offset: Offset(0, -3), + ), + ], ), - // clipBehavior: Clip.antiAlias, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + child: Container( + // decoration: containerColorRadiusLeft(Colors.white, 12), + margin: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 6, right: projectViewModel.isArabic ? 6 : 0), + padding: EdgeInsets.symmetric(vertical: 14, horizontal: 12), + decoration: BoxDecoration( + color: Colors.white, + border: Border.all(color: Colors.white, width: 1), + borderRadius: BorderRadius.only( + bottomRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), + topRight: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10.0), + bottomLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), + topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0), + ), + ), + // clipBehavior: Clip.antiAlias, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.model.pendingOrder.statusText ?? "", + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffCC9B14), letterSpacing: -0.4, height: 16 / 10), + ), + SizedBox(height: 6), + Text( + '${TranslationBase.of(context).requestID}: ${widget.model.pendingOrder.iD}', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).hospital + ": ", + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), + ), + Expanded( + child: Text( + widget.model.pendingOrder.nearestProjectName ?? "", + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), + ), + ), + ], + ) + ], + ), + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - widget.model.pendingOrder!.statusText!, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffCC9B14), letterSpacing: -0.4, height: 16 / 10), - ), - SizedBox(height: 6), - Text( - '${TranslationBase.of(context).requestID}: ${widget.model.pendingOrder!.iD.toString()}', - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), + DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder.created.toString()) ?? DateTime.now()), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).hospital + ": ", - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), - ), - Expanded( + SizedBox(height: 12), + if (widget.model.pendingOrder.statusId == 1 || widget.model.pendingOrder.statusId == 2) + InkWell( + onTap: () { + showConfirmMessage(widget.model, widget.model.pendingOrder); + }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), + decoration: BoxDecoration( + color: Color(0xffD02127), + border: Border.all(color: Colors.white, width: 1), + borderRadius: BorderRadius.circular(10), + ), child: Text( - widget.model.pendingOrder!.nearestProjectName.toString(), - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.56), + TranslationBase.of(context).cancel_nocaps, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), ), ), - ], - ) + ), ], ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - DateUtil.getDayMonthYearDateFormatted(DateTime.tryParse(widget.model.pendingOrder!.created!)!), - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), - ), - SizedBox(height: 12), - if (widget.model.pendingOrder!.statusId == 1 || widget.model.pendingOrder!.statusId == 2) - InkWell( - onTap: () { - showConfirmMessage(widget.model, widget.model.pendingOrder!); - }, - child: Container( - padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), - decoration: BoxDecoration( - color: Color(0xffD02127), - border: Border.all(color: Colors.white, width: 1), - borderRadius: BorderRadius.circular(10), - ), - child: Text( - TranslationBase.of(context).cancel_nocaps, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), - ), - ), - ), - ], - ), - ], + ], + ), ), - ), - )) - ]) + )) + ], + ) // FractionallySizedBox( // widthFactor: 0.9, diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 5e2097d4..b525dde1 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/main.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -72,7 +73,7 @@ class _clinic_listState extends State { late MyInAppBrowser browser; - late String liveCareClinicIDs; + late dynamic liveCareClinicIDs; late ProjectViewModel projectViewModel; diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index b937f3eb..188403bd 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -128,8 +128,8 @@ class LocationUtils { heading: 0.0, speed: 0.0, speedAccuracy: 1, - // altitudeAccuracy: 0, - // headingAccuracy: 0, + altitudeAccuracy: 0, + headingAccuracy: 0, // Added by Aamir ), );