From fee23de1fd21659af53038ddc48ed86e2d20378a Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 5 Oct 2021 15:38:54 +0300 Subject: [PATCH 01/27] hhc changes --- lib/config/config.dart | 4 +- .../home_health_care_service.dart | 2 + .../home_health_care_view_model.dart | 5 +- .../new_Home_health_care_step_one_page.dart | 16 +- .../new_Home_health_care_step_three_page.dart | 23 +- .../new_home_health_care_page.dart | 251 +++++++++++++----- .../rapid-response-team/rrt-place-order.dart | 2 + 7 files changed, 209 insertions(+), 94 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 7840b97d..d7ffabcd 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const PACKAGES_PRODUCTS = '/api/products'; const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart index fdf51326..5c0b13f4 100644 --- a/lib/core/service/AlHabibMedicalService/home_health_care_service.dart +++ b/lib/core/service/AlHabibMedicalService/home_health_care_service.dart @@ -20,6 +20,7 @@ class HomeHealthCareService extends BaseService { dynamic hhcResponse; bool isOrderUpdated; CustomerInfo customerInfo; + int requestNo; Future getHHCAllServices(HHCGetAllServicesRequestModel hHCGetAllServicesRequestModel) async { hasError = false; await baseAppClient.post(HHC_GET_ALL_SERVICES, onSuccess: (dynamic response, int statusCode) { @@ -77,6 +78,7 @@ class HomeHealthCareService extends BaseService { hasError = false; await baseAppClient.post(INSERT_ER_INERT_PRES_ORDER, onSuccess: (dynamic response, int statusCode) { hhcResponse = response; + requestNo = response['RequestNo']; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; 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 0957ceb1..47e6815e 100644 --- a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart @@ -32,6 +32,7 @@ class HomeHealthCareViewModel extends BaseViewModel { bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated; + int get orderId => _homeHealthCareService.requestNo; GetHHCAllPresOrdersResponseModel pendingOrder; List patientERHHCInsertServicesList = List(); @@ -112,8 +113,8 @@ class HomeHealthCareViewModel extends BaseViewModel { // await _customerAddressesService.getCustomerInfo(); setState(ViewState.ErrorLocal); } else { - await _pharmacyModuleService.createUser(); - // await _customerAddressesService.getCustomerInfo(); + // await _pharmacyModuleService.createUser(); + await _customerAddressesService.getCustomerInfo(); await getCustomerAddresses(); } } 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 4e4342f4..b429ca4a 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 @@ -107,15 +107,15 @@ class _NewHomeHealthCareStepOnePageState extends State { - widget.model.setState(ViewState.Idle), - Navigator.push( - context, - FadePage( - page: HomeHealthCarePage(), - ), - ) - }); + widget.model.insertPresPresOrder(order: widget.patientERInsertPresOrderRequestModel).then((value) { + widget.model.setState(ViewState.Idle); + if (widget.model.orderId != null) { + showCMCConfirmDialog( + context, + widget.model.orderId.toString(), + onClick: () { + Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: HomeHealthCarePage)); + }, + ); + } + }); }, color: CustomColors.green, ), diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart index 4b06d220..d6e9b353 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart @@ -72,8 +72,9 @@ class _NewHomeHealthCarePageState extends State with Tick child: ConfirmCancelOrderDialog( model: model, onTap: () async { - UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.presOrderID, rejectionReason: "", presOrderStatus: 4, editedBy: 3); model.setState(ViewState.Busy); + UpdatePresOrderRequestModel updatePresOrderRequestModel = UpdatePresOrderRequestModel(presOrderID: order.presOrderID, rejectionReason: "", presOrderStatus: 4, editedBy: 3); + await model.updateHHCPresOrder(updatePresOrderRequestModel); if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); @@ -107,61 +108,59 @@ class _NewHomeHealthCarePageState extends State with Tick scrollDirection: Axis.horizontal, children: [ widget.model.pendingOrder != null - ? FractionallySizedBox( - widthFactor: 0.9, - child: SingleChildScrollView( - child: Container( - // margin: EdgeInsets.all(10), - child: 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( + ? 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), + 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: [ - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, + Text( + (projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description), + 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), + ), + Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts( - TranslationBase.of(context).OrderStatus + - ' ' + - (projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description), - bold: false, - fontSize: 12, - color: Color(0xffcd9e1b), - fontWeight: FontWeight.bold, - ), - Texts( - TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(), - fontWeight: FontWeight.w600, - fontSize: 18, - ), - Texts( - TranslationBase.of(context).serviceName, - fontSize: 12, - fontWeight: FontWeight.w600, + Text( + TranslationBase.of(context).serviceName + ": ", + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), ...List.generate( widget.model.hhcAllOrderDetail.length, @@ -172,29 +171,135 @@ class _NewHomeHealthCarePageState extends State with Tick bold: false, ), ), - ), + ) ], - )), - Column( - children: [ - Texts( - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)), - fontSize: 14, + ) + ], + ), + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)), + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), + ), + SizedBox(height: 12), + if (widget.model.pendingOrder.status == 1 || widget.model.pendingOrder.status == 2) + InkWell( + onTap: () { + showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]); + }, + 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), ), - mHeight(8), - // SecondaryButton( - // onTap: () { - // showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]); - // }, - // label: TranslationBase.of(context).cancel, - // color: Colors.red[900], - // small: true, - // ) - ], + child: Text( + TranslationBase.of(context).cancel_nocaps, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), + ), + ), ), - ], - ))), - )))) + ], + ), + ], + ), + ), + )) + ]) + + // FractionallySizedBox( + // widthFactor: 0.9, + // child: SingleChildScrollView( + // child: Container( + // // margin: EdgeInsets.all(10), + // child: 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: [ + // Texts( + // TranslationBase.of(context).OrderStatus + + // ' ' + + // (projectViewModel.isArabic ? widget.model.pendingOrder.descriptionN : widget.model.pendingOrder.description), + // bold: false, + // fontSize: 12, + // color: Color(0xffcd9e1b), + // fontWeight: FontWeight.bold, + // ), + // Texts( + // TranslationBase.of(context).requestID + ' ' + widget.model.pendingOrder.iD.toString(), + // fontWeight: FontWeight.w600, + // fontSize: 18, + // ), + // Texts( + // TranslationBase.of(context).serviceName, + // fontSize: 12, + // fontWeight: FontWeight.w600, + // ), + // ...List.generate( + // widget.model.hhcAllOrderDetail.length, + // (index) => Container( + // child: Texts( + // projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description.capitalize(), + // fontSize: 13, + // bold: false, + // ), + // ), + // ), + // ], + // )), + // Column( + // children: [ + // Texts( + // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.model.pendingOrder.createdOn)), + // fontSize: 14, + // ), + // mHeight(8), + // // SecondaryButton( + // // onTap: () { + // // showConfirmMessage(widget.model, widget.model.hhcAllOrderDetail[0]); + // // }, + // // label: TranslationBase.of(context).cancel, + // // color: Colors.red[900], + // // small: true, + // // ) + // ], + // ), + // ], + // ))), + // )))) : NewHomeHealthCareStepOnePage( changePageViewIndex: _changeCurrentTab, patientERInsertPresOrderRequestModel: patientERInsertPresOrderRequestModel, diff --git a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart index ec44de1e..8087c5fe 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart @@ -14,6 +14,8 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-main-screen.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; class RRTPlaceOrderPage extends StatelessWidget { TranslationBase localize; From 5410b826c32b8fc58f7558ddece6f1f3122b8024 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 6 Oct 2021 10:43:36 +0300 Subject: [PATCH 02/27] prescriptions new ui updated. --- .../medical/prescriptions_view_model.dart | 5 + .../prescriptions_home_page.dart | 18 ++- .../prescriptions/prescriptions_page.dart | 128 ++++++++---------- lib/widgets/Loader/gif_loader_container.dart | 25 ++-- 4 files changed, 86 insertions(+), 90 deletions(-) diff --git a/lib/core/viewModels/medical/prescriptions_view_model.dart b/lib/core/viewModels/medical/prescriptions_view_model.dart index 568d2ed8..2f86e5a1 100644 --- a/lib/core/viewModels/medical/prescriptions_view_model.dart +++ b/lib/core/viewModels/medical/prescriptions_view_model.dart @@ -31,6 +31,11 @@ class PrescriptionsViewModel extends BaseViewModel { List get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList; List get prescriptionsOrderList => filterType == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital; + + List prescriptionsOrderListByValue(filterValue) { + return filterValue == FilterType.Clinic ? _prescriptionsOrderListClinic : _prescriptionsOrderListHospital; + } + get isMedDeliveryAllowed => _prescriptionsService.isMedDeliveryAllowed; getPrescriptions() async { setState(ViewState.Busy); diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index 6fdba0e4..26c8dc22 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/core/enum/filter_type.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -26,7 +27,7 @@ class _HomePrescriptionsPageState extends State with Sing @override void initState() { super.initState(); - _tabController = TabController(length: 2, vsync: this); + _tabController = TabController(length: 3, vsync: this); imagesInfo.add(ImagesInfo( imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-prescriptions/ar/0.png')); imagesInfo.add(ImagesInfo( @@ -74,7 +75,8 @@ class _HomePrescriptionsPageState extends State with Sing letterSpacing: -0.48, ), tabs: [ - Text(TranslationBase.of(context).prescriptions, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')), + Text(TranslationBase.of(context).byClinic, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')), + Text(TranslationBase.of(context).byHospital, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')), Text(TranslationBase.of(context).orderLog, style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins')), ], ), @@ -84,9 +86,19 @@ class _HomePrescriptionsPageState extends State with Sing controller: _tabController, children: [ PrescriptionsPage( + FilterType.Clinic, prescriptionsViewModel: model, showOrderLog: () async { - _tabController.animateTo(1); + _tabController.animateTo(2); + await model.getPrescriptionsOrders(showLoading: true); + setState(() {}); + }, + ), + PrescriptionsPage( + FilterType.Hospital, + prescriptionsViewModel: model, + showOrderLog: () async { + _tabController.animateTo(2); await model.getPrescriptionsOrders(showLoading: true); setState(() {}); }, diff --git a/lib/pages/medical/prescriptions/prescriptions_page.dart b/lib/pages/medical/prescriptions/prescriptions_page.dart index 3fabcd8b..4d9eb463 100644 --- a/lib/pages/medical/prescriptions/prescriptions_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_page.dart @@ -16,86 +16,66 @@ import 'package:provider/provider.dart'; class PrescriptionsPage extends StatelessWidget { final VoidCallback showOrderLog; + final FilterType filterType; final PrescriptionsViewModel prescriptionsViewModel; - const PrescriptionsPage({Key key, this.prescriptionsViewModel, this.showOrderLog}) : super(key: key); + const PrescriptionsPage(this.filterType, {Key key, this.prescriptionsViewModel, this.showOrderLog}) : super(key: key); @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( - baseViewModel: prescriptionsViewModel, - body: FractionallySizedBox( - widthFactor: 1.0, - child: ListView( + baseViewModel: prescriptionsViewModel, + body: ListView.separated( physics: BouncingScrollPhysics(), - children: [ - Row( - children: [ - MyTabView(TranslationBase.of(context).byClinic, FilterType.Clinic, prescriptionsViewModel.filterType, () { - prescriptionsViewModel.setFilterType(FilterType.Clinic); - }), - MyTabView(TranslationBase.of(context).byHospital, FilterType.Hospital, prescriptionsViewModel.filterType, () { - prescriptionsViewModel.setFilterType(FilterType.Hospital); - }), - ], - ), - ListView.separated( - physics: NeverScrollableScrollPhysics(), - shrinkWrap: true, - padding: EdgeInsets.only(top: 12), - separatorBuilder: (context, index) { - return Container( - height: 12, - margin: EdgeInsets.only(left: 21, right: 21), - // color: Color(0xffD9D9D9), - ); - }, - itemBuilder: (context, index) { - List prescriptionsList = prescriptionsViewModel.prescriptionsOrderList[index].prescriptionsList; - return AppExpandableNotifier( - title: prescriptionsViewModel.prescriptionsOrderList[index].filterName, - bodyWidget: ListView.separated( - shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), - itemBuilder: (context, _index) { - Prescriptions prescriptions = prescriptionsList[_index]; - return DoctorCard( - onTap: () async { - final _shouldRecallApi = await Navigator.push( - context, - FadePage( - page: PrescriptionItemsPage( - prescriptions: prescriptions, - ), - ), - ); - if (_shouldRecallApi != null) { - showOrderLog(); - } - }, - name: prescriptions.doctorName, - profileUrl: prescriptions.doctorImageURL, - rating: prescriptions.actualDoctorRate.toDouble(), - subName: prescriptions.name, - isInOutPatient: prescriptions.isInOutPatient, - isLiveCareAppointment: prescriptions.isLiveCareAppointment, - // appointmentTime: DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions - // .appointmentDate)), - date: DateUtil.convertStringToDate(prescriptions - .appointmentDate) //projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)), - ); - }, - separatorBuilder: (context, index) => SizedBox(height: 14), - itemCount: prescriptionsList.length), - ); - }, - itemCount: prescriptionsViewModel.prescriptionsOrderList.length, - ) - ], - ), - ), - ); + padding: EdgeInsets.only(top: 12), + separatorBuilder: (context, index) { + return Container( + height: 12, + margin: EdgeInsets.only(left: 21, right: 21), + // color: Color(0xffD9D9D9), + ); + }, + itemBuilder: (context, index) { + List prescriptionsList = prescriptionsViewModel.prescriptionsOrderListByValue(filterType)[index].prescriptionsList; + return AppExpandableNotifier( + title: prescriptionsViewModel.prescriptionsOrderListByValue(filterType)[index].filterName, + bodyWidget: ListView.separated( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), + itemBuilder: (context, _index) { + Prescriptions prescriptions = prescriptionsList[_index]; + return DoctorCard( + onTap: () async { + final _shouldRecallApi = await Navigator.push( + context, + FadePage( + page: PrescriptionItemsPage( + prescriptions: prescriptions, + ), + ), + ); + if (_shouldRecallApi != null) { + showOrderLog(); + } + }, + name: prescriptions.doctorName, + profileUrl: prescriptions.doctorImageURL, + rating: prescriptions.actualDoctorRate.toDouble(), + subName: prescriptions.name, + isInOutPatient: prescriptions.isInOutPatient, + isLiveCareAppointment: prescriptions.isLiveCareAppointment, + // appointmentTime: DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions + // .appointmentDate)), + date: DateUtil.convertStringToDate(prescriptions + .appointmentDate) //projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)), + ); + }, + separatorBuilder: (context, index) => SizedBox(height: 14), + itemCount: prescriptionsList.length), + ); + }, + itemCount: prescriptionsViewModel.prescriptionsOrderListByValue(filterType).length, + )); } } diff --git a/lib/widgets/Loader/gif_loader_container.dart b/lib/widgets/Loader/gif_loader_container.dart index b7a20339..75083d1a 100644 --- a/lib/widgets/Loader/gif_loader_container.dart +++ b/lib/widgets/Loader/gif_loader_container.dart @@ -6,8 +6,7 @@ class GifLoaderContainer extends StatefulWidget { _GifLoaderContainerState createState() => _GifLoaderContainerState(); } -class _GifLoaderContainerState extends State - with TickerProviderStateMixin { +class _GifLoaderContainerState extends State with TickerProviderStateMixin { GifController controller1; @override @@ -15,8 +14,9 @@ class _GifLoaderContainerState extends State controller1 = GifController(vsync: this); WidgetsBinding.instance.addPostFrameCallback((_) { - controller1.repeat( - min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); + try { + controller1.repeat(min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); + } catch (ex) {} }); super.initState(); } @@ -30,14 +30,13 @@ class _GifLoaderContainerState extends State @override Widget build(BuildContext context) { return Center( - //progress-loading.gif + //progress-loading.gif child: Container( - // margin: EdgeInsets.only(bottom: 40), - child: GifImage( - controller: controller1, - image: AssetImage( - "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), - ), - )); + // margin: EdgeInsets.only(bottom: 40), + child: GifImage( + controller: controller1, + image: AssetImage("assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), + ), + )); } -} \ No newline at end of file +} From df31c82fd5ecd30924232289833cc6ea8131af94 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 6 Oct 2021 12:18:11 +0300 Subject: [PATCH 03/27] doctor header review on tap improvement. --- lib/models/header_model.dart | 5 +- lib/pages/BookAppointment/BookConfirm.dart | 1 + lib/pages/BookAppointment/BookSuccess.dart | 1 + lib/pages/BookAppointment/DoctorProfile.dart | 1 + .../BookAppointment/book_reminder_page.dart | 5 +- .../MyAppointments/AppointmentDetails.dart | 20 +- lib/pages/medical/eye/EyeHomePage.dart | 10 +- .../my_invoices/invoice_detail_page.dart | 156 +++--------- .../prescription_details_page.dart | 1 + .../prescription_items_page.dart | 1 + .../radiology/radiology_details_page.dart | 1 + .../LabResult/laboratory_result_widget.dart | 1 + lib/widgets/new_design/doctor_header.dart | 235 +++++++++++++++++- 13 files changed, 294 insertions(+), 144 deletions(-) diff --git a/lib/models/header_model.dart b/lib/models/header_model.dart index f80091f3..b1da8b17 100644 --- a/lib/models/header_model.dart +++ b/lib/models/header_model.dart @@ -1,5 +1,6 @@ class HeaderModel { String doctorName; + int doctorId; String doctorImageURL; List speciality; String invoiceNo; @@ -12,6 +13,6 @@ class HeaderModel { int totalReviews; String email; - HeaderModel(this.doctorName, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate, this.actualDoctorRate, - this.totalReviews, this.email); + HeaderModel(this.doctorName, this.doctorId, this.doctorImageURL, this.speciality, this.invoiceNo, this.projectName, this.date, this.time, this.nationalityFlagURL, this.doctorRate, + this.actualDoctorRate, this.totalReviews, this.email); } diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index fe49fd52..4a47dee1 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -74,6 +74,7 @@ class _BookConfirmState extends State { DoctorHeader( headerModel: HeaderModel( widget.doctor.name, + widget.doctor.doctorID, widget.doctor.doctorImageURL, widget.doctor.speciality, "", diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index d9499eeb..2c278f5e 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -60,6 +60,7 @@ class _BookSuccessState extends State { DoctorHeader( headerModel: HeaderModel( widget.docObject.name, + widget.docObject.doctorID, widget.docObject.doctorImageURL, widget.docObject.speciality, "", diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 6d3a3afa..5e35d06a 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -103,6 +103,7 @@ class _DoctorProfileState extends State with TickerProviderStateM DoctorHeader( headerModel: HeaderModel( widget.doctor.name, + widget.doctor.doctorID, widget.doctor.doctorImageURL, widget.doctor.speciality, "", diff --git a/lib/pages/BookAppointment/book_reminder_page.dart b/lib/pages/BookAppointment/book_reminder_page.dart index fcdd8fd4..8066e369 100644 --- a/lib/pages/BookAppointment/book_reminder_page.dart +++ b/lib/pages/BookAppointment/book_reminder_page.dart @@ -70,6 +70,7 @@ class _BookReminderPageState extends State { DoctorHeader( headerModel: HeaderModel( widget.docObject.name, + widget.docObject.doctorID, widget.docObject.doctorImageURL, widget.docObject.speciality, "", @@ -191,7 +192,7 @@ class _BookReminderPageState extends State { disabledTextColor: Colors.white, disabledColor: CustomColors.green, onPressed: () async { - print(widget.patientShareResponse.appointmentNo); + print(widget.patientShareResponse.appointmentNo); showReminderDialog( context, widget.dateTime, @@ -201,7 +202,7 @@ class _BookReminderPageState extends State { widget.appoTimeFormatted, onSuccess: () { AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); - navigateToBookSuccess(context); + navigateToBookSuccess(context); }, ); }, diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 13b86071..8bcfe9ca 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -94,6 +94,7 @@ class _AppointmentDetailsState extends State with SingleTick DoctorHeader( headerModel: HeaderModel( widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, + widget.appo.doctorID, widget.appo.doctorImageURL, widget.appo.doctorSpeciality, "", @@ -107,7 +108,8 @@ class _AppointmentDetailsState extends State with SingleTick "", //model.user.emailAddress, ), - isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true, + isNeedToShowButton: + (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true, buttonTitle: TranslationBase.of(context).schedule, buttonIcon: 'assets/images/new/Boo_ Appointment.svg', showConfirmMessageDialog: false, @@ -357,13 +359,15 @@ class _AppointmentDetailsState extends State with SingleTick width: 100.0, margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))), - Container( - margin: EdgeInsets.only(top: 10.0), - child: SizedBox( - width: getRatingWidth(doctorDetailsList[0].patientNumber), - height: 6.0, - child: Container( - color: Colors.green[700], + Expanded( + child: Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[0].patientNumber), + height: 6.0, + child: Container( + color: Colors.green[700], + ), ), ), ), diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index 4c945f7a..3d59af3d 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -41,10 +41,7 @@ class _EyeHomePageState extends State with SingleTickerProviderStat super.initState(); _tabController = TabController(length: 2, vsync: this); _tabController.addListener(() { - - setState(() { - - }); + setState(() {}); }); } @@ -61,7 +58,7 @@ class _EyeHomePageState extends State with SingleTickerProviderStat builder: (_, model, w) => AppScaffold( isShowAppBar: true, isShowDecPage: false, - appBarTitle: widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj, + appBarTitle: widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj, showNewAppBarTitle: true, showNewAppBar: true, backgroundColor: CustomColors.appBackgroudGreyColor, @@ -70,6 +67,7 @@ class _EyeHomePageState extends State with SingleTickerProviderStat DoctorHeader( headerModel: HeaderModel( widget.appointmentAllHistoryResultList.doctorTitle + " " + widget.appointmentAllHistoryResultList.doctorNameObj, + widget.appointmentAllHistoryResultList.doctorID, widget.appointmentAllHistoryResultList.doctorImageURL, widget.appointmentAllHistoryResultList.doctorSpeciality, "", @@ -83,7 +81,7 @@ class _EyeHomePageState extends State with SingleTickerProviderStat "", //model.user.emailAddress, ), - isNeedToShowButton: _tabController.index==0?true:projectViewModel.havePrivilege(15), + isNeedToShowButton: _tabController.index == 0 ? true : projectViewModel.havePrivilege(15), showConfirmMessageDialog: true, onRatingAndReviewTap: getDoctorRatingsDetails, onTap: () { diff --git a/lib/pages/medical/my_invoices/invoice_detail_page.dart b/lib/pages/medical/my_invoices/invoice_detail_page.dart index 13fd8e6f..0f35a96f 100644 --- a/lib/pages/medical/my_invoices/invoice_detail_page.dart +++ b/lib/pages/medical/my_invoices/invoice_detail_page.dart @@ -27,8 +27,7 @@ class InvoiceDetail extends StatefulWidget { final DentalInvoiceDetailResponse dentalInvoiceDetailResponse; final BuildContext context; - InvoiceDetail(this.doctor, this.listDentalAppointments, - this.dentalInvoiceDetailResponse, this.context); + InvoiceDetail(this.doctor, this.listDentalAppointments, this.dentalInvoiceDetailResponse, this.context); @override _InvoiceDetailState createState() => _InvoiceDetailState(); @@ -50,11 +49,7 @@ class _InvoiceDetailState extends State { ProjectViewModel projectViewModel = Provider.of(context); generateInvoiceDetails(); return AppScaffold( - appBarTitle: widget.doctor.doctorTitle != null - ? widget.doctor.doctorTitle.toString() - : TranslationBase.of(context).dr + - " " + - widget.doctor.name.toString(), + appBarTitle: widget.doctor.doctorTitle != null ? widget.doctor.doctorTitle.toString() : TranslationBase.of(context).dr + " " + widget.doctor.name.toString(), isShowAppBar: true, isShowDecPage: false, showNewAppBar: true, @@ -67,6 +62,7 @@ class _InvoiceDetailState extends State { DoctorHeader( headerModel: HeaderModel( widget.doctor.name, + widget.doctor.doctorID, widget.doctor.doctorImageURL, widget.doctor.speciality, widget.doctor.clinicName, @@ -76,7 +72,7 @@ class _InvoiceDetailState extends State { widget.doctor.nationalityFlagURL, widget.doctor.doctorRate, widget.doctor.actualDoctorRate, - widget.doctor.noOfPatientsRate, + widget.doctor.noOfPatientsRate ?? 0, projectViewModel.user.emailAddress), onTap: () { sendInvoiceEmail(); @@ -86,8 +82,7 @@ class _InvoiceDetailState extends State { child: Card( elevation: 3.0, shape: cardRadius(12), - margin: EdgeInsets.only( - left: 16, top: 8, right: 16, bottom: 16), + margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16), child: Padding( padding: const EdgeInsets.all(12.0), child: Column( @@ -112,8 +107,7 @@ class _InvoiceDetailState extends State { child: Card( elevation: 3.0, shape: cardRadius(12), - margin: EdgeInsets.only( - left: 16, top: 8, right: 16, bottom: 16), + margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16), child: Padding( padding: const EdgeInsets.all(15.0), child: Column( @@ -121,29 +115,12 @@ class _InvoiceDetailState extends State { children: [ Container( margin: EdgeInsets.only(bottom: 10.0), - child: Text(TranslationBase.of(context).cardDetail, - style: TextStyle( - color: Colors.black, - letterSpacing: -0.64, - fontSize: 18.0, - fontWeight: FontWeight.bold)), + child: Text(TranslationBase.of(context).cardDetail, style: TextStyle(color: Colors.black, letterSpacing: -0.64, fontSize: 18.0, fontWeight: FontWeight.bold)), ), - myRichText( - TranslationBase.of(context).insuranceCompany + - ": ", - widget.dentalInvoiceDetailResponse - .listEInvoiceForDental[0].companyName, - projectViewModel.isArabic), + myRichText(TranslationBase.of(context).insuranceCompany + ": ", widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].companyName, projectViewModel.isArabic), myRichText( TranslationBase.of(context).insuranceID + ": ", - widget - .dentalInvoiceDetailResponse - .listEInvoiceForDental[0] - .insuranceID != - null - ? widget.dentalInvoiceDetailResponse - .listEInvoiceForDental[0].insuranceID - : "N/A", + widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID != null ? widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].insuranceID : "N/A", projectViewModel.isArabic), ], ), @@ -155,8 +132,7 @@ class _InvoiceDetailState extends State { child: Card( elevation: 3.0, shape: cardRadius(12), - margin: EdgeInsets.only( - left: 16, top: 8, right: 16, bottom: 16), + margin: EdgeInsets.only(left: 16, top: 8, right: 16, bottom: 16), child: Padding( padding: const EdgeInsets.all(15.0), child: Column( @@ -164,13 +140,7 @@ class _InvoiceDetailState extends State { children: [ Container( margin: EdgeInsets.only(bottom: 10.0), - child: Text( - TranslationBase.of(context).totalBalance, - style: TextStyle( - letterSpacing: -0.64, - color: Colors.black, - fontSize: 18.0, - fontWeight: FontWeight.bold)), + child: Text(TranslationBase.of(context).totalBalance, style: TextStyle(letterSpacing: -0.64, color: Colors.black, fontSize: 18.0, fontWeight: FontWeight.bold)), ), Container( width: double.infinity, @@ -178,15 +148,10 @@ class _InvoiceDetailState extends State { child: Row( children: [ Expanded( - child: _getNormalText( - TranslationBase.of(context).discount), + child: _getNormalText(TranslationBase.of(context).discount), ), Expanded( - child: _getNormalText( - this.totalDiscount.toString() + - " " + - TranslationBase.of(context).sar, - isBold: true), + child: _getNormalText(this.totalDiscount.toString() + " " + TranslationBase.of(context).sar, isBold: true), ) ], ), @@ -198,26 +163,13 @@ class _InvoiceDetailState extends State { child: Row( children: [ Expanded( - child: _getNormalText( - TranslationBase.of(context) - .totalVAT - .toString() + - " (" + - widget - .dentalInvoiceDetailResponse - .listEInvoiceForDental[0] - .listConsultation[0] - .vATPercentage - .toString() + - "%): "), + child: _getNormalText(TranslationBase.of(context).totalVAT.toString() + + " (" + + widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[0].vATPercentage.toString() + + "%): "), ), Expanded( - child: _getNormalText( - num.tryParse(this.totalVAT.toString()) - .toStringAsFixed(2) + - " " + - TranslationBase.of(context).sar, - isBold: true), + child: _getNormalText(num.tryParse(this.totalVAT.toString()).toStringAsFixed(2) + " " + TranslationBase.of(context).sar, isBold: true), ) ], ), @@ -229,15 +181,10 @@ class _InvoiceDetailState extends State { child: Row( children: [ Expanded( - child: _getNormalText( - TranslationBase.of(context).total), + child: _getNormalText(TranslationBase.of(context).total), ), Expanded( - child: _getNormalText( - this.subTotal.toString() + - " " + - TranslationBase.of(context).sar, - isBold: true), + child: _getNormalText(this.subTotal.toString() + " " + TranslationBase.of(context).sar, isBold: true), ) ], ), @@ -249,15 +196,10 @@ class _InvoiceDetailState extends State { child: Row( children: [ Expanded( - child: _getNormalText( - TranslationBase.of(context).paid), + child: _getNormalText(TranslationBase.of(context).paid), ), Expanded( - child: _getNormalText( - this.grandTotal.toString() + - " " + - TranslationBase.of(context).sar, - isBold: true), + child: _getNormalText(this.grandTotal.toString() + " " + TranslationBase.of(context).sar, isBold: true), ) ], ), @@ -284,10 +226,8 @@ class _InvoiceDetailState extends State { List listConsultations = new List(); - widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation - .forEach((item) { - var i = listConsultations - .indexWhere((x) => x.procedureID == item.procedureID); + widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.forEach((item) { + var i = listConsultations.indexWhere((x) => x.procedureID == item.procedureID); if (i <= -1) { listConsultations.add(item); } @@ -308,16 +248,10 @@ class _InvoiceDetailState extends State { GifLoaderDialogUtils.showMyDialog(widget.context); MyInvoicesService myInvoicesService = new MyInvoicesService(); - myInvoicesService - .sendDentalAppointmentInvoiceEmail( - widget.listDentalAppointments.projectID, - widget.listDentalAppointments.appointmentNo, - widget.context) - .then((res) { + myInvoicesService.sendDentalAppointmentInvoiceEmail(widget.listDentalAppointments.projectID, widget.listDentalAppointments.appointmentNo, widget.context).then((res) { GifLoaderDialogUtils.hideDialog(widget.context); if (res['MessageStatus'] == 1) { - AppToast.showSuccessToast( - message: TranslationBase.of(widget.context).emailSentSuccessfully); + AppToast.showSuccessToast(message: TranslationBase.of(widget.context).emailSentSuccessfully); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -342,37 +276,17 @@ class _InvoiceDetailState extends State { ], ), ); - for (int i = 0; - i < - widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0] - .listConsultation.length; - i++) { + for (int i = 0; i < widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length; i++) { tableRow.add( TableRow(children: [ - Utils.tableColumnValue( - '${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].procedureName}', - isLast: i == - (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0] - .listConsultation.length - - 1)), - Utils.tableColumnValue( - '${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].quantity}', - isLast: i == - (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0] - .listConsultation.length - - 1)), - Utils.tableColumnValue( - '${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].price.toString() + " " + TranslationBase.of(context).sar}', - isLast: i == - (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0] - .listConsultation.length - - 1)), - Utils.tableColumnValue( - '${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].total.toString() + " " + TranslationBase.of(context).sar}', - isLast: i == - (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0] - .listConsultation.length - - 1)), + Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].procedureName}', + isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)), + Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].quantity}', + isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)), + Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].price.toString() + " " + TranslationBase.of(context).sar}', + isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)), + Utils.tableColumnValue('${widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation[i].total.toString() + " " + TranslationBase.of(context).sar}', + isLast: i == (widget.dentalInvoiceDetailResponse.listEInvoiceForDental[0].listConsultation.length - 1)), ]), ); } diff --git a/lib/pages/medical/prescriptions/prescription_details_page.dart b/lib/pages/medical/prescriptions/prescription_details_page.dart index 9289ed75..5b47d8f9 100644 --- a/lib/pages/medical/prescriptions/prescription_details_page.dart +++ b/lib/pages/medical/prescriptions/prescription_details_page.dart @@ -38,6 +38,7 @@ class PrescriptionDetailsPage extends StatelessWidget { DoctorHeader( headerModel: HeaderModel( prescriptions.doctorName, + prescriptions.doctorID, prescriptions.doctorImageURL, prescriptions.speciality, "", diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index 8695a88f..1b593d07 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -49,6 +49,7 @@ class PrescriptionItemsPage extends StatelessWidget { DoctorHeader( headerModel: HeaderModel( prescriptions.doctorName, + prescriptions.doctorID, prescriptions.doctorImageURL, prescriptions.speciality, "", diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 1a61def8..e84a5063 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -40,6 +40,7 @@ class RadiologyDetailsPage extends StatelessWidget { DoctorHeader( headerModel: new HeaderModel( finalRadiology.doctorName, + finalRadiology.doctorID, finalRadiology.doctorImageURL, finalRadiology.speciality, finalRadiology.invoiceNo.toString(), diff --git a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index 82d53327..ba88263b 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -44,6 +44,7 @@ class _LaboratoryResultWidgetState extends State { DoctorHeader( headerModel: HeaderModel( widget.patientLabOrder.doctorName, + widget.patientLabOrder.doctorID, widget.patientLabOrder.doctorImageURL, widget.patientLabOrder.speciality, widget.billNo, diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 06f392bd..df882a7c 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -1,6 +1,10 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; @@ -27,7 +31,7 @@ class DoctorHeader extends StatelessWidget { this.isNeedToShowButton = true, this.buttonIcon, this.showConfirmMessageDialog = true, - this.onRatingAndReviewTap}) + @required this.onRatingAndReviewTap}) : super(key: key); ProjectViewModel projectViewModel; @@ -100,7 +104,11 @@ class DoctorHeader extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ InkWell( - onTap: onRatingAndReviewTap, + onTap: () { + if ((headerModel?.totalReviews ?? 0) > 0) { + getDoctorRatingsDetails(context); + } + }, child: Row( mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, @@ -122,10 +130,10 @@ class DoctorHeader extends StatelessWidget { style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, - color: onRatingAndReviewTap != null ? Colors.blue[600] : Color(0xff2B353E), + color: (headerModel?.totalReviews ?? 0) > 0 ? Colors.blue[600] : Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12, - decoration: onRatingAndReviewTap != null ? TextDecoration.underline : null, + decoration: (headerModel?.totalReviews ?? 0) > 0 ? TextDecoration.underline : null, ), ), ], @@ -141,7 +149,8 @@ class DoctorHeader extends StatelessWidget { }, child: Container( padding: EdgeInsets.only(top: 10, bottom: 10, right: 21, left: 15), - decoration: BoxDecoration(color: Color(0XFFD02127), borderRadius: projectViewModel.isArabic ? BorderRadius.only(topRight: Radius.circular(10)) : BorderRadius.only(topLeft: Radius.circular(10))), + decoration: BoxDecoration( + color: Color(0XFFD02127), borderRadius: projectViewModel.isArabic ? BorderRadius.only(topRight: Radius.circular(10)) : BorderRadius.only(topLeft: Radius.circular(10))), child: Row( mainAxisSize: MainAxisSize.min, children: [ @@ -175,4 +184,220 @@ class DoctorHeader extends StatelessWidget { ), ); } + + void getDoctorRatingsDetails(context) { + GifLoaderDialogUtils.showMyDialog(context); + List doctorDetailsList = List(); + + DoctorsListService service = new DoctorsListService(); + service.getDoctorsRatingDetails(headerModel.doctorId, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + doctorDetailsList.clear(); + res['DoctorRatingDetailsList'].forEach((v) { + doctorDetailsList.add(new DoctorRateDetails.fromJson(v)); + }); + showRatingDialog(doctorDetailsList, context); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); + print(err); + }); + } + + void showRatingDialog(List doctorDetailsList, context) { + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: Dialog( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + // height: 400.0, + width: MediaQuery.of(context).size.width * 0.8, + color: Colors.white, + child: Column( + children: [ + Container( + alignment: Alignment.center, + width: MediaQuery.of(context).size.width, + color: Theme.of(context).primaryColor, + margin: EdgeInsets.only(bottom: 5.0), + padding: EdgeInsets.all(10.0), + child: Text(TranslationBase.of(context).doctorRating, style: TextStyle(fontSize: 22.0, color: Colors.white))), + Container(margin: EdgeInsets.only(top: 0.0), child: Text(this.headerModel.actualDoctorRate.ceilToDouble().toString(), style: TextStyle(fontSize: 32.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 5.0), + alignment: Alignment.center, + child: RatingBar.readOnly( + initialRating: this.headerModel.actualDoctorRate.toDouble(), + size: 35.0, + filledColor: Colors.yellow[700], + emptyColor: Colors.grey[500], + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star, + ), + ), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(this.headerModel.totalReviews.toString() + " " + TranslationBase.of(context).reviews, style: TextStyle(fontSize: 14.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).excellent, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[0].patientNumber), + height: 6.0, + child: Container( + color: Colors.green[700], + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).v_good, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[1].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffB7B723), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).good, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[2].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEBA727), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).average, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[3].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffEB7227), + ), + ), + ), + ], + ), + ), + Container( + child: Row( + children: [ + Container( + width: 100.0, + margin: EdgeInsets.only(top: 10.0, left: 15.0, right: 15.0), + child: Text(TranslationBase.of(context).below_average, style: TextStyle(fontSize: 13.0, color: Colors.black))), + Container( + margin: EdgeInsets.only(top: 10.0), + child: SizedBox( + width: getRatingWidth(doctorDetailsList[4].patientNumber), + height: 6.0, + child: Container( + color: Color(0xffE20C0C), + ), + ), + ), + ], + ), + ), + Container(margin: EdgeInsets.only(top: 40.0), child: Divider()), + Container( + margin: EdgeInsets.only(top: 0.0), + child: Align( + alignment: FractionalOffset.bottomCenter, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width, + height: 40.0, + child: RaisedButton( + elevation: 0.0, + color: Colors.white, + textColor: Colors.red, + hoverColor: Colors.transparent, + focusColor: Colors.transparent, + highlightColor: Colors.transparent, + disabledColor: new Color(0xFFbcc2c4), + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)), + ), + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}); + } + + double getRatingWidth(int patientNumber) { + var width = (patientNumber / this.headerModel.totalReviews) * 100; + return width; + } } From 6099738a5c44ff838653764fd11ccbf875fdbbf7 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Wed, 6 Oct 2021 15:20:00 +0300 Subject: [PATCH 04/27] improvements --- lib/config/localized_values.dart | 30 +++++++----- .../BookAppointment/widgets/DoctorView.dart | 6 ++- .../widgets/reminder_dialog.dart | 12 ++--- .../prescription_details_page.dart | 26 ++++++++++ lib/uitl/translations_delegate_base.dart | 6 ++- .../data_display/medical/doctor_card.dart | 49 ++++++++++++------- 6 files changed, 90 insertions(+), 39 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c80c87ac..0bd3fad3 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -61,6 +61,9 @@ const Map localizedValues = { 'neverWait': {'en': 'Never wait in queue', 'ar': 'لا تنتظر في قائمة الانتظار'}, 'reminderTitle': {'en': 'You have appointment with Dr. ', 'ar': 'لديك موعد مع د'}, 'appointmentCalendar': {'en': 'Would you like to set a reminder for this appointment in your calendar?', 'ar': 'هل ترغب في تعيين تذكير لهذا الموعد في التقويم الخاص بك؟'}, + 'appointmentReminder': {'en': 'Would you like to set a reminder for this appointment?', 'ar': 'هل ترغب في تعيين تذكير لهذا الموعد؟'}, + 'prescriptionReminder': {'en': 'Would you like to set a reminder for this prescription?', 'ar': 'هل ترغب في تعيين تذكير لهذه الوصفة؟'}, + 'please_select_from_below_options': {'en': 'Please select from below options:', 'ar': 'الرجاء التحديد من الخيارات أدناه:'}, 'appointmentSuccess': {'en': 'Appointment is successfully booked', 'ar': 'تم حجز الموعد بنجاح'}, 'docQualifications': {'en': 'Doctor Qualifications', 'ar': 'مؤهلات الطبيب'}, 'pressAgain': {'en': 'Press again to exit the app', 'ar': 'اضغط مرة أخرى للخروج من التطبيق'}, @@ -916,7 +919,8 @@ const Map localizedValues = { "iAcceptTermsConditions": {"en": "I Accept the Terms And Conditions", "ar": "أوافق على الشروط والأحكام"}, "YouCanPayByTheFollowingOptions": {"en": "You can pay by the following Options:", "ar": "يمكنك الدفع عن طريق الخيارات التالية:"}, "RRTDDetails": { - "en": "The RRT service provides medical service for urgent and stable cases, not life-threatening situations or extremities, and the service includes providing medical care from a complete medical team at home.", + "en": + "The RRT service provides medical service for urgent and stable cases, not life-threatening situations or extremities, and the service includes providing medical care from a complete medical team at home.", "ar": "توفر خدمة فريق الاستجابة السريع RRT خدمه طبيه للحالات المستعجله والمستقره وليست الحالات المهدده للحياه او الاطراف ، وتشمل الخدمه تقديم رعايه طبيه من فريق طبي متكامل بالمنزل." }, "rrtService": {"en": "RRT Service", "ar": "خدمة RRT"}, @@ -1119,7 +1123,7 @@ const Map localizedValues = { "en": "\nThis service Displays nearest branch\n among all the branches of All Habib \n medical Group based on your current Location", "ar": "\nتعرض هذه الخدمة أقرب فرع\n من بين جميع فروع مجموعة \nالحبيب الطبية بناءً على موقعك الحالي." }, - "NearestEr": {"en": "Nearest ER", "ar":"اقرب طوارئ"}, + "NearestEr": {"en": "Nearest ER", "ar": "اقرب طوارئ"}, "infoCMC": { "en": "Through this service, you can request a set of tests that help you and your doctor to understand the current health condition and then identify potential risks.", "ar": "من خلال هذه الخدمة يمكنك طلب مجموعة من الفحوصات التي تساعدك وتساعد طبيبك في فهم حالتك الصحية الحالية ومن ثم تحديد المخاطر المحتملة" @@ -1508,18 +1512,18 @@ const Map localizedValues = { "secondTri": {"en": "Second Trimester Ends (27 weeks):", "ar": "تاريخ انتهاء الثلث الثاني 27 اسبوع: "}, "thirdTri": {"en": "Third Trimester, Estimated Due Date (40 weeks):", "ar": "تاريخ احتمال الولادة 40 اسبوع:"}, "seeDoctorsList": {"en": "See List Of Doctors", "ar": "اعرض قائمة الأطباء"}, - "covidQuestionnaire": { "en": "Please answer below questionnaire:", "ar": "الرجاء الإجابة على الاستبيان أدناه:" }, - "covidBookAppo": { "en": "Booking Appointment For: ", "ar": "موعد الحجز لـ: " }, - "emptySchedule": { "en": "Doctor has no schedule.", "ar": "لا يوجد جدول حضور مسجل للطبيب" }, - "serviceNotAvailable": { "en": "Dear, this service is not available now, please try again later", "ar": "عزيزي المراجع, هذه الخدمة غير متوفرة الان يرجى المحاوله لاحقا"}, + "covidQuestionnaire": {"en": "Please answer below questionnaire:", "ar": "الرجاء الإجابة على الاستبيان أدناه:"}, + "covidBookAppo": {"en": "Booking Appointment For: ", "ar": "موعد الحجز لـ: "}, + "emptySchedule": {"en": "Doctor has no schedule.", "ar": "لا يوجد جدول حضور مسجل للطبيب"}, + "serviceNotAvailable": {"en": "Dear, this service is not available now, please try again later", "ar": "عزيزي المراجع, هذه الخدمة غير متوفرة الان يرجى المحاوله لاحقا"}, "doctorScheduleNot": {"en": "Doctor schedule not available", "ar": "جدول الطبيب غير متوفر"}, - "RRTRequestSuccess": { "en": "Request has been sent successfully, You will be contacted soon.", "ar": "تم إرسال الطلب بنجاح ، وسيتم الاتصال بك باسرع وقت ممكن" }, - "rateDoctorAppo": { "en": "Rate DR & Appointment", "ar": "معدل الدكتور والتعيين" }, - "invoice": { "en": "Invoice", "ar": "الفاتورة" }, - "requestedDate": { "en": "Requested Date", "ar": "التاريخ " }, - "callDuration": { "en": "Call Duration", "ar": "مدة الاتصال" }, - "alreadyRated": { "en": "This appointment has been previously evaluated.", "ar": "تم تقييم هذا الموعد مسبقاً" }, - "insuranceCompany": { "en": "Insurance Company", "ar": "شركة تأمين" }, + "RRTRequestSuccess": {"en": "Request has been sent successfully, You will be contacted soon.", "ar": "تم إرسال الطلب بنجاح ، وسيتم الاتصال بك باسرع وقت ممكن"}, + "rateDoctorAppo": {"en": "Rate DR & Appointment", "ar": "معدل الدكتور والتعيين"}, + "invoice": {"en": "Invoice", "ar": "الفاتورة"}, + "requestedDate": {"en": "Requested Date", "ar": "التاريخ "}, + "callDuration": {"en": "Call Duration", "ar": "مدة الاتصال"}, + "alreadyRated": {"en": "This appointment has been previously evaluated.", "ar": "تم تقييم هذا الموعد مسبقاً"}, + "insuranceCompany": {"en": "Insurance Company", "ar": "شركة تأمين"}, "preferredBranch": {"en": "Preferred Branch", "ar": "الفرع المفضل"}, "selectPreferredBranch": {"en": "Select Preferred Branch", "ar": "اختر الفرع المفضل"}, "patientLocated": {"en": "Where the patient located", "ar": "اين موقع المريض"}, diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index f909ce53..1ae738cf 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -99,7 +99,11 @@ class DoctorView extends StatelessWidget { filledIcon: Icons.star, emptyIcon: Icons.star_border, ), - if (isShowFlag) Image.network(this.doctor.nationalityFlagURL, width: 22.0, height: 22.0) + Icon( + Icons.arrow_forward, + color: Theme.of(context).primaryColor, + ), + // if (isShowFlag) Image.network(this.doctor.nationalityFlagURL, width: 22.0, height: 22.0) ], ), ], diff --git a/lib/pages/BookAppointment/widgets/reminder_dialog.dart b/lib/pages/BookAppointment/widgets/reminder_dialog.dart index 1e580712..2eb5e062 100644 --- a/lib/pages/BookAppointment/widgets/reminder_dialog.dart +++ b/lib/pages/BookAppointment/widgets/reminder_dialog.dart @@ -115,7 +115,7 @@ class _ReminderDialogState extends State { ), mHeight(20), Text( - "When would you like to set a reminder for this appointment?", + TranslationBase.of(context).appointmentReminder, style: TextStyle( fontSize: 16, color: Color(0xff2B353E), @@ -125,7 +125,7 @@ class _ReminderDialogState extends State { ), mHeight(20), Text( - "Please select from below options:", + TranslationBase.of(context).pleaseSelectFromBelowOptions, style: TextStyle( fontSize: 12, color: Color(0xff2B353E), @@ -135,7 +135,7 @@ class _ReminderDialogState extends State { ), ListTile( contentPadding: EdgeInsets.zero, - title: const Text('Before 30 Mins'), + title: Text(TranslationBase.of(context).appoReminder30), leading: Radio( value: 0, groupValue: i, @@ -148,7 +148,7 @@ class _ReminderDialogState extends State { ), ListTile( contentPadding: EdgeInsets.zero, - title: const Text('Before 1 Hour'), + title: Text(TranslationBase.of(context).appoReminder60), leading: Radio( value: 1, groupValue: i, @@ -161,7 +161,7 @@ class _ReminderDialogState extends State { ), ListTile( contentPadding: EdgeInsets.zero, - title: const Text('Before 1 Hour and 30 Mins'), + title: Text(TranslationBase.of(context).appoReminder90), leading: Radio( value: 2, groupValue: i, @@ -174,7 +174,7 @@ class _ReminderDialogState extends State { ), ListTile( contentPadding: EdgeInsets.zero, - title: const Text('Before 2 Hours'), + title: Text(TranslationBase.of(context).appoReminder120), leading: Radio( value: 3, groupValue: i, diff --git a/lib/pages/medical/prescriptions/prescription_details_page.dart b/lib/pages/medical/prescriptions/prescription_details_page.dart index 5b47d8f9..860a362e 100644 --- a/lib/pages/medical/prescriptions/prescription_details_page.dart +++ b/lib/pages/medical/prescriptions/prescription_details_page.dart @@ -181,6 +181,32 @@ class PrescriptionDetailsPage extends StatelessWidget { }, ); return; + + showGeneralDialog( + barrierColor: Colors.black.withOpacity(0.5), + transitionBuilder: (context, a1, a2, widget) { + final curvedValue = Curves.easeInOutBack.transform(a1.value) - 1.0; + return Transform( + transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), + child: Opacity( + opacity: a1.value, + child: PrescriptionReminderDialog( + eventId: prescriptionReport.itemID.toString(), + title: "${prescriptionReport.itemDescriptionN} Prescription Reminder", + description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ", + startDate: startDate, + endDate: endDate, + location: prescriptionReport.remarks, + days: 1, + ), + ), + ); + }, + transitionDuration: Duration(milliseconds: 500), + barrierDismissible: true, + barrierLabel: '', + context: context, + pageBuilder: (context, animation1, animation2) {}); }, iconData: Icons.notifications_active, color: Color(0xffEAEAEA), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 8b3c72cf..682da6a6 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -108,6 +108,11 @@ class TranslationBase { String get appointmentCalendar => localizedValues['appointmentCalendar'][locale.languageCode]; + String get appointmentReminder => localizedValues['appointmentReminder'][locale.languageCode]; + String get prescriptionReminder => localizedValues['prescriptionReminder'][locale.languageCode]; + + String get pleaseSelectFromBelowOptions => localizedValues['please_select_from_below_options'][locale.languageCode]; + String get appointmentSuccess => localizedValues['appointmentSuccess'][locale.languageCode]; String get confirm => localizedValues['confirm'][locale.languageCode]; @@ -2325,7 +2330,6 @@ class TranslationBase { String get rateDoctor => localizedValues["rateDoctor"][locale.languageCode]; String get rateAppointment => localizedValues["rateAppointment"][locale.languageCode]; - } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 8ddca1b2..a8f87e25 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -94,17 +94,19 @@ class DoctorCard extends StatelessWidget { ), ) : BoxDecoration(), - child: isShowInOutPatient ? RotatedBox( - quarterTurns: 3, - child: Text( - isLiveCareAppointment - ? TranslationBase.of(context).liveCare.toLowerCase().capitalizeFirstofEach - : !isInOutPatient - ? TranslationBase.of(context).inPatient.toLowerCase().capitalizeFirstofEach - : TranslationBase.of(context).outpatient.toLowerCase().capitalizeFirstofEach, - style: TextStyle(fontSize: 10, fontWeight: FontWeight.w700, color: Colors.white, letterSpacing: -0.2, height: 16 / 10), - ), - ) : Container(), + child: isShowInOutPatient + ? RotatedBox( + quarterTurns: 3, + child: Text( + isLiveCareAppointment + ? TranslationBase.of(context).liveCare.toLowerCase().capitalizeFirstofEach + : !isInOutPatient + ? TranslationBase.of(context).inPatient.toLowerCase().capitalizeFirstofEach + : TranslationBase.of(context).outpatient.toLowerCase().capitalizeFirstofEach, + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w700, color: Colors.white, letterSpacing: -0.2, height: 16 / 10), + ), + ) + : Container(), ), Expanded( child: Padding( @@ -147,6 +149,7 @@ class DoctorCard extends StatelessWidget { ), Row( mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, children: [ LargeAvatar( name: name, @@ -201,14 +204,24 @@ class DoctorCard extends StatelessWidget { ], ), ), - if (onEmailTap != null && projectViewModel.havePrivilege(17)) - InkWell( - onTap: onEmailTap, - child: Icon( - Icons.email, - color: Theme.of(context).primaryColor, - ), + SizedBox( + height: 48, + child: Align( + alignment: Alignment.bottomCenter, + child: (onEmailTap != null && projectViewModel.havePrivilege(17)) + ? InkWell( + onTap: onEmailTap, + child: Icon( + Icons.email, + color: Theme.of(context).primaryColor, + ), + ) + : Icon( + Icons.arrow_forward, + color: Theme.of(context).primaryColor, + ), ), + ), ], ), ], From 76e16594ba19a43a91be75eb59e539b3967629a9 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 6 Oct 2021 15:25:41 +0300 Subject: [PATCH 05/27] FAMILY FILES --- .../new_Home_health_care_step_three_page.dart | 3 +- .../new_home_health_care_page.dart | 24 +- .../orders_log_details_page.dart | 2 +- .../DrawerPages/family/add-family-member.dart | 40 ++- .../DrawerPages/family/add-family_type.dart | 333 +++++++++++------- lib/pages/DrawerPages/family/my-family.dart | 15 +- .../rapid-response-team/rrt-place-order.dart | 2 +- .../rapid-response-team/rrt-request-page.dart | 1 + lib/pages/login/confirm-login.dart | 64 ++-- lib/pages/login/login-type.dart | 273 +++++++------- .../family_files/family_files_provider.dart | 2 +- 11 files changed, 419 insertions(+), 340 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart index 794d991f..e07b7d70 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart @@ -178,7 +178,8 @@ class _NewHomeHealthCareStepThreePageState extends State Utils.route(route, equalsTo: HomeHealthCarePage)); + Navigator.pop(context); + Navigator.push(context, FadePage(page: HomeHealthCarePage())); }, ); } diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart index d6e9b353..4a2234c6 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_home_health_care_page.dart @@ -162,15 +162,21 @@ class _NewHomeHealthCarePageState extends State with Tick TranslationBase.of(context).serviceName + ": ", style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), - ...List.generate( - widget.model.hhcAllOrderDetail.length, - (index) => Container( - child: Texts( - projectViewModel.isArabic ? widget.model.hhcAllOrderDetail[index].descriptionN : widget.model.hhcAllOrderDetail[index].description.capitalize(), - fontSize: 13, - bold: false, - ), - ), + Column( + children: [ + ...List.generate( + widget.model.hhcAllOrderDetail.length, + (index) => Container( + child: Texts( + projectViewModel.isArabic + ? widget.model.hhcAllOrderDetail[index].descriptionN + : widget.model.hhcAllOrderDetail[index].description.capitalize(), + fontSize: 13, + bold: false, + ), + ), + ) + ], ) ], ) diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index 468ab225..b64c5d7d 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -121,7 +121,7 @@ class OrdersLogDetailsPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - TranslationBase.of(context).serviceName + ": ", + TranslationBase.of(context).hospital + ": ", style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), Expanded( diff --git a/lib/pages/DrawerPages/family/add-family-member.dart b/lib/pages/DrawerPages/family/add-family-member.dart index be5c5152..75291ee2 100644 --- a/lib/pages/DrawerPages/family/add-family-member.dart +++ b/lib/pages/DrawerPages/family/add-family-member.dart @@ -51,6 +51,8 @@ class _AddMember extends State { return AppScaffold( appBarTitle: TranslationBase.of(context).myFamilyFiles, isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, body: isLoading == true ? AppCircularProgressIndicator() : SingleChildScrollView( @@ -69,7 +71,7 @@ class _AddMember extends State { Expanded( flex: 4, child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ PhoneNumberSelectorWidget(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), //MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value), @@ -88,24 +90,24 @@ class _AddMember extends State { ], ), ), - // Expanded( - // flex: 3, - // child: Column( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // Row( - // children: [ - // Expanded( - // child: DefaultButton( - // TranslationBase.of(context).add, - // () => {this.addMember()}, - // color: isButtonDisabled == true ? Colors.grey : Colors.grey[900], - // textColor: Colors.white, - // )) - // ], - // ), - // ], - // )) + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Row( + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).add, + () => {this.addMember()}, + color: isButtonDisabled == true ? Colors.grey : Colors.red[600], + textColor: Colors.white, + )) + ], + ), + ], + )) ]), ))); } diff --git a/lib/pages/DrawerPages/family/add-family_type.dart b/lib/pages/DrawerPages/family/add-family_type.dart index 48773820..533669c7 100644 --- a/lib/pages/DrawerPages/family/add-family_type.dart +++ b/lib/pages/DrawerPages/family/add-family_type.dart @@ -6,6 +6,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; +import 'package:diplomaticquarterapp/widgets/habib_logo_widget.dart'; class AddFamilyMemberType extends StatelessWidget { static int loginType = 0; @@ -14,139 +16,204 @@ class AddFamilyMemberType extends StatelessWidget { return AppScaffold( appBarTitle: TranslationBase.of(context).myFamilyFiles, isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, body: Padding( - padding: EdgeInsets.all(20), - child: Column( - children: [ - Expanded( - flex: 6, - child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset( - 'assets/images/habib-logo.png', - height: 80, - width: 80, - ), - Padding( - padding: EdgeInsets.all(20), - child: AppText( - TranslationBase.of(context).registerInfoFamily, - fontSize: SizeConfig.textMultiplier * 3.5, - textAlign: TextAlign.left, - ), - ), - Padding( - padding: EdgeInsets.all(20), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: InkWell( - onTap: () => { - AddFamilyMemberType.loginType = 1, - Navigator.of(context) - .pushNamed(ADD_FAMILY_MEMBER) - }, - child: RoundedContainer( - borderColor: Colors.grey, - showBorder: true, - child: Padding( - padding: EdgeInsets.fromLTRB( - 20, 10, 20, 10), - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/id_card_icon.png', - height: SizeConfig - .imageSizeMultiplier * - 12, - width: SizeConfig - .imageSizeMultiplier * - 15, - ), - SizedBox( - height: 20, - ), - AppText( - TranslationBase.of(context) - .idNo, - fontSize: SizeConfig - .textMultiplier * - 2, - ) - ], - ), - )))), - Expanded( - child: InkWell( - onTap: () => { - AddFamilyMemberType.loginType = 2, - Navigator.of(context) - .pushNamed(ADD_FAMILY_MEMBER) - }, - child: RoundedContainer( - borderColor: Colors.grey, - showBorder: true, - child: Padding( - padding: EdgeInsets.fromLTRB( - 25, 10, 25, 10), - child: Column( - children: [ - Image.asset( - 'assets/images/my_file_white_icon.png', - height: SizeConfig - .imageSizeMultiplier * - 12, - width: SizeConfig - .imageSizeMultiplier * - 15, - ), - SizedBox( - height: 20, - ), - AppText( - TranslationBase.of(context) - .fileNo, - fontSize: SizeConfig - .textMultiplier * - 2, - ) - ], - ), - )))) - ], - )), - Divider( - color: Colors.grey, - height: 2, - ), - ]), - ), - // Expanded( - // flex: 2, - // child: Column( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // Row( - // children: [ - // Expanded( - // child: DefaultButton( - // TranslationBase.of(context).registerNow, - // () => { - // Navigator.of(context).pushNamed( - // REGISTER, - // ) - // }, - // )) - // ], - // ), - // ], - // )) - ], - ))); + padding: EdgeInsets.only(bottom: 20, left: 21, right: 21), + child: Column(children: [ + Expanded( + child: ListView( + padding: EdgeInsets.zero, + physics: BouncingScrollPhysics(), + children: [ + SizedBox(height: 12), + HabibLogoWidget(), + SizedBox(height: 50), + Text( + TranslationBase.of(context).logintypeRadio, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), + ), + GridView( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), + physics: NeverScrollableScrollPhysics(), + padding: EdgeInsets.only(top: 25), + shrinkWrap: true, + children: [ + getButton(context, TranslationBase.of(context).nationalIdNumber, 'assets/images/new/national_id.svg', 1), + getButton(context, TranslationBase.of(context).medicalFileNumber, 'assets/images/new/medical_file.svg', 2), + ], + ), + SizedBox(height: 20), + // RichText( + // text: TextSpan( + // text: TranslationBase.of(context).forgotPassword, + // style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffC9272B), letterSpacing: -0.48, height: 18 / 12), + // recognizer: TapGestureRecognizer()..onTap = () => Navigator.of(context).push(FadePage(page: ForgotPassword())), + // ), + // ), + ], + ), + ), + // SizedBox( + // height: 43, + // width: double.infinity, + // child: FlatButton( + // onPressed: () {}, + // child: Text( + // TranslationBase.of(context).registerNow, + // style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), + // ), + // color: Color(0xffD02127), + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(6), + // ), + // ), + // ), + ]), + )); + // body: Padding( + // padding: EdgeInsets.all(20), + // child: Column( + // children: [ + // Expanded( + // flex: 6, + // child: Column( + // // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Image.asset( + // 'assets/images/habib-logo.png', + // height: 80, + // width: 80, + // ), + // Padding( + // padding: EdgeInsets.all(20), + // child: AppText( + // TranslationBase.of(context).registerInfoFamily, + // fontSize: SizeConfig.textMultiplier * 3.5, + // textAlign: TextAlign.left, + // ), + // ), + // Padding( + // padding: EdgeInsets.all(20), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.center, + // children: [ + // Expanded( + // child: InkWell( + // onTap: () => {AddFamilyMemberType.loginType = 1, Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER)}, + // child: RoundedContainer( + // borderColor: Colors.grey, + // showBorder: true, + // child: Padding( + // padding: EdgeInsets.fromLTRB(20, 10, 20, 10), + // child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + // children: [ + // Image.asset( + // 'assets/images/id_card_icon.png', + // height: SizeConfig.imageSizeMultiplier * 12, + // width: SizeConfig.imageSizeMultiplier * 15, + // ), + // SizedBox( + // height: 20, + // ), + // AppText( + // TranslationBase.of(context).idNo, + // fontSize: SizeConfig.textMultiplier * 2, + // ) + // ], + // ), + // )))), + // Expanded( + // child: InkWell( + // onTap: () => {AddFamilyMemberType.loginType = 2, Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER)}, + // child: RoundedContainer( + // borderColor: Colors.grey, + // showBorder: true, + // child: Padding( + // padding: EdgeInsets.fromLTRB(25, 10, 25, 10), + // child: Column( + // children: [ + // Image.asset( + // 'assets/images/my_file_white_icon.png', + // height: SizeConfig.imageSizeMultiplier * 12, + // width: SizeConfig.imageSizeMultiplier * 15, + // ), + // SizedBox( + // height: 20, + // ), + // AppText( + // TranslationBase.of(context).fileNo, + // fontSize: SizeConfig.textMultiplier * 2, + // ) + // ], + // ), + // )))) + // ], + // )), + // Divider( + // color: Colors.grey, + // height: 2, + // ), + // ]), + // ), + // // Expanded( + // // flex: 2, + // // child: Column( + // // mainAxisAlignment: MainAxisAlignment.end, + // // children: [ + // // Row( + // // children: [ + // // Expanded( + // // child: DefaultButton( + // // TranslationBase.of(context).registerNow, + // // () => { + // // Navigator.of(context).pushNamed( + // // REGISTER, + // // ) + // // }, + // // )) + // // ], + // // ), + // // ], + // // )) + // ], + // ))); + } + + Widget getButton(BuildContext _context, String _title, String _icon, int _flag) { + return InkWell( + onTap: () { + AddFamilyMemberType.loginType = _flag; + Navigator.of(_context).pushNamed(ADD_FAMILY_MEMBER); + }, + child: Container( + padding: EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(15), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + SvgPicture.asset( + _icon, + height: 38, + width: 38, + ), + Text( + _title, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), + ), + ], + ), + ), + ); } } diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index fd6264ba..a3f67a03 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -80,6 +80,8 @@ class _MyFamily extends State with TickerProviderStateMixin { appBarTitle: TranslationBase.of(context).myFamilyFiles, isShowAppBar: widget.isAppbarVisible, imagesInfo: imagesInfo, + showNewAppBar: true, + showNewAppBarTitle: true, icon: "assets/images/new/bottom_nav/family_files.svg", description: TranslationBase.of(context).familyInfo, body: Scaffold( @@ -527,28 +529,31 @@ class _MyFamily extends State with TickerProviderStateMixin { var currentLang = await sharedPref.getString(APP_LANGUAGE); Provider.of(context, listen: false).setPrivilege(privilegeList: result, isLoginChild: true); result = list.CheckActivationCode.fromJson(result); + var familyFile = await sharedPref.getObject(FAMILY_FILE); - result = list.CheckActivationCode.fromJson(result); var mainUser = await sharedPref.getObject(MAIN_USER); - var bloodType = await sharedPref.getString(BLOOD_TYPE); + var loginType = await sharedPref.getInt(LAST_LOGIN); this.sharedPref.clear(); if (mainUser["PatientID"] != result.list.patientID) { result.list.isFamily = true; } + this.sharedPref.setString(APP_LANGUAGE, currentLang); + this.sharedPref.setInt(LAST_LOGIN, loginType); this.sharedPref.setObject(MAIN_USER, mainUser); this.sharedPref.setObject(USER_PROFILE, result.list); this.sharedPref.setObject(FAMILY_FILE, familyFile); this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID); this.sharedPref.setString(TOKEN, result.authenticationTokenID); + await authenticatedUserObject.getUser(getUser: true); Provider.of(context, listen: false).user = authenticatedUserObject.user; Provider.of(context, listen: false).setUser(authenticatedUserObject.user); - await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { - if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser(); - }); + // await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { + // if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser(); + // }); appointmentRateViewModel .getIsLastAppointmentRatedList() diff --git a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart index 8087c5fe..41b4b2fe 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart @@ -207,6 +207,6 @@ class RRTPlaceOrderPage extends StatelessWidget { } gotoRRTRoot() { - Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: ErOptions)); + Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: RRTMainScreen)); } } diff --git a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart index c6e56c34..4dbe73a1 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-request-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-request-page.dart @@ -190,6 +190,7 @@ class RRTRequestPageState extends State { else AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms); }, + color: acceptTerms ? Colors.red[600] : Colors.grey, ), ), ], diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 2cef4da2..b4336910 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -391,14 +391,12 @@ class _ConfirmLogin extends State { } loginWithFingurePrintFace(type, int isActive) async { - if (isActive == 1 || isActive ==0) { - + if (isActive == 1 || isActive == 0) { const iosStrings = const IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID'); try { authenticated = await auth.authenticateWithBiometrics(localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true, iOSAuthStrings: iosStrings); - } on PlatformException catch (e) { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: 'Please enable your Touch or Face ID'); @@ -689,36 +687,36 @@ class _ConfirmLogin extends State { ), ); - return InkWell( - onTap: () { - if (_flag == 0) { - setState(() { - isMoreOption = true; - }); - } else { - authenticateUser(4, isActive: _loginIndex); - } - }, - child: RoundedContainer( - height: 150, - borderColor: Colors.grey, - showBorder: true, - child: Padding( - padding: EdgeInsets.fromLTRB(30, 15, 30, 15), - child: Column( - children: [ - Image.asset( - _icon, - height: SizeConfig.imageSizeMultiplier * 13, - width: SizeConfig.imageSizeMultiplier * 16, - ), - SizedBox( - height: 20, - ), - Texts(_title, fontSize: SizeConfig.textMultiplier * 2, color: Colors.black) - ], - ), - ))); + // return InkWell( + // onTap: () { + // if (_flag == 0) { + // setState(() { + // isMoreOption = true; + // }); + // } else { + // authenticateUser(4, isActive: _loginIndex); + // } + // }, + // child: RoundedContainer( + // height: 150, + // borderColor: Colors.grey, + // showBorder: true, + // child: Padding( + // padding: EdgeInsets.fromLTRB(30, 15, 30, 15), + // child: Column( + // children: [ + // Image.asset( + // _icon, + // height: SizeConfig.imageSizeMultiplier * 13, + // width: SizeConfig.imageSizeMultiplier * 16, + // ), + // SizedBox( + // height: 20, + // ), + // Texts(_title, fontSize: SizeConfig.textMultiplier * 2, color: Colors.black) + // ], + // ), + // ))); } // todo 'sikander' optimize this after knowing usage diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart index 054d11a6..e2e08654 100644 --- a/lib/pages/login/login-type.dart +++ b/lib/pages/login/login-type.dart @@ -59,8 +59,7 @@ class LoginType extends StatelessWidget { RichText( text: TextSpan( text: TranslationBase.of(context).forgotPassword, - style: TextStyle( - decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffC9272B), letterSpacing: -0.48, height: 18 / 12), + style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffC9272B), letterSpacing: -0.48, height: 18 / 12), recognizer: TapGestureRecognizer()..onTap = () => Navigator.of(context).push(FadePage(page: ForgotPassword())), ), ), @@ -88,141 +87,141 @@ class LoginType extends StatelessWidget { ), ); - AppScaffold( - appBarTitle: TranslationBase.of(context).login, - isShowAppBar: true, - isShowDecPage: false, - body: SingleChildScrollView( - child: Container( - padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), - height: SizeConfig.realScreenHeight * .9, - width: SizeConfig.realScreenWidth, - child: Column( - children: [ - Expanded( - flex: 4, - child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset( - 'assets/images/DQ/logo.png', - height: 90, - width: 90, - ), - AppText( - TranslationBase.of(context).logintypeRadio, - fontSize: SizeConfig.textMultiplier * 3.5, - textAlign: TextAlign.start, - marginBottom: 20.0, - marginTop: 20.0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: InkWell( - onTap: () => { - LoginType.loginType = 1, - Navigator.of(context).push(FadePage(page: Login())), - }, - child: RoundedContainer( - borderColor: Colors.grey, - showBorder: true, - child: Padding( - padding: EdgeInsets.fromLTRB(20, 10, 20, 10), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/id_card_icon.png', - height: SizeConfig.imageSizeMultiplier * 12, - width: SizeConfig.imageSizeMultiplier * 15, - ), - SizedBox( - height: 20, - ), - AppText( - TranslationBase.of(context).idNo, - fontSize: SizeConfig.textMultiplier * 2, - fontWeight: FontWeight.bold, - ) - ], - ), - )))), - Expanded( - child: InkWell( - onTap: () => { - LoginType.loginType = 2, - Navigator.of(context).push(FadePage(page: Login())), - }, - child: RoundedContainer( - borderColor: Colors.grey, - showBorder: true, - child: Padding( - padding: EdgeInsets.fromLTRB(25, 10, 25, 10), - child: Column( - children: [ - Image.asset( - 'assets/images/my_file_white_icon.png', - height: SizeConfig.imageSizeMultiplier * 12, - width: SizeConfig.imageSizeMultiplier * 15, - ), - SizedBox( - height: 20, - ), - AppText( - TranslationBase.of(context).fileNo, - fontSize: SizeConfig.textMultiplier * 2, - fontWeight: FontWeight.bold, - ) - ], - ), - )))) - ], - ), - SizedBox( - height: 25, - ), - Divider( - color: Colors.grey, - height: 2, - ), - Center( - child: InkWell( - onTap: () => { - Navigator.of(context).push(FadePage(page: ForgotPassword())), - }, - child: AppText(TranslationBase.of(context).forgotPassword, fontSize: SizeConfig.textMultiplier * 2.5, marginTop: 20.0, underline: true))) - ]), - ), - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Divider( - color: Colors.grey, - height: 2, - ), - SizedBox( - height: 10, - ), - Row( - children: [ - Expanded( - child: DefaultButton( - TranslationBase.of(context).registerNow, - () => { - Navigator.of(context).push(FadePage(page: Register())), - }, - )), - ], - ), - ], - )) - ], - )))); + // AppScaffold( + // appBarTitle: TranslationBase.of(context).login, + // isShowAppBar: true, + // isShowDecPage: false, + // body: SingleChildScrollView( + // child: Container( + // padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), + // height: SizeConfig.realScreenHeight * .9, + // width: SizeConfig.realScreenWidth, + // child: Column( + // children: [ + // Expanded( + // flex: 4, + // child: Column( + // // mainAxisAlignment: MainAxisAlignment.spaceEvenly, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Image.asset( + // 'assets/images/DQ/logo.png', + // height: 90, + // width: 90, + // ), + // AppText( + // TranslationBase.of(context).logintypeRadio, + // fontSize: SizeConfig.textMultiplier * 3.5, + // textAlign: TextAlign.start, + // marginBottom: 20.0, + // marginTop: 20.0, + // ), + // Row( + // mainAxisAlignment: MainAxisAlignment.center, + // children: [ + // Expanded( + // child: InkWell( + // onTap: () => { + // LoginType.loginType = 1, + // Navigator.of(context).push(FadePage(page: Login())), + // }, + // child: RoundedContainer( + // borderColor: Colors.grey, + // showBorder: true, + // child: Padding( + // padding: EdgeInsets.fromLTRB(20, 10, 20, 10), + // child: Column( + // mainAxisAlignment: MainAxisAlignment.center, + // children: [ + // Image.asset( + // 'assets/images/id_card_icon.png', + // height: SizeConfig.imageSizeMultiplier * 12, + // width: SizeConfig.imageSizeMultiplier * 15, + // ), + // SizedBox( + // height: 20, + // ), + // AppText( + // TranslationBase.of(context).idNo, + // fontSize: SizeConfig.textMultiplier * 2, + // fontWeight: FontWeight.bold, + // ) + // ], + // ), + // )))), + // Expanded( + // child: InkWell( + // onTap: () => { + // LoginType.loginType = 2, + // Navigator.of(context).push(FadePage(page: Login())), + // }, + // child: RoundedContainer( + // borderColor: Colors.grey, + // showBorder: true, + // child: Padding( + // padding: EdgeInsets.fromLTRB(25, 10, 25, 10), + // child: Column( + // children: [ + // Image.asset( + // 'assets/images/my_file_white_icon.png', + // height: SizeConfig.imageSizeMultiplier * 12, + // width: SizeConfig.imageSizeMultiplier * 15, + // ), + // SizedBox( + // height: 20, + // ), + // AppText( + // TranslationBase.of(context).fileNo, + // fontSize: SizeConfig.textMultiplier * 2, + // fontWeight: FontWeight.bold, + // ) + // ], + // ), + // )))) + // ], + // ), + // SizedBox( + // height: 25, + // ), + // Divider( + // color: Colors.grey, + // height: 2, + // ), + // Center( + // child: InkWell( + // onTap: () => { + // Navigator.of(context).push(FadePage(page: ForgotPassword())), + // }, + // child: AppText(TranslationBase.of(context).forgotPassword, fontSize: SizeConfig.textMultiplier * 2.5, marginTop: 20.0, underline: true))) + // ]), + // ), + // Expanded( + // flex: 1, + // child: Column( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // Divider( + // color: Colors.grey, + // height: 2, + // ), + // SizedBox( + // height: 10, + // ), + // Row( + // children: [ + // Expanded( + // child: DefaultButton( + // TranslationBase.of(context).registerNow, + // () => { + // Navigator.of(context).push(FadePage(page: Register())), + // }, + // )), + // ], + // ), + // ], + // )) + // ], + // )))); } Widget getButton(BuildContext _context, String _title, String _icon, int _flag) { diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index cd83f2d9..014ba7b3 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -232,7 +232,7 @@ class FamilyFilesProvider with ChangeNotifier { var currentUser = AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER)); request['PatientOutSA'] = currentUser.outSA; //? 1 : 0; - request['LoginType'] = await sharedPref.getInt(LAST_LOGIN); + request['LoginType'] = await sharedPref.getInt(LAST_LOGIN) ?? 1; request['MobileNo'] = currentUser.mobileNumber[0].toString() == "0" ? currentUser.mobileNumber.toString() : '0' + currentUser.mobileNumber.toString(); request['PatientMobileNumber'] = currentUser.mobileNumber; //['MobileNumber']; request['SearchType'] = 2; From 5163c826adeba139cfe72793d90963d0c552483b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 6 Oct 2021 15:29:12 +0300 Subject: [PATCH 06/27] Updates & fixes --- lib/config/localized_values.dart | 4 + .../service/feedback/feedback_service.dart | 3 + .../service/medical/BloodSugarService.dart | 19 +- .../parmacyModule/parmacy_module_service.dart | 10 +- .../home_health_care_view_model.dart | 4 +- .../medical/ask_doctor_view_model.dart | 2 +- lib/pages/BookAppointment/DoctorProfile.dart | 2 +- .../rrt-order-list-item.dart | 2 +- .../MyAppointments/AppointmentDetails.dart | 6 +- .../widgets/AppointmentActions.dart | 2 +- lib/pages/ToDoList/payment_method_select.dart | 10 +- lib/pages/feedback/send_feedback_page.dart | 270 +++++++----------- lib/pages/feedback/status_feedback_page.dart | 124 ++++---- .../AttachInsuranceCardImageDialog.dart | 9 +- .../insurance/insurance_approval_screen.dart | 6 +- lib/pages/insurance/insurance_page.dart | 4 +- .../medical/ask_doctor/ask_doctor_page.dart | 17 +- .../medical/balance/advance_payment_page.dart | 15 +- .../my_trackers/Weight/WeightWeeklyPage.dart | 6 +- .../bloodPressureWeeklyPage.dart | 7 +- .../blood_suger/blood_sugar_weekly_page.dart | 6 +- .../vital_sign/vital_sign_details_screen.dart | 14 +- .../rate_appointment_doctor.dart | 1 - lib/uitl/translations_delegate_base.dart | 9 + lib/uitl/utils_new.dart | 19 ++ .../data_display/medical/doctor_card.dart | 2 +- lib/widgets/new_design/doctor_header.dart | 4 +- 27 files changed, 293 insertions(+), 284 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c80c87ac..ec234553 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -797,6 +797,7 @@ const Map localizedValues = { "mass": {"en": "Mass", "ar": "كتلة"}, "temp-c": {"en": "°C", "ar": "°س"}, "bpm": {"en": "bpm", "ar": "نبضة"}, + "respirationBPM": {"en": "bpm", "ar": "نفس"}, "respiration-signs": {"en": "Respiration", "ar": "تنفس"}, "sys-dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"}, "body": {"en": "Body Mass", "ar": "كتلة\nالجسم"}, @@ -1213,6 +1214,7 @@ const Map localizedValues = { "pound": {"en": "Pound", "ar": "رطل"}, "seeListOfDoctor": {"en": "See List Of Doctors", "ar": "انظر قائمة الأطباء"}, "obese": {"en": "Obese", "ar": "سمين"}, + "extremeObese": {"en": "Extreme Obese", "ar": "السمنة المفرطة"}, "overWeight": {"en": "OverWeight", "ar": "وزن زائد"}, "healthy": {"en": "Healthy", "ar": "صحي"}, "underWeight": {"en": "UnderWeight", "ar": "نقص الوزن"}, @@ -1528,4 +1530,6 @@ const Map localizedValues = { "insuredPatient": {"en": "Insured Patient", "ar": "هل لدى المريض تامين؟"}, "rateDoctor": {"en": "Rate Doctor", "ar": "تقييم الطبيب"}, "rateAppointment": {"en": "Rate Appointment", "ar": "سعر التعيين"}, + "noInsuranceCardAttached": {"en": "Please attach your insurance card image to continue", "ar": "يرجى إرفاق صورة بطاقة التأمين الخاصة بك للمتابعة"}, + "bodyMassIndex": {"en": "Body Mass Index is: ", "ar": "مؤشر كتلة الجسم هو:"}, }; diff --git a/lib/core/service/feedback/feedback_service.dart b/lib/core/service/feedback/feedback_service.dart index b36ebee3..d6da1ee3 100644 --- a/lib/core/service/feedback/feedback_service.dart +++ b/lib/core/service/feedback/feedback_service.dart @@ -41,10 +41,13 @@ class FeedbackService extends BaseService { _requestInsertCOCItem.deviceInfo = Platform.localHostname; _requestInsertCOCItem.resolution = "400x847"; _requestInsertCOCItem.projectID = 0; + _requestInsertCOCItem.tokenID = "C0c@@dm!n?T&A&A@Barcha202029582948"; _requestInsertCOCItem.identificationNo = int.parse(user.patientIdentificationNo); if (BASE_URL.contains('uat')) { _requestInsertCOCItem.forDemo = true; + } else { + _requestInsertCOCItem.forDemo = false; } final Map body = _requestInsertCOCItem.toJson(); diff --git a/lib/core/service/medical/BloodSugarService.dart b/lib/core/service/medical/BloodSugarService.dart index 84b932e8..9c8e9cd9 100644 --- a/lib/core/service/medical/BloodSugarService.dart +++ b/lib/core/service/medical/BloodSugarService.dart @@ -18,15 +18,14 @@ class BloodSugarService extends BaseService { Future getBloodSugar() async { hasError = false; Map body = Map(); + monthDiabtectResultAverageList.clear(); + weekDiabtectResultAverageList.clear(); + yearDiabtecResultAverageList.clear(); + monthDiabtecPatientResult.clear(); + weekDiabtecPatientResult.clear(); + yearDiabtecPatientResult.clear(); body['isDentalAllowedBackend'] = false; await baseAppClient.post(GET_DIABETIC_RESULT_AVERAGE, onSuccess: (dynamic response, int statusCode) { - monthDiabtectResultAverageList.clear(); - weekDiabtectResultAverageList.clear(); - yearDiabtecResultAverageList.clear(); - - monthDiabtecPatientResult.clear(); - weekDiabtecPatientResult.clear(); - yearDiabtecPatientResult.clear(); response['List_MonthDiabtectResultAverage'].forEach((item) { monthDiabtectResultAverageList.add(MonthDiabtectResultAverage.fromJson(item)); @@ -47,10 +46,10 @@ class BloodSugarService extends BaseService { Future getDiabtecResults() async { hasError = false; + monthDiabtecPatientResult.clear(); + weekDiabtecPatientResult.clear(); + yearDiabtecPatientResult.clear(); await baseAppClient.post(GET_DIABTEC_RESULT, onSuccess: (dynamic response, int statusCode) { - monthDiabtecPatientResult.clear(); - weekDiabtecPatientResult.clear(); - yearDiabtecPatientResult.clear(); response['List_MonthDiabtecPatientResult'].forEach((item) { monthDiabtecPatientResult.add(DiabtecPatientResult.fromJson(item)); diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart index 0a87000d..9cca6ac9 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyImageObject.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; +import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; @@ -12,6 +13,7 @@ class PharmacyModuleService extends BaseService { bool isFinished = true; String errorMsg = ''; String url = ""; + CustomerInfo customerInfo; List bannerItems = List(); List manufacturerList = List(); @@ -51,8 +53,12 @@ class PharmacyModuleService extends BaseService { hasError = false; try { await baseAppClient.getPharmacy(PHARMACY_CREATE_CUSTOMER, onSuccess: (dynamic response, int statusCode) async { - if (!response['IsRegistered']) {} - await generatePharmacyToken(); + if (!response['IsRegistered']) { + + } else { + customerInfo = CustomerInfo.fromJson(response); + } + // await generatePharmacyToken(); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; 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 47e6815e..d7d9f1c2 100644 --- a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart @@ -113,8 +113,8 @@ class HomeHealthCareViewModel extends BaseViewModel { // await _customerAddressesService.getCustomerInfo(); setState(ViewState.ErrorLocal); } else { - // await _pharmacyModuleService.createUser(); - await _customerAddressesService.getCustomerInfo(); + await _pharmacyModuleService.createUser(); + // await _customerAddressesService.getCustomerInfo(); await getCustomerAddresses(); } } diff --git a/lib/core/viewModels/medical/ask_doctor_view_model.dart b/lib/core/viewModels/medical/ask_doctor_view_model.dart index 7890fb3a..d060db1f 100644 --- a/lib/core/viewModels/medical/ask_doctor_view_model.dart +++ b/lib/core/viewModels/medical/ask_doctor_view_model.dart @@ -39,7 +39,7 @@ class AskDoctorViewModel extends BaseViewModel { }); } else { setState(ViewState.Idle); - AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).askDocEmpty); + // AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).askDocEmpty); } } diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 6d3a3afa..caadb72a 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -145,7 +145,7 @@ class _DoctorProfileState extends State with TickerProviderStateM onTap: (index) { setState(() { if (index == 1) { - if (widget.doctor.clinicID == 17 || widget.doctor.clinicID == 23 || widget.isLiveCareAppointment) { + if (widget.doctor.clinicID == 17 || widget.doctor.clinicID == 23 || widget.doctor.clinicID == 47 || widget.isLiveCareAppointment) { _tabController.index = _tabController.previousIndex; showFooterButton = false; } else { diff --git a/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart index 656d47e0..fd433f66 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-order-list-item.dart @@ -124,7 +124,7 @@ class RRTLogListItem extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.getDayMonthYearDateFormattedLang(order.createdOn, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(order.createdOn), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.4, height: 16 / 10), ), SizedBox(height: 12), diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 13b86071..0ff38fd5 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -107,7 +107,7 @@ class _AppointmentDetailsState extends State with SingleTick "", //model.user.emailAddress, ), - isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true, + isNeedToShowButton: (widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) ? false : true, buttonTitle: TranslationBase.of(context).schedule, buttonIcon: 'assets/images/new/Boo_ Appointment.svg', showConfirmMessageDialog: false, @@ -136,7 +136,7 @@ class _AppointmentDetailsState extends State with SingleTick onTap: (index) { setState(() { if (index == 1) { - if (widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) { + if (widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment) { _tabController.index = _tabController.previousIndex; AppointmentDetails.showFooterButton = false; } else { @@ -147,7 +147,7 @@ class _AppointmentDetailsState extends State with SingleTick }, tabs: [ Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))), - widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment + widget.appo.clinicID == 17 || widget.appo.clinicID == 23 || widget.appo.clinicID == 47 || widget.appo.clinicID == 265 || widget.appo.isExecludeDoctor || widget.appo.isLiveCareAppointment ? Tab( child: Text(TranslationBase.of(context).availableAppo, style: TextStyle(color: Colors.grey)), ) diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index fd402a6b..ee94a616 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -67,7 +67,7 @@ class _AppointmentActionsState extends State { padding: EdgeInsets.all(21), shrinkWrap: true, itemBuilder: (context, index) { - bool shouldEnable = (widget.appo.clinicID == 17 && appoButtonsList[index].caller == "openReschedule"); + bool shouldEnable = (widget.appo.clinicID == 17 && widget.appo.clinicID == 47 && appoButtonsList[index].caller == "openReschedule"); return InkWell( onTap: shouldEnable ? null diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index fef55190..f2a96651 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -47,7 +47,7 @@ class _PaymentMethodState extends State { updateSelectedPaymentMethod("MADA"); }, child: Card( - elevation: 3.0, + elevation: 0.0, margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( @@ -83,7 +83,7 @@ class _PaymentMethodState extends State { updateSelectedPaymentMethod("VISA"); }, child: Card( - elevation: 3.0, + elevation: 0.0, margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( @@ -119,7 +119,7 @@ class _PaymentMethodState extends State { updateSelectedPaymentMethod("MASTERCARD"); }, child: Card( - elevation: 3.0, + elevation: 0.0, margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( @@ -155,7 +155,7 @@ class _PaymentMethodState extends State { updateSelectedPaymentMethod("Installment"); }, child: Card( - elevation: 3.0, + elevation: 0.0, margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( @@ -192,7 +192,7 @@ class _PaymentMethodState extends State { updateSelectedPaymentMethod("ApplePay"); }, child: Card( - elevation: 3.0, + elevation: 0.0, margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), color: Colors.white, shape: RoundedRectangleBorder( diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 7ba5e29c..c3af1577 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -13,6 +13,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -111,7 +112,7 @@ class _SendFeedbackPageState extends State { children: [ Text( TranslationBase.of(context).likeToHear, - textAlign: TextAlign.center, + // textAlign: TextAlign.center, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 23 / 16), ), SizedBox(height: 21), @@ -159,99 +160,23 @@ class _SendFeedbackPageState extends State { isShowListAppointHistory = true; }); }, - child: Container( - // margin: EdgeInsets.all(8.0), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), - child: Row( - children: [ - Container( - width: projectViewModel.isArabic ? 27 : 20, - height: projectViewModel.isArabic ? 105 : 90, - decoration: BoxDecoration( - //Colors.red[900] Color(0xff404545) - color: appointHistory.isLiveCareAppointment - ? Color(0xff404545) - : !appointHistory.isInOutPatient - ? Colors.red[900] - : Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8), - topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), - bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0), - ), - ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - appointHistory.isLiveCareAppointment - ? TranslationBase.of(context).liveCare.toUpperCase() - : !appointHistory.isInOutPatient - ? TranslationBase.of(context).inPatient.toUpperCase() - : TranslationBase.of(context).outpatient.toUpperCase(), - style: TextStyle(color: Colors.white, fontSize: 12), - ), - )), - ), - Expanded( - flex: 4, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - children: [ - Expanded( - flex: 1, - child: LargeAvatar( - name: appointHistory.doctorNameObj, - url: appointHistory.doctorImageURL, - ), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - appointHistory.doctorNameObj, - bold: true, - ), - Texts( - DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(appointHistory.appointmentDate)), - variant: 'caption3', - ), - StarRating(totalAverage: appointHistory.doctorRate.toDouble(), forceStars: true), - ], - ), - ), - ), - ], - ), - ), - ], - ), - ), - Expanded( - flex: 1, - child: Center( - child: Icon( - Icons.arrow_forward_ios, - size: 15, - ), - ), - ) - ], - ), + child: DoctorCard( + onTap: () {}, + isInOutPatient: appointHistory.isInOutPatient, + name: appointHistory.doctorTitle + " " + appointHistory.doctorNameObj, + // billNo: _appointmentResult.invoiceNo, + profileUrl: appointHistory.doctorImageURL, + subName: appointHistory.projectName, + isLiveCareAppointment: appointHistory.isLiveCareAppointment, + date: DateUtil.convertStringToDate(appointHistory.appointmentDate), + rating: appointHistory.actualDoctorRate + 0.0, + appointmentTime: appointHistory.startTime.substring(0, 5), ), ), + SizedBox(height: 12), if (messageType == MessageType.ComplaintOnAnAppointment && model.appointHistoryList.length != 0 && isShowListAppointHistory) Container( - height: model.appointHistoryList.length > 2 ? MediaQuery.of(context).size.height * 0.25 : MediaQuery.of(context).size.height * 0.15, + height: model.appointHistoryList.length > 2 ? MediaQuery.of(context).size.height * 0.35 : MediaQuery.of(context).size.height * 0.17, child: ListView.builder( itemCount: model.appointHistoryList.length, itemBuilder: (context, index) => InkWell( @@ -261,76 +186,87 @@ class _SendFeedbackPageState extends State { isShowListAppointHistory = false; }); }, - child: Container( - margin: EdgeInsets.only(left: 8, right: 8), - color: Colors.white, - child: Column( - children: [ - Row( - children: [ - Expanded( - flex: 4, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( - children: [ - Expanded( - flex: 1, - child: LargeAvatar( - name: model.appointHistoryList[index].doctorNameObj, - url: model.appointHistoryList[index].doctorImageURL, - ), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - model.appointHistoryList[index].doctorNameObj, - bold: true, - ), - Texts( - DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)), - variant: 'caption3', - ), - StarRating(totalAverage: model.appointHistoryList[index].doctorRate.toDouble(), forceStars: true), - ], - ), - ), - ), - ], - ), - ), - ], - ), - ), - Expanded( - flex: 1, - child: Center( - child: Icon( - Icons.arrow_forward_ios, - size: 15, - ), - ), - ) - ], - ), - SizedBox( - height: 5, - ), - Divider( - height: 0.5, - color: Colors.grey[400], - ) - ], - ), + child: DoctorCard( + onTap: () {}, + isInOutPatient: model.appointHistoryList[index].isInOutPatient, + name: model.appointHistoryList[index].doctorTitle + " " + model.appointHistoryList[index].doctorNameObj, + profileUrl: model.appointHistoryList[index].doctorImageURL, + subName: model.appointHistoryList[index].projectName, + isLiveCareAppointment: model.appointHistoryList[index].isLiveCareAppointment, + date: DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate), + rating: model.appointHistoryList[index].actualDoctorRate + 0.0, + appointmentTime: model.appointHistoryList[index].startTime.substring(0, 5), ), + // Container( + // margin: EdgeInsets.only(left: 8, right: 8), + // color: Colors.white, + // child: Column( + // children: [ + // Row( + // children: [ + // Expanded( + // flex: 4, + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Padding( + // padding: const EdgeInsets.all(10.0), + // child: Row( + // children: [ + // Expanded( + // flex: 1, + // child: LargeAvatar( + // name: model.appointHistoryList[index].doctorNameObj, + // url: model.appointHistoryList[index].doctorImageURL, + // ), + // ), + // Expanded( + // flex: 4, + // child: Container( + // margin: EdgeInsets.all(10), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Texts( + // model.appointHistoryList[index].doctorNameObj, + // bold: true, + // ), + // Texts( + // DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(model.appointHistoryList[index].appointmentDate)), + // variant: 'caption3', + // ), + // StarRating(totalAverage: model.appointHistoryList[index].doctorRate.toDouble(), forceStars: true), + // ], + // ), + // ), + // ), + // ], + // ), + // ), + // ], + // ), + // ), + // Expanded( + // flex: 1, + // child: Center( + // child: Icon( + // Icons.arrow_forward_ios, + // size: 15, + // ), + // ), + // ) + // ], + // ), + // SizedBox( + // height: 5, + // ), + // Divider( + // height: 0.5, + // color: Colors.grey[400], + // ) + // ], + // ), + // ), ), ), ), @@ -515,19 +451,6 @@ class _SendFeedbackPageState extends State { ), suffixIconConstraints: BoxConstraints(minWidth: 50), suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), - // prefixIconConstraints: BoxConstraints(minWidth: 50), - // prefixIcon: suffix == null - // ? null - // : Text( - // "+" + suffix, - // style: TextStyle( - // fontSize: 14, - // height: 21 / 14, - // fontWeight: FontWeight.w500, - // color: Color(0xff2E303A), - // letterSpacing: -0.56, - // ), - // ), contentPadding: EdgeInsets.zero, border: InputBorder.none, focusedBorder: InputBorder.none, @@ -581,8 +504,11 @@ class _SendFeedbackPageState extends State { GifLoaderDialogUtils.hideDialog(context); setState(() { appointHistory = null; + isShowListAppointHistory = true; }); }); + } else { + isShowListAppointHistory = false; } setMessageType(value); }, diff --git a/lib/pages/feedback/status_feedback_page.dart b/lib/pages/feedback/status_feedback_page.dart index 18993f1d..ae13d81b 100644 --- a/lib/pages/feedback/status_feedback_page.dart +++ b/lib/pages/feedback/status_feedback_page.dart @@ -1,13 +1,16 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/feedback/feedback-detail.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class StatusFeedbackPage extends StatefulWidget { @override @@ -17,6 +20,7 @@ class StatusFeedbackPage extends StatefulWidget { class _StatusFeedbackPageState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getCOC(), builder: (_, model, widget) => AppScaffold( @@ -28,67 +32,70 @@ class _StatusFeedbackPageState extends State { child: model.cOCItemList.isNotEmpty ? Container( margin: EdgeInsets.only(top: 8.0, left: 8.0, right: 8.0, bottom: 80), - padding: EdgeInsets.all(15.0), child: ListView.builder( itemCount: model.cOCItemList.length, itemBuilder: (context, index) => InkWell( - onTap: () { - gotodetails(model.cOCItemList[index]); - }, - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - border: Border.all(color: Colors.white, width: 0.5), - borderRadius: BorderRadius.all(Radius.circular(5)), - color: Colors.white, - ), - margin: EdgeInsets.all(4), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts('${model.cOCItemList[index].cOCTitle}'), - Texts( - TranslationBase.of(context).number + ' : ${model.cOCItemList[index].itemID}', - variant: 'overline', - ), - ], - ), - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts('${model.cOCItemList[index].status}'), - Texts( - '${model.cOCItemList[index].date}', - variant: 'overline', - ), - ], - ), - ), - ], - ), - Texts('${model.cOCItemList[index].formType}'), - Divider( - height: 4.5, - color: Colors.grey[500], - ) - ], + onTap: () { + // gotodetails(model.cOCItemList[index]); + }, + child: Card( + shape: cardRadius(12), + margin: EdgeInsets.all(10), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(projectViewModel.isArabic ? model.cOCItemList[index].statusAr : model.cOCItemList[index].status, + style: TextStyle(fontSize: 14.0, letterSpacing: -0.56, fontWeight: FontWeight.bold)), + Container( + margin: EdgeInsets.only(top: 5.0), + child: Text(model.cOCItemList[index].formType, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + color: Color(0xff2B353E), + letterSpacing: -0.48, + height: 18 / 12))), + myRichText(TranslationBase.of(context).number + ": ", model.cOCItemList[index].itemID.toString(), projectViewModel.isArabic), + Text(model.cOCItemList[index].cOCTitle, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + color: Color(0xff2B353E), + letterSpacing: -0.48, + height: 18 / 12)), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text(model.cOCItemList[index].date.split(" ")[0], + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + color: Color(0xff2B353E), + letterSpacing: -0.48)), + Text(model.cOCItemList[index].date.split(" ")[1], + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + color: Color(0xff2B353E), + letterSpacing: -0.48)), + ], + ), + ], + ), ), ), - ))), + )), ) : Center( child: Column( @@ -122,7 +129,8 @@ class _StatusFeedbackPageState extends State { padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: DefaultButton( TranslationBase.of(context).search, - () => {}, + projectViewModel.isLogin ? null : () => {}, + disabledColor: Colors.grey, ), ), ], diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart index 38fd75d5..8272f0c2 100644 --- a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart'; import 'package:flutter/cupertino.dart'; @@ -154,8 +155,12 @@ class _AttachInsuranceCardImageDialogState extends State { description: TranslationBase.of(context).infoApprovals, infoList: TranslationBase.of(context).infoApprovalPoints, imagesInfo: imagesInfo, - body: ListView.separated( + body: model.insuranceApproval.length > 0 ? ListView.separated( padding: EdgeInsets.all(21), physics: BouncingScrollPhysics(), itemBuilder: (_, index) { @@ -164,7 +166,7 @@ class _InsuranceApprovalState extends State { ); }, separatorBuilder: (context, index) => SizedBox(height: 12), - itemCount: model.insuranceApproval.length)), + itemCount: model.insuranceApproval.length) : getNoDataWidget(context)), ); } diff --git a/lib/pages/insurance/insurance_page.dart b/lib/pages/insurance/insurance_page.dart index e1f347a0..58a9e64a 100644 --- a/lib/pages/insurance/insurance_page.dart +++ b/lib/pages/insurance/insurance_page.dart @@ -150,7 +150,9 @@ class InsurancePage extends StatelessWidget { patientID: patientID, patientIdentificationID: patientIdentificationID, name: name, - ))); + ))).then((value) { + model.getInsuranceUpdated(); + }); } else { AppToast.showErrorToast(message: _insuranceCardService.error); } diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index ccff9042..389baf24 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -4,9 +4,11 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/ask_doctor/request_type.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -22,7 +24,20 @@ class AskDoctorPage extends StatelessWidget { onModelReady: (model) => model.getMyDoctor(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - body: _appointmentExpandableList(model.patientDoctorAppointmentListHospital, model), + body: model.patientDoctorAppointmentListHospital.length > 0 ? _appointmentExpandableList(model.patientDoctorAppointmentListHospital, model) : noDoctor(context), + ), + ); + } + + Widget noDoctor(BuildContext context) { + return Container( + margin: EdgeInsets.only(left: 50.0, right: 50.0), + child: Center( + child: Text(TranslationBase.of(context).askDocEmpty, textAlign: TextAlign.center, style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w400, + color: CustomColors.accentColor + )), ), ); } diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 9e1e042e..9e587b7f 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -258,16 +259,13 @@ class _AdvancePaymentPageState extends State { ), ), bottomSheet: Container( - height: 70, width: double.infinity, + color: Theme.of(context).scaffoldBackgroundColor, padding: EdgeInsets.all(12), - color: Colors.white, - child: SecondaryButton( - textColor: Colors.white, - label: TranslationBase.of(context).submit, - color: CustomColors.accentColor, - disabled: amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null, - onTap: () { + child: DefaultButton( + TranslationBase.of(context).submit, + (amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null) ? null : + () { var mobileNum; var patientName; @@ -320,6 +318,7 @@ class _AdvancePaymentPageState extends State { } }); }, + disabledColor: Colors.grey, ), )), ); diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart index 81d8c150..8d82b13c 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -109,7 +109,11 @@ class WeightWeeklyPage extends StatelessWidget { model: model, ), ), - ); + ).then((value) { + if (model.weekWeightMeasurementResult.isEmpty) { + model.weightWeekTimeSeriesData.clear(); + } + }); }, child: Container( // height: 70, diff --git a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart index 1262897c..b4974159 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/bloodPressureWeeklyPage.dart @@ -111,7 +111,12 @@ class BloodPressureWeeklyPage extends StatelessWidget { measureTimeSelectedType: diabtec.measuredArmDesc, ), ), - ); + ).then((value) { + if(model.weekDiabtecPatientResult.isEmpty) { + model.weightWeekTimeSeriesDataTop.clear(); + model.weightWeekTimeSeriesDataLow.clear(); + } + }); }, child: Container( // height: 70, diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart index 9afcd888..537265ed 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_weekly_page.dart @@ -116,7 +116,11 @@ class BloodSugarWeeklyPage extends StatelessWidget { bloodSugarViewMode: bloodSugarViewMode, ), ), - ); + ).then((value) { + if(bloodSugarViewMode.weekDiabtecPatientResult.isEmpty) { + timeSeriesData.clear(); + } + }); }, child: Container( // height: 70, diff --git a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart index d11e91f5..89f5545f 100644 --- a/lib/pages/medical/vital_sign/vital_sign_details_screen.dart +++ b/lib/pages/medical/vital_sign/vital_sign_details_screen.dart @@ -33,7 +33,7 @@ class VitalSignDetailsScreen extends StatelessWidget { // vitalSigns.add(new VitalSign(TranslationBase.of(context).body, mode.bodyMax, TranslationBase.of(context).mass, "assets/images/new/")); vitalSigns.add(new VitalSign(TranslationBase.of(context).temperature, mode.temperatureCelcius, TranslationBase.of(context).tempC, "assets/images/new/temperature.svg")); vitalSigns.add(new VitalSign(TranslationBase.of(context).heart, mode.hartRat, TranslationBase.of(context).bpm, "assets/images/new/heart_rate.svg")); - vitalSigns.add(new VitalSign(TranslationBase.of(context).respirationRate, mode.respirationBeatPerMinute, TranslationBase.of(context).bpm, "assets/images/new/respiration_rate.svg")); + vitalSigns.add(new VitalSign(TranslationBase.of(context).respirationRate, mode.respirationBeatPerMinute, TranslationBase.of(context).respirationBPM, "assets/images/new/respiration_rate.svg")); vitalSigns.add(new VitalSign(TranslationBase.of(context).bloodPressure, mode.bloodPressure, TranslationBase.of(context).sysDias, "assets/images/new/blood_pressure.svg")); } @@ -71,7 +71,7 @@ class VitalSignDetailsScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Body Mass Index is: " + mode.bodyMax, + TranslationBase.of(context).bodyMassIndex + mode.bodyMax, style: TextStyle( fontSize: 16, letterSpacing: -0.64, @@ -83,15 +83,15 @@ class VitalSignDetailsScreen extends StatelessWidget { height: MediaQuery.of(context).size.width / 2.8, child: Row( children: [ - showMass(context, "Underweight", "< 18.5", double.parse(mode.bodyMax) <= 18.5 ? Colors.red : Colors.black, 8), + showMass(context, TranslationBase.of(context).underWeight, "< 18.5", double.parse(mode.bodyMax) <= 18.5 ? Colors.red : Colors.black, 8), mWidth(12), - showMass(context, "Normal", "18.5 - 24.9", (double.parse(mode.bodyMax) > 18.5 && double.parse(mode.bodyMax) < 25) ? Colors.red : Colors.black, 6), + showMass(context, TranslationBase.of(context).healthy, "18.5 - 24.9", (double.parse(mode.bodyMax) > 18.5 && double.parse(mode.bodyMax) < 25) ? Colors.red : Colors.black, 6), mWidth(12), - showMass(context, "Overweight", "25 - 29.9", (double.parse(mode.bodyMax) >= 25 && double.parse(mode.bodyMax) < 30) ? Colors.red : Colors.black, 4), + showMass(context, TranslationBase.of(context).overWeight, "25 - 29.9", (double.parse(mode.bodyMax) >= 25 && double.parse(mode.bodyMax) < 30) ? Colors.red : Colors.black, 4), mWidth(12), - showMass(context, "Obese", "30 - 34.9", (double.parse(mode.bodyMax) >= 30 && double.parse(mode.bodyMax) < 35) ? Colors.red : Colors.black, 2), + showMass(context, TranslationBase.of(context).obese, "30 - 34.9", (double.parse(mode.bodyMax) >= 30 && double.parse(mode.bodyMax) < 35) ? Colors.red : Colors.black, 2), mWidth(12), - showMass(context, "Extreme Obese", "> 35", (double.parse(mode.bodyMax) >= 35) ? Colors.red : Colors.black, 0), + showMass(context, TranslationBase.of(context).extremeObese, "> 35", (double.parse(mode.bodyMax) >= 35) ? Colors.red : Colors.black, 0), ], ), ), diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 241412e9..aaf9aa06 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -111,7 +111,6 @@ class _RateAppointmentDoctorState extends State { color: rating >= (index + 1) ? Color.fromRGBO(255, 186, 0, 1.0) : Colors.grey[400], - // Theme.of(context).hintColor, icon: Icon(rating >= (index + 1) ? Icons.star : Icons.star)), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 8b3c72cf..9676871f 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2326,6 +2326,15 @@ class TranslationBase { String get rateAppointment => localizedValues["rateAppointment"][locale.languageCode]; + String get noInsuranceCardAttached => localizedValues["noInsuranceCardAttached"][locale.languageCode]; + + String get bodyMassIndex => localizedValues["bodyMassIndex"][locale.languageCode]; + + String get extremeObese => localizedValues["extremeObese"][locale.languageCode]; + + String get respirationBPM => localizedValues["respirationBPM"][locale.languageCode]; + + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/uitl/utils_new.dart b/lib/uitl/utils_new.dart index 0040a1f2..124b3b45 100644 --- a/lib/uitl/utils_new.dart +++ b/lib/uitl/utils_new.dart @@ -1,6 +1,9 @@ import 'dart:ui'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; Decoration appGradient = BoxDecoration( gradient: LinearGradient( @@ -23,6 +26,22 @@ Color getColorFromHex(String hexColor) { return Color(int.parse(hexColor, radix: 16)); } +Widget getNoDataWidget(BuildContext context) { + return Container( + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgPicture.asset('assets/images/new/not_found.svg', width: 110.0, height: 110.0), + Container( + margin: EdgeInsets.only(top: 15.0), + child: Text(TranslationBase.of(context).noResultFound, style: TextStyle(fontSize: 14, fontWeight: FontWeight.w400, color: Color(0xFFBABABA)))), + ], + ), + ), + ); +} + spacerVertical(double v) { return Container( height: v, diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 8ddca1b2..81defe5d 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -133,7 +133,7 @@ class DoctorCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ Text( - DateUtil.getDayMonthYearDateFormattedLang(date, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(date), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), Text( diff --git a/lib/widgets/new_design/doctor_header.dart b/lib/widgets/new_design/doctor_header.dart index 06f392bd..79cccab3 100644 --- a/lib/widgets/new_design/doctor_header.dart +++ b/lib/widgets/new_design/doctor_header.dart @@ -75,7 +75,7 @@ class DoctorHeader extends StatelessWidget { children: [ if (headerModel.date != null) Text( - DateUtil.getDayMonthYearDateFormattedLang(headerModel.date, projectViewModel.isArabic), + DateUtil.getDayMonthYearDateFormatted(headerModel.date), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), ), if (headerModel.time != null) @@ -118,7 +118,7 @@ class DoctorHeader extends StatelessWidget { ), SizedBox(width: 6), Text( - "${headerModel.totalReviews} ${TranslationBase.of(context).reviews}", + "${headerModel.totalReviews == null ? 0 : headerModel.totalReviews} ${TranslationBase.of(context).reviews}", style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, From 1b387c2dbfb4ae9868bac763cc435376de1384b1 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 6 Oct 2021 15:56:39 +0300 Subject: [PATCH 07/27] changes pushed --- .../NewHomeHealthCare/new_Home_health_care_step_three_page.dart | 2 +- lib/pages/ErService/rapid-response-team/rrt-place-order.dart | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart index e07b7d70..540f0e7f 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart @@ -178,7 +178,7 @@ class _NewHomeHealthCareStepThreePageState extends State Utils.route(route, equalsTo: HomeHealthCarePage)); Navigator.push(context, FadePage(page: HomeHealthCarePage())); }, ); diff --git a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart index 41b4b2fe..262ef1b6 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart @@ -208,5 +208,6 @@ class RRTPlaceOrderPage extends StatelessWidget { gotoRRTRoot() { Navigator.popUntil(_context, (route) => Utils.route(route, equalsTo: RRTMainScreen)); + Navigator.push(_context, FadePage(page: RRTMainScreen())); } } From 06c5ee269b8cf2034151c3d2f9699831bd040393 Mon Sep 17 00:00:00 2001 From: "Mirza.Shafique" Date: Wed, 6 Oct 2021 15:57:56 +0300 Subject: [PATCH 08/27] Bug Fixes --- assets/images/new/ic_zoom.svg | 53 +++ .../NewCMC/new_cmc_step_one_page.dart | 7 +- .../covid-dirvethru-questions.dart | 16 +- .../covid-payment-details.dart | 1 + .../covid-payment-summary.dart | 12 +- .../landing/widgets/logged_slider_view.dart | 32 +- .../my_trackers/Weight/WeightHomePage.dart | 47 +- .../my_trackers/Weight/WeightMonthlyPage.dart | 98 ++-- .../my_trackers/Weight/WeightWeeklyPage.dart | 80 ++-- .../my_trackers/Weight/WeightYeaPage.dart | 88 ++-- .../my_trackers/widget/LineChartCurved.dart | 121 ++++- .../widget/MonthLineChartCurved.dart | 17 +- .../PrescriptionIDeliveryAddressPage.dart | 436 ++++++++++-------- .../PrescriptionOrderOverveiw.dart | 251 +++++----- .../medical/vital_sign/LineChartCurved.dart | 9 - lib/widgets/buttons/button.dart | 66 +-- .../dialogs/ConfirmWithMessageDialog.dart | 103 +++-- lib/widgets/dialogs/confirm_dialog.dart | 126 ++++- 18 files changed, 930 insertions(+), 633 deletions(-) create mode 100644 assets/images/new/ic_zoom.svg diff --git a/assets/images/new/ic_zoom.svg b/assets/images/new/ic_zoom.svg new file mode 100644 index 00000000..f7449eeb --- /dev/null +++ b/assets/images/new/ic_zoom.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 4320eb21..32aaa898 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 @@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/photo_view_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; import 'package:provider/provider.dart'; import 'new_cmc_step_tow_page.dart'; @@ -124,10 +125,8 @@ class _NewCMCStepOnePageState extends State { ), margin: EdgeInsets.all(12), child: IconButton( - icon: Icon( - Icons.view_carousel_rounded, - color: Colors.white, - ), + icon: SvgPicture.asset("assets/images/new/ic_zoom.svg",color: Colors.white,), + padding: EdgeInsets.all(12), onPressed: () { showDraggableDialog(context, PhotoViewPage(projectViewModel.isArabic ? "assets/images/cc_ar.png" : "assets/images/cc_en.png")); }, diff --git a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart index 458d9ec2..97953978 100644 --- a/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart +++ b/lib/pages/Covid-DriveThru/covid-dirvethru-questions.dart @@ -145,6 +145,7 @@ class CovidDirveThruQuestionsState extends State { itemBuilder: (ctx, idx) { var obj = qa[idx]; var qtext = isArabic ? obj["questionAR"] : obj["questionEN"]; + print("dddddddddddddd " + obj["ans"].toString()); return Padding( padding: const EdgeInsets.symmetric(vertical: 10), @@ -170,6 +171,7 @@ class CovidDirveThruQuestionsState extends State { onChanged: (newValue) { setState(() { obj["ans"] = newValue; + checkAllChecked(); }); }), Text( @@ -192,6 +194,7 @@ class CovidDirveThruQuestionsState extends State { onChanged: (newValue) { setState(() { obj["ans"] = newValue; + checkAllChecked(); }); }), Text( @@ -228,7 +231,7 @@ class CovidDirveThruQuestionsState extends State { child: MaterialButton( height: 50, elevation: 0, - color: CustomColors.accentColor, + color: all2 ? CustomColors.accentColor : CustomColors.grey, disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), child: Text( @@ -249,6 +252,17 @@ class CovidDirveThruQuestionsState extends State { )); } + bool all2 = false; + + checkAllChecked() { + all2 = true; + qa.forEach((element) { + if (element["ans"] == 2 || element["ans"] == null) { + all2 = false; + } + }); + } + next() async { bool all = true; qa.forEach((element) { diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index 29a269af..81ba1285 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -117,6 +117,7 @@ class _CovidPaymentDetailsState extends State { onTap: () { setState(() { widget.selectedProcedure = widget.proceduresList[index]; + getPaymentInfo(context, widget.projectID.toString(), widget.selectedProcedure.procedureID); }); }, child: ListTile( diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index 62eb6942..c47c8d36 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.da import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -251,7 +252,16 @@ class _CovidPaymentSummaryState extends State { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { print("onBrowserExit Called!!!!"); - if (isPaymentMade) checkPaymentStatus(appo); + if (isPaymentMade) { + checkPaymentStatus(appo); + } else { + print("onBrowserExit Payment Not made"); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route route) => false, + ); + } } checkPaymentStatus(AppoitmentAllHistoryResultList appo) { diff --git a/lib/pages/landing/widgets/logged_slider_view.dart b/lib/pages/landing/widgets/logged_slider_view.dart index a73b4531..a239e789 100644 --- a/lib/pages/landing/widgets/logged_slider_view.dart +++ b/lib/pages/landing/widgets/logged_slider_view.dart @@ -137,19 +137,20 @@ class LoggedSliderView extends StatelessWidget { padding: const EdgeInsets.only(left: 20, right: 20), child: Row( children: [ - Expanded( flex: 3, + Expanded( + flex: 3, child: Row( children: [ SvgPicture.asset( 'assets/images/new/height.svg', - width: 12, - height: 12, + width: 11, + height: 11, ), mWidth(6), Texts( "${TranslationBase.of(context).height}: ${model.heightCm} ${TranslationBase.of(context).cm}", color: Colors.white, - fontSize: 10, + fontSize: 8, ) ], ), @@ -157,16 +158,21 @@ class LoggedSliderView extends StatelessWidget { SizedBox( width: 3, ), - Expanded( flex: 3, + Expanded( + flex: 3, child: Row( children: [ SvgPicture.asset( 'assets/images/new/weight.svg', - width: 12, - height: 12, + width: 11, + height: 11, ), mWidth(6), - Texts('${TranslationBase.of(context).weight}: ${model.weightKg} ${TranslationBase.of(context).kg}', color: Colors.white, fontSize: 10) + Texts( + '${TranslationBase.of(context).weight}: ${model.weightKg} ${TranslationBase.of(context).kg}', + color: Colors.white, + fontSize: 8, + ) ], ), ), @@ -179,11 +185,15 @@ class LoggedSliderView extends StatelessWidget { children: [ SvgPicture.asset( 'assets/images/new/blood.svg', - width: 12, - height: 12, + width: 11, + height: 11, ), mWidth(6), - Texts('${TranslationBase.of(context).bloodType1} ${model.booldType}', color: Colors.white, fontSize: 10) + Texts( + '${TranslationBase.of(context).bloodType1} ${model.booldType}', + color: Colors.white, + fontSize: 8, + ) ], ), ), diff --git a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart index 1f1dda1c..d7dcafa7 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/TabBarWidget.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -49,6 +50,7 @@ class _WeightHomePageState extends State with SingleTickerProvid showNewAppBar: true, showNewAppBarTitle: true, appBarTitle: TranslationBase.of(context).weight, + backgroundColor: CustomColors.appBackgroudGrey2Color, appBarIcons: [ IconButton( icon: Icon(Icons.email), @@ -106,35 +108,22 @@ class _WeightHomePageState extends State with SingleTickerProvid ) ], ), - floatingActionButton: Stack( - children: [ - Positioned( - bottom: 80, - right: projectViewModel.isArabic ? MediaQuery.of(context).size.width * .85 : 0, - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: AddWeightPage( - model: model, - ))); - }, - child: Container( - width: 55, - height: 55, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).primaryColor, - ), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, - ), - ), - ))) - ], + floatingActionButton: FloatingActionButton( + child: Icon( + Icons.add, + color: Colors.white, + ), + backgroundColor: CustomColors.accentColor, + onPressed: () { + Navigator.push( + context, + FadePage( + page: AddWeightPage( + model: model, + ), + ), + ); + }, ), ), ), diff --git a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart index 5088d572..05485adf 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightMonthlyPage.dart @@ -2,9 +2,11 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart'; +import 'package:diplomaticquarterapp/theme/colors.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/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -20,62 +22,74 @@ class WeightMonthlyPage extends StatelessWidget { this.model, }) : super(key: key); List monthlyGroup = []; + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); groupData(); return AppScaffold( isShowDecPage: false, + backgroundColor: CustomColors.appBackgroudGrey2Color, body: ListView( children: [ - Container( - width: double.maxFinite, - color: Colors.white, - child: MonthLineChartCurved( - horizontalInterval: 1.0, - title: TranslationBase.of(context).weight, - timeSeries: model.weighMonthTimeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesData, - indexes: model.weighMonthTimeSeriesData.length ~/ 5.5, - )), - SizedBox( - height: 12, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts(TranslationBase.of(context).details), + Card( + shape: cardRadius(12), + elevation: 1, + margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), + child: MonthLineChartCurved( + horizontalInterval: 1.0, + title: TranslationBase.of(context).weight, + timeSeries: model.weighMonthTimeSeriesData.isEmpty ? [TimeSeriesSales3(0, 0.0)] : model.weighMonthTimeSeriesData, + indexes: model.weighMonthTimeSeriesData.length ~/ 5.5, + ), ), - Container( - padding: EdgeInsets.all(10), - color: Colors.transparent, + Card( + shape: cardRadius(12), + elevation: 1, + margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ - model.weighMonthTimeSeriesData.isEmpty - ? Container( - child: Center( - child: Texts(TranslationBase.of(context).noDataAvailable), - ), - ) - : Column(children: [ - for (var monthly in monthlyGroup) - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: double.maxFinite, - padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)), - child: Texts(monthly[0])), - Table( - columnWidths: { - 0: FlexColumnWidth(2.5), - // 2: FlexColumnWidth(1.8), - }, - children: fullData(context, projectViewModel, monthly[1]), + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts(TranslationBase.of(context).details), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + model.weighMonthTimeSeriesData.isEmpty + ? Container( + child: Center( + child: Texts(TranslationBase.of(context).noDataAvailable), + ), ) - ]) - ]) + : Column(children: [ + for (var monthly in monthlyGroup) + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Container( + width: double.maxFinite, + padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)), + child: Texts(monthly[0])), + Table( + columnWidths: { + 0: FlexColumnWidth(2.5), + // 2: FlexColumnWidth(1.8), + }, + children: fullData(context, projectViewModel, monthly[1]), + ) + ]) + ]) + ], + ), + ) ], ), - ) + ), + mHeight(80), ], ), ); diff --git a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart index 81d8c150..4ff833b0 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightWeeklyPage.dart @@ -1,9 +1,11 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; +import 'package:diplomaticquarterapp/theme/colors.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/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -25,46 +27,64 @@ class WeightWeeklyPage extends StatelessWidget { return AppScaffold( isShowDecPage: false, + backgroundColor: CustomColors.appBackgroudGrey2Color, body: ListView( children: [ - Container( - margin: EdgeInsets.only(top: 12, left: 8, right: 8), - color: Colors.white, + // Container( + // margin: EdgeInsets.only(top: 12, left: 8, right: 8), + // color: Colors.white, + // child: LineChartCurved( + // horizontalInterval: 1.0, + // title: TranslationBase.of(context).weight, + // timeSeries: model.weightWeekTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesData, + // indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0, + // ), + // ), + Card( + shape: cardRadius(12), + elevation: 1, + margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), child: LineChartCurved( - horizontalInterval: 1.0, title: TranslationBase.of(context).weight, timeSeries: model.weightWeekTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightWeekTimeSeriesData, indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0, ), ), - SizedBox( - height: 12, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts(TranslationBase.of(context).details), - ), - Container( - padding: EdgeInsets.all(10), - color: Colors.transparent, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - model.weightWeekTimeSeriesData.isEmpty - ? Container( - child: Center( - child: Texts(TranslationBase.of(context).noDataAvailable), - ), - ) - : Table( - columnWidths: { - 0: FlexColumnWidth(2.5), - }, - children: fullData(context, projectViewModel, model), - ), + Card( + shape: cardRadius(12), + elevation: 1, + margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), + child: Column(crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts(TranslationBase.of(context).details), + ), + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + model.weightWeekTimeSeriesData.isEmpty + ? Container( + child: Center( + child: Texts(TranslationBase.of(context).noDataAvailable), + ), + ) + : Table( + columnWidths: { + 0: FlexColumnWidth(2.5), + }, + children: fullData(context, projectViewModel, model), + ), + ], + ), + ) ], ), - ) + ), + mHeight(80), ], ), ); diff --git a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart index 9c2414eb..843e438b 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightYeaPage.dart @@ -2,9 +2,11 @@ import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/core/viewModels/medical/weight_pressure_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; +import 'package:diplomaticquarterapp/theme/colors.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/charts/app_time_series_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -26,55 +28,63 @@ class WeightYearPage extends StatelessWidget { groupData(); return AppScaffold( isShowDecPage: false, + backgroundColor: CustomColors.appBackgroudGrey2Color, body: ListView( children: [ - Container( - width: double.maxFinite, - color: Colors.white, + Card( + shape: cardRadius(12), + elevation: 1, + margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), child: LineChartCurved( horizontalInterval: 2.0, title: TranslationBase.of(context).weight, timeSeries: model.weightYearTimeSeriesData.isEmpty ? [TimeSeriesSales2(DateTime.now(), 0.0)] : model.weightYearTimeSeriesData, indexes: model.weightYearTimeSeriesData.length ~/ 5.5 ?? "", )), - SizedBox( - height: 12, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts(TranslationBase.of(context).details), - ), - Container( - padding: EdgeInsets.all(10), - color: Colors.transparent, + + Card( + shape: cardRadius(12), + elevation: 1, + margin: EdgeInsets.only(left: 16, top: 16, right: 16, bottom: 8), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - model.weightYearTimeSeriesData.isEmpty - ? Container( - child: Center( - child: Texts(TranslationBase.of(context).noDataAvailable), - ), - ) - : Column(children: [ - for (var monthly in monthlyGroup) - Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - width: double.maxFinite, - padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)), - child: Texts(monthly[0])), - Table( - columnWidths: { - 0: FlexColumnWidth(2.5), - }, - children: fullData(context, projectViewModel, monthly[1]), - ) - ]) - ]), - ], + crossAxisAlignment: CrossAxisAlignment.start,children: [ Padding( + padding: const EdgeInsets.all(8.0), + child: Texts(TranslationBase.of(context).details), ), - ) + Container( + padding: EdgeInsets.all(10), + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + model.weightYearTimeSeriesData.isEmpty + ? Container( + child: Center( + child: Texts(TranslationBase.of(context).noDataAvailable), + ), + ) + : Column(children: [ + for (var monthly in monthlyGroup) + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ + Container( + width: double.maxFinite, + padding: EdgeInsets.only(top: 10, bottom: 10, left: 5, right: 5), + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(5)), + child: Texts(monthly[0])), + Table( + columnWidths: { + 0: FlexColumnWidth(2.5), + }, + children: fullData(context, projectViewModel, monthly[1]), + ) + ]) + ]), + ], + ), + )], + ), + ), + mHeight(80), ], ), ); diff --git a/lib/pages/medical/my_trackers/widget/LineChartCurved.dart b/lib/pages/medical/my_trackers/widget/LineChartCurved.dart index 2597f17c..47a5d490 100644 --- a/lib/pages/medical/my_trackers/widget/LineChartCurved.dart +++ b/lib/pages/medical/my_trackers/widget/LineChartCurved.dart @@ -36,7 +36,7 @@ class LineChartCurved extends StatelessWidget { ), Text( title, - style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2), + style: TextStyle(color: Colors.black, fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600), textAlign: TextAlign.center, ), SizedBox( @@ -44,7 +44,7 @@ class LineChartCurved extends StatelessWidget { ), Expanded( child: Padding( - padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15, bottom: 15), + padding: const EdgeInsets.only(right: 18.0, left: 16.0), child: LineChart( sampleData1(context), swapAnimationDuration: const Duration(milliseconds: 250), @@ -80,6 +80,83 @@ class LineChartCurved extends StatelessWidget { } } } + + // LineChartData sampleData1(context) { + // return LineChartData( + // lineTouchData: LineTouchData( + // touchTooltipData: LineTouchTooltipData( + // tooltipBgColor: Colors.white, + // ), + // touchCallback: (LineTouchResponse touchResponse) {}, + // handleBuiltInTouches: true, + // ), + // gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14), + // titlesData: FlTitlesData( + // bottomTitles: SideTitles( + // showTitles: true, + // getTextStyles: (value) => const TextStyle( + // color: Colors.black, + // fontSize: 10, + // ), + // // rotateAngle: 90, + // //rotateAngle:-65, + // margin: 22, + // getTitles: (value) { + // if (timeSeries.length < 15) { + // if (timeSeries.length > value.toInt()) { + // return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + // } else + // return ''; + // } else { + // if (value.toInt() == 0) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + // if (value.toInt() == timeSeries.length - 1) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + // if (xAxixs.contains(value.toInt())) { + // return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + // } + // } + // return ''; + // }, + // ), + // leftTitles: SideTitles( + // showTitles: true, + // // interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, + // interval: 3, + // getTextStyles: (value) => const TextStyle( + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 10, + // ), + // + // margin: 12, + // ), + // ), + // borderData: FlBorderData( + // show: true, + // border: const Border( + // bottom: BorderSide( + // color: Colors.black, + // width: 0.5, + // ), + // left: BorderSide( + // color: Colors.black, + // ), + // right: BorderSide( + // color: Colors.black, + // ), + // top: BorderSide( + // color: Colors.transparent, + // ), + // ), + // ), + // minX: 0, + // maxX: (timeSeries.length - 1).toDouble(), + // maxY: getMaxY() + 0.3, + // minY: 0, + // //getMinY(), + // lineBarsData: getData(context), + // ); + // } + LineChartData sampleData1(context) { return LineChartData( lineTouchData: LineTouchData( @@ -89,8 +166,7 @@ class LineChartCurved extends StatelessWidget { touchCallback: (LineTouchResponse touchResponse) {}, handleBuiltInTouches: true, ), - gridData: FlGridData( - horizontalInterval: horizontalInterval, show: true, drawVerticalLine: true, drawHorizontalLine: true), + gridData: FlGridData(show: true, drawVerticalLine: true, drawHorizontalLine: true, horizontalInterval: 14, verticalInterval: 14), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -98,8 +174,7 @@ class LineChartCurved extends StatelessWidget { color: Colors.black, fontSize: 10, ), - // rotateAngle: 90, - //rotateAngle:-65, + rotateAngle: -65, margin: 22, getTitles: (value) { if (timeSeries.length < 15) { @@ -108,10 +183,8 @@ class LineChartCurved extends StatelessWidget { } else return ''; } else { - if (value.toInt() == 0) - return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; - if (value.toInt() == timeSeries.length - 1) - return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (value.toInt() == 0) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (value.toInt() == timeSeries.length - 1) return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; if (xAxixs.contains(value.toInt())) { return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; } @@ -121,13 +194,21 @@ class LineChartCurved extends StatelessWidget { ), leftTitles: SideTitles( showTitles: true, - interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, getTextStyles: (value) => const TextStyle( color: Colors.black, fontWeight: FontWeight.bold, fontSize: 10, ), - + interval: 3.0, + // interval: getMaxY() - getMinY() <= 500 + // ? getMaxY() - getMinY() <= 50 + // ? 10 + // : 10 + // : getMaxY() - getMinY() <= 1000 + // ? 100 + // : getMaxY() - getMinY() >= 10000 + // ? 5000 + // : 200, margin: 12, ), ), @@ -149,14 +230,14 @@ class LineChartCurved extends StatelessWidget { ), ), ), - minX: 0, - maxX: (timeSeries.length - 1).toDouble(), - maxY: getMaxY() + 0.3, - minY: 0,//getMinY(), + minX: 0, + maxX: (timeSeries.length - 1).toDouble(), + maxY: getMaxY() + 0.3, + minY: 0, + //getMinY(), lineBarsData: getData(context), ); } - double getMaxY() { double max = 0; timeSeries.forEach((element) { @@ -180,9 +261,6 @@ class LineChartCurved extends StatelessWidget { List getData(context) { List spots = List(); - if (timeSeries.length == 0) { - spots.add(FlSpot(0, 0)); - } for (int index = 0; index < timeSeries.length; index++) { spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); } @@ -191,9 +269,8 @@ class LineChartCurved extends StatelessWidget { spots: spots, isCurved: true, colors: [secondaryColor], - barWidth: 5, + barWidth: 1.5, isStrokeCapRound: true, - curveSmoothness: 0.12, dotData: FlDotData( show: false, ), diff --git a/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart b/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart index 5ef71f5b..c1ef7f5a 100644 --- a/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart +++ b/lib/pages/medical/my_trackers/widget/MonthLineChartCurved.dart @@ -36,7 +36,7 @@ class MonthLineChartCurved extends StatelessWidget { ), Text( title, - style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2), + style: TextStyle(color: Colors.black, fontSize: 16, letterSpacing: -0.64, fontWeight: FontWeight.w600), textAlign: TextAlign.center, ), SizedBox( @@ -91,7 +91,12 @@ class MonthLineChartCurved extends StatelessWidget { handleBuiltInTouches: true, ), gridData: FlGridData( - horizontalInterval: horizontalInterval, show: true, drawVerticalLine: true, drawHorizontalLine: true), + horizontalInterval: 12, + show: true, + drawVerticalLine: true, + drawHorizontalLine: true, + verticalInterval: 12, + ), titlesData: FlTitlesData( bottomTitles: SideTitles( showTitles: true, @@ -111,7 +116,11 @@ class MonthLineChartCurved extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 10, ), - interval:getMaxY() - getMinY() <=500?50:getMaxY() - getMinY() <=1000?100:200, + interval: getMaxY() - getMinY() <= 500 + ? 50 + : getMaxY() - getMinY() <= 1000 + ? 100 + : 200, // getTitles: (value) { // if (value.toInt() == 0) @@ -184,7 +193,7 @@ class MonthLineChartCurved extends StatelessWidget { spots: spots, isCurved: true, colors: [secondaryColor], - barWidth: 5, + barWidth: 1.5, isStrokeCapRound: true, curveSmoothness: 0.0, dotData: FlDotData( diff --git a/lib/pages/medical/prescriptions/PrescriptionIDeliveryAddressPage.dart b/lib/pages/medical/prescriptions/PrescriptionIDeliveryAddressPage.dart index 8f04d3a0..f4d3aaed 100644 --- a/lib/pages/medical/prescriptions/PrescriptionIDeliveryAddressPage.dart +++ b/lib/pages/medical/prescriptions/PrescriptionIDeliveryAddressPage.dart @@ -7,9 +7,12 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/PrescriptionDeliveryViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart'; @@ -28,20 +31,13 @@ class PrescriptionDeliveryAddressPage extends StatefulWidget { final List prescriptionReportList; final List prescriptionReportEnhList; - const PrescriptionDeliveryAddressPage( - {Key key, - this.prescriptions, - this.prescriptionReportList, - this.prescriptionReportEnhList}) - : super(key: key); + const PrescriptionDeliveryAddressPage({Key key, this.prescriptions, this.prescriptionReportList, this.prescriptionReportEnhList}) : super(key: key); @override - _PrescriptionDeliveryAddressPageState createState() => - _PrescriptionDeliveryAddressPageState(); + _PrescriptionDeliveryAddressPageState createState() => _PrescriptionDeliveryAddressPageState(); } -class _PrescriptionDeliveryAddressPageState - extends State { +class _PrescriptionDeliveryAddressPageState extends State { AddressInfo _selectedAddress; Completer _controller = Completer(); @@ -79,218 +75,252 @@ class _PrescriptionDeliveryAddressPageState return BaseView( onModelReady: (model) => model.getCustomerInfo(), builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).shippingAddresss, - baseViewModel: model, - body: Container( - height: MediaQuery.of(context).size.height * 0.65, - child: SingleChildScrollView( - physics: BouncingScrollPhysics(), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 8, - ), - InkWell( - onTap: () { - confirmSelectLocationDialog(model.addressesList); - }, - child: Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - height: 50, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey), - borderRadius: BorderRadius.circular(7), - color: Colors.white, - shape: BoxShape.rectangle, - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - child: Text( - getAddressName(), - ), - margin: EdgeInsets.only(left: 10, right: 10), + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).shippingAddresss, + baseViewModel: model, + showNewAppBarTitle: true, + showNewAppBar: true, + backgroundColor: CustomColors.appBackgroudGrey2Color, + body: Container( + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Card( + margin: EdgeInsets.only(left: 12, right: 12, bottom: 12, top: 12), + shape: cardRadius(12), + elevation: 3, + child: Container( + child: InkWell( + onTap: () => confirmSelectLocationDialog(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, - size: 22, - color: Colors.grey, - ) - ], + height: 50, + width: double.infinity, + ), ), - ), - ), - SizedBox( - height: 10, - ), - _selectedAddress == null - ? Container( - child: Image.asset( - projectViewModel.isArabic - ? 'assets/images/pharmacy/shipping_image_ar.png' - : 'assets/images/pharmacy/shipping_image.png', - height: 300, - ), - ) - : Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - decoration: BoxDecoration( - border: Border.all(color: Colors.grey)), - height: 200, - child: GoogleMap( - mapType: MapType.normal, - markers: markers, - initialCameraPosition: _kGooglePlex, - onMapCreated: - (GoogleMapController controller) { - _controller.complete(controller); - }, + InkWell( + onTap: () async { + Navigator.push( + context, + FadePage( + page: LocationPage( + latitude: latitude, + longitude: longitude, + )), + ).then((value) { + if (value != null && value is AddNewAddressRequestModel) { + setState(() { + _selectedAddress = AddressInfo( + id: value.customer.id.toString(), + email: value.customer.email, + firstName: value.customer.addresses[0].firstName, + lastName: value.customer.addresses[0].lastName, + address1: value.customer.addresses[0].address1, + address2: value.customer.addresses[0].address2, + city: value.customer.addresses[0].city, + country: value.customer.addresses[0].country, + phoneNumber: value.customer.addresses[0].phoneNumber, + latLong: value.customer.addresses[0].latLong, + company: value.customer.addresses[0].company, + countryId: value.customer.addresses[0].countryId, + createdOnUtc: value.customer.addresses[0].createdOnUtc, + customerAttributes: value.customer.addresses[0].customerAttributes, + faxNumber: value.customer.addresses[0].faxNumber, + province: value.customer.addresses[0].province, + stateProvinceId: value.customer.addresses[0].stateProvinceId, + zipPostalCode: value.customer.addresses[0].zipPostalCode, + ); + List latLongArr = _selectedAddress.latLong.split(','); + + latitude = double.parse(latLongArr[0]); + longitude = double.parse(latLongArr[1]); + markers = Set(); + markers.add( + Marker( + markerId: MarkerId( + _selectedAddress.latLong.hashCode.toString(), + ), + position: LatLng(latitude, longitude), ), + ); + _kGooglePlex = CameraPosition( + target: LatLng(latitude, longitude), + zoom: 14.4746, + ); + }); + } + }); + }, + 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, ), ), - SizedBox( - height: 10, - ), - Texts( - TranslationBase.of(context).shippingAddresss), - SizedBox( - height: 10, - ), - Texts( - '${model.user.firstName} ${model.user.lastName}'), - SizedBox( - height: 10, - ), - Texts(_selectedAddress.address1), - SizedBox( - height: 10, - ), - Texts(_selectedAddress.address2), - SizedBox( - height: 10, - ), - Texts(_selectedAddress.city + - " " + - _selectedAddress.country), ], ), + ), + ), + if (_selectedAddress != null) + Card( + shape: cardRadius(12), + color: Colors.white, + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).selectAddress + ":", + fontSize: 12, + color: CustomColors.grey, + fontWeight: FontWeight.w600, + ), + mHeight(12), + Container( + height: 175, + 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); + // }, + // ), + child: Image.network( + "https://maps.googleapis.com/maps/api/staticmap?center=" + + _kGooglePlex.target.latitude.toString() + + "," + + _kGooglePlex.target.longitude.toString() + + "&zoom=16&size=600x300&maptype=roadmap&markers=color:red%7C" + + _kGooglePlex.target.latitude.toString() + + "," + + _kGooglePlex.target.longitude.toString() + + "&key=AIzaSyCyDbWUM9d_sBUGIE8PcuShzPaqO08NSC8", + width: double.infinity, + height: double.infinity, + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context).shippingAddresss + ":", + fontSize: 12, + color: CustomColors.grey, + fontWeight: FontWeight.w600, + ), + SizedBox( + height: 2, + ), + Texts( + '${model.user.firstName} ${model.user.lastName}', + fontSize: 12, + fontWeight: FontWeight.w600, + ), + Texts( + _selectedAddress.address1, + fontSize: 12, + fontWeight: FontWeight.w600, + ), + Texts( + _selectedAddress.address2, + fontSize: 12, + fontWeight: FontWeight.w600, + ), + Texts( + _selectedAddress.city + " " + _selectedAddress.country, + fontSize: 12, + fontWeight: FontWeight.w600, + ), + ], + ), + ), ) - ], + ], + ), + ), ), - ), - ), - bottomSheet: Container( - width: double.infinity, - height: MediaQuery.of(context).size.height * 0.25, - color: Colors.grey[100], - child: Column( - children: [ - Divider(), - Container( - width: MediaQuery.of(context).size.width * 0.8, + Card( + shape: cardRadius(0), + margin: EdgeInsets.zero, + elevation: 20, + child: Container( + width: double.infinity, + padding: EdgeInsets.only(left: 16, right: 16, top: 16), child: Button( - label: - TranslationBase.of(context).addNewAddress.toUpperCase(), + label: TranslationBase.of(context).continues.toUpperCase(), + disabled: _selectedAddress == null, + backgroundColor: _selectedAddress == null ? CustomColors.grey2 : CustomColors.accentColor, onTap: () { Navigator.push( context, FadePage( - page: LocationPage( - latitude: latitude, - longitude: longitude, - )), - ).then((value) { - if (value != null && - value is AddNewAddressRequestModel) { - setState(() { - _selectedAddress = AddressInfo( - id: value.customer.id.toString(), - email: value.customer.email, - firstName: value.customer.addresses[0].firstName, - lastName: value.customer.addresses[0].lastName, - address1: value.customer.addresses[0].address1, - address2: value.customer.addresses[0].address2, - city: value.customer.addresses[0].city, - country: value.customer.addresses[0].country, - phoneNumber: value.customer.addresses[0].phoneNumber, - latLong: value.customer.addresses[0].latLong, - company: value.customer.addresses[0].company, - countryId: value.customer.addresses[0].countryId, - createdOnUtc: value.customer.addresses[0].createdOnUtc, - customerAttributes: value.customer.addresses[0].customerAttributes, - faxNumber: value.customer.addresses[0].faxNumber, - province: value.customer.addresses[0].province, - stateProvinceId: value.customer.addresses[0].stateProvinceId, - zipPostalCode: value.customer.addresses[0].zipPostalCode, - - ); - List latLongArr = _selectedAddress.latLong.split(','); - - latitude = double.parse(latLongArr[0]); - longitude = double.parse(latLongArr[1]); - markers = Set(); - markers.add( - Marker( - markerId: MarkerId( - _selectedAddress.latLong.hashCode.toString(), - ), - position: LatLng(latitude, longitude), - ), - ); - _kGooglePlex = CameraPosition( - target: LatLng(latitude, longitude), - zoom: 14.4746, - ); - }); - } - }); + page: PrescriptionOrderOverview( + latitude: latitude, + longitude: longitude, + prescriptionReportEnhList: widget.prescriptionReportEnhList, + prescriptionReportList: widget.prescriptionReportList, + prescriptions: widget.prescriptions, + selectedAddress: _selectedAddress, + ), + ), + ); }, ), ), - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - label: - TranslationBase.of(context).continues.toUpperCase(), - disabled: _selectedAddress == null, - backgroundColor: _selectedAddress == null - ? Colors.green[300] - : Colors.green[700], - onTap: () { - Navigator.push( - context, - FadePage( - page: PrescriptionOrderOverview( - latitude: latitude, - longitude: longitude, - prescriptionReportEnhList: - widget.prescriptionReportEnhList, - prescriptionReportList: - widget.prescriptionReportList, - prescriptions: widget.prescriptions, - selectedAddress: _selectedAddress, - ), - ), - ); - }, - )) - ], - ), - )), + ), + ], + ), + ), + ), ); } diff --git a/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart b/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart index e77b29db..9a437d6a 100644 --- a/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart +++ b/lib/pages/medical/prescriptions/PrescriptionOrderOverveiw.dart @@ -5,8 +5,10 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_repor import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/PrescriptionDeliveryViewModel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.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/dialogs/ConfirmWithMessageDialog.dart'; @@ -30,146 +32,145 @@ class PrescriptionOrderOverview extends StatelessWidget { isShowAppBar: true, appBarTitle: TranslationBase.of(context).orderOverview, baseViewModel: model, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: CustomColors.appBackgroudGrey2Color, body: Container( - height: MediaQuery.of(context).size.height * 0.8, + height: double.infinity, child: Column( children: [ - if (!prescriptions.isInOutPatient) - ...List.generate( - prescriptionReportList.length, - (index) => Container( - width: double.infinity, - margin: EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all(color: Colors.grey[200], width: 0.5), - ), + Expanded( + child: Column( + children: [ + if (!prescriptions.isInOutPatient) + ...List.generate( + prescriptionReportList.length, + (index) => Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(color: Colors.grey[200], width: 0.5), + ), + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + prescriptionReportList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + prescriptionReportList[index].itemDescription.isNotEmpty ? prescriptionReportList[index].itemDescription : prescriptionReportList[index].itemDescriptionN)), + )), + + ], + ), + )) + else + ...List.generate( + prescriptionReportEnhList.length, + (index) => Card( + margin: EdgeInsets.all(12.0), + color: Colors.white, + shape: cardRadius(12), + elevation: 4, child: Row( children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - prescriptionReportList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, + Padding( + padding: const EdgeInsets.all(8.0), + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 60, + ), ), ), - SizedBox( - width: 10, - ), + Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts( - prescriptionReportList[index].itemDescription.isNotEmpty ? prescriptionReportList[index].itemDescription : prescriptionReportList[index].itemDescriptionN)), - )), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(prescriptionReportEnhList[index].itemDescription), + ], + ), + ), + ), + ], ), - )) - else - ...List.generate( - prescriptionReportEnhList.length, - (index) => Container( - margin: EdgeInsets.all(8.0), - color: Colors.white, - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(prescriptionReportEnhList[index].itemDescription), - ], - ), - ), ), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], - ), - ), - ) - ], - ), - ), - bottomSheet: Container( - width: double.infinity, - height: MediaQuery.of(context).size.height * 0.15, - color: Colors.grey[100], - child: Column( - children: [ - SizedBox( - height: 12, + ) + ], + ), ), - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: SecondaryButton( - label: TranslationBase.of(context).submit.toUpperCase(), - color: Colors.green[800], - onTap: () async { - showDialog( - context: context, - child: ConfirmWithMessageDialog( - message: TranslationBase.of(context).confirmPrescription, - okTitle: TranslationBase.of(context).ok, - onTap: () async { - GifLoaderDialogUtils.showMyDialog(context); - await model - .insertDeliveryOrder( - lineItemNo: 0, - longitude: longitude, - latitude: latitude, - appointmentNo: prescriptions.appointmentNo, - dischargeID: prescriptions.dischargeNo, - createdBy: model.user.patientID) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (model.state == ViewState.ErrorLocal) - showErrorDialog(context, model.error); - else { - Navigator.pop(context); - Navigator.pop(context); - Navigator.pop(context, true); - } - }).catchError((e) { - GifLoaderDialogUtils.hideDialog(context); - }); - }, - ), - ); - }, - )) + Card( + shape: cardRadius(0), + margin: EdgeInsets.zero, + elevation: 20, + child: Container( + width: double.infinity, + margin: EdgeInsets.all(12), + child: SecondaryButton( + label: TranslationBase.of(context).submit.toUpperCase(), + color: CustomColors.accentColor, + onTap: () async { + showDialog( + context: context, + child: ConfirmWithMessageDialog( + message: TranslationBase.of(context).confirmPrescription, + okTitle: TranslationBase.of(context).ok, + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + await model + .insertDeliveryOrder( + lineItemNo: 0, + longitude: longitude, + latitude: latitude, + appointmentNo: prescriptions.appointmentNo, + dischargeID: prescriptions.dischargeNo, + createdBy: model.user.patientID) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (model.state == ViewState.ErrorLocal) + showErrorDialog(context, model.error); + else { + Navigator.pop(context); + Navigator.pop(context); + Navigator.pop(context, true); + } + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); + }); + }, + ), + ); + }, + )), + ) ], ), ), + ), ); } diff --git a/lib/pages/medical/vital_sign/LineChartCurved.dart b/lib/pages/medical/vital_sign/LineChartCurved.dart index 34e3735e..f28c2801 100644 --- a/lib/pages/medical/vital_sign/LineChartCurved.dart +++ b/lib/pages/medical/vital_sign/LineChartCurved.dart @@ -137,15 +137,6 @@ class LineChartCurved extends StatelessWidget { fontSize: 10, ), interval: 3.0, - // interval: getMaxY() - getMinY() <= 500 - // ? getMaxY() - getMinY() <= 50 - // ? 10 - // : 10 - // : getMaxY() - getMinY() <= 1000 - // ? 100 - // : getMaxY() - getMinY() >= 10000 - // ? 5000 - // : 200, margin: 12, ), ), diff --git a/lib/widgets/buttons/button.dart b/lib/widgets/buttons/button.dart index 99abad84..84f3cca6 100644 --- a/lib/widgets/buttons/button.dart +++ b/lib/widgets/buttons/button.dart @@ -10,15 +10,7 @@ import 'package:provider/provider.dart'; /// [loading] show the progress indicator /// [elevation] color elevation value class Button extends StatefulWidget { - Button( - {Key key, - this.label: "", - this.icon, - this.onTap, - this.backgroundColor, - this.loading: false, - this.elevation: true, this.disabled=false}) - : super(key: key); + Button({Key key, this.label: "", this.icon, this.onTap, this.backgroundColor, this.loading: false, this.elevation: true, this.disabled = false}) : super(key: key); final String label; final Widget icon; @@ -37,17 +29,11 @@ class _ButtonState extends State