diff --git a/lib/analytics/flows/appointments.dart b/lib/analytics/flows/appointments.dart index 50a02c76..720fbb52 100644 --- a/lib/analytics/flows/appointments.dart +++ b/lib/analytics/flows/appointments.dart @@ -264,4 +264,11 @@ class Appointment{ }); } + appointment_cancel(){ + logger('cancel_appointment', parameters: { + 'flow_type' : GAnalytics.APPOINTMENT_DETAIL_FLOW_TYPE, + }); + } + + } \ No newline at end of file diff --git a/lib/config/config.dart b/lib/config/config.dart index b15f49a7..02ca3db1 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; -// var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 8223bee6..14d8a6cb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1844,4 +1844,7 @@ const Map localizedValues = { "termsConditions": {"en": "Terms & Conditions", "ar": "الأحكام والشروط"}, "prescriptionDeliveryError": {"en": "This clinic does not support refill & delivery.", "ar": "هذه العيادة لا تدعم إعادة التعبئة والتسليم."}, "liveCarePermissions": {"en": "LiveCare requires Camera & Microphone permissions, Please allow these to proceed.", "ar": "يتطلب لايف كير أذونات الكاميرا والميكروفون ، يرجى السماح لها بالمتابعة."}, + "lakumUnhold": { "en": "The account has already been activated", "ar": "لقد تم تفعيل الحساب من قبل" }, + "lakumDiscontinue": { "en": "The account is closed", "ar": "الحساب مغلق" }, + "lakumSuccess": { "en": "The account has been activated successfully", "ar": "تم تفعيل الحساب بنجاح" }, }; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index cc570bd1..55684afe 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -142,9 +142,9 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); // if (BASE_URL == "https://uat.hmgwebservices.com/") { - print("URL : $url"); - final jsonBody = json.encode(body); - print(jsonBody); + debugPrint("URL : $url"); + final jsonBody = json.encode(body); + debugPrint(jsonBody); // } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 89a2a587..67ef388b 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -81,8 +81,8 @@ class _DocAvailableAppointmentsState extends State wit WidgetsBinding.instance.addPostFrameCallback((_) async { getCurrentLanguage(); - - if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) + bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT); + if (isLiveCareSchedule != null && isLiveCareSchedule) getDoctorScheduledFreeSlots(context, widget.doctor); else { getDoctorFreeSlots(context, widget.doctor); diff --git a/lib/pages/ErService/ErOptions.dart b/lib/pages/ErService/ErOptions.dart index 00424a35..40bcc1af 100644 --- a/lib/pages/ErService/ErOptions.dart +++ b/lib/pages/ErService/ErOptions.dart @@ -87,14 +87,14 @@ class _ErOptionsState extends State { ), InkWell( onTap: () { - Navigator.push(context, FadePage(page: DdServicesPage())); + if (projectViewModel.havePrivilege(81)) Navigator.push(context, FadePage(page: DdServicesPage())); }, child: MedicalProfileItem( title: "ED", imagePath: 'assets/images/new-design/AM.PNG', subTitle: TranslationBase.of(context).service, isPngImage: true, - isEnable: true, + isEnable: projectViewModel.havePrivilege(81), ), ), ], diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index f235c8b1..885013b5 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -614,7 +614,8 @@ class _AppointmentDetailsState extends State with SingleTick } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } - projectViewModel.analytics.appointment.appointment_details_cancel(appointment: widget.appo); + // projectViewModel.analytics.appointment.appointment_details_cancel(appointment: widget.appo); + projectViewModel.analytics.appointment.appointment_cancel(); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 1be3f6af..dd12a5cd 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -1,4 +1,3 @@ -import 'dart:convert'; import 'dart:math' as math; import 'package:auto_size_text/auto_size_text.dart'; @@ -16,7 +15,6 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medic import 'package:diplomaticquarterapp/pages/landing/widgets/logged_slider_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/services_view.dart'; import 'package:diplomaticquarterapp/pages/landing/widgets/slider_view.dart'; -import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesPage.dart'; import 'package:diplomaticquarterapp/pages/packages_offers/packages_offers_tab_pager.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -25,9 +23,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; -import 'package:pay/pay.dart'; class HomePageFragment2 extends StatefulWidget { DashboardViewModel model; @@ -104,7 +100,6 @@ class _HomePageFragment2State extends State { onLoginClick: () { widget.onLoginClick(); projectViewModel.analytics.loginRegistration.login_register_initiate(); - // navigateTo(context, CallHomePage()); }, ), // height: MediaQuery.of(context).size.width / 2.6, @@ -242,6 +237,10 @@ class _HomePageFragment2State extends State { ), FlatButton( onPressed: () { + // AppSharedPreferences().getAll().then((value){ + // debugPrint("ALL SHARED PREFERENCES!!!!!"); + // debugPrint(jsonEncode(value)); + // }); Navigator.push(context, FadePage(page: AllHabibMedicalSevicePage2())); projectViewModel.analytics.hmgServices.viewAll(); }, @@ -290,8 +289,7 @@ class _HomePageFragment2State extends State { child: InkWell( onTap: () { AuthenticatedUser user = projectViewModel.user; - if(projectViewModel.havePrivilege(82) || bypassPrivilageCheck) - Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(user))); + if (projectViewModel.havePrivilege(82) || bypassPrivilageCheck) Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(user))); projectViewModel.analytics.offerPackages.log(); }, child: Stack( diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 0e79e4c8..80680df8 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -310,7 +310,8 @@ class _ConfirmLogin extends State { login_method = type; LoginRegistration.verificationMethod = type; - projectViewModel.analytics.loginRegistration.login_verfication(forRegistration: widget.fromRegistration); + if(!widget.fromRegistration) + projectViewModel.analytics.loginRegistration.login_verfication(forRegistration: widget.fromRegistration); switch (type) { case 1: diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 4d3c7718..bf2b2e29 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -209,7 +209,7 @@ class _ConfirmPaymentPageState extends State { child: DefaultButton( TranslationBase.of(context).confirm.toUpperCase(), () { - + // startApplePay(); if (widget.advanceModel.fileNumber == projectViewModel.user.patientID.toString()) { openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null); } else { diff --git a/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart b/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart index bcd367ff..ec20d414 100644 --- a/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart +++ b/lib/pages/pharmacies/screens/lacum-activitaion-vida-page.dart @@ -2,20 +2,18 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/lacum-registration-viewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'lacum-registration-page.dart'; - class LakumActivationVidaPage extends StatelessWidget { ProjectViewModel projectViewModel; - TextEditingController _identificationNumberController = - new TextEditingController(); + TextEditingController _identificationNumberController = new TextEditingController(); @override Widget build(BuildContext context) { @@ -50,10 +48,7 @@ class LakumActivationVidaPage extends StatelessWidget { padding: const EdgeInsets.all(8.0), child: TextField( controller: _identificationNumberController, - decoration: new InputDecoration( - hintText: TranslationBase.of(context) - .enterIdentificationNumber, - ), + decoration: new InputDecoration(hintText: TranslationBase.of(context).enterIdentificationNumber, focusColor: CustomColors.green), keyboardType: TextInputType.number, style: TextStyle( fontSize: 16, @@ -67,39 +62,38 @@ class LakumActivationVidaPage extends StatelessWidget { margin: EdgeInsets.only(top: 4), child: BorderedButton( TranslationBase.of(context).accountActivation, - backgroundColor: - _identificationNumberController.text != null && - _identificationNumberController.text != "" - ? Color(0xff60686b) - : Color(0xffb0b4b5), + // backgroundColor: _identificationNumberController.text != null && _identificationNumberController.text != "" ? CustomColors.green : Color(0xffb0b4b5), textColor: Colors.white, + backgroundColor: CustomColors.green, + borderColor: CustomColors.green, fontSize: 16, hPadding: 8, vPadding: 12, - handler: _identificationNumberController.text != null || - _identificationNumberController.text != "" + handler: _identificationNumberController.text != null || _identificationNumberController.text != "" ? () { - model - .checkLacumAccountActivation( - _identificationNumberController.text) - .then((_) => { - if (model.state == ViewState.Idle) - { - Navigator.push( - context, - FadePage( - page: LakumRegistrationPage( - _identificationNumberController - .text))) - .then((status) => { - if (status == 200) - {model.makeAccountActivate(projectViewModel.user.patientIdentificationNo)} - // back to previous page - }) - } + model.checkLacumAccountActivation(_identificationNumberController.text).then((_) { + if (model.state == ViewState.Idle) { + if (model.lacumInformation.status != "Hold") { + AppToast.showErrorToast(message: TranslationBase.of(context).lakumUnhold); + if (model.lacumInformation.status != "Discontinue") { + AppToast.showErrorToast(message: TranslationBase.of(context).lakumDiscontinue); + } + } else { + if (model.lacumInformation.status == "Hold") { + model.makeAccountActivate(projectViewModel.user.patientIdentificationNo).then((value) { + AppToast.showSuccessToast(message: TranslationBase.of(context).lakumSuccess); + Navigator.of(context).pop(); }); + } + } + // Navigator.push(context, FadePage(page: LakumRegistrationPage(_identificationNumberController.text))).then((status) => { + // if (status == 200) {model.makeAccountActivate(projectViewModel.user.patientIdentificationNo)} + // // back to previous page + // }) + } + }); } - : () {}, + : null, ), ), ], diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 7b44b24a..d279b564 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2853,6 +2853,9 @@ class TranslationBase { String get termsConditions => localizedValues["termsConditions"][locale.languageCode]; String get liveCarePermissions => localizedValues["liveCarePermissions"][locale.languageCode]; String get prescriptionDeliveryError => localizedValues["prescriptionDeliveryError"][locale.languageCode]; + String get lakumUnhold => localizedValues["lakumUnhold"][locale.languageCode]; + String get lakumDiscontinue => localizedValues["lakumDiscontinue"][locale.languageCode]; + String get lakumSuccess => localizedValues["lakumSuccess"][locale.languageCode]; } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e6acc895..7b0b0161 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -20,7 +20,11 @@ import 'package:flutter_inappwebview/flutter_inappwebview.dart'; enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT } var _InAppBrowserOptions = InAppBrowserClassOptions( - inAppWebViewGroupOptions: InAppWebViewGroupOptions(crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true)), + inAppWebViewGroupOptions: InAppWebViewGroupOptions( + crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true), + ios: IOSInAppWebViewOptions( + applePayAPIEnabled: true, + )), crossPlatform: InAppBrowserOptions(hideUrlBar: true), ios: IOSInAppBrowserOptions( hideToolbarBottom: false, @@ -31,7 +35,7 @@ class MyInAppBrowser extends InAppBrowser { _PAYMENT_TYPE paymentType; // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE - static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWeb/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT + static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT @@ -187,8 +191,8 @@ class MyInAppBrowser extends InAppBrowser { service.applePayInsertRequest(applePayInsertRequest, context).then((res) { if (context != null) GifLoaderDialogUtils.hideDialog(context); String url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; - safariBrowser.open(url: Uri.parse(url)); - // this.browser.openUrl(url: url, options: _InAppBrowserOptions); + // safariBrowser.open(url: Uri.parse(url)); + this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(url)), options: _InAppBrowserOptions); }).catchError((err) { print(err); if (context != null) GifLoaderDialogUtils.hideDialog(context); @@ -220,7 +224,7 @@ class MyInAppBrowser extends InAppBrowser { if (order.customValuesXml.contains("ApplePay")) { safariBrowser.open(url: Uri.parse(value)); } else { - this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value))); + this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(value)), options: _InAppBrowserOptions); } }); } diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index a39b9d6a..6865ece5 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -2,6 +2,7 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:badges/badges.dart'; import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; @@ -16,6 +17,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/pr import 'package:diplomaticquarterapp/pages/search_products_page.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; @@ -404,6 +406,7 @@ class NewAppBarWidget extends StatelessWidget with PreferredSizeWidget { else IconButton( onPressed: () { + AppSharedPreferences().remove(IS_LIVECARE_APPOINTMENT); Navigator.pushAndRemoveUntil( context, MaterialPageRoute(builder: (context) => LandingPage()), diff --git a/pubspec.yaml b/pubspec.yaml index 0165c607..0d80cd42 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.4.94+404094 +version: 4.4.95+404095 environment: sdk: ">=2.7.0 <3.0.0" @@ -202,7 +202,7 @@ dependencies: sms_otp_auto_verify: ^2.1.0 flutter_ios_voip_kit: ^0.0.5 - payfort_plugin: ^0.3.1 +# payfort_plugin: ^0.3.1 dependency_overrides: provider : ^5.0.0