From cd7da0dd707ae604dc9e33d1c6fc688e422233f6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 17 Dec 2024 11:31:57 +0300 Subject: [PATCH] Penguin SDK changes & crashlytics --- android/app/build.gradle | 1 + .../penguin/PenguinView.kt | 13 +++- lib/config/config.dart | 12 +-- lib/core/service/client/base_app_client.dart | 6 +- lib/main.dart | 15 ++-- .../new_Home_health_care_step_tow_page.dart | 78 +++++++------------ lib/splashPage.dart | 3 +- 7 files changed, 59 insertions(+), 69 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index f154f114..98c75fbe 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -58,6 +58,7 @@ android { buildFeatures { viewBinding true + dataBinding true } sourceSets { diff --git a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/penguin/PenguinView.kt b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/penguin/PenguinView.kt index 238765b2..9f74103f 100644 --- a/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/penguin/PenguinView.kt +++ b/android/app/src/main/kotlin/com/cloud/diplomaticquarterapp/penguin/PenguinView.kt @@ -204,6 +204,7 @@ internal class PenguinView( // .setDeepLinkData("deeplink") .setCustomizeColor("#2CA0AF") .setDeepLinkSchema("") + .setIsEnableReportIssue(true) .build() // Set location delegate to handle location updates @@ -215,7 +216,17 @@ internal class PenguinView( // } // Set events delegate for reporting issues - PlugAndPlaySDK.setPiEventsDelegate { } +// PlugAndPlaySDK.setPiEventsDelegate(new PIEventsDelegate() { +// @Override +// public void onReportIssue(PIReportIssue issue) { +// Log.e("Issue Reported: ", issue.getReportType()); +// } +// // Implement issue reporting logic here } +// @Override +// public void onSharedLocation(String link) { +// // Implement Shared location logic here +// } +// }) // Start the Penguin SDK PlugAndPlaySDK.start(mContext, this) diff --git a/lib/config/config.dart b/lib/config/config.dart index 648d52ae..e69f0510 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -22,7 +22,7 @@ var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:2018/'; // var BASE_URL = 'http://10.50.100.198:4422/'; -// var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.20.200.111:1010/'; // var BASE_URL = 'https://hmgwebservices.com/'; @@ -30,7 +30,7 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; -var BASE_URL = 'https://webservices.hmg.com/'; +// var BASE_URL = 'https://webservices.hmg.com/'; // var BASE_URL = 'http://10.50.100.198:4422/'; @@ -698,10 +698,10 @@ var GET_PROJECT_FROM_NFC = 'Services/OUTPs.svc/Rest/GetProjectByNFC'; //PAYFORT var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails"; var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; -var payFortEnvironment = FortEnvironment.production; -var applePayMerchantId = "merchant.com.hmgwebservices"; -// var payFortEnvironment = FortEnvironment.test; -// var applePayMerchantId = "merchant.com.hmgwebservices.uat"; +// var payFortEnvironment = FortEnvironment.production; +// var applePayMerchantId = "merchant.com.hmgwebservices"; +var payFortEnvironment = FortEnvironment.test; +var applePayMerchantId = "merchant.com.hmgwebservices.uat"; class AppGlobal { static var context; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index ac2c60ca..68593a1c 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -184,8 +184,8 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; //0560717232 - // body['PatientID'] = 4769791; //4609100 - // body['TokenID'] = "@dm!n"; + body['PatientID'] = 1231755; //4609100 + body['TokenID'] = "@dm!n"; // Patient ID: 3027574 // Mobile no.: 0502303285 @@ -195,7 +195,7 @@ class BaseAppClient { // if (url == 'https://uat.hmgwebservices.com/Services/NHIC.svc/REST/GetPatientInfo') { // url = "https://hmgwebservices.com/Services/NHIC.svc/REST/GetPatientInfo"; - // body['TokenID'] = "@dm!n"; + // body['TokenID'] = "@dm!n"; // } // if (AppGlobal.isNetworkDebugEnabled) { diff --git a/lib/main.dart b/lib/main.dart index 7bf71077..815bea40 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -35,12 +35,13 @@ void main() async { // Pass all uncaught asynchronous errors that aren't handled by the Flutter framework to Crashlytics PlatformDispatcher.instance.onError = (error, stack) { - FirebaseCrashlytics.instance.recordError(error, stack, fatal: true); + if (!kDebugMode) FirebaseCrashlytics.instance.recordError(error, stack, fatal: true); return true; }; setupLocator(); HttpOverrides.global = MyHttpOverrides(); + runApp(MyApp()); } @@ -67,8 +68,6 @@ class _MyApp extends State { //0567184134 mobile //246305493 - - // checkForUpdate() { // // todo need to verify 'imp' // InAppUpdate.checkForUpdate().then((info) { @@ -152,14 +151,12 @@ class _MyApp extends State { ], child: Consumer( builder: (context, projectProvider, child) => MaterialApp( - builder: (_, mchild) { return MediaQuery( - data: MediaQuery.of(context).copyWith( - textScaler: TextScaler.linear(1.0), - ), //set desired text scale factor here - child: mchild! - ); + data: MediaQuery.of(context).copyWith( + textScaler: TextScaler.linear(1.0), + ), //set desired text scale factor here + child: mchild!); // Container( // color: Colors.blue, // )); diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart index dfccb11b..ee8f5b92 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart @@ -30,28 +30,18 @@ class NewHomeHealthCareStepTowPage extends StatefulWidget { final Function(PickResult)? onPick; final double? latitude; final double? longitude; - final PatientERInsertPresOrderRequestModel? - patientERInsertPresOrderRequestModel; + final PatientERInsertPresOrderRequestModel? patientERInsertPresOrderRequestModel; final Function? changePageViewIndex; final HomeHealthCareViewModel model; - const NewHomeHealthCareStepTowPage( - {Key? key, - this.onPick, - this.latitude, - this.longitude, - this.patientERInsertPresOrderRequestModel, - this.changePageViewIndex, - required this.model}) + const NewHomeHealthCareStepTowPage({Key? key, this.onPick, this.latitude, this.longitude, this.patientERInsertPresOrderRequestModel, this.changePageViewIndex, required this.model}) : super(key: key); @override - _NewHomeHealthCareStepTowPageState createState() => - _NewHomeHealthCareStepTowPageState(); + _NewHomeHealthCareStepTowPageState createState() => _NewHomeHealthCareStepTowPageState(); } -class _NewHomeHealthCareStepTowPageState - extends State { +class _NewHomeHealthCareStepTowPageState extends State { double latitude = 0; double longitude = 0; AddressInfo? _selectedAddress; @@ -88,8 +78,7 @@ class _NewHomeHealthCareStepTowPageState } void _getUserLocation() async { - if (await this.sharedPref.getDouble(USER_LAT) != null && - await this.sharedPref.getDouble(USER_LONG) != null) { + if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { var lat = await this.sharedPref.getDouble(USER_LAT); var long = await this.sharedPref.getDouble(USER_LONG); latitude = lat; @@ -97,8 +86,7 @@ class _NewHomeHealthCareStepTowPageState currentPostion = LatLng(lat, long); setMap(); } else { - locationUtils = - new LocationUtils(isShowConfirmDialog: true, context: context); + locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); locationUtils.getCurrentLocation(callBack: (value) { print(value); setMap(); @@ -138,8 +126,7 @@ class _NewHomeHealthCareStepTowPageState showCurrentLocation = true; }); } else { - latLong = widget - .model.addressesList[widget.model.addressesList.length - 1].latLong; + latLong = widget.model.addressesList[widget.model.addressesList.length - 1].latLong; } } @@ -178,8 +165,7 @@ class _NewHomeHealthCareStepTowPageState decoration: cardRadius(12), child: Container( child: InkWell( - onTap: () => - confirmSelectLocationDialog(widget.model.addressesList), + onTap: () => confirmSelectLocationDialog(widget.model.addressesList), child: Container( padding: EdgeInsets.all(8), width: double.infinity, @@ -212,28 +198,28 @@ class _NewHomeHealthCareStepTowPageState ), InkWell( onTap: () { - Navigator.push( - context, - FadePage( - page: LocationPage( - // latitude: latitude, - // longitude: longitude, - ), - ), - ).then((value) async { - print(value); - await widget.model.getCustomerAddresses(); - setState(() {}); - }); + // Navigator.push( + // context, + // FadePage( + // page: LocationPage( + // // latitude: latitude, + // // longitude: longitude, + // ), + // ), + // ).then((value) async { + // print(value); + // await widget.model.getCustomerAddresses(); + // setState(() {}); + // }); }, child: Padding( - padding: EdgeInsets.only(left: 12, right: 12, bottom: 16, top: 8), + padding: EdgeInsets.only(left: 12, right: 12, bottom: 16, top: 16), child: Row( children: [ - Icon(Icons.add_circle_outline_sharp), + Icon(Icons.location_on_outlined), mWidth(12), Text( - TranslationBase.of(context).addNewAddress, + TranslationBase.of(context).selectLocation, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -261,23 +247,18 @@ class _NewHomeHealthCareStepTowPageState ), ), Padding( - padding: - const EdgeInsets.only(left: 20, right: 20, top: 14, bottom: 14), + padding: const EdgeInsets.only(left: 20, right: 20, top: 14, bottom: 14), child: DefaultButton( TranslationBase.of(context).continues, () { setState(() { - widget.patientERInsertPresOrderRequestModel!.latitude = - latitude; - widget.patientERInsertPresOrderRequestModel!.longitude = - longitude; + widget.patientERInsertPresOrderRequestModel!.latitude = latitude; + widget.patientERInsertPresOrderRequestModel!.longitude = longitude; }); - navigateTo( context, NewHomeHealthCareStepThreePage( - patientERInsertPresOrderRequestModel: - widget.patientERInsertPresOrderRequestModel, + patientERInsertPresOrderRequestModel: widget.patientERInsertPresOrderRequestModel, model: widget.model, ), ); @@ -319,8 +300,7 @@ class _NewHomeHealthCareStepTowPageState goToCurrentLocation() { Geolocator.getCurrentPosition().then((value) { - _selectedAddress = - AddressInfo(latLong: '${value.latitude},${value.longitude}'); + _selectedAddress = AddressInfo(latLong: '${value.latitude},${value.longitude}'); moveToLocation(LatLng(value.latitude, value.longitude)); }); } diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 7743cd73..533456ee 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/push-notification-handler.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_zoom_videosdk/native/zoom_videosdk.dart'; @@ -85,7 +86,7 @@ class _SplashScreenState extends State { // debugPrint("ALL SHARED PREFERENCES!!!!!"); // debugPrint(jsonEncode(value)); }); - await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); + if (!kDebugMode) await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true); // PushNotificationHandler(context).init(); // Asyncronously }