From 0c3ef158951ec945dc1274bde18db6de0534dda1 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 14 May 2025 11:01:37 +0300 Subject: [PATCH] Privacy policy updates --- lib/config/localized_values.dart | 1 + lib/core/service/client/base_app_client.dart | 2 +- lib/pages/login/confirm-login.dart | 8 +- .../login/user-login-agreement-page.dart | 125 +++++++++++------- lib/uitl/translations_delegate_base.dart | 1 + 5 files changed, 81 insertions(+), 56 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ef2dc15b..786baadc 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -2326,4 +2326,5 @@ const Map localizedValues = { "liveCareTermsHeading16": {"en": "14. COMPLAINTS", "ar": "14. الشكاوى"}, "liveCareTermsConditions47": {"en": "Our Telehealth Services will be for specific medical specialties or follow-up or medication refill appointments.", "ar": "خدمات الرعاية الصحية عن بُعد الخاصة بنا سوف تكون لتخصصات طبية محددة أو لمواعيد المتابعة أو إعادة صرف الدواء. "}, "liveCareTermsConditions48": {"en": "If you have any complaints or concerns about the Application and or the Website, Our Services, or how we handle your personal information please contact us on: EServices.HMG@drsulaimanalhabib.com or call 011 525 9553", "ar": "إذا كانت لديك أي شكاوى أو مخاوف بشأن التطبيق و/أو موقع الويب أو خدماتنا أو كيفية تعاملنا مع معلوماتك الشخصية، فيرجى التواصل معنا على: EServices.HMG@drsulaimanalhabib.com أو الاتصال على الرقم: 9553 525 011"}, + "clickPrivacyPolicy": {"en": "Please click here to view the privacy policy", "ar": "الرجاء الضغط هنا لعرض سياسة الخصوصية"}, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 36afccdd..edce26ff 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -187,7 +187,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; //0560717232 - // body['PatientID'] = 814121; //4609100 + // body['PatientID'] = 5690832; //4609100 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 7766a443..8a5cc457 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -711,9 +711,9 @@ class _ConfirmLogin extends State { checkIfUserAgreedBefore(CheckActivationCode result) { if (projectViewModel.havePrivilege(109)) { this.authService.checkIfUserAgreed().then((result) { - if (result['IsPatientAlreadyAgreed']) { - goToHome(); - } else { + // if (result['IsPatientAlreadyAgreed']) { + // goToHome(); + // } else { this.authService.getUserAgreementContent().then((result) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); Navigator.pushAndRemoveUntil( @@ -732,7 +732,7 @@ class _ConfirmLogin extends State { GifLoaderDialogUtils.hideDialog(context); print(err); }); - } + // } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); diff --git a/lib/pages/login/user-login-agreement-page.dart b/lib/pages/login/user-login-agreement-page.dart index 40a1da7e..ea40411e 100644 --- a/lib/pages/login/user-login-agreement-page.dart +++ b/lib/pages/login/user-login-agreement-page.dart @@ -23,6 +23,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; import 'package:webview_flutter/webview_flutter.dart'; class UserLoginAgreementPage extends StatefulWidget { @@ -52,31 +53,31 @@ class _UserLoginAgreementPageState extends State { @override void initState() { super.initState(); - _controller = WebViewController() - ..setJavaScriptMode(JavaScriptMode.unrestricted) - ..setNavigationDelegate( - NavigationDelegate( - onProgress: (int progress) { - // Update loading bar. - print("Progress: $progress"); - }, - onPageStarted: (String url) {}, - onPageFinished: (String url) { - setState(() { - isPageLoaded = true; - }); - }, - onHttpError: (HttpResponseError error) {}, - onWebResourceError: (WebResourceError error) {}, - onNavigationRequest: (NavigationRequest request) { - if (request.url.startsWith('https://www.youtube.com/')) { - return NavigationDecision.prevent; - } - return NavigationDecision.navigate; - }, - ), - ) - ..loadRequest(Uri.parse(widget.isArabic ? "https://hmg.com/ar/Pages/Privacy.aspx" : "https://hmg.com/en/Pages/Privacy.aspx")); + // _controller = WebViewController() + // ..setJavaScriptMode(JavaScriptMode.unrestricted) + // ..setNavigationDelegate( + // NavigationDelegate( + // onProgress: (int progress) { + // // Update loading bar. + // print("Progress: $progress"); + // }, + // onPageStarted: (String url) {}, + // onPageFinished: (String url) { + // setState(() { + // isPageLoaded = true; + // }); + // }, + // onHttpError: (HttpResponseError error) {}, + // onWebResourceError: (WebResourceError error) {}, + // onNavigationRequest: (NavigationRequest request) { + // if (request.url.startsWith('https://www.youtube.com/')) { + // return NavigationDecision.prevent; + // } + // return NavigationDecision.navigate; + // }, + // ), + // ) + // ..loadRequest(Uri.parse(widget.isArabic ? "https://hmg.com/ar/Pages/Privacy.aspx" : "https://hmg.com/en/Pages/Privacy.aspx")); } @override @@ -90,17 +91,19 @@ class _UserLoginAgreementPageState extends State { showNewAppBar: true, isShowDecPage: false, appBarTitle: TranslationBase.of(context).userAgreement, - body: isTermsAndConditionsPage - ? getTermsAndConditionsContent() - : isPageLoaded - ? WebViewWidget(controller: _controller) - : Container( - child: Center( - child: GifLoaderContainer( - barrierDismissible: false, - ), - ), - ), + body: + // isTermsAndConditionsPage + // ? + getTermsAndConditionsContent(), + // : isPageLoaded + // ? WebViewWidget(controller: _controller) + // : Container( + // child: Center( + // child: GifLoaderContainer( + // barrierDismissible: false, + // ), + // ), + // ), // Padding( // padding: const EdgeInsets.all(8.0), // child: SingleChildScrollView(child: WebViewWidget(controller: _controller) @@ -153,21 +156,24 @@ class _UserLoginAgreementPageState extends State { child: CustomTextButton( backgroundColor: CustomColors.green, elevation: 0, - onPressed: isPageLoaded - ? () { - if (isTermsAndConditionsPage) { - if (acceptTerms) { - setState(() { - isTermsAndConditionsPage = false; - }); - } else { - AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms); - } - } else { - addUsageAgreement(); - } - } - : null, + onPressed: + // isPageLoaded + // ? + () { + // if (isTermsAndConditionsPage) { + if (acceptTerms) { + addUsageAgreement(); + // setState(() { + // isTermsAndConditionsPage = false; + // }); + } else { + AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms); + } + // } else { + // addUsageAgreement(); + // } + }, + // : null, child: Text(TranslationBase.of(context).acceptLbl.toUpperCase(), style: TextStyle( fontSize: 18.0, @@ -238,6 +244,23 @@ class _UserLoginAgreementPageState extends State { style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), ), mHeight(12.0), + InkWell( + onTap: () async { + await launchUrl(Uri.parse(widget.isArabic ? "https://hmg.com/ar/Pages/Privacy.aspx" : "https://hmg.com/en/Pages/Privacy.aspx")); + }, + child: Text( + TranslationBase.of(context).clickPrivacyPolicy, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + color: Colors.blue, + letterSpacing: -1.44, + height: 35 / 24, + decoration: TextDecoration.underline), + ), + ), + mHeight(12.0), Text( TranslationBase.of(context).termsConditions4, style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 3f4539c1..1f1438a8 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -3473,6 +3473,7 @@ class TranslationBase { String get liveCareTermsHeading16 => localizedValues["liveCareTermsHeading16"][locale.languageCode]; String get liveCareTermsConditions47 => localizedValues["liveCareTermsConditions47"][locale.languageCode]; String get liveCareTermsConditions48 => localizedValues["liveCareTermsConditions48"][locale.languageCode]; + String get clickPrivacyPolicy => localizedValues["clickPrivacyPolicy"][locale.languageCode]; }