From faeba6a14c7eb5013012775a11f8421c05b4445d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 1 Oct 2024 11:08:53 +0300 Subject: [PATCH] CloudFlare & NPHIES in livecare reinstated --- .../insurance/insurance_update_screen.dart | 2 +- .../livecare/live_care_payment_page.dart | 60 +++++++++---------- lib/pages/livecare/widgets/clinic_list.dart | 46 +++++++------- lib/pages/login/forgot-password.dart | 38 ++++++------ 4 files changed, 73 insertions(+), 73 deletions(-) diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 191170ef..4c4d5686 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -167,7 +167,7 @@ class _InsuranceUpdateState extends State with SingleTickerProv Container( margin: EdgeInsets.only(top: 6.5, left: 2.0), child: Text( - model.insuranceUpdate[index].statusDescription!, + model.insuranceUpdate[index].statusDescription ?? "", style: TextStyle( fontSize: 10, fontWeight: FontWeight.w600, diff --git a/lib/pages/livecare/live_care_payment_page.dart b/lib/pages/livecare/live_care_payment_page.dart index 99b6baca..a1bb6cb1 100644 --- a/lib/pages/livecare/live_care_payment_page.dart +++ b/lib/pages/livecare/live_care_payment_page.dart @@ -336,36 +336,36 @@ class _LiveCarePatmentPageState extends State { ), ], ), - // widget.getERAppointmentFeesList.isCash! - // ? Column( - // children: [ - // mHeight(10.0), - // Text( - // TranslationBase.of(context).cashAmountUpdateInsurance, - // style: TextStyle( - // fontSize: 14.0, - // fontWeight: FontWeight.w600, - // color: Color(0xff2E303A), - // ), - // ), - // mHeight(5.0), - // DefaultButton( - // TranslationBase.of(context).updateInsuranceText, - // () { - // Navigator.pop(context, null); - // Navigator.pushAndRemoveUntil( - // context, - // MaterialPageRoute(builder: (context) => LandingPage()), - // (Route route) => false, - // ); - // Navigator.push(context, FadePage(page: InsuranceUpdate())); - // }, - // color: Color(0xffEAA118), - // textColor: Colors.white, - // ), - // ], - // ) - // : Container(), + widget.getERAppointmentFeesList.isCash! + ? Column( + children: [ + mHeight(10.0), + Text( + TranslationBase.of(context).cashAmountUpdateInsurance, + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + ), + ), + mHeight(5.0), + DefaultButton( + TranslationBase.of(context).updateInsuranceText, + () { + Navigator.pop(context, null); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route route) => false, + ); + Navigator.push(context, FadePage(page: InsuranceUpdate())); + }, + color: Color(0xffEAA118), + textColor: Colors.white, + ), + ], + ) + : Container(), ], ), ), diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 07404bd1..44ad58b0 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -207,29 +207,29 @@ class _clinic_listState extends State { // getERAppointmentFeesList.isInsured = true; // getERAppointmentFeesList.isEligible = false; - // if (getERAppointmentFeesList.isCash!) { - // showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); - // } else { - // if (getERAppointmentFeesList.isInsured! && getERAppointmentFeesList.isEligible!) { - // showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); - // } else { - // if (getERAppointmentFeesList.isInsured! && !getERAppointmentFeesList.isEligible!) { - // errorMsg = TranslationBase.of(context).invalidEligibility; - // } else { - // errorMsg = TranslationBase.of(context).invalidInsurance; - // } - // ConfirmDialog dialog = new ConfirmDialog( - // isDissmissable: false, - // context: context, - // confirmMessage: errorMsg, - // okText: TranslationBase.of(context).updateInsuranceText, - // cancelText: TranslationBase.of(context).continueCash, - // okFunction: () => {openUpdateInsurance()}, - // cancelFunction: () => {continueAsCash()}); - // dialog.showAlertDialog(context); - // } - // } - showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); + if (getERAppointmentFeesList.isCash!) { + showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); + } else { + if (getERAppointmentFeesList.isInsured! && getERAppointmentFeesList.isEligible!) { + showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); + } else { + if (getERAppointmentFeesList.isInsured! && !getERAppointmentFeesList.isEligible!) { + errorMsg = TranslationBase.of(context).invalidEligibility; + } else { + errorMsg = TranslationBase.of(context).invalidInsurance; + } + ConfirmDialog dialog = new ConfirmDialog( + isDissmissable: false, + context: context, + confirmMessage: errorMsg, + okText: TranslationBase.of(context).updateInsuranceText, + cancelText: TranslationBase.of(context).continueCash, + okFunction: () => {openUpdateInsurance()}, + cancelFunction: () => {continueAsCash()}); + dialog.showAlertDialog(context); + } + } + // showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart index bb0bdc66..529d0b8f 100644 --- a/lib/pages/login/forgot-password.dart +++ b/lib/pages/login/forgot-password.dart @@ -85,25 +85,25 @@ class _ForgotPassword extends State { countryCode = value; }); }), - // const SizedBox(height: 12.0), - // CloudFlareTurnstile( - // siteKey: '0x4AAAAAAAkmbvEy63pcxBBt', - // baseUrl: BASE_URL, - // options: _options, - // controller: _controller, - // onTokenRecived: (token) { - // setState(() { - // print("Cloudflare token: $token"); - // _token = token; - // }); - // }, - // onTokenExpired: () {}, - // mode: TurnstileMode.managed, - // errorBuilder: (context, error) { - // return Text(error.message); - // }, - // ), - // const SizedBox(height: 48.0), + const SizedBox(height: 12.0), + CloudFlareTurnstile( + siteKey: '0x4AAAAAAAkmbvEy63pcxBBt', + baseUrl: BASE_URL, + options: _options, + controller: _controller, + onTokenRecived: (token) { + setState(() { + print("Cloudflare token: $token"); + _token = token; + }); + }, + onTokenExpired: () {}, + mode: TurnstileMode.managed, + errorBuilder: (context, error) { + return Text(error.message); + }, + ), + const SizedBox(height: 48.0), ], ), ),