From e50a67ea122a14778c1b4b9cec155f156155a49a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 21 Dec 2022 15:59:56 +0300 Subject: [PATCH 01/86] Vida Plus changes --- lib/config/config.dart | 7 +- .../request_patient_lab_special_result.dart | 4 ++ .../labs/request_send_lab_report_email.dart | 4 ++ lib/core/service/client/base_app_client.dart | 28 ++------ lib/core/service/medical/labs_service.dart | 12 ++-- .../service/medical/radiology_service.dart | 3 +- lib/main.dart | 2 +- lib/pages/login/login.dart | 24 +++---- lib/uitl/push-notification-handler.dart | 65 +++++++++---------- 9 files changed, 72 insertions(+), 77 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index a7676855..3fea4c82 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,7 +21,8 @@ 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://hmgwebservices.com/'; +var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -411,14 +412,14 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 9.8; +var VERSION_ID = 7.6; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; var SESSION_ID = 'TMRhVmkGhOsvamErw'; var IS_DENTAL_ALLOWED_BACKEND = false; var PATIENT_TYPE = 1; -var PATIENT_TYPE_ID = 1; +var PATIENT_TYPE_ID = null; var DEVICE_TOKEN = ""; var IS_VOICE_COMMAND_CLOSED = true; var IS_TEXT_COMPLETED = false; diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart index bdeb3930..b3794e3c 100644 --- a/lib/core/model/labs/request_patient_lab_special_result.dart +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -1,5 +1,6 @@ class RequestPatientLabSpecialResult { String invoiceNo; + String invoiceNoVP; String orderNo; String setupID; String projectID; @@ -20,6 +21,7 @@ class RequestPatientLabSpecialResult { RequestPatientLabSpecialResult( {this.invoiceNo, + this.invoiceNoVP, this.orderNo, this.setupID, this.projectID, @@ -40,6 +42,7 @@ class RequestPatientLabSpecialResult { RequestPatientLabSpecialResult.fromJson(Map json) { invoiceNo = json['InvoiceNo']; + invoiceNo = json['InvoiceNo_VP']; orderNo = json['OrderNo']; setupID = json['SetupID']; projectID = json['ProjectID']; @@ -62,6 +65,7 @@ class RequestPatientLabSpecialResult { Map toJson() { final Map data = new Map(); data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNoVP; data['OrderNo'] = this.orderNo; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index 118da906..dcd28b5b 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -23,6 +23,7 @@ class RequestSendLabReportEmail { String doctorName; String projectID; String invoiceNo; + String invoiceNoVP; String orderDate; RequestSendLabReportEmail( @@ -50,6 +51,7 @@ class RequestSendLabReportEmail { this.doctorName, this.projectID, this.invoiceNo, + this.invoiceNoVP, this.orderDate}); RequestSendLabReportEmail.fromJson(Map json) { @@ -77,6 +79,7 @@ class RequestSendLabReportEmail { doctorName = json['DoctorName']; projectID = json['ProjectID']; invoiceNo = json['InvoiceNo']; + invoiceNo = json['InvoiceNo_VP']; orderDate = json['OrderDate']; } @@ -106,6 +109,7 @@ class RequestSendLabReportEmail { data['DoctorName'] = this.doctorName; data['ProjectID'] = this.projectID; data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNo; data['OrderDate'] = this.orderDate; return data; } diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 38e63391..041c3bb0 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -77,6 +77,7 @@ class BaseAppClient { body['IPAdress'] = IP_ADDRESS; body['generalid'] = GENERAL_ID; + body['isVidaPlus'] = true; body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT); body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG); @@ -98,31 +99,12 @@ class BaseAppClient { } else { body['PatientType'] = PATIENT_TYPE; } - // } - // body['PatientType'] = body.containsKey('PatientType') - // ? body['PatientType'] != null - // ? body['PatientType'] - // : user['PatientType'] != null - // ? user['PatientType'] - // : PATIENT_TYPE - // : PATIENT_TYPE; - - // if (!body.containsKey('PatientTypeID')) { if (user != null && user['PatientType'] != null) { body['PatientTypeID'] = user['PatientType']; } else { body['PatientType'] = PATIENT_TYPE_ID; } - // } - - // body['PatientTypeID'] = body.containsKey('PatientTypeID') - // ? body['PatientTypeID'] != null - // ? body['PatientTypeID'] - // : user['PatientType'] != null - // ? user['PatientType'] - // : PATIENT_TYPE_ID - // : PATIENT_TYPE_ID; if (user != null) { body['TokenID'] = body['TokenID'] != null ? body['TokenID'] : token; @@ -158,11 +140,11 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); - if (AppGlobal.isNetworkDebugEnabled) { - print("URL : $url"); + // if (AppGlobal.isNetworkDebugEnabled) { + print("Debug URL : $url"); final jsonBody = json.encode(body); - print(jsonBody); - } + print("Debug Body : $jsonBody"); + // } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index f12e4669..b967d41c 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -36,7 +36,8 @@ class LabsService extends BaseService { hasError = false; _requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.clinicID = clinicID; - _requestPatientLabSpecialResult.invoiceNo = invoiceNo; + _requestPatientLabSpecialResult.invoiceNo = "0"; + _requestPatientLabSpecialResult.invoiceNoVP = invoiceNo; _requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.setupID = setupID; @@ -54,7 +55,8 @@ class LabsService extends BaseService { Future getPatientLabResult({PatientLabOrders patientLabOrder}) async { hasError = false; Map body = Map(); - body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['InvoiceNo_VP'] = patientLabOrder.invoiceNo; + body['InvoiceNo'] = "0"; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; @@ -156,7 +158,8 @@ class LabsService extends BaseService { Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { hasError = false; Map body = Map(); - body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['InvoiceNo'] = "0"; + body['InvoiceNo_VP'] = patientLabOrder.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; @@ -178,7 +181,8 @@ class LabsService extends BaseService { Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj}) async { _requestSendLabReportEmail.projectID = patientLabOrder.projectID; - _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; + _requestSendLabReportEmail.invoiceNo = "0"; + _requestSendLabReportEmail.invoiceNoVP = patientLabOrder.invoiceNo; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; _requestSendLabReportEmail.patientName = userObj.firstName + " " + userObj.lastName; diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index df3f0e19..44940b31 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -28,7 +28,8 @@ class RadiologyService extends BaseService { hasError = false; await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) { finalRadiologyList.clear(); - response['FinalRadiologyList'].forEach((radiology) { + // response['FinalRadiologyList'].forEach((radiology) { + response['FinalRadiologyListAPI'].forEach((radiology) { finalRadiologyList.add(FinalRadiology.fromJson(radiology)); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/main.dart b/lib/main.dart index f2faf588..4f6e43f6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -70,7 +70,7 @@ class _MyApp extends State { // var font = projectProvider.isArabic ? 'Cairo' : 'WorkSans'; // Re-enable once going live - if (Platform.isAndroid) checkForUpdate(); + // if (Platform.isAndroid) checkForUpdate(); ThemeNotifier(defaultTheme()); super.initState(); diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 94747b37..adcc4820 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -256,7 +256,7 @@ class _Login extends State { sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); GifLoaderDialogUtils.showMyDialog(context); authService.checkPatientAuthentication(request).then((value) { - if (value['UserAccountIsActivated']) { + // if (value['UserAccountIsActivated']) { if (value['isSMSSent']) { sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']); sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request); @@ -267,17 +267,17 @@ class _Login extends State { this.checkActivationCode(); } } - } else { - ConfirmDialog activationDialog = new ConfirmDialog( - context: context, - confirmMessage: TranslationBase.of(context).accountDeactivatedMsg, - okText: TranslationBase.of(context).yes, - cancelText: TranslationBase.of(context).no, - okFunction: () => {ConfirmDialog.closeAlertDialog(context), this.activatePatientFile()}, - cancelFunction: () => {}); - GifLoaderDialogUtils.hideDialog(context); - activationDialog.showAlertDialog(context); - } + // } else { + // ConfirmDialog activationDialog = new ConfirmDialog( + // context: context, + // confirmMessage: TranslationBase.of(context).accountDeactivatedMsg, + // okText: TranslationBase.of(context).yes, + // cancelText: TranslationBase.of(context).no, + // okFunction: () => {ConfirmDialog.closeAlertDialog(context), this.activatePatientFile()}, + // cancelFunction: () => {}); + // GifLoaderDialogUtils.hideDialog(context); + // activationDialog.showAlertDialog(context); + // } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); ConfirmDialog dialog = new ConfirmDialog( diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 2cea20f3..dcd90cdb 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -20,7 +20,7 @@ import 'package:flutter/material.dart'; // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; import 'package:flutter_ios_voip_kit/call_state_type.dart'; import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart'; -import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; +// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:huawei_push/huawei_push.dart' as h_push; import 'app_shared_preferences.dart'; @@ -115,7 +115,7 @@ class PushNotificationHandler { final BuildContext context; static PushNotificationHandler _instance; final voIPKit = FlutterIOSVoIPKit.instance; - HmsApiAvailability hmsApiAvailability; + // HmsApiAvailability hmsApiAvailability; Timer timeOutTimer; bool isTalking = false; @@ -161,7 +161,7 @@ class PushNotificationHandler { } init() async { - hmsApiAvailability = new HmsApiAvailability(); + // hmsApiAvailability = new HmsApiAvailability(); // VoIP Callbacks voIPKit.getVoIPToken().then((value) { print('🎈 example: getVoIPToken: $value'); @@ -223,12 +223,12 @@ class PushNotificationHandler { // if (Platform.isAndroid && (!await FlutterHmsGmsAvailability.isHmsAvailable)) { if (Platform.isAndroid) { - await hmsApiAvailability.isHMSAvailable().then((value) async { - if (value != 0) { - final fcmToken = await FirebaseMessaging.instance.getToken(); - if (fcmToken != null) onToken(fcmToken); - } - }); + // await hmsApiAvailability.isHMSAvailable().then((value) async { + // if (value != 0) { + // final fcmToken = await FirebaseMessaging.instance.getToken(); + // if (fcmToken != null) onToken(fcmToken); + // } + // }).catchError((err) {}); } if (Platform.isIOS) { @@ -244,7 +244,6 @@ class PushNotificationHandler { // 'Android GMS or iOS' (Handle Firebase Messaging Streams FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async { - print("Firebase getInitialMessage with message : ${message.data.toString()}"); subscribeFCMTopic(); if (Platform.isIOS) await Future.delayed(Duration(milliseconds: 3000)).then((value) { @@ -288,29 +287,29 @@ class PushNotificationHandler { FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); if (Platform.isAndroid) { - await hmsApiAvailability.isHMSAvailable().then((value) async { - if (value == 0) { - h_push.Push.enableLogger(); - final result = await h_push.Push.setAutoInitEnabled(true); - - h_push.Push.onNotificationOpenedApp.listen((message) { - newMessage(toFirebaseRemoteMessage(message)); - }, onError: (e) => print(e.toString())); - - h_push.Push.onMessageReceivedStream.listen((message) { - newMessage(toFirebaseRemoteMessage(message)); - }, onError: (e) => print(e.toString())); - - h_push.Push.getTokenStream.listen((token) { - onToken(token); - }, onError: (e) => print(e.toString())); - await h_push.Push.getToken(''); - - h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); - } - }).catchError((err) { - print(err); - }); + // await hmsApiAvailability.isHMSAvailable().then((value) async { + // if (value == 0) { + // h_push.Push.enableLogger(); + // final result = await h_push.Push.setAutoInitEnabled(true); + // + // h_push.Push.onNotificationOpenedApp.listen((message) { + // newMessage(toFirebaseRemoteMessage(message)); + // }, onError: (e) => print(e.toString())); + // + // h_push.Push.onMessageReceivedStream.listen((message) { + // newMessage(toFirebaseRemoteMessage(message)); + // }, onError: (e) => print(e.toString())); + // + // h_push.Push.getTokenStream.listen((token) { + // onToken(token); + // }, onError: (e) => print(e.toString())); + // await h_push.Push.getToken(''); + // + // h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); + // } + // }).catchError((err) { + // print(err); + // }); } } From 98abc5a0692c0dd65edbdc2e6ec8e5f86c540a5c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 19 Jan 2023 09:37:34 +0300 Subject: [PATCH 02/86] updates --- .../PharmacyAddressesViewModel.dart | 2 +- .../NewCMC/cmc_location_page.dart | 2 +- .../NewCMC/new_cmc_step_tow_page.dart | 2 +- .../NewHomeHealthCare/location_page.dart | 2 +- .../new_Home_health_care_step_one_page.dart | 2 +- .../new_Home_health_care_step_tow_page.dart | 2 +- .../rrt-pickup-address-page.dart | 4 +- lib/pages/feedback/send_feedback_page.dart | 44 ++++++------ .../pharmacyAddresses/AddAddress.dart | 2 +- lib/uitl/LocalNotification.dart | 26 +++---- lib/widgets/others/bottom_bar.dart | 70 +++++++++---------- .../others/floating_button_search.dart | 44 ++++++------ .../pickupLocation/PickupLocationFromMap.dart | 2 +- 13 files changed, 102 insertions(+), 102 deletions(-) diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart index 5a098b6f..ea9af54d 100644 --- a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart @@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:geocoding/geocoding.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart index fbef90e6..f45d2942 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart @@ -25,7 +25,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index 87d55b72..e846d31c 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -20,7 +20,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:permission_handler/permission_handler.dart'; import 'cmc_location_page.dart'; diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart index e96ddcc7..78e13982 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart @@ -23,7 +23,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; 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 7984cbbf..3a59b21e 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 @@ -12,7 +12,7 @@ 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:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; class NewHomeHealthCareStepOnePage extends StatefulWidget { 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 5328bfba..9cc194f1 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 @@ -21,7 +21,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'location_page.dart'; diff --git a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart index 2008ef4c..c12cdb26 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart @@ -318,7 +318,7 @@ class RRTRequestPickupAddressPageState extends State { final formKey = GlobalKey(); MessageType messageType = MessageType.NON; var _currentLocaleId; - stt.SpeechToText speech = stt.SpeechToText(); + // stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; int selectedStatusIndex = 5; var event = RobotProvider(); @@ -520,23 +520,23 @@ class _SendFeedbackPageState extends State { openSpeechReco() async { new RoboSearch(context: context).showAlertDialog(context); _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode; - bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); - if (available) { - speech.listen( - onResult: resultListener, - listenMode: stt.ListenMode.confirmation, - localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', - ); - } else { - print("The user has denied the use of speech recognition."); - } + // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); + // if (available) { + // speech.listen( + // onResult: resultListener, + // listenMode: stt.ListenMode.confirmation, + // localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', + // ); + // } else { + // print("The user has denied the use of speech recognition."); + // } } - void errorListener(SpeechRecognitionError error) { - event.setValue({"searchText": 'null'}); - //SpeechToText.closeAlertDialog(context); - print(error); - } + // void errorListener(SpeechRecognitionError error) { + // event.setValue({"searchText": 'null'}); + // SpeechToText.closeAlertDialog(context); + // print(error); + // } void statusListener(String status) { reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; @@ -556,14 +556,14 @@ class _SendFeedbackPageState extends State { setState(() { messageController.text += reconizedWord + '\n'; RoboSearch.closeAlertDialog(context); - speech.stop(); + // speech.stop(); }); } } Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); - print(hasSpeech); - if (!mounted) return; + // bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + // print(hasSpeech); + // if (!mounted) return; } } diff --git a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart index dcc4b299..d93e0c3a 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart @@ -16,7 +16,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; class AddAddressPage extends StatefulWidget { diff --git a/lib/uitl/LocalNotification.dart b/lib/uitl/LocalNotification.dart index 3d31e84b..c6e1685d 100644 --- a/lib/uitl/LocalNotification.dart +++ b/lib/uitl/LocalNotification.dart @@ -30,9 +30,9 @@ class LocalNotification { _initialize() { var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon'); - var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null); - var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS); - flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: _onNotificationClick); + // var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null); + // var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS); + // flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: _onNotificationClick); } var _random = new Random(); @@ -55,11 +55,11 @@ class LocalNotification { Future.delayed(Duration(seconds: 1)).then((result) async { var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG', channelDescription: 'HMG', importance: Importance.max, priority: Priority.high, ticker: 'ticker', vibrationPattern: _vibrationPattern()); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(); - var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); - await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) { - print(err); - }); + // var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + // var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) { + // print(err); + // }); }); } @@ -84,18 +84,18 @@ class LocalNotification { ledColor: const Color.fromARGB(255, 255, 0, 0), ledOnMs: 1000, ledOffMs: 500); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff'); + // var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff'); // /change it to be as ionic - var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); - await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics); + // var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics); } ///Repeat notification every day at approximately 10:00:00 am Future showDailyAtTime() async { var time = Time(10, 0, 0); var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description'); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + // var iOSPlatformChannelSpecifics = IOSNotificationDetails(); // var platformChannelSpecifics = NotificationDetails( // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); // await flutterLocalNotificationsPlugin.showDailyAtTime( @@ -110,7 +110,7 @@ class LocalNotification { Future showWeeklyAtDayAndTime() async { var time = Time(10, 0, 0); var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', channelDescription: 'show weekly description'); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + // var iOSPlatformChannelSpecifics = IOSNotificationDetails(); // var platformChannelSpecifics = NotificationDetails( // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); // await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime( diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 03622a7a..04f4f851 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -33,9 +33,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_recognition_result.dart'; -import 'package:speech_to_text/speech_to_text.dart'; +// import 'package:speech_to_text/speech_recognition_error.dart'; +// import 'package:speech_to_text/speech_recognition_result.dart'; +// import 'package:speech_to_text/speech_to_text.dart'; class BottomBarSearch extends StatefulWidget { @override @@ -47,7 +47,7 @@ class _SearchBot extends State { RobotProvider Provider = RobotProvider(); bool isLoading = false; bool isError = false; - final SpeechToText speech = SpeechToText(); + // final SpeechToText speech = SpeechToText(); String error = ''; String _currentLocaleId = ""; String lastError; @@ -112,33 +112,33 @@ class _SearchBot extends State { } startVoiceSearch() async { - speech.listen( - onResult: resultListener, - listenFor: Duration(seconds: 10), - localeId: _currentLocaleId, - onSoundLevelChange: soundLevelListener, - cancelOnError: true, - partialResults: true, - onDevice: true, - listenMode: ListenMode.confirmation); + // speech.listen( + // onResult: resultListener, + // listenFor: Duration(seconds: 10), + // localeId: _currentLocaleId, + // onSoundLevelChange: soundLevelListener, + // cancelOnError: true, + // partialResults: true, + // onDevice: true, + // listenMode: ListenMode.confirmation); } - void resultListener(SpeechRecognitionResult result) { - // lastWords = "${result.recognizedWords} - ${result.finalResult}"; - - if (result.finalResult == true) { - // setState(() { - reconizedWord = result.recognizedWords; - //}); - setState(() { - searchController.text = reconizedWord; - }); - Future.delayed(const Duration(seconds: 1), () { - _speak(reconizedWord); - }); - } - //}); - } + // void resultListener(SpeechRecognitionResult result) { + // // lastWords = "${result.recognizedWords} - ${result.finalResult}"; + // + // if (result.finalResult == true) { + // // setState(() { + // reconizedWord = result.recognizedWords; + // //}); + // setState(() { + // searchController.text = reconizedWord; + // }); + // Future.delayed(const Duration(seconds: 1), () { + // _speak(reconizedWord); + // }); + // } + // //}); + // } Future _speak(reconizedWord) async { //await flutterTts.speak(reconizedWord); @@ -162,7 +162,7 @@ class _SearchBot extends State { } Future initSpeechState() async { - await speech.initialize(onError: errorListener, onStatus: statusListener); + // await speech.initialize(onError: errorListener, onStatus: statusListener); _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' @@ -173,11 +173,11 @@ class _SearchBot extends State { // if (!mounted) return; } - void errorListener(SpeechRecognitionError error) { - //setState(() { - // reconizedWord = "${error.errorMsg} - ${error.permanent}"; - //}); - } + // void errorListener(SpeechRecognitionError error) { + // //setState(() { + // // reconizedWord = "${error.errorMsg} - ${error.permanent}"; + // //}); + // } void statusListener(String status) { //setState(() { diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 10f30b71..5b2c995e 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -66,8 +66,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_to_text.dart' as stt; +// import 'package:speech_to_text/speech_recognition_error.dart'; +// import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:url_launcher/url_launcher.dart'; class FloatingSearchButton extends StatefulWidget { @@ -83,7 +83,7 @@ class _FloatingSearchButton extends State with TickerProvi RobotProvider eventProvider = RobotProvider(); bool isLoading = false; bool isError = false; - stt.SpeechToText speech = stt.SpeechToText(); + // stt.SpeechToText speech = stt.SpeechToText(); String error = ''; String _currentLocaleId = ""; String lastError; @@ -235,18 +235,18 @@ class _FloatingSearchButton extends State with TickerProvi } startVoiceSearch() async { - bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); - _currentLocaleId = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - - if (available) { - speech.listen( - onResult: resultListener, - //listenMode: ListenMode.confirmation, - localeId: _currentLocaleId == 'en' ? 'en_US' : 'ar_SA', - ); - } else { - print("The user has denied the use of speech recognition."); - } + // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); + // _currentLocaleId = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + + // if (available) { + // speech.listen( + // onResult: resultListener, + // //listenMode: ListenMode.confirmation, + // localeId: _currentLocaleId == 'en' ? 'en_US' : 'ar_SA', + // ); + // } else { + // print("The user has denied the use of speech recognition."); + // } // some time later... //speech.stop(); // speech.listen( @@ -305,7 +305,7 @@ class _FloatingSearchButton extends State with TickerProvi isArabic = Provider.of(context, listen: false).isArabic; await requestPermissions(); getUserData(); - await speech.initialize(onError: errorListener, onStatus: statusListener); + // await speech.initialize(onError: errorListener, onStatus: statusListener); //initialSpeak(); if (!mounted) return; @@ -315,10 +315,10 @@ class _FloatingSearchButton extends State with TickerProvi // }); } - void errorListener(SpeechRecognitionError error) { - event.setValue({"searchText": 'null'}); - RoboSearch.closeAlertDialog(context); - } + // void errorListener(SpeechRecognitionError error) { + // event.setValue({"searchText": 'null'}); + // RoboSearch.closeAlertDialog(context); + // } void statusListener(String status) { //setState(() { @@ -951,7 +951,7 @@ class _MyStatefulBuilderState extends State { var searchText; static StreamSubscription streamSubscription; static var isClosed = false; - stt.SpeechToText speech = stt.SpeechToText(); + // stt.SpeechToText speech = stt.SpeechToText(); @override void initState() { @@ -1019,7 +1019,7 @@ class _MyStatefulBuilderState extends State { TranslationBase.of(context).ok, () { RoboSearch.closeAlertDialog(context); - speech.stop(); + // speech.stop(); // event.setValue({"searchText": { // 'isIOSFeedback':true, // diff --git a/lib/widgets/pickupLocation/PickupLocationFromMap.dart b/lib/widgets/pickupLocation/PickupLocationFromMap.dart index e5639f5c..d8aa1642 100644 --- a/lib/widgets/pickupLocation/PickupLocationFromMap.dart +++ b/lib/widgets/pickupLocation/PickupLocationFromMap.dart @@ -13,7 +13,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; From 8e140844678ce8c8762d8cbfbf2759437c4b6918 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 19 Jan 2023 09:50:15 +0300 Subject: [PATCH 03/86] updates --- lib/config/config.dart | 2 +- .../pharmacyModule/PharmacyAddressesViewModel.dart | 1 - .../NewCMC/cmc_location_page.dart | 2 +- .../NewCMC/new_cmc_step_tow_page.dart | 2 +- .../HomeHealthCare/NewHomeHealthCare/location_page.dart | 2 +- .../new_Home_health_care_step_one_page.dart | 2 +- .../new_Home_health_care_step_tow_page.dart | 2 +- lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart | 2 +- lib/widgets/pickupLocation/PickupLocationFromMap.dart | 2 +- pubspec.yaml | 6 +++--- 10 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3fea4c82..9680994d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -412,7 +412,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 7.6; +var VERSION_ID = 9.9; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart index ea9af54d..947ace34 100644 --- a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart @@ -5,7 +5,6 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:geocoding/geocoding.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart index f45d2942..fbef90e6 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart @@ -25,7 +25,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index e846d31c..87d55b72 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -20,7 +20,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:permission_handler/permission_handler.dart'; import 'cmc_location_page.dart'; diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart index 78e13982..e96ddcc7 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart @@ -23,7 +23,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; 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 3a59b21e..7984cbbf 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 @@ -12,7 +12,7 @@ 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:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; class NewHomeHealthCareStepOnePage extends StatefulWidget { 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 9cc194f1..5328bfba 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 @@ -21,7 +21,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'location_page.dart'; diff --git a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart index d93e0c3a..dcc4b299 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart @@ -16,7 +16,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; class AddAddressPage extends StatefulWidget { diff --git a/lib/widgets/pickupLocation/PickupLocationFromMap.dart b/lib/widgets/pickupLocation/PickupLocationFromMap.dart index d8aa1642..e5639f5c 100644 --- a/lib/widgets/pickupLocation/PickupLocationFromMap.dart +++ b/lib/widgets/pickupLocation/PickupLocationFromMap.dart @@ -13,7 +13,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 7acc49ed..30b311be 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -209,9 +209,9 @@ dependency_overrides: permission_handler : ^6.0.1+1 flutter_svg: ^1.0.0 # firebase_messaging_platform_interface: any - flutter_inappwebview: - git: - url: https://github.com/CodeEagle/flutter_inappwebview + flutter_inappwebview: 5.7.2+3 +# git: +# url: https://github.com/CodeEagle/flutter_inappwebview dev_dependencies: From 83c15196c8cf48d1e517a3c882266104cb39ddd1 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Sun, 21 May 2023 18:25:57 +0300 Subject: [PATCH 04/86] VIDA PLUS CHANGE --- lib/config/config.dart | 6 +++--- lib/core/model/radiology/final_radiology.dart | 6 +++++- lib/pages/medical/radiology/radiology_home_page.dart | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index cd192911..8c32434d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,9 +21,9 @@ 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 = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; -// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://oras§h.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 7a9121fa..d92ffead 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -3,9 +3,10 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class FinalRadiology { String setupID; int projectID; - Null patientID; + dynamic patientID; int invoiceLineItemNo; int invoiceNo; + dynamic invoiceNo_VP; int doctorID; int clinicID; DateTime orderDate; @@ -49,6 +50,7 @@ class FinalRadiology { this.patientID, this.invoiceLineItemNo, this.invoiceNo, + this.invoiceNo_VP, this.doctorID, this.clinicID, this.orderDate, @@ -92,6 +94,7 @@ class FinalRadiology { patientID = json['PatientID']; invoiceLineItemNo = json['InvoiceLineItemNo']; invoiceNo = json['InvoiceNo']; + invoiceNo_VP = json['InvoiceNo_VP']; doctorID = json['DoctorID']; clinicID = json['ClinicID']; orderDate = DateUtil.convertStringToDate(json['OrderDate']); @@ -141,6 +144,7 @@ class FinalRadiology { data['PatientID'] = this.patientID; data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNo_VP; data['DoctorID'] = this.doctorID; data['ClinicID'] = this.clinicID; data['OrderDate'] = this.orderDate; diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 4e22dcf6..8a98401a 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -83,7 +83,7 @@ class RadiologyHomePage extends StatelessWidget { ), isInOutPatient: radiology.isInOutPatient, name: TranslationBase.of(context).dr + " " + radiology.doctorName, - billNo: radiology.invoiceNo.toString(), + billNo: radiology.invoiceNo_VP.toString(), profileUrl: radiology.doctorImageURL, subName: _isSortByClinic ? radiology.projectName : radiology.clinicDescription, isLiveCareAppointment: radiology.isLiveCareAppointment, From 0514fecae265f01e6bf1b8dd02b9101714a01d0e Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Tue, 23 May 2023 10:40:40 +0300 Subject: [PATCH 05/86] lab report email change --- lib/core/model/labs/patient_lab_orders.dart | 4 ++++ lib/core/model/labs/request_send_lab_report_email.dart | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index 3c49b80a..c2908023 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -16,6 +16,7 @@ class PatientLabOrders { int gender; String genderDescription; String invoiceNo; + String invoiceNo_VP; bool isActiveDoctorProfile; bool isDoctorAllowVedioCall; bool isExecludeDoctor; @@ -68,6 +69,7 @@ class PatientLabOrders { this.projectNameN, this.qR, this.setupID, + this.invoiceNo_VP, this.speciality,this.isLiveCareAppointment}); PatientLabOrders.fromJson(Map json) { @@ -103,6 +105,7 @@ class PatientLabOrders { projectNameN = json['ProjectNameN']; qR = json['QR']; setupID = json['SetupID']; + invoiceNo_VP = json['invoiceNo_VP']; isLiveCareAppointment = json['IsLiveCareAppointment']; // speciality = json['Speciality'].cast(); } @@ -143,6 +146,7 @@ class PatientLabOrders { data['SetupID'] = this.setupID; data['Speciality'] = this.speciality; data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['invoiceNo_VP'] =this.invoiceNo_VP; return data; } } diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index dcd28b5b..53a6f7b7 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -79,7 +79,7 @@ class RequestSendLabReportEmail { doctorName = json['DoctorName']; projectID = json['ProjectID']; invoiceNo = json['InvoiceNo']; - invoiceNo = json['InvoiceNo_VP']; + invoiceNoVP = json['InvoiceNo_VP']; orderDate = json['OrderDate']; } @@ -109,7 +109,7 @@ class RequestSendLabReportEmail { data['DoctorName'] = this.doctorName; data['ProjectID'] = this.projectID; data['InvoiceNo'] = this.invoiceNo; - data['InvoiceNo_VP'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNoVP; data['OrderDate'] = this.orderDate; return data; } From 3675d05911294358085e235b2b3473a42fa60ced Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 23 May 2023 11:47:38 +0300 Subject: [PATCH 06/86] config changes --- lib/config/config.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 8c32434d..c22e6e38 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -22,8 +22,9 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:2018/'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; -// var BASE_URL = 'https://oras§h.cloudsolutions.com.sa/'; -var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; From 17e788690779081162b156c41be70084011e574a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 25 May 2023 09:36:16 +0300 Subject: [PATCH 07/86] VidaPlus Project changes --- .../privilege/VidaPlusProjectListModel.dart | 15 ++++++++ lib/core/service/medical/labs_service.dart | 20 ++++++----- .../service/medical/radiology_service.dart | 13 ++++--- lib/core/service/privilege_service.dart | 12 +++++-- .../viewModels/medical/labs_view_model.dart | 12 +++---- lib/core/viewModels/project_view_model.dart | 34 ++++++++++++------- .../medical/labs/laboratory_result_page.dart | 15 ++++---- lib/splashPage.dart | 1 + lib/uitl/utils.dart | 12 +++++++ .../LabResult/laboratory_result_widget.dart | 3 +- 10 files changed, 96 insertions(+), 41 deletions(-) create mode 100644 lib/core/model/privilege/VidaPlusProjectListModel.dart diff --git a/lib/core/model/privilege/VidaPlusProjectListModel.dart b/lib/core/model/privilege/VidaPlusProjectListModel.dart new file mode 100644 index 00000000..e56b82db --- /dev/null +++ b/lib/core/model/privilege/VidaPlusProjectListModel.dart @@ -0,0 +1,15 @@ +class VidaPlusProjectListModel { + int projectID; + + VidaPlusProjectListModel({this.projectID}); + + VidaPlusProjectListModel.fromJson(Map json) { + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 9703874e..e9c9d846 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -32,12 +32,14 @@ class LabsService extends BaseService { List labResultList = List(); List labOrdersResultsList = List(); - Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID}) async { + Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID, bool isVidaPlus}) async { hasError = false; _requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.clinicID = clinicID; - _requestPatientLabSpecialResult.invoiceNo = "0"; - _requestPatientLabSpecialResult.invoiceNoVP = invoiceNo; + + _requestPatientLabSpecialResult.invoiceNo = isVidaPlus ? "0" : invoiceNo; + _requestPatientLabSpecialResult.invoiceNoVP = isVidaPlus ? invoiceNo : "0"; + _requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.setupID = setupID; @@ -52,11 +54,11 @@ class LabsService extends BaseService { }, body: _requestPatientLabSpecialResult.toJson()); } - Future getPatientLabResult({PatientLabOrders patientLabOrder}) async { + Future getPatientLabResult({PatientLabOrders patientLabOrder, bool isVidaPlus}) async { hasError = false; Map body = Map(); - body['InvoiceNo_VP'] = patientLabOrder.invoiceNo; - body['InvoiceNo'] = "0"; + body['InvoiceNo_VP'] = isVidaPlus ? patientLabOrder.invoiceNo : "0"; + body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; @@ -179,10 +181,10 @@ class LabsService extends BaseService { RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); - Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj}) async { + Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj, bool isVidaPlus}) async { _requestSendLabReportEmail.projectID = patientLabOrder.projectID; - _requestSendLabReportEmail.invoiceNo = "0"; - _requestSendLabReportEmail.invoiceNoVP = patientLabOrder.invoiceNo; + _requestSendLabReportEmail.invoiceNo = isVidaPlus ? "0" : patientLabOrder.invoiceNo; + _requestSendLabReportEmail.invoiceNoVP = isVidaPlus ? patientLabOrder.invoiceNo : "0"; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; _requestSendLabReportEmail.patientName = userObj.firstName + " " + userObj.lastName; diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index 44940b31..6c8ed698 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -1,7 +1,6 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/model/radiology/request_send_rad_report_email.dart'; -import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -29,9 +28,15 @@ class RadiologyService extends BaseService { await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) { finalRadiologyList.clear(); // response['FinalRadiologyList'].forEach((radiology) { - response['FinalRadiologyListAPI'].forEach((radiology) { - finalRadiologyList.add(FinalRadiology.fromJson(radiology)); - }); + if (response['FinalRadiologyList'].length != 0) { + response['FinalRadiologyList'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); + } else { + response['FinalRadiologyListAPI'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/privilege_service.dart b/lib/core/service/privilege_service.dart index 5beef992..e9b2d8a9 100644 --- a/lib/core/service/privilege_service.dart +++ b/lib/core/service/privilege_service.dart @@ -1,19 +1,25 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; class PrivilegeService extends BaseService { - List privilegeModelList = List(); + List vidaPlusProjectListModel = List(); Future getPrivilege() async { Map body = Map(); body['PatientType'] = 4; - await baseAppClient.post(GET_PRIVILEGE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PRIVILEGE, onSuccess: (dynamic response, int statusCode) { response['ServicePrivilegeList'].forEach((item) { privilegeModelList.add(PrivilegeModel.fromJson(item)); }); + + if (response['ProjectListVidaPlus'].length != 0) { + response['ProjectListVidaPlus'].forEach((item) { + vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index e42dbbb4..3d4b1039 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -72,9 +72,9 @@ class LabsViewModel extends BaseViewModel { List labResultLists = List(); - getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID}) async { + getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID, bool isVidaPlus}) async { setState(ViewState.Busy); - await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, setupID: setupID); + await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, setupID: setupID, isVidaPlus: isVidaPlus); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -83,9 +83,9 @@ class LabsViewModel extends BaseViewModel { } } - getPatientLabResult({PatientLabOrders patientLabOrder}) async { + getPatientLabResult({PatientLabOrders patientLabOrder, bool isVidaPlus}) async { setState(ViewState.Busy); - await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder); + await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder, isVidaPlus: isVidaPlus); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -135,8 +135,8 @@ class LabsViewModel extends BaseViewModel { } } - sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj}) async { - await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj); + sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj, bool isVidaPlus}) async { + await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isVidaPlus: isVidaPlus); if (_labsService.hasError) { error = _labsService.error; } else diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index c45e7dd8..d3b7566c 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart'; @@ -15,8 +16,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; var isAppArabic = false; -class ProjectViewModel extends BaseViewModel { +class ProjectViewModel extends BaseViewModel { GAnalytics get analytics => locator(); // Platform Bridge @@ -39,10 +40,14 @@ class ProjectViewModel extends BaseViewModel { double _latitude; double _longitude; - RegisterInfoResponse _registerInfo =RegisterInfoResponse(); + RegisterInfoResponse _registerInfo = RegisterInfoResponse(); + double get latitude => _latitude; + double get longitude => _longitude; - RegisterInfoResponse get registerInfo=> _registerInfo; + + RegisterInfoResponse get registerInfo => _registerInfo; + dynamic get searchValue => searchvalue; Locale get appLocal => _appLocale; @@ -54,9 +59,11 @@ class ProjectViewModel extends BaseViewModel { bool isLoginChild = false; List privilegeRootUser = List(); List privilegeChildUser = List(); + List _vidaPlusProjectListModel = List(); - List get privileges => - isLoginChild ? privilegeChildUser : privilegeChildUser; + List get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser; + + List get vidaPlusProjectList => _vidaPlusProjectListModel; List selectedBodyPartList = []; @@ -64,9 +71,7 @@ class ProjectViewModel extends BaseViewModel { ProjectViewModel() { loadSharedPrefLanguage(); - subscription = Connectivity() - .onConnectivityChanged - .listen((ConnectivityResult result) { + subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { switch (result) { case ConnectivityResult.wifi: isInternetConnection = true; @@ -89,8 +94,7 @@ class ProjectViewModel extends BaseViewModel { } Future loadSharedPrefLanguage() async { - currentLanguage = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); _appLocale = Locale(currentLanguage); isAppArabic = _isArabic = currentLanguage == 'ar'; notifyListeners(); @@ -121,6 +125,11 @@ class ProjectViewModel extends BaseViewModel { notifyListeners(); } + setVidaPlusProjectList(List vidaPlusProjectListModelInput) { + _vidaPlusProjectListModel = vidaPlusProjectListModelInput; + notifyListeners(); + } + setPrivilege({privilegeList, bool isLoginChild = false}) { List privilege = List(); @@ -166,8 +175,9 @@ class ProjectViewModel extends BaseViewModel { searchvalue = data; notifyListeners(); } - setRegisterData(RegisterInfoResponse data){ - _registerInfo =data; + + setRegisterData(RegisterInfoResponse data) { + _registerInfo = data; notifyListeners(); } } diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 847f979b..2a77436f 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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/data_display/medical/LabResult/laboratory_result_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -25,11 +26,13 @@ class _LaboratoryResultPageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getLaboratoryResult( - invoiceNo: widget.patientLabOrders.invoiceNo, - clinicID: widget.patientLabOrders.clinicID, - projectID: widget.patientLabOrders.projectID, - orderNo: widget.patientLabOrders.orderNo, - setupID: widget.patientLabOrders.setupID), + invoiceNo: widget.patientLabOrders.invoiceNo, + clinicID: widget.patientLabOrders.clinicID, + projectID: widget.patientLabOrders.projectID, + orderNo: widget.patientLabOrders.orderNo, + setupID: widget.patientLabOrders.setupID, + isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), + ), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: widget.patientLabOrders.doctorName, @@ -43,7 +46,7 @@ class _LaboratoryResultPageState extends State { itemBuilder: (context, index) => LaboratoryResultWidget( onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID))); GifLoaderDialogUtils.hideDialog(context); }, billNo: widget.patientLabOrders.invoiceNo, diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 5876ed99..04e1c3b5 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -54,6 +54,7 @@ class _SplashScreenState extends State { await _privilegeService.getPrivilege(); ProjectViewModel projectProvider = Provider.of(context, listen: false); projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); + projectProvider.setVidaPlusProjectList(_privilegeService.vidaPlusProjectListModel); AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en"); var themeNotifier = Provider.of(context, listen: false); diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 001baf50..a417f40b 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -809,6 +809,18 @@ class Utils { static String generateMd5Hash(String input) { return crypto.md5.convert(utf8.encode(input)).toString(); } + + static bool isVidaPlusProject(ProjectViewModel projectViewModel, int projectID) { + bool isVidaPlus = false; + projectViewModel.vidaPlusProjectList.forEach((element) { + if (element.projectID == projectID) { + isVidaPlus = true; + } else { + isVidaPlus = false; + } + }); + return isVidaPlus; + } } Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) { 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 d54249da..3436523d 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:flutter/cupertino.dart'; @@ -35,7 +36,7 @@ class _LaboratoryResultWidgetState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrder), + onModelReady: (model) => model.getPatientLabResult(isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrder.projectID)), patientLabOrder: widget.patientLabOrder), builder: (_, model, w) => NetworkBaseView( baseViewModel: model, child: Column( From 77f3d0a2383221cca2d3503676b83c0f635476e1 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 28 May 2023 10:02:46 +0300 Subject: [PATCH 08/86] radiology API fixes --- lib/core/service/medical/radiology_service.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index 6c8ed698..a289cebd 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -28,7 +28,7 @@ class RadiologyService extends BaseService { await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) { finalRadiologyList.clear(); // response['FinalRadiologyList'].forEach((radiology) { - if (response['FinalRadiologyList'].length != 0) { + if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) { response['FinalRadiologyList'].forEach((radiology) { finalRadiologyList.add(FinalRadiology.fromJson(radiology)); }); From 2437d2da9ceffd2da3cb52c3b32a9373b55a972c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 30 May 2023 14:49:52 +0300 Subject: [PATCH 09/86] Updates --- lib/config/config.dart | 8 ++-- .../request_send_rad_report_email.dart | 4 ++ lib/core/service/client/base_app_client.dart | 2 +- .../service/medical/radiology_service.dart | 6 +++ .../medical/radiology_view_model.dart | 5 +++ .../medical/ask_doctor/doctor_response.dart | 41 +++++++++---------- .../radiology/radiology_details_page.dart | 7 ++-- .../radiology/radiology_home_page.dart | 4 +- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- 9 files changed, 49 insertions(+), 32 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index c22e6e38..a8bc93d3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -23,8 +23,8 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; -var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -39,7 +39,9 @@ var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // RC API URL -var RC_BASE_URL = 'https://rc.hmg.com/'; +// var RC_BASE_URL = 'https://rc.hmg.com/'; + +var RC_BASE_URL = 'https://ms.hmg.com/rc/'; var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart index a461156e..6819de0d 100644 --- a/lib/core/model/radiology/request_send_rad_report_email.dart +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -6,6 +6,7 @@ class RequestSendRadReportEmail { String doctorName; String generalid; int invoiceNo; + int invoiceNo_VP; String iPAdress; bool isDentalAllowedBackend; int languageID; @@ -35,6 +36,7 @@ class RequestSendRadReportEmail { this.doctorName, this.generalid, this.invoiceNo, + this.invoiceNo_VP, this.iPAdress, this.isDentalAllowedBackend, this.languageID, @@ -63,6 +65,7 @@ class RequestSendRadReportEmail { doctorName = json['DoctorName']; generalid = json['generalid']; invoiceNo = json['InvoiceNo']; + invoiceNo_VP = json['InvoiceNo_VP']; iPAdress = json['IPAdress']; isDentalAllowedBackend = json['isDentalAllowedBackend']; languageID = json['LanguageID']; @@ -94,6 +97,7 @@ class RequestSendRadReportEmail { data['DoctorName'] = this.doctorName; data['generalid'] = this.generalid; data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNo_VP; data['IPAdress'] = this.iPAdress; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['LanguageID'] = this.languageID; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index db9cc5e8..7d38d794 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 3649158; //3844083 + // body['PatientID'] = 336; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index a289cebd..5a586356 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -8,10 +8,13 @@ class RadiologyService extends BaseService { List finalRadiologyList = List(); String url = ''; + bool isRadiologyVIDAPlus = false; + Future getRadImageURL({int invoiceNo, int lineItem, int projectId}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; + body['InvoiceNo_VP'] = invoiceNo; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; @@ -29,10 +32,12 @@ class RadiologyService extends BaseService { finalRadiologyList.clear(); // response['FinalRadiologyList'].forEach((radiology) { if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) { + isRadiologyVIDAPlus = false; response['FinalRadiologyList'].forEach((radiology) { finalRadiologyList.add(FinalRadiology.fromJson(radiology)); }); } else { + isRadiologyVIDAPlus = true; response['FinalRadiologyListAPI'].forEach((radiology) { finalRadiologyList.add(FinalRadiology.fromJson(radiology)); }); @@ -62,6 +67,7 @@ class RadiologyService extends BaseService { _requestSendRadReportEmail.projectID = finalRadiology.projectID; _requestSendRadReportEmail.clinicName = finalRadiology.clinicDescription; _requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo; + _requestSendRadReportEmail.invoiceNo_VP = finalRadiology.invoiceNo_VP; _requestSendRadReportEmail.invoiceLineItemNo = finalRadiology.invoiceLineItemNo; _requestSendRadReportEmail.setupID = finalRadiology.setupID; _requestSendRadReportEmail.doctorName = finalRadiology.doctorName; diff --git a/lib/core/viewModels/medical/radiology_view_model.dart b/lib/core/viewModels/medical/radiology_view_model.dart index e944b685..311c4366 100644 --- a/lib/core/viewModels/medical/radiology_view_model.dart +++ b/lib/core/viewModels/medical/radiology_view_model.dart @@ -18,9 +18,14 @@ class RadiologyViewModel extends BaseViewModel { List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; + bool _isRadiologyVIDAPlus = false; + + bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus; + void getPatientRadOrders() async { setState(ViewState.Busy); await _radiologyService.getPatientRadOrders(); + _isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus; if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/pages/medical/ask_doctor/doctor_response.dart b/lib/pages/medical/ask_doctor/doctor_response.dart index 37e5f1c9..1ff9def7 100644 --- a/lib/pages/medical/ask_doctor/doctor_response.dart +++ b/lib/pages/medical/ask_doctor/doctor_response.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_mod import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -27,7 +28,7 @@ class DoctorResponse extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 65, + height: 16, ), AppExpandableNotifier( headerWidget: Padding( @@ -61,14 +62,18 @@ class DoctorResponse extends StatelessWidget { return InkWell( onTap: () { ///go to page ViewDoctorResponsesPage - Navigator.push( - context, - FadePage( - page: ViewDoctorResponsesPage( - doctorResponse: doctor, + if (doctor.transactions != null && doctor.transactions.isNotEmpty) { + Navigator.push( + context, + FadePage( + page: ViewDoctorResponsesPage( + doctorResponse: doctor, + ), ), - ), - ); + ); + } else { + Utils.showErrorToast("There are no doctor responses for this request."); + } }, child: Container( height: 100, @@ -85,24 +90,20 @@ class DoctorResponse extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts('${doctor.doctorName}'), SizedBox( height: 5, ), - Texts( - '${doctor.requestTypeDescription}'), + Texts('${doctor.requestTypeDescription}'), ], ), ), ), Padding( padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), - child: Icon(projectViewModel.isArabic - ? Icons.arrow_forward_ios - : Icons.arrow_back_ios), + child: Icon(projectViewModel.isArabic ? Icons.arrow_back_ios : Icons.arrow_forward_ios), ) ], ), @@ -158,24 +159,20 @@ class DoctorResponse extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts('${doctor.doctorName}'), SizedBox( height: 5, ), - Texts( - '${doctor.requestTypeDescription}'), + Texts('${doctor.requestTypeDescription}'), ], ), ), ), Padding( padding: const EdgeInsets.all(8.0), - child: Icon(projectViewModel.isArabic - ? Icons.arrow_forward_ios - : Icons.arrow_back_ios), + child: Icon(projectViewModel.isArabic ? Icons.arrow_back_ios : Icons.arrow_forward_ios), ) ], ), diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index a84acbae..c7513757 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -1,6 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; -import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -19,14 +18,16 @@ import 'package:url_launcher/url_launcher.dart'; class RadiologyDetailsPage extends StatelessWidget { final FinalRadiology finalRadiology; + bool isRadiologyVidaPlus; - RadiologyDetailsPage({Key key, this.finalRadiology}); + RadiologyDetailsPage({Key key, this.finalRadiology, this.isRadiologyVidaPlus}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getRadImageURL(projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), + onModelReady: (model) => model.getRadImageURL( + projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: isRadiologyVidaPlus ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( appBarTitle: TranslationBase.of(context).report, isShowAppBar: true, diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 8a98401a..2c18dc09 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/new_design/my_tab_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; @@ -78,12 +79,13 @@ class RadiologyHomePage extends StatelessWidget { FadePage( page: RadiologyDetailsPage( finalRadiology: radiology, + isRadiologyVidaPlus: Utils.isVidaPlusProject(projectViewModel, radiology.projectID), ), ), ), isInOutPatient: radiology.isInOutPatient, name: TranslationBase.of(context).dr + " " + radiology.doctorName, - billNo: radiology.invoiceNo_VP.toString(), + billNo: Utils.isVidaPlusProject(projectViewModel, radiology.projectID) ? radiology.invoiceNo_VP.toString() : radiology.invoiceNo.toString(), profileUrl: radiology.doctorImageURL, subName: _isSortByClinic ? radiology.projectName : radiology.clinicDescription, isLiveCareAppointment: radiology.isLiveCareAppointment, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e91990b4..ba9d79ee 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -39,9 +39,9 @@ class MyInAppBrowser extends InAppBrowser { // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS + static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; From cf30762eecd9de24b6effeaf37e6e3e41c2e6531 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 1 Jun 2023 12:17:29 +0300 Subject: [PATCH 10/86] updates --- lib/core/model/labs/request_send_lab_report_email.dart | 5 ++++- lib/core/service/client/base_app_client.dart | 4 ++-- lib/core/service/medical/labs_service.dart | 1 + lib/core/service/medical/radiology_service.dart | 6 +++--- lib/core/viewModels/medical/radiology_view_model.dart | 4 ++-- lib/pages/medical/radiology/radiology_details_page.dart | 8 ++++++-- lib/pages/medical/radiology/radiology_home_page.dart | 1 + lib/uitl/utils.dart | 2 -- 8 files changed, 19 insertions(+), 12 deletions(-) diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index 53a6f7b7..4f2fc02a 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -25,6 +25,7 @@ class RequestSendLabReportEmail { String invoiceNo; String invoiceNoVP; String orderDate; + String orderNo; RequestSendLabReportEmail( {this.versionID, @@ -52,7 +53,7 @@ class RequestSendLabReportEmail { this.projectID, this.invoiceNo, this.invoiceNoVP, - this.orderDate}); + this.orderDate, this.orderNo}); RequestSendLabReportEmail.fromJson(Map json) { versionID = json['VersionID']; @@ -81,6 +82,7 @@ class RequestSendLabReportEmail { invoiceNo = json['InvoiceNo']; invoiceNoVP = json['InvoiceNo_VP']; orderDate = json['OrderDate']; + orderNo = json['OrderNo']; } Map toJson() { @@ -111,6 +113,7 @@ class RequestSendLabReportEmail { data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo_VP'] = this.invoiceNoVP; data['OrderDate'] = this.orderDate; + data['OrderNo'] = this.orderNo; return data; } } diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 7d38d794..bd89c933 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,8 +150,8 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 336; //3844083 - // body['TokenID'] = "@dm!n"; + body['PatientID'] = 339; //3844083 + body['TokenID'] = "@dm!n"; // Patient ID: 3027574 // Mobile no.: 0502303285 diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index e9c9d846..ab3cd829 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -195,6 +195,7 @@ class LabsService extends BaseService { _requestSendLabReportEmail.patientMobileNumber = userObj.mobileNumber; _requestSendLabReportEmail.projectName = patientLabOrder.projectName; _requestSendLabReportEmail.setupID = patientLabOrder.setupID; + _requestSendLabReportEmail.orderNo = patientLabOrder.orderNo; await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index 5a586356..f2a54c0c 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -10,11 +10,11 @@ class RadiologyService extends BaseService { bool isRadiologyVIDAPlus = false; - Future getRadImageURL({int invoiceNo, int lineItem, int projectId}) async { + Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus}) async { hasError = false; final Map body = new Map(); - body['InvoiceNo'] = invoiceNo; - body['InvoiceNo_VP'] = invoiceNo; + body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo; + body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0"; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; diff --git a/lib/core/viewModels/medical/radiology_view_model.dart b/lib/core/viewModels/medical/radiology_view_model.dart index 311c4366..3ee6fedf 100644 --- a/lib/core/viewModels/medical/radiology_view_model.dart +++ b/lib/core/viewModels/medical/radiology_view_model.dart @@ -48,9 +48,9 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId}) async { + getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus}) async { setState(ViewState.Busy); - await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId); + await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index c7513757..7e609370 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; @@ -27,7 +28,10 @@ class RadiologyDetailsPage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getRadImageURL( - projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: isRadiologyVidaPlus ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo), + projectId: finalRadiology.projectID, + lineItem: finalRadiology.invoiceLineItemNo, + invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo, + isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID)), builder: (_, model, widget) => AppScaffold( appBarTitle: TranslationBase.of(context).report, isShowAppBar: true, @@ -46,7 +50,7 @@ class RadiologyDetailsPage extends StatelessWidget { finalRadiology.doctorID, finalRadiology.doctorImageURL, finalRadiology.speciality, - finalRadiology.invoiceNo.toString(), + Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP.toString() : finalRadiology.invoiceNo.toString(), finalRadiology.projectName, finalRadiology.orderDate, null, diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 2c18dc09..9fc49cb5 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -86,6 +86,7 @@ class RadiologyHomePage extends StatelessWidget { isInOutPatient: radiology.isInOutPatient, name: TranslationBase.of(context).dr + " " + radiology.doctorName, billNo: Utils.isVidaPlusProject(projectViewModel, radiology.projectID) ? radiology.invoiceNo_VP.toString() : radiology.invoiceNo.toString(), + // billNo: radiology.invoiceNo_VP.toString(), profileUrl: radiology.doctorImageURL, subName: _isSortByClinic ? radiology.projectName : radiology.clinicDescription, isLiveCareAppointment: radiology.isLiveCareAppointment, diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index a417f40b..4d9904c7 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -815,8 +815,6 @@ class Utils { projectViewModel.vidaPlusProjectList.forEach((element) { if (element.projectID == projectID) { isVidaPlus = true; - } else { - isVidaPlus = false; } }); return isVidaPlus; From 101f2dcab8b7d3b32e27f2794b04ca4ce08a0e5f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 11 Jun 2023 13:39:32 +0300 Subject: [PATCH 11/86] updates --- lib/config/config.dart | 12 ++++++++---- lib/core/service/client/base_app_client.dart | 4 ++-- .../Covid-DriveThru/covid-drivethru-location.dart | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index a8bc93d3..af5c606c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -23,16 +23,20 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; -var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // // Pharmacy Production URLs -var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; -var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; +// var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; +// var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; + +// Pharmacy VidaPlus URLs +var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; +var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // // Pharmacy Pre-Production URLs // var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index bd89c933..014e3eab 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,8 +150,8 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - body['PatientID'] = 339; //3844083 - body['TokenID'] = "@dm!n"; + // body['PatientID'] = 339; //3844083 + // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 // Mobile no.: 0502303285 diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 4d0479e6..c85f53ae 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -126,7 +126,7 @@ class _CovidDrivethruLocationState extends State { value: item, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Text(item.projectName), getCovidTestTypeImage(item)], + children: [Text(item.projectName ?? ""), getCovidTestTypeImage(item)], ), ); }).toList(), From 17acae0a95a62884a95bfae104955fd9d41abe77 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 11 Jun 2023 16:40:39 +0300 Subject: [PATCH 12/86] updates --- lib/core/service/client/base_app_client.dart | 4 ++-- lib/pages/ToDoList/ToDo.dart | 11 +++++++++-- lib/services/appointment_services/GetDoctorsList.dart | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 014e3eab..d88769a3 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,8 +150,8 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 339; //3844083 - // body['TokenID'] = "@dm!n"; + body['PatientID'] = 454; //3844083 + body['TokenID'] = "@dm!n"; // Patient ID: 3027574 // Mobile no.: 0502303285 diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index d8eeded9..5f29e784 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1119,7 +1119,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { error_type: res['Response_Message']); } }).catchError((err) { - if(mounted) GifLoaderDialogUtils.hideDialog(context); + if (mounted) GifLoaderDialogUtils.hideDialog(context); print(err); }); } @@ -1130,7 +1130,14 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { String paymentReference = res['Fort_id'].toString(); service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { GifLoaderDialogUtils.hideDialog(context); - addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo, res['OnlineCheckInAppointments'][0]); + addAdvancedNumberRequest( + Utils.isVidaPlusProject(projectViewModel, appo.projectID) + ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() + : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString(), + appo, + res['OnlineCheckInAppointments'][0]); }).catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index effa4445..dfd3ed32 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -961,6 +961,7 @@ class DoctorsListService extends BaseService { Request req = appGlobal.getPublicRequest(); request = { "AdvanceNumber": advanceNumber, + "AdvanceNumber_VP": advanceNumber, "PaymentReferenceNumber": paymentReference, "AppointmentID": appointmentID, "VersionID": req.VersionID, From f28fcbd006247bc4dbb10a9b8769b8120b4ae8fc Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 12 Jun 2023 13:37:20 +0300 Subject: [PATCH 13/86] AdvanceNumber_VP added --- lib/config/config.dart | 4 ++-- lib/core/service/client/base_app_client.dart | 6 +++--- .../ancillaryOrdersDetails.dart | 21 ++++++++----------- lib/pages/Blood/confirm_payment_page.dart | 13 ++++++++++-- lib/pages/BookAppointment/BookSuccess.dart | 10 +++++++-- .../covid-payment-summary.dart | 8 +++++-- .../medical/balance/confirm_payment_page.dart | 10 ++++++++- 7 files changed, 48 insertions(+), 24 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index af5c606c..470fba3b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -23,8 +23,8 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; -var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index d88769a3..cf19dbac 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -77,7 +77,7 @@ class BaseAppClient { body['IPAdress'] = IP_ADDRESS; body['generalid'] = GENERAL_ID; - body['isVidaPlus'] = true; + // body['isVidaPlus'] = true; body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT); body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG); @@ -150,8 +150,8 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - body['PatientID'] = 454; //3844083 - body['TokenID'] = "@dm!n"; + // body['PatientID'] = 442; //3844083 + // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 // Mobile no.: 0502303285 diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 1dd34876..eb411b46 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -560,7 +560,6 @@ class _AnicllaryOrdersState extends State with SingleTic } else { checkPaymentStatus(appo); } - } checkTamaraPaymentStatus(String orderID, AppoitmentAllHistoryResultList appo) { @@ -622,18 +621,16 @@ class _AnicllaryOrdersState extends State with SingleTic createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); - service.HIS_createAdvancePayment( - appo, - widget.projectID.toString(), - res['Amount'], - res['Fort_id'], - res['PaymentMethod'], - projectViewModel.user.patientType, - projectViewModel.user.firstName + " " + projectViewModel.user.lastName, - projectViewModel.user.patientID, - localContext) + service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType, + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext) .then((res) { - addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo); + addAdvancedNumberRequest( + Utils.isVidaPlusProject(projectViewModel, appo.projectID) + ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() + : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + 0, + appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(localContext); AppToast.showErrorToast(message: err); diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index 4b3f96e2..bfd8f69a 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -20,6 +21,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; import 'dialogs/ConfirmSMSDialog.dart'; import 'new_text_Field.dart'; @@ -31,11 +33,13 @@ class ConfirmPaymentPage extends StatelessWidget { MyInAppBrowser browser; AuthenticatedUser authenticatedUser; AppSharedPreferences sharedPref = AppSharedPreferences(); + ProjectViewModel projectViewModel; ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser}); @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); void showSMSDialog() { showDialog( context: context, @@ -250,8 +254,13 @@ class ConfirmPaymentPage extends StatelessWidget { GifLoaderDialogUtils.showMyDialog(AppGlobal.context); service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); - print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); - addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo); + addAdvancedNumberRequest( + Utils.isVidaPlusProject(projectViewModel, appo.projectID) + ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() + : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString(), + appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); AppToast.showErrorToast(message: err); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 890b96d8..83c3fdbd 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -1,6 +1,5 @@ import 'dart:io'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; @@ -46,6 +45,7 @@ class BookSuccess extends StatefulWidget { class _BookSuccessState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); + // AuthenticatedUser authUser; ProjectViewModel projectViewModel; @@ -775,7 +775,13 @@ class _BookSuccessState extends State { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { - addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo); + addAdvancedNumberRequest( + Utils.isVidaPlusProject(projectViewModel, appo.projectID) + ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() + : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString(), + appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index d23be14a..e1f00173 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -402,8 +402,12 @@ class _CovidPaymentSummaryState extends State { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { - print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); - addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString()); + addAdvancedNumberRequest( + Utils.isVidaPlusProject(projectViewModel, appo.projectID) + ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() + : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString()); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 7c562b43..a36eb4fd 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -24,6 +24,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; + // import 'package:pay/pay.dart'; import 'package:provider/provider.dart'; @@ -52,6 +53,7 @@ class _ConfirmPaymentPageState extends State { String tamaraPaymentStatus; String tamaraOrderID; + // Pay _payClient; @override @@ -463,7 +465,13 @@ class _ConfirmPaymentPageState extends State { service.HIS_createAdvancePayment(appo, widget.advanceModel.hospitalsModel.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], widget.patientInfoAndMobileNumber.patientType, widget.advanceModel.patientName, widget.advanceModel.fileNumber, AppGlobal.context) .then((res) { - addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo); + addAdvancedNumberRequest( + Utils.isVidaPlusProject(projectViewModel, appo.projectID) + ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() + : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + 0, + appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); AppToast.showErrorToast(message: err); From 58e598843bcf8da04801e83e3cb9377561755081 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 14 Jun 2023 10:27:08 +0300 Subject: [PATCH 14/86] sickleave --- lib/config/config.dart | 4 +-- lib/core/service/client/base_app_client.dart | 2 +- .../medical/patient_sick_leave_page.dart | 25 ++++++++++++------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 470fba3b..2777ebee 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,9 +21,9 @@ 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 = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; -var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index cf19dbac..87faf867 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 442; //3844083 + // body['PatientID'] = 197; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 1ca32e02..3d977a96 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -57,8 +57,8 @@ class _PatientSickLeavePageState extends State { subName: model.sickLeaveList[index].clinicName, isSortByClinic: false, isInOutPatient: model.sickLeaveList[index].isInOutPatient, - // isSickLeave: true, - // sickLeaveStatus: model.sickLeaveList[index].status, + isSickLeave: true, + sickLeaveStatus: model.sickLeaveList[index].status, onEmailTap: () { showConfirmMessage(model, index); }, @@ -69,13 +69,13 @@ class _PatientSickLeavePageState extends State { } void showConfirmMessage(PatientSickLeaveViewMode model, int index) { - // if (model.sickLeaveList[index].status == 1) { - // openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); - // } else if (model.sickLeaveList[index].status == 2) { + if (model.sickLeaveList[index].status == 1) { + openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); + } else if (model.sickLeaveList[index].status == 2) { showEmailDialog(model, index); - // } else { - // showApprovalDialog(); - // } + } else { + showApprovalDialog(); + } } void showApprovalDialog() { @@ -111,7 +111,14 @@ class _PatientSickLeavePageState extends State { } void openWorkPlaceUpdatePage(int requestNumber, String setupID, PatientSickLeaveViewMode model, int index, int projectID) { - Navigator.push(context, FadePage(page: WorkplaceUpdatePage(requestNumber: requestNumber, setupID: setupID, projectID: projectID,))).then((value) { + Navigator.push( + context, + FadePage( + page: WorkplaceUpdatePage( + requestNumber: requestNumber, + setupID: setupID, + projectID: projectID, + ))).then((value) { print(value); if (value != null && value == true) { model.getSickLeave(); From 83ca5e8e4c28c1fee67a25bfcac3b1fd47437f5d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 18 Jun 2023 20:08:10 +0300 Subject: [PATCH 15/86] ask doctor date param added --- lib/pages/medical/ask_doctor/ask_doctor_page.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index 19636d62..463f7fb9 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -60,6 +60,7 @@ class AskDoctorPage extends StatelessWidget { itemBuilder: (context, _index) { DoctorList _doctor = _doctorList[_index]; DoctorList doctorList = DoctorList( + date: _doctor.date, projectID: _doctor.projectID, setupID: _doctor.setupID, clinicID: _doctor.clinicID, From e4fe4baa27e11b40dbb6e70c03cad4909ef416d5 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 18 Jun 2023 20:30:44 +0300 Subject: [PATCH 16/86] nearest appo crash fixed --- lib/pages/BookAppointment/components/SearchByClinic.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 891d01cb..850e23af 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -243,8 +243,7 @@ class _SearchByClinicState extends State { Navigator.push(context, FadePage(page: LaserClinic())); } else if (!isDentalSelectedAndSupported()) { projectDropdownValue = ""; - if(!nearestAppo) - getDoctorsList(context); + if (!nearestAppo) getDoctorsList(context); } else {} }); projectViewModel.analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription); @@ -531,8 +530,8 @@ class _SearchByClinicState extends State { searchInfo.clinic = selectedClinic; searchInfo.date = DateTime.now(); - if(projectViewModel.isLogin) { - if(projectViewModel.user.age > 12) { + if (projectViewModel.isLogin) { + if (projectViewModel.user.age > 12) { navigateToDentalComplaints(context, searchInfo); } else { callDoctorsSearchAPI(17); @@ -606,6 +605,8 @@ class _SearchByClinicState extends State { result = LinkedHashSet.from(arr).toList(); numAll = result.length; + nearestAppo = false; + isProjectLoaded = false; navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); From 792b3ea249229c0d19c67db5e990985db2ffb225 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 21 Jun 2023 11:16:54 +0300 Subject: [PATCH 17/86] no message --- lib/core/service/medical/ask_doctor_services.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/core/service/medical/ask_doctor_services.dart b/lib/core/service/medical/ask_doctor_services.dart index 57ab856b..e3fddf66 100644 --- a/lib/core/service/medical/ask_doctor_services.dart +++ b/lib/core/service/medical/ask_doctor_services.dart @@ -96,6 +96,7 @@ class AskDoctorService extends BaseService { body['EditedBy'] = 102; body['EditedOn'] = DateUtil.yearMonthDay(DateTime.now()); body['isDentalAllowedBackend'] = false; + body['QuestionType'] = num.parse(requestType); await baseAppClient.post(INSERT_CALL_INFO, onSuccess: (dynamic response, int statusCode) { From 12af8bb8a9fef315a6fc058ed5add4c62660e9f0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 3 Jul 2023 12:45:03 +0300 Subject: [PATCH 18/86] updates --- lib/config/config.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 2777ebee..470fba3b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,9 +21,9 @@ 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 = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs From 7bc105c6c77857c5517c3cae459b440e29a429ac Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 3 Jul 2023 14:33:00 +0300 Subject: [PATCH 19/86] updates --- lib/pages/medical/labs/laboratory_result_page.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 2a77436f..694382cc 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -46,7 +46,11 @@ class _LaboratoryResultPageState extends State { itemBuilder: (context, index) => LaboratoryResultWidget( onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID))); + await model.sendLabReportEmail( + patientLabOrder: widget.patientLabOrders, + mes: TranslationBase.of(context).sendSuc, + userObj: projectViewModel.user, + isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID))); GifLoaderDialogUtils.hideDialog(context); }, billNo: widget.patientLabOrders.invoiceNo, From 31d8443f87888781e1f98de73d767a884d8285fa Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 9 Jul 2023 10:40:40 +0300 Subject: [PATCH 20/86] insert call info updates --- .../service/medical/ask_doctor_services.dart | 49 ++++++++----------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/lib/core/service/medical/ask_doctor_services.dart b/lib/core/service/medical/ask_doctor_services.dart index e3fddf66..ca2e12a3 100644 --- a/lib/core/service/medical/ask_doctor_services.dart +++ b/lib/core/service/medical/ask_doctor_services.dart @@ -18,9 +18,8 @@ class AskDoctorService extends BaseService { dynamic localRes; - await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT, - onSuccess: (dynamic response, int statusCode) { - localRes = response; + await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT, onSuccess: (dynamic response, int statusCode) { + localRes = response; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -29,11 +28,10 @@ class AskDoctorService extends BaseService { } Future getCallRequestTypeLOV() async { - hasError =false; + hasError = false; Map body = Map(); body['isDentalAllowedBackend'] = false; - await baseAppClient.post(GET_CALL_REQUEST_TYPE_LOV, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CALL_REQUEST_TYPE_LOV, onSuccess: (dynamic response, int statusCode) { askDoctorReqTypes.clear(); response['ListReqTypes'].forEach((reqType) { askDoctorReqTypes.add(AskDoctorReqTypes.fromJson(reqType)); @@ -45,15 +43,12 @@ class AskDoctorService extends BaseService { } Future getDoctorResponse() async { - hasError =false; + hasError = false; Map body = Map(); body['isDentalAllowedBackend'] = false; - body['from'] = - "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} 00:00:00"; - body['from'] = - "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}:00"; - await baseAppClient.post(GET_DOCTOR_RESPONSE, - onSuccess: (dynamic response, int statusCode) { + body['from'] = "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} 00:00:00"; + body['from'] = "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}:00"; + await baseAppClient.post(GET_DOCTOR_RESPONSE, onSuccess: (dynamic response, int statusCode) { doctorResponseList.clear(); response['List_DoctorResponse'].forEach((reqType) { doctorResponseList.add(DoctorResponse.fromJson(reqType)); @@ -65,12 +60,11 @@ class AskDoctorService extends BaseService { } Future updateReadStatus({int transactionNo}) async { - hasError =false; + hasError = false; Map body = Map(); body['isDentalAllowedBackend'] = false; body['TransactionNo'] = transactionNo; - await baseAppClient.post(UPDATE_READ_STATUS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(UPDATE_READ_STATUS, onSuccess: (dynamic response, int statusCode) { //TODO fix it }, onFailure: (String error, int statusCode) { hasError = true; @@ -78,9 +72,8 @@ class AskDoctorService extends BaseService { }, body: body); } - - Future sendRequestLOV({DoctorList doctorList,String requestType,String remark}) async { - hasError =false; + Future sendRequestLOV({DoctorList doctorList, String requestType, String remark}) async { + hasError = false; Map body = Map(); body['ProjectID'] = doctorList.projectID; body['SetupID'] = doctorList.setupID; @@ -90,20 +83,18 @@ class AskDoctorService extends BaseService { body['RequestDate'] = DateUtil.yearMonthDay(DateTime.now()); body['RequestTime'] = DateUtil.time(DateTime.now()); body['Remarks'] = remark; - body['Status'] = 2;// 4 for testing only.."cancelled status insert" else should be changed to 1 in live version + body['Status'] = 2; // 4 for testing only.."cancelled status insert" else should be changed to 1 in live version body['CreatedBy'] = 102; - body['CreatedOn'] = DateUtil.yearMonthDay(DateTime.now()); + body['CreatedOn'] = DateUtil.yearMonthDay(DateTime.now()); body['EditedBy'] = 102; body['EditedOn'] = DateUtil.yearMonthDay(DateTime.now()); body['isDentalAllowedBackend'] = false; body['QuestionType'] = num.parse(requestType); - await baseAppClient.post(INSERT_CALL_INFO, - onSuccess: (dynamic response, int statusCode) { - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + body['RequestType'] = num.parse(requestType); + body['RequestTypeID'] = num.parse(requestType); + await baseAppClient.post(INSERT_CALL_INFO, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } - } From b337343df3b173884cb11d50f73399217c564b2d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 11 Jul 2023 12:25:18 +0300 Subject: [PATCH 21/86] Project ID fix in ancillary orders --- .../ancillary-orders/ancillaryOrdersDetails.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index eb411b46..5f9411ad 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -625,7 +625,7 @@ class _AnicllaryOrdersState extends State with SingleTic projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext) .then((res) { addAdvancedNumberRequest( - Utils.isVidaPlusProject(projectViewModel, appo.projectID) + Utils.isVidaPlusProject(projectViewModel, widget.projectID) ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, From b2ec6c76bf4480a87d9cec54ce2680f9acb81297 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 8 Aug 2023 11:19:28 +0300 Subject: [PATCH 22/86] ancillary fix --- lib/models/anicllary-orders/ancillary_order_list_model.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/models/anicllary-orders/ancillary_order_list_model.dart b/lib/models/anicllary-orders/ancillary_order_list_model.dart index 76ef3a7d..56cfeb31 100644 --- a/lib/models/anicllary-orders/ancillary_order_list_model.dart +++ b/lib/models/anicllary-orders/ancillary_order_list_model.dart @@ -1,6 +1,6 @@ class AncillaryOrdersListModel { List ancillaryOrderList; - Null errCode; + dynamic errCode; String message; int patientID; String patientName; @@ -32,7 +32,7 @@ class AncillaryOrdersListModel { errCode = json['ErrCode']; message = json['Message']; patientID = json['PatientID']; - patientName = json['PatientName']; + patientName = json['PatientName'] != null ? json['PatientName'] : ""; patientType = json['PatientType']; projectID = json['ProjectID']; projectName = json['ProjectName']; @@ -83,7 +83,7 @@ class AncillaryOrderList { appointmentDate = json['AppointmentDate']; appointmentNo = json['AppointmentNo']; clinicID = json['ClinicID']; - clinicName = json['ClinicName']; + clinicName = json['ClinicName'] != null ? json['ClinicName'] : ""; doctorID = json['DoctorID']; doctorName = json['DoctorName']; orderDate = json['OrderDate']; From ff23f3a8cbaf1ba4c1dd74a9eeff3baa1563425a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 8 Aug 2023 14:47:29 +0300 Subject: [PATCH 23/86] fixes --- lib/pages/medical/balance/confirm_payment_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index a36eb4fd..b43810c0 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -466,7 +466,7 @@ class _ConfirmPaymentPageState extends State { widget.advanceModel.patientName, widget.advanceModel.fileNumber, AppGlobal.context) .then((res) { addAdvancedNumberRequest( - Utils.isVidaPlusProject(projectViewModel, appo.projectID) + Utils.isVidaPlusProject(projectViewModel, widget.advanceModel.hospitalsModel.iD) ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, From 3353c93de9623bbe0e546f48885c4456b719fa3c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 10 Aug 2023 10:44:58 +0300 Subject: [PATCH 24/86] fixes --- .../conference/web_rtc/call_home_page_.dart | 408 ++++++------- lib/pages/landing/landing_page.dart | 2 +- lib/pages/livecare/incoming_call.dart | 2 +- lib/pages/webRTC/call_page.dart | 4 +- lib/pages/webRTC/signaling.dart | 554 +++++++++--------- lib/uitl/SignalRUtil.dart | 346 +++++------ 6 files changed, 658 insertions(+), 658 deletions(-) diff --git a/lib/pages/conference/web_rtc/call_home_page_.dart b/lib/pages/conference/web_rtc/call_home_page_.dart index 1f36a8e9..a831a23f 100644 --- a/lib/pages/conference/web_rtc/call_home_page_.dart +++ b/lib/pages/conference/web_rtc/call_home_page_.dart @@ -1,204 +1,204 @@ -import 'dart:async'; -import 'dart:convert'; - -import 'package:diplomaticquarterapp/pages/conference/web_rtc/widgets/cam_view_widget.dart'; -import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart'; -import 'package:diplomaticquarterapp/pages/webRTC/signaling.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_webrtc/flutter_webrtc.dart'; - -import '../conference_button_bar.dart'; - -class CallHomePage extends StatefulWidget { - final String receiverId; - final String callerId; - - const CallHomePage({Key key, this.receiverId, this.callerId}) : super(key: key); - - @override - _CallHomePageState createState() => _CallHomePageState(); -} - -class _CallHomePageState extends State { - bool showNoise = true; - RTCVideoRenderer _localRenderer = RTCVideoRenderer(); - RTCVideoRenderer _remoteRenderer = RTCVideoRenderer(); - - final StreamController _audioButton = StreamController.broadcast(); - final StreamController _videoButton = StreamController.broadcast(); - final StreamController _onButtonBarVisibleStreamController = StreamController.broadcast(); - final StreamController _onButtonBarHeightStreamController = StreamController.broadcast(); - - //Stream to enable video - MediaStream localMediaStream; - MediaStream remoteMediaStream; - Signaling signaling = Signaling(); - - @override - void initState() { - // TODO: implement initState - super.initState(); - startCall(); - } - - startCall() async{ - await _localRenderer.initialize(); - await _remoteRenderer.initialize(); - await signaling.init(); - final connected = await receivedCall(); - } - - - Future receivedCall() async { - //Stream local media - localMediaStream = await navigator.mediaDevices.getUserMedia({'video': true, 'audio': true}); - _localRenderer.srcObject = localMediaStream; - - final connected = await signaling.acceptCall(widget.callerId, widget.receiverId, localMediaStream: localMediaStream, - onRemoteMediaStream: (remoteMediaStream){ - - // print(remoteMediaStream.toString()); - // print(json.encode(remoteMediaStream.getTracks().asMap())); - this.remoteMediaStream = remoteMediaStream; - _remoteRenderer.srcObject = remoteMediaStream; - _remoteRenderer.addListener(() { - print('_remoteRenderer'); - print(_remoteRenderer); - setState(() {}); - }); - }, - onRemoteTrack: (track){ - _remoteRenderer.srcObject.addTrack(track.track); - // setState(() { - // }); - - print(track.streams.first.getVideoTracks()); - print(track.streams.first.getAudioTracks()); - print(json.encode(track.streams.asMap())); - } - ); - - if(connected){ - signaling.signalR.listen( - onAcceptCall: (arg0){ - print(arg0.toString()); - }, - onCandidate: (candidateJson){ - signaling.addCandidate(candidateJson); - }, - onDeclineCall: (arg0,arg1){ - // _onHangup(); - }, - onHangupCall: (arg0){ - // _onHangup(); - }, - - onOffer: (offerSdp, callerUser) async{ - print('${offerSdp.toString()} | ${callerUser.toString()}'); - await signaling.answerOffer(offerSdp); - } - ); - } - return connected; - } - - @override - void dispose() { - // TODO: implement dispose - super.dispose(); - signaling.dispose(); - _localRenderer?.dispose(); - _remoteRenderer?.dispose(); - _audioButton?.close(); - _videoButton?.close(); - localMediaStream?.dispose(); - remoteMediaStream?.dispose(); - _disposeStreamsAndSubscriptions(); - } - - Future _disposeStreamsAndSubscriptions() async { - if (_onButtonBarVisibleStreamController != null) await _onButtonBarVisibleStreamController.close(); - if (_onButtonBarHeightStreamController != null) await _onButtonBarHeightStreamController.close(); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Colors.white, - body: buildLayout(), - ); - } - - LayoutBuilder buildLayout() { - return LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { - return Stack( - children: [ - CamViewWidget( - localRenderer: _localRenderer, - remoteRenderer: _remoteRenderer, - constraints: constraints, - onButtonBarVisibleStreamController: _onButtonBarVisibleStreamController, - onButtonBarHeightStreamController: _onButtonBarHeightStreamController, - ), - ConferenceButtonBar( - audioEnabled: _audioButton.stream, - videoEnabled: _videoButton.stream, - onAudioEnabled: _onAudioEnable, - onVideoEnabled: _onVideoEnabled, - onSwitchCamera: _onSwitchCamera, - onHangup: _onHangup, - onPersonAdd: () {}, - onPersonRemove: () {}, - onHeight: _onHeightBar, - onShow: _onShowBar, - onHide: _onHideBar, - ), - ], - ); - }, - ); - } - - Function _onAudioEnable() { - final audioTrack = localMediaStream.getAudioTracks()[0]; - final mute = audioTrack.muted; - Helper.setMicrophoneMute(!mute, audioTrack); - _audioButton.add(mute); - } - - Function _onVideoEnabled() { - final videoTrack = localMediaStream.getVideoTracks()[0]; - bool videoEnabled = videoTrack.enabled; - localMediaStream.getVideoTracks()[0].enabled = !videoEnabled; - _videoButton.add(!videoEnabled); - } - - Function _onSwitchCamera() { - Helper.switchCamera(localMediaStream.getVideoTracks()[0]); - } - - void _onShowBar() { - setState(() { - }); - _onButtonBarVisibleStreamController.add(true); - } - - void _onHeightBar(double height) { - _onButtonBarHeightStreamController.add(height); - } - - void _onHideBar() { - setState(() { - SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]); - }); - _onButtonBarVisibleStreamController.add(false); - } - - Future _onHangup() async { - signaling.hangupCall(widget.callerId, widget.receiverId); - print('onHangup'); - Navigator.of(context).pop(); - } -} +// import 'dart:async'; +// import 'dart:convert'; +// +// import 'package:diplomaticquarterapp/pages/conference/web_rtc/widgets/cam_view_widget.dart'; +// import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart'; +// import 'package:diplomaticquarterapp/pages/webRTC/signaling.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter/services.dart'; +// import 'package:flutter_webrtc/flutter_webrtc.dart'; +// +// import '../conference_button_bar.dart'; +// +// class CallHomePage extends StatefulWidget { +// final String receiverId; +// final String callerId; +// +// const CallHomePage({Key key, this.receiverId, this.callerId}) : super(key: key); +// +// @override +// _CallHomePageState createState() => _CallHomePageState(); +// } +// +// class _CallHomePageState extends State { +// bool showNoise = true; +// RTCVideoRenderer _localRenderer = RTCVideoRenderer(); +// RTCVideoRenderer _remoteRenderer = RTCVideoRenderer(); +// +// final StreamController _audioButton = StreamController.broadcast(); +// final StreamController _videoButton = StreamController.broadcast(); +// final StreamController _onButtonBarVisibleStreamController = StreamController.broadcast(); +// final StreamController _onButtonBarHeightStreamController = StreamController.broadcast(); +// +// //Stream to enable video +// MediaStream localMediaStream; +// MediaStream remoteMediaStream; +// // Signaling signaling = Signaling(); +// +// @override +// void initState() { +// // TODO: implement initState +// super.initState(); +// startCall(); +// } +// +// startCall() async{ +// await _localRenderer.initialize(); +// await _remoteRenderer.initialize(); +// await signaling.init(); +// final connected = await receivedCall(); +// } +// +// +// Future receivedCall() async { +// //Stream local media +// localMediaStream = await navigator.mediaDevices.getUserMedia({'video': true, 'audio': true}); +// _localRenderer.srcObject = localMediaStream; +// +// final connected = await signaling.acceptCall(widget.callerId, widget.receiverId, localMediaStream: localMediaStream, +// onRemoteMediaStream: (remoteMediaStream){ +// +// // print(remoteMediaStream.toString()); +// // print(json.encode(remoteMediaStream.getTracks().asMap())); +// this.remoteMediaStream = remoteMediaStream; +// _remoteRenderer.srcObject = remoteMediaStream; +// _remoteRenderer.addListener(() { +// print('_remoteRenderer'); +// print(_remoteRenderer); +// setState(() {}); +// }); +// }, +// onRemoteTrack: (track){ +// _remoteRenderer.srcObject.addTrack(track.track); +// // setState(() { +// // }); +// +// print(track.streams.first.getVideoTracks()); +// print(track.streams.first.getAudioTracks()); +// print(json.encode(track.streams.asMap())); +// } +// ); +// +// if(connected){ +// signaling.signalR.listen( +// onAcceptCall: (arg0){ +// print(arg0.toString()); +// }, +// onCandidate: (candidateJson){ +// signaling.addCandidate(candidateJson); +// }, +// onDeclineCall: (arg0,arg1){ +// // _onHangup(); +// }, +// onHangupCall: (arg0){ +// // _onHangup(); +// }, +// +// onOffer: (offerSdp, callerUser) async{ +// print('${offerSdp.toString()} | ${callerUser.toString()}'); +// await signaling.answerOffer(offerSdp); +// } +// ); +// } +// return connected; +// } +// +// @override +// void dispose() { +// // TODO: implement dispose +// super.dispose(); +// signaling.dispose(); +// _localRenderer?.dispose(); +// _remoteRenderer?.dispose(); +// _audioButton?.close(); +// _videoButton?.close(); +// localMediaStream?.dispose(); +// remoteMediaStream?.dispose(); +// _disposeStreamsAndSubscriptions(); +// } +// +// Future _disposeStreamsAndSubscriptions() async { +// if (_onButtonBarVisibleStreamController != null) await _onButtonBarVisibleStreamController.close(); +// if (_onButtonBarHeightStreamController != null) await _onButtonBarHeightStreamController.close(); +// } +// +// @override +// Widget build(BuildContext context) { +// return Scaffold( +// backgroundColor: Colors.white, +// body: buildLayout(), +// ); +// } +// +// LayoutBuilder buildLayout() { +// return LayoutBuilder( +// builder: (BuildContext context, BoxConstraints constraints) { +// return Stack( +// children: [ +// CamViewWidget( +// localRenderer: _localRenderer, +// remoteRenderer: _remoteRenderer, +// constraints: constraints, +// onButtonBarVisibleStreamController: _onButtonBarVisibleStreamController, +// onButtonBarHeightStreamController: _onButtonBarHeightStreamController, +// ), +// ConferenceButtonBar( +// audioEnabled: _audioButton.stream, +// videoEnabled: _videoButton.stream, +// onAudioEnabled: _onAudioEnable, +// onVideoEnabled: _onVideoEnabled, +// onSwitchCamera: _onSwitchCamera, +// onHangup: _onHangup, +// onPersonAdd: () {}, +// onPersonRemove: () {}, +// onHeight: _onHeightBar, +// onShow: _onShowBar, +// onHide: _onHideBar, +// ), +// ], +// ); +// }, +// ); +// } +// +// Function _onAudioEnable() { +// final audioTrack = localMediaStream.getAudioTracks()[0]; +// final mute = audioTrack.muted; +// Helper.setMicrophoneMute(!mute, audioTrack); +// _audioButton.add(mute); +// } +// +// Function _onVideoEnabled() { +// final videoTrack = localMediaStream.getVideoTracks()[0]; +// bool videoEnabled = videoTrack.enabled; +// localMediaStream.getVideoTracks()[0].enabled = !videoEnabled; +// _videoButton.add(!videoEnabled); +// } +// +// Function _onSwitchCamera() { +// Helper.switchCamera(localMediaStream.getVideoTracks()[0]); +// } +// +// void _onShowBar() { +// setState(() { +// }); +// _onButtonBarVisibleStreamController.add(true); +// } +// +// void _onHeightBar(double height) { +// _onButtonBarHeightStreamController.add(height); +// } +// +// void _onHideBar() { +// setState(() { +// SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]); +// }); +// _onButtonBarVisibleStreamController.add(false); +// } +// +// Future _onHangup() async { +// signaling.hangupCall(widget.callerId, widget.receiverId); +// print('onHangup'); +// Navigator.of(context).pop(); +// } +// } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index e9fbd62c..623c9298 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -81,7 +81,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { var themeNotifier; DateTime currentBackPressTime; - SignalRUtil signalRUtil; + // SignalRUtil signalRUtil; ToDoCountProviderModel toDoProvider; diff --git a/lib/pages/livecare/incoming_call.dart b/lib/pages/livecare/incoming_call.dart index da8c507e..7cea1153 100644 --- a/lib/pages/livecare/incoming_call.dart +++ b/lib/pages/livecare/incoming_call.dart @@ -34,7 +34,7 @@ class _IncomingCallState extends State with SingleTickerProviderSt CameraController _controller; Future _initializeControllerFuture; bool isCameraReady = false; - Signaling signaling = Signaling()..init(); + // Signaling signaling = Signaling()..init(); @override void initState() { diff --git a/lib/pages/webRTC/call_page.dart b/lib/pages/webRTC/call_page.dart index 8a5625b2..e75b2f8e 100644 --- a/lib/pages/webRTC/call_page.dart +++ b/lib/pages/webRTC/call_page.dart @@ -14,7 +14,7 @@ class CallPage extends StatefulWidget { } class _CallPageState extends State { - Signaling signaling = Signaling(); + // Signaling signaling = Signaling(); RTCVideoRenderer _localRenderer = RTCVideoRenderer(); RTCVideoRenderer _remoteRenderer = RTCVideoRenderer(); String roomId; @@ -73,7 +73,7 @@ class _CallPageState extends State { ), ElevatedButton( onPressed: () { - signaling.hangUp(_localRenderer); + // signaling.hangUp(_localRenderer); }, child: Text("Hangup"), ) diff --git a/lib/pages/webRTC/signaling.dart b/lib/pages/webRTC/signaling.dart index 9a4d1c48..53966bdc 100644 --- a/lib/pages/webRTC/signaling.dart +++ b/lib/pages/webRTC/signaling.dart @@ -1,277 +1,277 @@ -import 'dart:convert'; - -import 'package:diplomaticquarterapp/uitl/SignalRUtil.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter_webrtc/flutter_webrtc.dart'; - -typedef void StreamStateCallback(MediaStream stream); -typedef void RTCIceGatheringStateCallback(RTCIceGatheringState state); -typedef void RTCPeerConnectionStateCallback(RTCPeerConnectionState state); -typedef void RTCSignalingStateCallback(RTCSignalingState state); - -final Map constraints = { - 'mandatory': {}, - 'optional': [ - {'DtlsSrtpKeyAgreement': true}, - ] -}; - -Map snapsis_ice_config = { - 'iceServers': [ - { "urls": 'stun:15.185.116.59:3478' }, - { "urls": "turn:15.185.116.59:3479", "username": "admin", "credential": "admin" }, - ], - // 'sdpSemantics': 'unified-plan' -}; -Map twilio_ice_config = { - "ice_servers": [ - { - "url": "stun:global.stun.twilio.com:3478?transport=udp", - "urls": "stun:global.stun.twilio.com:3478?transport=udp" - }, - { - "url": "turn:global.turn.twilio.com:3478?transport=udp", - "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", - "urls": "turn:global.turn.twilio.com:3478?transport=udp", - "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" - }, - { - "url": "turn:global.turn.twilio.com:3478?transport=tcp", - "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", - "urls": "turn:global.turn.twilio.com:3478?transport=tcp", - "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" - }, - { - "url": "turn:global.turn.twilio.com:443?transport=tcp", - "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", - "urls": "turn:global.turn.twilio.com:443?transport=tcp", - "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" - } - ], - // 'sdpSemantics': 'unified-plan' -}; -Map google_ice_config = { - 'iceServers': [ - { - 'urls': [ - 'stun:stun.l.google.com:19302', - 'stun:stun1.l.google.com:19302', - 'stun:stun2.l.google.com:19302', - 'stun:stun3.l.google.com:19302' - ] - }, - ], - // 'sdpSemantics': 'unified-plan' -}; -Map aws_ice_config = { - 'iceServers': [ - {'url': "stun:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3478"}, - {'url': "turn:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3479", 'credential': "admin", 'username': "admin"} - ], - // 'sdpSemantics': 'unified-plan' -}; - -class Signaling { - dispose() { - if (peerConnection != null) { - peerConnection.dispose(); - peerConnection.getLocalStreams().forEach((e) => e.dispose()); - peerConnection.getRemoteStreams().forEach((e) => e.dispose()); - } - signalR.closeConnection(); - } - - init() async{ - // Create Peer Connection - peerConnection = await createPeerConnection(google_ice_config, constraints); - registerPeerConnectionListeners(); - } - - initializeSignalR(String userName) async { - if (signalR != null) await signalR.closeConnection(); - // https://vcallapi.hmg.com/webRTCHub?source=web&username=zohaib - // signalR = SignalRUtil(hubName: "https://vcallapi.hmg.com/webRTCHub?source=mobile&username=$userName"); - signalR = SignalRUtil(hubName: "http://35.193.237.29/webRTCHub?source=mobile&username=$userName"); - final connected = await signalR.openConnection(); - if (!connected) throw 'Failed to connect SignalR'; - } - - Map configuration = { - // 'iceServers': [ - // { - // 'urls': ['stun:stun1.l.google.com:19302', 'stun:stun2.l.google.com:19302'] - // } - // ] - - 'iceServers': [ - // {'url': "stun:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3478"}, - // {'url': "turn:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3479", 'credential': "admin", 'username': "admin"} - // {'url': "stun:15.185.116.59:3478"}, - // { - // "url":"turn:15.185.116.59:3479", - // "username": "admin", - // "credential":"admin" - // } - { - "url": "stun:global.stun.twilio.com:3478?transport=udp", - "urls": "stun:global.stun.twilio.com:3478?transport=udp" - }, - { - "url": "turn:global.turn.twilio.com:3478?transport=udp", - "username": "f18fc347ba4aeeaa1b00f5199b1e900834b464962d434a4a89b4cdba02510047", - "urls": "turn:global.turn.twilio.com:3478?transport=udp", - "credential": "WX16BB+9nKm0f+Whf5EwpM8S/Yv+T2tlvQWLfdV7oqo=" - } - ] - }; - - SignalRUtil signalR; - - RTCPeerConnection peerConnection; - MediaStream localStream; - MediaStream remoteStream; - RTCDataChannel dataChannel; - - // Future call(String patientId, String mobile, {@required RTCVideoRenderer localVideo, @required RTCVideoRenderer remoteVideo}) async { - // await initializeSignalR(patientId); - // - // // final isCallPlaced = await FCM.sendCallNotifcationTo(DOCTOR_TOKEN, patientId, mobile); - // if(!isCallPlaced) - // throw 'Failed to notify target for call'; - // - // return isCallPlaced; - // } - - Future acceptCall(String caller, String receiver, {@required MediaStream localMediaStream, @required Function(MediaStream) onRemoteMediaStream, @required Function(RTCTrackEvent) onRemoteTrack}) async { - await initializeSignalR(receiver); - signalR.setContributors(caller: caller, receiver: receiver); - await signalR.acceptCall(receiver, caller).catchError((e) => throw 'Failed to inform signalR that i accepted a call'); - - peerConnection.addStream(localMediaStream); - - // peerConnection?.onTrack = (track){ - // onRemoteTrack(track); - // }; - peerConnection?.onAddStream = (MediaStream stream) { - remoteStream = stream; - onRemoteMediaStream?.call(stream); - }; - return true; - } - - - Future declineCall(String caller, String receiver) async { - await initializeSignalR(receiver); - signalR.setContributors(caller: caller, receiver: receiver); - await signalR.declineCall(receiver, caller).catchError((e) => throw 'Failed to inform signalR that i accepted a call'); - - // peerConnection.addStream(localMediaStream); - // - // peerConnection?.onAddStream = (MediaStream stream) { - // remoteStream = stream; - // onRemoteMediaStream?.call(stream); - // }; - return true; - } - - Future hangupCall(String caller, String receiver) async { - await signalR.hangupCall(caller, receiver); - dispose(); - } - - answerOffer(String sdp) async { - final offer = jsonDecode(sdp); - final caller = offer['caller']; - final receiver = offer['target']; - final offerSdp = offer['sdp']; - peerConnection.setRemoteDescription(rtcSessionDescriptionFrom(offerSdp)).then((value) { - return peerConnection.createAnswer().catchError((e){ - print(e); - }); - }).then((anwser) { - return peerConnection.setLocalDescription(anwser).catchError((e){ - print(e); - }); - }).then((value) { - return peerConnection.getLocalDescription().catchError((e){ - print(e); - }); - }).then((answer) { - return signalR.answerOffer(answer, caller, receiver).catchError((e){ - print(e); - }); - }).catchError((e) { - print(e); - }); - } - - Future hangUp(RTCVideoRenderer localVideo) async {} - - Future createSdpAnswer(String toOfferSdp) async { - final offerSdp = rtcSessionDescriptionFrom(jsonDecode(toOfferSdp)); - peerConnection.setRemoteDescription(offerSdp).catchError((e){ - print(e); - }); - - final answer = await peerConnection.createAnswer().catchError((e){ - print(e); - }); - var answerSdp = json.encode(answer); // Send SDP via Push or any channel - return answerSdp; - } - - Future createSdpOffer() async { - final offer = await peerConnection.createOffer(); - await peerConnection.setLocalDescription(offer).catchError((e){ - print(e); - }); - final map = offer.toMap(); - var offerSdp = json.encode(map); // Send SDP via Push or any channel - return offerSdp; - } - - addCandidate(String candidateJson) { - peerConnection.addCandidate(rtcIceCandidateFrom(candidateJson)).catchError((e){ - print(e); - }); - } - - void registerPeerConnectionListeners() { - peerConnection.onRenegotiationNeeded = (){ - print('Renegotiation Needed...'); - }; - - peerConnection.onIceCandidate = (RTCIceCandidate candidate) { - // print(json.encode(candidate.toMap())); - signalR.addIceCandidate(json.encode(candidate.toMap())).catchError((e){ - print(e); - }); - }; - - peerConnection?.onIceGatheringState = (RTCIceGatheringState state) { - print('ICE gathering state changed: $state'); - }; - - peerConnection?.onConnectionState = (RTCPeerConnectionState state) { - print('Connection state change: $state'); - }; - - peerConnection?.onSignalingState = (RTCSignalingState state) { - print('Signaling state change: $state'); - }; - - - } -} - -rtcSessionDescriptionFrom(Map sdp) { - return RTCSessionDescription( - sdp['sdp'], - sdp['type'], - ); -} - -rtcIceCandidateFrom(String json) { - final map = jsonDecode(json)['candidate']; - return RTCIceCandidate(map['candidate'], map['sdpMid'], map['sdpMLineIndex']); -} +// import 'dart:convert'; +// +// import 'package:diplomaticquarterapp/uitl/SignalRUtil.dart'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter_webrtc/flutter_webrtc.dart'; +// +// typedef void StreamStateCallback(MediaStream stream); +// typedef void RTCIceGatheringStateCallback(RTCIceGatheringState state); +// typedef void RTCPeerConnectionStateCallback(RTCPeerConnectionState state); +// typedef void RTCSignalingStateCallback(RTCSignalingState state); +// +// final Map constraints = { +// 'mandatory': {}, +// 'optional': [ +// {'DtlsSrtpKeyAgreement': true}, +// ] +// }; +// +// Map snapsis_ice_config = { +// 'iceServers': [ +// { "urls": 'stun:15.185.116.59:3478' }, +// { "urls": "turn:15.185.116.59:3479", "username": "admin", "credential": "admin" }, +// ], +// // 'sdpSemantics': 'unified-plan' +// }; +// Map twilio_ice_config = { +// "ice_servers": [ +// { +// "url": "stun:global.stun.twilio.com:3478?transport=udp", +// "urls": "stun:global.stun.twilio.com:3478?transport=udp" +// }, +// { +// "url": "turn:global.turn.twilio.com:3478?transport=udp", +// "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", +// "urls": "turn:global.turn.twilio.com:3478?transport=udp", +// "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" +// }, +// { +// "url": "turn:global.turn.twilio.com:3478?transport=tcp", +// "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", +// "urls": "turn:global.turn.twilio.com:3478?transport=tcp", +// "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" +// }, +// { +// "url": "turn:global.turn.twilio.com:443?transport=tcp", +// "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", +// "urls": "turn:global.turn.twilio.com:443?transport=tcp", +// "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" +// } +// ], +// // 'sdpSemantics': 'unified-plan' +// }; +// Map google_ice_config = { +// 'iceServers': [ +// { +// 'urls': [ +// 'stun:stun.l.google.com:19302', +// 'stun:stun1.l.google.com:19302', +// 'stun:stun2.l.google.com:19302', +// 'stun:stun3.l.google.com:19302' +// ] +// }, +// ], +// // 'sdpSemantics': 'unified-plan' +// }; +// Map aws_ice_config = { +// 'iceServers': [ +// {'url': "stun:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3478"}, +// {'url': "turn:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3479", 'credential': "admin", 'username': "admin"} +// ], +// // 'sdpSemantics': 'unified-plan' +// }; +// +// class Signaling { +// dispose() { +// if (peerConnection != null) { +// peerConnection.dispose(); +// peerConnection.getLocalStreams().forEach((e) => e.dispose()); +// peerConnection.getRemoteStreams().forEach((e) => e.dispose()); +// } +// signalR.closeConnection(); +// } +// +// init() async{ +// // Create Peer Connection +// peerConnection = await createPeerConnection(google_ice_config, constraints); +// registerPeerConnectionListeners(); +// } +// +// initializeSignalR(String userName) async { +// if (signalR != null) await signalR.closeConnection(); +// // https://vcallapi.hmg.com/webRTCHub?source=web&username=zohaib +// // signalR = SignalRUtil(hubName: "https://vcallapi.hmg.com/webRTCHub?source=mobile&username=$userName"); +// // signalR = SignalRUtil(hubName: "http://35.193.237.29/webRTCHub?source=mobile&username=$userName"); +// final connected = await signalR.openConnection(); +// if (!connected) throw 'Failed to connect SignalR'; +// } +// +// Map configuration = { +// // 'iceServers': [ +// // { +// // 'urls': ['stun:stun1.l.google.com:19302', 'stun:stun2.l.google.com:19302'] +// // } +// // ] +// +// 'iceServers': [ +// // {'url': "stun:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3478"}, +// // {'url': "turn:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3479", 'credential': "admin", 'username': "admin"} +// // {'url': "stun:15.185.116.59:3478"}, +// // { +// // "url":"turn:15.185.116.59:3479", +// // "username": "admin", +// // "credential":"admin" +// // } +// { +// "url": "stun:global.stun.twilio.com:3478?transport=udp", +// "urls": "stun:global.stun.twilio.com:3478?transport=udp" +// }, +// { +// "url": "turn:global.turn.twilio.com:3478?transport=udp", +// "username": "f18fc347ba4aeeaa1b00f5199b1e900834b464962d434a4a89b4cdba02510047", +// "urls": "turn:global.turn.twilio.com:3478?transport=udp", +// "credential": "WX16BB+9nKm0f+Whf5EwpM8S/Yv+T2tlvQWLfdV7oqo=" +// } +// ] +// }; +// +// // SignalRUtil signalR; +// +// RTCPeerConnection peerConnection; +// MediaStream localStream; +// MediaStream remoteStream; +// RTCDataChannel dataChannel; +// +// // Future call(String patientId, String mobile, {@required RTCVideoRenderer localVideo, @required RTCVideoRenderer remoteVideo}) async { +// // await initializeSignalR(patientId); +// // +// // // final isCallPlaced = await FCM.sendCallNotifcationTo(DOCTOR_TOKEN, patientId, mobile); +// // if(!isCallPlaced) +// // throw 'Failed to notify target for call'; +// // +// // return isCallPlaced; +// // } +// +// Future acceptCall(String caller, String receiver, {@required MediaStream localMediaStream, @required Function(MediaStream) onRemoteMediaStream, @required Function(RTCTrackEvent) onRemoteTrack}) async { +// await initializeSignalR(receiver); +// signalR.setContributors(caller: caller, receiver: receiver); +// await signalR.acceptCall(receiver, caller).catchError((e) => throw 'Failed to inform signalR that i accepted a call'); +// +// peerConnection.addStream(localMediaStream); +// +// // peerConnection?.onTrack = (track){ +// // onRemoteTrack(track); +// // }; +// peerConnection?.onAddStream = (MediaStream stream) { +// remoteStream = stream; +// onRemoteMediaStream?.call(stream); +// }; +// return true; +// } +// +// +// Future declineCall(String caller, String receiver) async { +// await initializeSignalR(receiver); +// signalR.setContributors(caller: caller, receiver: receiver); +// await signalR.declineCall(receiver, caller).catchError((e) => throw 'Failed to inform signalR that i accepted a call'); +// +// // peerConnection.addStream(localMediaStream); +// // +// // peerConnection?.onAddStream = (MediaStream stream) { +// // remoteStream = stream; +// // onRemoteMediaStream?.call(stream); +// // }; +// return true; +// } +// +// Future hangupCall(String caller, String receiver) async { +// await signalR.hangupCall(caller, receiver); +// dispose(); +// } +// +// answerOffer(String sdp) async { +// final offer = jsonDecode(sdp); +// final caller = offer['caller']; +// final receiver = offer['target']; +// final offerSdp = offer['sdp']; +// peerConnection.setRemoteDescription(rtcSessionDescriptionFrom(offerSdp)).then((value) { +// return peerConnection.createAnswer().catchError((e){ +// print(e); +// }); +// }).then((anwser) { +// return peerConnection.setLocalDescription(anwser).catchError((e){ +// print(e); +// }); +// }).then((value) { +// return peerConnection.getLocalDescription().catchError((e){ +// print(e); +// }); +// }).then((answer) { +// return signalR.answerOffer(answer, caller, receiver).catchError((e){ +// print(e); +// }); +// }).catchError((e) { +// print(e); +// }); +// } +// +// Future hangUp(RTCVideoRenderer localVideo) async {} +// +// Future createSdpAnswer(String toOfferSdp) async { +// final offerSdp = rtcSessionDescriptionFrom(jsonDecode(toOfferSdp)); +// peerConnection.setRemoteDescription(offerSdp).catchError((e){ +// print(e); +// }); +// +// final answer = await peerConnection.createAnswer().catchError((e){ +// print(e); +// }); +// var answerSdp = json.encode(answer); // Send SDP via Push or any channel +// return answerSdp; +// } +// +// Future createSdpOffer() async { +// final offer = await peerConnection.createOffer(); +// await peerConnection.setLocalDescription(offer).catchError((e){ +// print(e); +// }); +// final map = offer.toMap(); +// var offerSdp = json.encode(map); // Send SDP via Push or any channel +// return offerSdp; +// } +// +// addCandidate(String candidateJson) { +// peerConnection.addCandidate(rtcIceCandidateFrom(candidateJson)).catchError((e){ +// print(e); +// }); +// } +// +// void registerPeerConnectionListeners() { +// peerConnection.onRenegotiationNeeded = (){ +// print('Renegotiation Needed...'); +// }; +// +// peerConnection.onIceCandidate = (RTCIceCandidate candidate) { +// // print(json.encode(candidate.toMap())); +// signalR.addIceCandidate(json.encode(candidate.toMap())).catchError((e){ +// print(e); +// }); +// }; +// +// peerConnection?.onIceGatheringState = (RTCIceGatheringState state) { +// print('ICE gathering state changed: $state'); +// }; +// +// peerConnection?.onConnectionState = (RTCPeerConnectionState state) { +// print('Connection state change: $state'); +// }; +// +// peerConnection?.onSignalingState = (RTCSignalingState state) { +// print('Signaling state change: $state'); +// }; +// +// +// } +// } +// +// rtcSessionDescriptionFrom(Map sdp) { +// return RTCSessionDescription( +// sdp['sdp'], +// sdp['type'], +// ); +// } +// +// rtcIceCandidateFrom(String json) { +// final map = jsonDecode(json)['candidate']; +// return RTCIceCandidate(map['candidate'], map['sdpMid'], map['sdpMLineIndex']); +// } diff --git a/lib/uitl/SignalRUtil.dart b/lib/uitl/SignalRUtil.dart index d9a73a14..904155a2 100644 --- a/lib/uitl/SignalRUtil.dart +++ b/lib/uitl/SignalRUtil.dart @@ -1,173 +1,173 @@ -import 'dart:convert'; -import 'dart:io'; - -import 'package:flutter/cupertino.dart'; -import 'package:flutter_webrtc/flutter_webrtc.dart'; -import 'package:http/io_client.dart'; -import 'package:signalr_core/signalr_core.dart'; - -class SignalRUtil { - String hubName; - - String sourceUser; - String destinationUser; - setContributors({@required String caller, @required String receiver}){ - this.sourceUser = caller; - this.destinationUser = receiver; - } - - Function(bool) onConnected; - SignalRUtil({@required this.hubName}); - - - HubConnection connectionHub; - - closeConnection() async{ - if(connectionHub != null) { - connectionHub.off('OnIncomingCallAsync'); - connectionHub.off('OnCallDeclinedAsync'); - connectionHub.off('OnCallAcceptedAsync'); - connectionHub.off('nHangUpAsync'); - connectionHub.off('OnIceCandidateAsync'); - connectionHub.off('OnOfferAsync'); - await connectionHub.stop(); - } - } - - Future openConnection() async { - connectionHub = HubConnectionBuilder() - .withUrl( - hubName, - HttpConnectionOptions( - logMessageContent: true, - client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true), - logging: (level, message) => print(message), - )).build(); - - await connectionHub.start(); - await Future.delayed(Duration(seconds: 1)); - - connectionHub.on('ReceiveMessage', (message) { - handleIncomingMessage(message); - }); - - return getConnectionState(); - } - - void handleIncomingMessage(List message) { - print(message.toString()); - } - - void sendMessage(List args) async { - await connectionHub.invoke('SendMessage', args: args); //['Bob', 'Says hi!'] - } - - listen({Function(CallUser) onAcceptCall, Function(CallUser) onHangupCall, Function(String, CallUser) onDeclineCall, Function(String, CallUser) onOffer, Function(String) onCandidate}){ - - connectionHub.on('OnIncomingCallAsync', (arguments) { - print('OnIncomingCallAsync: ${arguments.toString()}'); - }); - - connectionHub.on('OnCallDeclinedAsync', (arguments) { - print('OnCallDeclinedAsync: ${arguments.toString()}'); - onDeclineCall(arguments.first, CallUser.from(arguments.last)); - }); - - connectionHub.on('OnCallAcceptedAsync', (arguments) { - print('OnCallAcceptedAsync: ${arguments.toString()}'); - }); - - connectionHub.on('OnHangUpAsync', (arguments) { - print('nHangUpAsync: ${arguments.toString()}'); - onHangupCall(CallUser.from(arguments.first)); - }); - - connectionHub.on('OnIceCandidateAsync', (arguments) { - print('OnIceCandidateAsync: ${arguments.toString()}'); - onCandidate(arguments.first); - }); - - connectionHub.on('OnOfferAsync', (arguments) { - print('OnOfferAsync: ${arguments.toString()}'); - onOffer(arguments.first, CallUser.from(arguments.last)); - }); - - } - - // CallUserAsync(string currentUserId, string targerUserId) - Future callUser(String from, to) async{ - return await connectionHub.invoke('CallUserAsync', args: [from, to]); - } - - // CallDeclinedAsync(string currentUserId, string targerUserId) - Future declineCall(String from, to) async{ - return await connectionHub.invoke('CallDeclinedAsync', args: [from, to]); - } - - // AnswerCallAsync(string currentUserId, string targetUserId) - Future answerCall(String from, to) async{ - return await connectionHub.invoke('AnswerCallAsync', args: [from, to]); - } - - // IceCandidateAsync(string targetUserId, string candidate) - Future addIceCandidate(String candidate) async{ - final target = destinationUser; - return await connectionHub.invoke('IceCandidateAsync', args: [target, candidate]); - } - - // OfferAsync(string targetUserId,string currentUserId, string targetOffer) - Future offer(String from, to, offer) async{ - return await connectionHub.invoke('OfferAsync', args: [from, to, offer]); - } - - // AnswerOfferAsync(string targetUserId, string CallerOffer) - Future answerOffer(RTCSessionDescription answerSdp, caller, receiver) async{ - final payload = { - 'target': receiver, - 'caller': caller, - 'sdp': answerSdp.toMap(), - }; - return await connectionHub.invoke('AnswerOfferAsync', args: [caller, jsonEncode(payload)]); - } - - // HangUpAsync(string currentUserId, string targetUserId) - Future hangupCall(String from, to) async{ - return await connectionHub.invoke('HangUpAsync', args: [from, to]); - } - - // CallAccepted(string currentUserId,string targetUserId) - Future acceptCall(String from, to) async{ - // return await connectionHub.send(methodName: 'CallAccepted', args: [from, to]); - return await connectionHub.invoke("CallAccepted", args: [ from, to]); - } - - - bool getConnectionState() { - if (connectionHub.state == HubConnectionState.connected) return true; - if (connectionHub.state == HubConnectionState.disconnected) return false; - return false; - } -} - - -class CallUser{ - String Id; - String UserName; - String Email; - String Phone; - String Title; - dynamic UserStatus; - String Image; - int UnreadMessageCount = 0; - - CallUser.from(Map map){ - Id = map['Id']; - UserName = map['UserName']; - Email = map['Email']; - Phone = map['Phone']; - Title = map['Title']; - UserStatus = map['UserStatus']; - Image = map['Image']; - UnreadMessageCount = map['UnreadMessageCount']; - } -} \ No newline at end of file +// import 'dart:convert'; +// import 'dart:io'; +// +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter_webrtc/flutter_webrtc.dart'; +// import 'package:http/io_client.dart'; +// // import 'package:signalr_core/signalr_core.dart'; +// +// class SignalRUtil { +// String hubName; +// +// String sourceUser; +// String destinationUser; +// setContributors({@required String caller, @required String receiver}){ +// this.sourceUser = caller; +// this.destinationUser = receiver; +// } +// +// Function(bool) onConnected; +// SignalRUtil({@required this.hubName}); +// +// +// // HubConnection connectionHub; +// +// closeConnection() async{ +// if(connectionHub != null) { +// connectionHub.off('OnIncomingCallAsync'); +// connectionHub.off('OnCallDeclinedAsync'); +// connectionHub.off('OnCallAcceptedAsync'); +// connectionHub.off('nHangUpAsync'); +// connectionHub.off('OnIceCandidateAsync'); +// connectionHub.off('OnOfferAsync'); +// await connectionHub.stop(); +// } +// } +// +// Future openConnection() async { +// // connectionHub = HubConnectionBuilder() +// // .withUrl( +// // hubName, +// // HttpConnectionOptions( +// // logMessageContent: true, +// // client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true), +// // logging: (level, message) => print(message), +// // )).build(); +// +// await connectionHub.start(); +// await Future.delayed(Duration(seconds: 1)); +// +// connectionHub.on('ReceiveMessage', (message) { +// handleIncomingMessage(message); +// }); +// +// return getConnectionState(); +// } +// +// void handleIncomingMessage(List message) { +// print(message.toString()); +// } +// +// void sendMessage(List args) async { +// await connectionHub.invoke('SendMessage', args: args); //['Bob', 'Says hi!'] +// } +// +// listen({Function(CallUser) onAcceptCall, Function(CallUser) onHangupCall, Function(String, CallUser) onDeclineCall, Function(String, CallUser) onOffer, Function(String) onCandidate}){ +// +// connectionHub.on('OnIncomingCallAsync', (arguments) { +// print('OnIncomingCallAsync: ${arguments.toString()}'); +// }); +// +// connectionHub.on('OnCallDeclinedAsync', (arguments) { +// print('OnCallDeclinedAsync: ${arguments.toString()}'); +// onDeclineCall(arguments.first, CallUser.from(arguments.last)); +// }); +// +// connectionHub.on('OnCallAcceptedAsync', (arguments) { +// print('OnCallAcceptedAsync: ${arguments.toString()}'); +// }); +// +// connectionHub.on('OnHangUpAsync', (arguments) { +// print('nHangUpAsync: ${arguments.toString()}'); +// onHangupCall(CallUser.from(arguments.first)); +// }); +// +// connectionHub.on('OnIceCandidateAsync', (arguments) { +// print('OnIceCandidateAsync: ${arguments.toString()}'); +// onCandidate(arguments.first); +// }); +// +// connectionHub.on('OnOfferAsync', (arguments) { +// print('OnOfferAsync: ${arguments.toString()}'); +// onOffer(arguments.first, CallUser.from(arguments.last)); +// }); +// +// } +// +// // CallUserAsync(string currentUserId, string targerUserId) +// Future callUser(String from, to) async{ +// return await connectionHub.invoke('CallUserAsync', args: [from, to]); +// } +// +// // CallDeclinedAsync(string currentUserId, string targerUserId) +// Future declineCall(String from, to) async{ +// return await connectionHub.invoke('CallDeclinedAsync', args: [from, to]); +// } +// +// // AnswerCallAsync(string currentUserId, string targetUserId) +// Future answerCall(String from, to) async{ +// return await connectionHub.invoke('AnswerCallAsync', args: [from, to]); +// } +// +// // IceCandidateAsync(string targetUserId, string candidate) +// Future addIceCandidate(String candidate) async{ +// final target = destinationUser; +// return await connectionHub.invoke('IceCandidateAsync', args: [target, candidate]); +// } +// +// // OfferAsync(string targetUserId,string currentUserId, string targetOffer) +// Future offer(String from, to, offer) async{ +// return await connectionHub.invoke('OfferAsync', args: [from, to, offer]); +// } +// +// // AnswerOfferAsync(string targetUserId, string CallerOffer) +// Future answerOffer(RTCSessionDescription answerSdp, caller, receiver) async{ +// final payload = { +// 'target': receiver, +// 'caller': caller, +// 'sdp': answerSdp.toMap(), +// }; +// return await connectionHub.invoke('AnswerOfferAsync', args: [caller, jsonEncode(payload)]); +// } +// +// // HangUpAsync(string currentUserId, string targetUserId) +// Future hangupCall(String from, to) async{ +// return await connectionHub.invoke('HangUpAsync', args: [from, to]); +// } +// +// // CallAccepted(string currentUserId,string targetUserId) +// Future acceptCall(String from, to) async{ +// // return await connectionHub.send(methodName: 'CallAccepted', args: [from, to]); +// return await connectionHub.invoke("CallAccepted", args: [ from, to]); +// } +// +// +// bool getConnectionState() { +// if (connectionHub.state == HubConnectionState.connected) return true; +// if (connectionHub.state == HubConnectionState.disconnected) return false; +// return false; +// } +// } +// +// +// class CallUser{ +// String Id; +// String UserName; +// String Email; +// String Phone; +// String Title; +// dynamic UserStatus; +// String Image; +// int UnreadMessageCount = 0; +// +// CallUser.from(Map map){ +// Id = map['Id']; +// UserName = map['UserName']; +// Email = map['Email']; +// Phone = map['Phone']; +// Title = map['Title']; +// UserStatus = map['UserStatus']; +// Image = map['Image']; +// UnreadMessageCount = map['UnreadMessageCount']; +// } +// } \ No newline at end of file From 3e63d80655757142017aeb51d32f04878095bcb2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 16 Aug 2023 17:27:28 +0300 Subject: [PATCH 25/86] Ancillary order updates --- .../ancillary_orders_proc_list.dart | 18 ++++++ .../ancillaryOrdersDetails.dart | 9 ++- .../appointment_services/GetDoctorsList.dart | 63 +++++++++---------- 3 files changed, 53 insertions(+), 37 deletions(-) create mode 100644 lib/models/anicllary-orders/ancillary_orders_proc_list.dart diff --git a/lib/models/anicllary-orders/ancillary_orders_proc_list.dart b/lib/models/anicllary-orders/ancillary_orders_proc_list.dart new file mode 100644 index 00000000..ed22bd05 --- /dev/null +++ b/lib/models/anicllary-orders/ancillary_orders_proc_list.dart @@ -0,0 +1,18 @@ +class AncillaryOrdersProcedureList { + int procedureID; + String procedureDescription; + + AncillaryOrdersProcedureList({this.procedureID, this.procedureDescription}); + + AncillaryOrdersProcedureList.fromJson(Map json) { + procedureID = json['ProcedureID']; + procedureDescription = json['ProcedureDescription']; + } + + Map toJson() { + final Map data = new Map(); + data['ProcedureID'] = this.procedureID; + data['ProcedureDescription'] = this.procedureDescription; + return data; + } +} diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 5f9411ad..ff669048 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart'; +import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; @@ -621,8 +622,13 @@ class _AnicllaryOrdersState extends State with SingleTic createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); + List ancillaryOrdersProcedureList = []; + selectedProcList.forEach((element) { + ancillaryOrdersProcedureList.add(new AncillaryOrdersProcedureList(procedureID: num.parse(element.procedureID), procedureDescription: element.procedureName)); + }); service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType, - projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext) + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext, + isAncillaryOrder: true, ancillaryOrdersProcedureList: ancillaryOrdersProcedureList) .then((res) { addAdvancedNumberRequest( Utils.isVidaPlusProject(projectViewModel, widget.projectID) @@ -651,7 +657,6 @@ class _AnicllaryOrdersState extends State with SingleTic autoGenerateInvoice() { List selectedProcListAPI = []; - Map selectedProcListAPIMap; selectedProcList.forEach((element) { selectedProcListAPI.add({ diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index dfd3ed32..2a7a92b8 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.d import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart'; import 'package:diplomaticquarterapp/models/apple_pay_request.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -1369,7 +1370,8 @@ class DoctorsListService extends BaseService { } Future HIS_createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, dynamic patientType, - String patientName, dynamic patientID, BuildContext context) async { + String patientName, dynamic patientID, BuildContext context, + {bool isAncillaryOrder = false, List ancillaryOrdersProcedureList}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); @@ -1401,6 +1403,8 @@ class DoctorsListService extends BaseService { "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, "PatientTypeID": patientType, + "IsAncillaryOrder": isAncillaryOrder, + "AncillaryProcedureList": ancillaryOrdersProcedureList, "PatientType": patientType }; dynamic localRes; @@ -1758,41 +1762,32 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future logDoctorFreeSlots(int docID, int clinicID, int projectID, List selectedfreeSlots, dynamic appoNumber, BuildContext context, [ProjectViewModel projectViewModel]) async { + Map requestFreeSlots; + Map request; - - Future logDoctorFreeSlots(int docID, int clinicID, int projectID, List selectedfreeSlots, dynamic appoNumber, BuildContext context, [ProjectViewModel projectViewModel]) async { - Map requestFreeSlots; - Map request; - - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - Request req = appGlobal.getPublicRequest(); - requestFreeSlots = { - "DoctorID": docID, - "IsBookingForLiveCare": 0, - "ClinicID": clinicID, - "ProjectID": projectID, - "OriginalClinicID": clinicID, - "days": 0, - "isReschadual": false, - "VersionID": req.VersionID, - "Channel": 3, - "LanguageID": languageID == 'ar' ? 1 : 2, - "IPAdress": "10.20.10.20", - "generalid": "Cs2020@2016\$2958", - "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, - "SessionID": null, - "isDentalAllowedBackend": false, - "DeviceTypeID": 1 - }; - - request = { + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + requestFreeSlots = { + "DoctorID": docID, + "IsBookingForLiveCare": 0, "ClinicID": clinicID, "ProjectID": projectID, - "AppointmentNo":appoNumber, - "DoctorFreeSlotRequest":requestFreeSlots, - "DoctorFreeSlotResponse":selectedfreeSlots, - "Value1":docID - }; + "OriginalClinicID": clinicID, + "days": 0, + "isReschadual": false, + "VersionID": req.VersionID, + "Channel": 3, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "generalid": "Cs2020@2016\$2958", + "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, + "SessionID": null, + "isDentalAllowedBackend": false, + "DeviceTypeID": 1 + }; + + request = {"ClinicID": clinicID, "ProjectID": projectID, "AppointmentNo": appoNumber, "DoctorFreeSlotRequest": requestFreeSlots, "DoctorFreeSlotResponse": selectedfreeSlots, "Value1": docID}; dynamic localRes; await baseAppClient.post(INSERT_FREE_SLOTS_LOGS, onSuccess: (response, statusCode) async { localRes = response; @@ -1802,6 +1797,4 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - - } From 275c99a4ceb576ccd298a0514c471756c3326eb0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 29 Aug 2023 16:25:54 +0300 Subject: [PATCH 26/86] updates --- lib/pages/BookAppointment/BookConfirm.dart | 6 +++--- lib/pages/ToDoList/ToDo.dart | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 0405f657..830bd6bb 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -331,9 +331,9 @@ class _BookConfirmState extends State { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); Future.delayed(new Duration(milliseconds: 500), () { - checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context); - // getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); - // getToDoCount(); + // checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context); + getToDoCount(); + getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); }); widget.service.logDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, decodedLogs, res['AppointmentNo'], context).then((res) { diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index d3705a7c..9d806a18 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -543,8 +543,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { confirmAppointment(appo); break; case 20: - // getPatientShare(context, appo); - checkPatientNphiesEligibility(context, appo); + getPatientShare(context, appo); + // checkPatientNphiesEligibility(context, appo); break; case 30: getAppoQR(context, appo); From 38661621e33253c3b415e0703b07cada0e9dd232 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 4 Sep 2023 14:09:26 +0300 Subject: [PATCH 27/86] updates & fixes --- lib/core/service/medical/reports_service.dart | 4 ++-- lib/pages/medical/balance/my_balance_page.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index 9f8bfb45..d80c80e4 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -29,7 +29,7 @@ class ReportsService extends BaseService { } Future getInPatientReports() async { - RequestReports _requestReportsInpatient = RequestReports(isReport: true, encounterType: 2, requestType: 2, patientOutSA: 0, projectID: 0); + RequestReports _requestReportsInpatient = RequestReports(isReport: true, encounterType: 2, requestType: 1, patientOutSA: 0, projectID: 0); hasError = false; await baseAppClient.post(REPORTS, onSuccess: (dynamic response, int statusCode) { inpatientReportsList.clear(); @@ -137,7 +137,7 @@ class ReportsService extends BaseService { body['ProjectID'] = projectID; body['Remarks'] = ""; body['ProcedureId'] = ""; - body['RequestType'] = 2; + body['RequestType'] = 1; body['Source'] = 2; body['Status'] = 1; body['CreatedBy'] = 102; diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index a7a6d5d7..6783c895 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -106,7 +106,7 @@ class MyBalancePage extends StatelessWidget { ), ), Text( - TranslationBase.of(context).sar, + projectViewModel.user.outSA == 1 ? TranslationBase.of(context).aed : TranslationBase.of(context).sar, style: TextStyle( fontSize: 16, fontWeight: FontWeight.bold, @@ -157,7 +157,7 @@ class MyBalancePage extends StatelessWidget { ), ), Text( - amount.toStringAsFixed(2) + " " + TranslationBase.of(context).sar, + amount.toStringAsFixed(2) + " " + (projectViewModel.user.outSA == 1 ? TranslationBase.of(context).aed : TranslationBase.of(context).sar), style: TextStyle( fontSize: 16, letterSpacing: -0.64, From a58e4452b854a2725b0a5d060e7e86e9201306d5 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 5 Sep 2023 11:51:50 +0300 Subject: [PATCH 28/86] ancillary changes --- .../ancillary-orders/ancillaryOrdersDetails.dart | 10 +++++----- lib/services/appointment_services/GetDoctorsList.dart | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index ff669048..5fba9b5a 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -622,13 +622,13 @@ class _AnicllaryOrdersState extends State with SingleTic createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); - List ancillaryOrdersProcedureList = []; - selectedProcList.forEach((element) { - ancillaryOrdersProcedureList.add(new AncillaryOrdersProcedureList(procedureID: num.parse(element.procedureID), procedureDescription: element.procedureName)); - }); + // List ancillaryOrdersProcedureList = []; + // selectedProcList.forEach((element) { + // ancillaryOrdersProcedureList.add(new AncillaryOrdersProcedureList(procedureID: num.parse(element.procedureID), procedureDescription: element.procedureName)); + // }); service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType, projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext, - isAncillaryOrder: true, ancillaryOrdersProcedureList: ancillaryOrdersProcedureList) + isAncillaryOrder: true) .then((res) { addAdvancedNumberRequest( Utils.isVidaPlusProject(projectViewModel, widget.projectID) diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 2a7a92b8..128a3460 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1371,7 +1371,7 @@ class DoctorsListService extends BaseService { Future HIS_createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, dynamic patientType, String patientName, dynamic patientID, BuildContext context, - {bool isAncillaryOrder = false, List ancillaryOrdersProcedureList}) async { + {bool isAncillaryOrder = false}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); @@ -1404,7 +1404,7 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "PatientTypeID": patientType, "IsAncillaryOrder": isAncillaryOrder, - "AncillaryProcedureList": ancillaryOrdersProcedureList, + // "AncillaryProcedureList": ancillaryOrdersProcedureList, "PatientType": patientType }; dynamic localRes; From 4dd16bde59762959a434de8934818376beb2049a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 7 Sep 2023 12:53:14 +0300 Subject: [PATCH 29/86] Inpatient medical report fixes --- .../medical/reports/report_home_page.dart | 92 +++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 7cc8fc2b..911e74a0 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -104,40 +104,39 @@ class _HomeReportPageState extends State with SingleTickerProvid ), if (model.user != null) Expanded( - child: - TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController_new, - children: [ + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController_new, + children: [ Container( - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(21), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - myRadioButton(TranslationBase.of(context).requested, 0), - myRadioButton(TranslationBase.of(context).ready, 1), - myRadioButton(TranslationBase.of(context).cancelled, 2), - ], - ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(21), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + myRadioButton(TranslationBase.of(context).requested, 0), + myRadioButton(TranslationBase.of(context).ready, 1), + myRadioButton(TranslationBase.of(context).cancelled, 2), + ], + ), + ), + Expanded( + child: IndexedStack( + index: _currentPage, + children: [ + ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress), + ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress), + ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress), + ], + ), + ) + ], ), - Expanded( - child: IndexedStack( - index: _currentPage, - children: [ - ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress), - ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress), - ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress), - ], - ), - ) - ], - ), - ), - // InPatient Medical Reports - Container( + ), + // InPatient Medical Reports + Container( child: model.admissionsMedicalReportList.isNotEmpty ? Column( children: [ @@ -249,20 +248,21 @@ class _HomeReportPageState extends State with SingleTickerProvid if (projectViewModel.havePrivilege(21) // && _tabController_new.index == 0 ) - Padding( - padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), - child: DefaultButton( - TranslationBase.of(context).requestMedicalReport.toLowerCase().capitalizeFirstofEach, - () => Navigator.push( - context, - FadePage( - page: MedicalReports(), - ), - ).then((value) { - model.getReports(); - }), - ), - ) + if (_tabController_new.index == 0) + Padding( + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).requestMedicalReport.toLowerCase().capitalizeFirstofEach, + () => Navigator.push( + context, + FadePage( + page: MedicalReports(), + ), + ).then((value) { + model.getReports(); + }), + ), + ) ], ), ), From 49963911ba6870b0096f654763212f5a0f56d796 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 7 Sep 2023 14:12:53 +0300 Subject: [PATCH 30/86] Patient eligibility change --- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 3 ++ lib/pages/BookAppointment/BookConfirm.dart | 29 +++++++++++++++++-- lib/pages/ToDoList/ToDo.dart | 28 ++++++++++++++++-- .../appointment_services/GetDoctorsList.dart | 2 +- lib/uitl/translations_delegate_base.dart | 3 ++ 6 files changed, 61 insertions(+), 6 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index e93af7c8..1b4c69b3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -326,7 +326,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 10.8; +var VERSION_ID = 10.9; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4984053d..ea364e24 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1893,4 +1893,7 @@ const Map localizedValues = { "sickLeaveAdmittedPatient": {"en": "You cannot activate this sick leave since you're an admitted patient.", "ar": "لا يمكنك تفعيل هذه الإجازة المرضية لأنك مريض مقبل."}, "dischargeDate": {"en": "Discharge Date", "ar": "تاريخ التفريغ"}, "selectAdmissionText": {"en": "Please select one of the admissions from below to view medical reports:", "ar": "يرجى تحديد أحد حالات القبول من الأسفل لعرض التقارير الطبية:"}, + + "invalidEligibility": {"en": "You cannot make online payment because you are not eligible to use the provided service.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة."}, + "invalidInsurance": {"en": "You cannot make online payment because you do not have a valid insurance.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح."}, }; \ No newline at end of file diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 830bd6bb..f6988037 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -59,6 +59,9 @@ class _BookConfirmState extends State { AppSharedPreferences sharedPref = new AppSharedPreferences(); + bool isInsured = false; + bool isEligible = false; + @override void initState() { // widget.authUser = new AuthenticatedUser(); @@ -437,13 +440,35 @@ class _BookConfirmState extends State { } getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { + String errorMsg = ""; GifLoaderDialogUtils.showMyDialog(context); widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) { projectViewModel.selectedBodyPartList.clear(); projectViewModel.laserSelectionDuration = 0; print(res); - widget.patientShareResponse = new PatientShareResponse.fromJson(res); - navigateToBookSuccess(context, docObject, widget.patientShareResponse); + widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); + + isInsured = res["IsInsured"]; + isEligible = res["IsEligible"]; + + if (isInsured && isEligible) { + navigateToBookSuccess(context, docObject, widget.patientShareResponse); + } else { + if (isInsured && !isEligible) { + errorMsg = TranslationBase.of(context).invalidEligibility; + } else { + errorMsg = TranslationBase.of(context).invalidInsurance; + } + ConfirmDialog dialog = new ConfirmDialog( + isDissmissable: false, + context: context, + confirmMessage: errorMsg, + okText: "Update insurance", + cancelText: "Continue as cash", + okFunction: () => {openUpdateInsurance()}, + cancelFunction: () => {continueAsCash(docObject, appointmentNo)}); + dialog.showAlertDialog(context); + } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); // AppToast.showErrorToast(message: err); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 9d806a18..d98c40be 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -79,6 +79,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { bool dataLoaded = false; + bool isInsured = false; + bool isEligible = false; + @override void initState() { widget.patientShareResponse = new PatientShareResponse(); @@ -889,6 +892,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } getPatientShare(context, AppoitmentAllHistoryResultList appo) { + String errorMsg = ""; DoctorsListService service = new DoctorsListService(); if (appo.isLiveCareAppointment) { getLiveCareAppointmentPatientShare(context, service, appo); @@ -896,8 +900,28 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { GifLoaderDialogUtils.showMyDialog(context); service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); - widget.patientShareResponse = new PatientShareResponse.fromJson(res); - openPaymentDialog(appo, widget.patientShareResponse); + widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); + isInsured = res["IsInsured"]; + isEligible = res["IsEligible"]; + + if (isInsured && isEligible) { + openPaymentDialog(appo, widget.patientShareResponse); + } else { + if (isInsured && !isEligible) { + errorMsg = TranslationBase.of(context).invalidEligibility; + } else { + errorMsg = TranslationBase.of(context).invalidInsurance; + } + ConfirmDialog dialog = new ConfirmDialog( + isDissmissable: false, + context: context, + confirmMessage: errorMsg, + okText: "Update insurance", + cancelText: "Continue as cash", + okFunction: () => {openUpdateInsurance()}, + cancelFunction: () => {continueAsCash(appo)}); + dialog.showAlertDialog(context); + } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 7d97239c..f4c0aec3 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -484,7 +484,7 @@ class DoctorsListService extends BaseService { dynamic localRes; await baseAppClient.post(GET_PATIENT_SHARE, onSuccess: (response, statusCode) async { - localRes = response['OnlineCheckInAppointments'][0]; + localRes = response; }, onFailure: (String error, int statusCode) { throw error; }, body: request); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 8d8f51ee..35e6b7bf 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2903,6 +2903,9 @@ class TranslationBase { String get dischargeDate => localizedValues["dischargeDate"][locale.languageCode]; String get selectAdmissionText => localizedValues["selectAdmissionText"][locale.languageCode]; + String get invalidEligibility => localizedValues["invalidEligibility"][locale.languageCode]; + String get invalidInsurance => localizedValues["invalidInsurance"][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { From 9ed454f67a3405d18e3791ce5f51b63df9fb2b1b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 12 Sep 2023 11:01:04 +0300 Subject: [PATCH 31/86] Cash patient check implemented --- lib/config/localized_values.dart | 3 +- lib/pages/BookAppointment/BookConfirm.dart | 32 +++++++++++++--------- lib/pages/ToDoList/ToDo.dart | 32 +++++++++++++--------- lib/uitl/translations_delegate_base.dart | 3 +- 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea364e24..4a24f79b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1893,7 +1893,8 @@ const Map localizedValues = { "sickLeaveAdmittedPatient": {"en": "You cannot activate this sick leave since you're an admitted patient.", "ar": "لا يمكنك تفعيل هذه الإجازة المرضية لأنك مريض مقبل."}, "dischargeDate": {"en": "Discharge Date", "ar": "تاريخ التفريغ"}, "selectAdmissionText": {"en": "Please select one of the admissions from below to view medical reports:", "ar": "يرجى تحديد أحد حالات القبول من الأسفل لعرض التقارير الطبية:"}, - "invalidEligibility": {"en": "You cannot make online payment because you are not eligible to use the provided service.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة."}, "invalidInsurance": {"en": "You cannot make online payment because you do not have a valid insurance.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح."}, + "continueCash": {"en": "Continue as cash", "ar": "تواصل نقدا"}, + "updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"}, }; \ No newline at end of file diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index f6988037..50dbc70f 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -61,6 +61,7 @@ class _BookConfirmState extends State { bool isInsured = false; bool isEligible = false; + bool isCash = false; @override void initState() { @@ -450,24 +451,29 @@ class _BookConfirmState extends State { isInsured = res["IsInsured"]; isEligible = res["IsEligible"]; + isCash = res["IsCash"]; - if (isInsured && isEligible) { + if (isCash) { navigateToBookSuccess(context, docObject, widget.patientShareResponse); } else { - if (isInsured && !isEligible) { - errorMsg = TranslationBase.of(context).invalidEligibility; + if (isInsured && isEligible) { + navigateToBookSuccess(context, docObject, widget.patientShareResponse); } else { - errorMsg = TranslationBase.of(context).invalidInsurance; + if (isInsured && !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(docObject, appointmentNo)}); + dialog.showAlertDialog(context); } - ConfirmDialog dialog = new ConfirmDialog( - isDissmissable: false, - context: context, - confirmMessage: errorMsg, - okText: "Update insurance", - cancelText: "Continue as cash", - okFunction: () => {openUpdateInsurance()}, - cancelFunction: () => {continueAsCash(docObject, appointmentNo)}); - dialog.showAlertDialog(context); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index d98c40be..d3af8742 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -81,6 +81,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { bool isInsured = false; bool isEligible = false; + bool isCash = false; @override void initState() { @@ -903,24 +904,29 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); isInsured = res["IsInsured"]; isEligible = res["IsEligible"]; + isCash = res["IsCash"]; - if (isInsured && isEligible) { + if (isCash) { openPaymentDialog(appo, widget.patientShareResponse); } else { - if (isInsured && !isEligible) { - errorMsg = TranslationBase.of(context).invalidEligibility; + if (isInsured && isEligible) { + openPaymentDialog(appo, widget.patientShareResponse); } else { - errorMsg = TranslationBase.of(context).invalidInsurance; + if (isInsured && !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(appo)}); + dialog.showAlertDialog(context); } - ConfirmDialog dialog = new ConfirmDialog( - isDissmissable: false, - context: context, - confirmMessage: errorMsg, - okText: "Update insurance", - cancelText: "Continue as cash", - okFunction: () => {openUpdateInsurance()}, - cancelFunction: () => {continueAsCash(appo)}); - dialog.showAlertDialog(context); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 35e6b7bf..b14c21a5 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2902,9 +2902,10 @@ class TranslationBase { String get sickLeaveAdmittedPatient => localizedValues["sickLeaveAdmittedPatient"][locale.languageCode]; String get dischargeDate => localizedValues["dischargeDate"][locale.languageCode]; String get selectAdmissionText => localizedValues["selectAdmissionText"][locale.languageCode]; - String get invalidEligibility => localizedValues["invalidEligibility"][locale.languageCode]; String get invalidInsurance => localizedValues["invalidInsurance"][locale.languageCode]; + String get continueCash => localizedValues["continueCash"][locale.languageCode]; + String get updateInsuranceText => localizedValues["updateInsurance"][locale.languageCode]; } From 2048747a628cc9006ce9d09e61ded6cc4814c472 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 17 Sep 2023 14:37:33 +0300 Subject: [PATCH 32/86] ancillary updates --- lib/config/config.dart | 4 ++-- .../appointment_services/GetDoctorsList.dart | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 470fba3b..af5c606c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -23,8 +23,8 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; -var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 128a3460..62097fb1 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1048,12 +1048,18 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - Request req = appGlobal.getPublicRequest(); + + List procedureOrderIDs = []; + + selectedProcListAPI.forEach((element) { + procedureOrderIDs.add(element["ProcedureID"]); + }); + request = { "RequestAncillaryOrderInvoice": [ {"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI} - ] + ], + "ProcedureOrderIds": procedureOrderIDs }; dynamic localRes; await baseAppClient.post(GENERATE_ANCILLARY_ORDERS_INVOICE, onSuccess: (response, statusCode) async { From 31144c7c279d96228e7730eaf23e7f50bd96a047 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 20 Sep 2023 16:57:09 +0300 Subject: [PATCH 33/86] updates --- lib/config/config.dart | 4 +++- lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index af5c606c..02cd4161 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -24,7 +24,9 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; -var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; + +var BASE_URL = 'https://webservices.hmg.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index ba9d79ee..e91990b4 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -39,9 +39,9 @@ class MyInAppBrowser extends InAppBrowser { // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS + // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; From d8e9f368449c07a46eea1da0d5b83a0a081ba27b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 28 Sep 2023 12:01:41 +0300 Subject: [PATCH 34/86] updates --- lib/config/config.dart | 4 +-- lib/pages/paymentService/payment_service.dart | 14 +++++----- lib/uitl/utils.dart | 26 +++++++++---------- .../bottom_navigation_item.dart | 8 +++--- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +-- lib/widgets/others/app_scaffold_widget.dart | 8 +++--- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 02cd4161..4645ba77 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -23,10 +23,10 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +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/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index 5bcf4592..3c5cb01f 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -1,4 +1,4 @@ -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:diplomaticquarterapp/Constants.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; @@ -95,11 +95,11 @@ class PaymentService extends StatelessWidget { ? Positioned( left: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -111,11 +111,11 @@ class PaymentService extends StatelessWidget { : Positioned( right: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 4d9904c7..1621002c 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -4,7 +4,7 @@ import 'dart:io'; import 'dart:typed_data'; import 'package:auto_size_text/auto_size_text.dart'; -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:cached_network_image/cached_network_image.dart'; import 'package:connectivity/connectivity.dart'; import 'package:crypto/crypto.dart' as crypto; @@ -241,11 +241,11 @@ class Utils { ? Positioned( left: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -259,11 +259,11 @@ class Utils { ? Positioned( right: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -614,11 +614,11 @@ class Utils { ? Positioned( left: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -632,11 +632,11 @@ class Utils { ? Positioned( right: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index ff085dd9..f7cdafce 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -1,4 +1,4 @@ -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -106,10 +106,10 @@ class BottomNavigationItem extends StatelessWidget { Positioned( right: 18.0, bottom: 28.0, - child: Badge( + child: badge_import.Badge( toAnimate: false, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e91990b4..ba9d79ee 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -39,9 +39,9 @@ class MyInAppBrowser extends InAppBrowser { // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS + static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 6865ece5..f433a8e4 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -1,5 +1,5 @@ import 'package:auto_size_text/auto_size_text.dart'; -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; @@ -494,7 +494,7 @@ class AppBarWidgetState extends State { actions: [ (widget.isPharmacy && widget.showPharmacyCart) ? IconButton( - icon: Badge( + icon: badge_import.Badge( badgeContent: Text( orderPreviewViewModel.cartResponse.quantityCount.toString(), style: TextStyle(color: Colors.white), @@ -507,8 +507,8 @@ class AppBarWidgetState extends State { : Container(), (widget.isOfferPackages && widget.showOfferPackagesCart) ? IconButton( - icon: Badge( - position: BadgePosition.topStart(top: -15, start: -10), + icon: badge_import.Badge( + position: badge_import.BadgePosition.topStart(top: -15, start: -10), badgeContent: Text( _badgeText, style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal), From df610690d55abdd4effe7974c30041c0bf72d838 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 1 Oct 2023 11:46:48 +0300 Subject: [PATCH 35/86] updates --- lib/config/localized_values.dart | 1 + lib/core/service/client/base_app_client.dart | 2 +- .../medical/labs/laboratory_result_page.dart | 56 ++++++++++++++----- lib/pages/paymentService/payment_service.dart | 14 ++--- lib/uitl/translations_delegate_base.dart | 1 + lib/uitl/utils.dart | 26 ++++----- .../bottom_navigation_item.dart | 8 +-- lib/widgets/others/app_scaffold_widget.dart | 8 +-- 8 files changed, 72 insertions(+), 44 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4a24f79b..e818eb82 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1897,4 +1897,5 @@ const Map localizedValues = { "invalidInsurance": {"en": "You cannot make online payment because you do not have a valid insurance.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح."}, "continueCash": {"en": "Continue as cash", "ar": "تواصل نقدا"}, "updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"}, + "downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"}, }; \ No newline at end of file diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index fb3c900a..9cb81a41 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -149,7 +149,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 4767370; //3844083 + // body['PatientID'] = 2001273; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 847f979b..88fdcbe8 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/LabResult/laboratory_result_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -37,22 +38,47 @@ class _LaboratoryResultPageState extends State { showNewAppBar: true, showNewAppBarTitle: true, backgroundColor: Color(0xffF8F8F8), - body: ListView.builder( - physics: BouncingScrollPhysics(), - padding: EdgeInsets.only(bottom: 12), - itemBuilder: (context, index) => LaboratoryResultWidget( - onTap: () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user); - GifLoaderDialogUtils.hideDialog(context); - }, - billNo: widget.patientLabOrders.invoiceNo, - // details: model.patientLabSpecialResult[index].resultDataHTML, - details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model), - orderNo: widget.patientLabOrders.orderNo, - patientLabOrder: widget.patientLabOrders, + body: SingleChildScrollView( + child: Column( + children: [ + ListView.builder( + physics: BouncingScrollPhysics(), + shrinkWrap: true, + padding: EdgeInsets.only(bottom: 12), + itemBuilder: (context, index) => LaboratoryResultWidget( + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user); + GifLoaderDialogUtils.hideDialog(context); + }, + billNo: widget.patientLabOrders.invoiceNo, + // details: model.patientLabSpecialResult[index].resultDataHTML, + details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model), + orderNo: widget.patientLabOrders.orderNo, + patientLabOrder: widget.patientLabOrders, + ), + itemCount: 1, + ), + ], + ), + ), + bottomSheet: Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.08, + width: double.infinity, + padding: EdgeInsets.all(12.0), + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: DefaultButton( + TranslationBase.of(context).downloadReport, + () => {}, + textColor: Colors.white, + ), + ), + ], ), - itemCount: 1, ), ), ); diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index 5bcf4592..3c5cb01f 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -1,4 +1,4 @@ -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:diplomaticquarterapp/Constants.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; @@ -95,11 +95,11 @@ class PaymentService extends StatelessWidget { ? Positioned( left: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -111,11 +111,11 @@ class PaymentService extends StatelessWidget { : Positioned( right: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index b14c21a5..0863de1e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2906,6 +2906,7 @@ class TranslationBase { String get invalidInsurance => localizedValues["invalidInsurance"][locale.languageCode]; String get continueCash => localizedValues["continueCash"][locale.languageCode]; String get updateInsuranceText => localizedValues["updateInsurance"][locale.languageCode]; + String get downloadReport => localizedValues["downloadReport"][locale.languageCode]; } diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index ece5613d..f061b6bf 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -4,7 +4,7 @@ import 'dart:io'; import 'dart:typed_data'; import 'package:auto_size_text/auto_size_text.dart'; -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:cached_network_image/cached_network_image.dart'; import 'package:connectivity/connectivity.dart'; import 'package:crypto/crypto.dart' as crypto; @@ -241,11 +241,11 @@ class Utils { ? Positioned( left: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -259,11 +259,11 @@ class Utils { ? Positioned( right: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -614,11 +614,11 @@ class Utils { ? Positioned( left: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -632,11 +632,11 @@ class Utils { ? Positioned( right: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index ff085dd9..f7cdafce 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -1,4 +1,4 @@ -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -106,10 +106,10 @@ class BottomNavigationItem extends StatelessWidget { Positioned( right: 18.0, bottom: 28.0, - child: Badge( + child: badge_import.Badge( toAnimate: false, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 6865ece5..f433a8e4 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -1,5 +1,5 @@ import 'package:auto_size_text/auto_size_text.dart'; -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; @@ -494,7 +494,7 @@ class AppBarWidgetState extends State { actions: [ (widget.isPharmacy && widget.showPharmacyCart) ? IconButton( - icon: Badge( + icon: badge_import.Badge( badgeContent: Text( orderPreviewViewModel.cartResponse.quantityCount.toString(), style: TextStyle(color: Colors.white), @@ -507,8 +507,8 @@ class AppBarWidgetState extends State { : Container(), (widget.isOfferPackages && widget.showOfferPackagesCart) ? IconButton( - icon: Badge( - position: BadgePosition.topStart(top: -15, start: -10), + icon: badge_import.Badge( + position: badge_import.BadgePosition.topStart(top: -15, start: -10), badgeContent: Text( _badgeText, style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal), From 34d3cf29456fbf3850459a172ce378889694e6d0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 2 Oct 2023 12:01:56 +0300 Subject: [PATCH 36/86] CR 6204 Lab reports enhancements in progress --- .../labs/request_send_lab_report_email.dart | 54 ++++++++++--------- lib/core/service/medical/labs_service.dart | 3 +- .../viewModels/medical/labs_view_model.dart | 2 +- .../medical/labs/laboratory_result_page.dart | 6 ++- 4 files changed, 37 insertions(+), 28 deletions(-) diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index 65ac1762..a849da73 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -25,34 +25,36 @@ class RequestSendLabReportEmail { String invoiceNo; String orderDate; String orderNo; + bool isDownload; RequestSendLabReportEmail( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.to, - this.dateofBirth, - this.patientIditificationNum, - this.patientMobileNumber, - this.patientName, - this.setupID, - this.projectName, - this.clinicName, - this.doctorName, - this.projectID, - this.invoiceNo, - this.orderDate, - this.orderNo}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.to, + this.dateofBirth, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.setupID, + this.projectName, + this.clinicName, + this.doctorName, + this.projectID, + this.invoiceNo, + this.orderDate, + this.orderNo, + this.isDownload}); RequestSendLabReportEmail.fromJson(Map json) { versionID = json['VersionID']; @@ -81,6 +83,7 @@ class RequestSendLabReportEmail { invoiceNo = json['InvoiceNo']; orderDate = json['OrderDate']; orderNo = json['OrderNo']; + isDownload = json['IsDownload']; } Map toJson() { @@ -111,6 +114,7 @@ class RequestSendLabReportEmail { data['InvoiceNo'] = this.invoiceNo; data['OrderDate'] = this.orderDate; data['OrderNo'] = this.orderNo; + data['IsDownload'] = this.isDownload; return data; } } diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 714ebcb1..06115173 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -194,7 +194,7 @@ class LabsService extends BaseService { RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); - Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj}) async { + Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj, bool isDownload = false}) async { _requestSendLabReportEmail.projectID = patientLabOrder.projectID; _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; @@ -208,6 +208,7 @@ class LabsService extends BaseService { _requestSendLabReportEmail.projectName = patientLabOrder.projectName; _requestSendLabReportEmail.setupID = patientLabOrder.setupID; _requestSendLabReportEmail.orderNo = patientLabOrder.orderNo; + _requestSendLabReportEmail.isDownload = isDownload; await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index e42dbbb4..263d7d32 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -135,7 +135,7 @@ class LabsViewModel extends BaseViewModel { } } - sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj}) async { + sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj, bool isDownload = false}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj); if (_labsService.hasError) { error = _labsService.error; diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 88fdcbe8..574c407f 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -73,7 +73,11 @@ class _LaboratoryResultPageState extends State { width: MediaQuery.of(context).size.width * 0.9, child: DefaultButton( TranslationBase.of(context).downloadReport, - () => {}, + () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isDownload: true); + GifLoaderDialogUtils.hideDialog(context); + }, textColor: Colors.white, ), ), From 14928ad833a3ac1514c68730867150a40f1eec9e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 2 Oct 2023 12:48:15 +0300 Subject: [PATCH 37/86] CR 6204 --- lib/core/model/labs/request_send_lab_report_email.dart | 6 +++++- lib/core/service/medical/labs_service.dart | 1 + lib/core/viewModels/medical/labs_view_model.dart | 2 +- lib/pages/medical/labs/laboratory_result_page.dart | 5 ++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index a849da73..2fae6e0c 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -26,6 +26,7 @@ class RequestSendLabReportEmail { String orderDate; String orderNo; bool isDownload; + int doctorID; RequestSendLabReportEmail( {this.versionID, @@ -54,7 +55,8 @@ class RequestSendLabReportEmail { this.invoiceNo, this.orderDate, this.orderNo, - this.isDownload}); + this.isDownload, + this.doctorID}); RequestSendLabReportEmail.fromJson(Map json) { versionID = json['VersionID']; @@ -84,6 +86,7 @@ class RequestSendLabReportEmail { orderDate = json['OrderDate']; orderNo = json['OrderNo']; isDownload = json['IsDownload']; + doctorID = json['DoctorID']; } Map toJson() { @@ -115,6 +118,7 @@ class RequestSendLabReportEmail { data['OrderDate'] = this.orderDate; data['OrderNo'] = this.orderNo; data['IsDownload'] = this.isDownload; + data['DoctorID'] = this.doctorID; return data; } } diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 06115173..1bc12af3 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -209,6 +209,7 @@ class LabsService extends BaseService { _requestSendLabReportEmail.setupID = patientLabOrder.setupID; _requestSendLabReportEmail.orderNo = patientLabOrder.orderNo; _requestSendLabReportEmail.isDownload = isDownload; + _requestSendLabReportEmail.doctorID = patientLabOrder.doctorID; await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 263d7d32..e250a85c 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -136,7 +136,7 @@ class LabsViewModel extends BaseViewModel { } sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj, bool isDownload = false}) async { - await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj); + await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isDownload: true); if (_labsService.hasError) { error = _labsService.error; } else diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 574c407f..9ef18fb3 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -59,12 +59,15 @@ class _LaboratoryResultPageState extends State { ), itemCount: 1, ), + SizedBox( + height: 120.0, + ) ], ), ), bottomSheet: Container( color: Colors.white, - height: MediaQuery.of(context).size.height * 0.08, + height: MediaQuery.of(context).size.height * 0.081, width: double.infinity, padding: EdgeInsets.all(12.0), child: Column( From b2f390c19d438d08afa00ee66ec6fcee11bdb739 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 2 Oct 2023 14:42:47 +0300 Subject: [PATCH 38/86] CR 6204 implemented --- ios/Podfile | 26 +++++++++++++++++++ lib/core/service/medical/labs_service.dart | 10 ++++++- .../viewModels/medical/labs_view_model.dart | 13 +++++++--- .../medical/labs/laboratory_result_page.dart | 21 +++++++++++++++ pubspec.yaml | 2 +- 5 files changed, 67 insertions(+), 5 deletions(-) diff --git a/ios/Podfile b/ios/Podfile index c92f7e80..264db98d 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -32,6 +32,7 @@ target 'Runner' do use_modular_headers! pod 'OpenTok', '~> 2.22.0' + pod 'VTO2Lib' flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end @@ -53,9 +54,34 @@ post_install do |installer| ] build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' + xcconfig_path = build_configuration.base_configuration_reference.real_path + xcconfig = File.read(xcconfig_path) + xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR") + File.open(xcconfig_path, "w") { |file| file << xcconfig_mod } + if build_configuration.build_settings['WRAPPER_EXTENSION'] == 'bundle' build_configuration.build_settings['DEVELOPMENT_TEAM'] = '3A359E86ZF' end end end +end + +post_integrate do |installer| + compiler_flags_key = 'COMPILER_FLAGS' + project_path = 'Pods/Pods.xcodeproj' + + project = Xcodeproj::Project.open(project_path) + project.targets.each do |target| + target.build_phases.each do |build_phase| + if build_phase.is_a?(Xcodeproj::Project::Object::PBXSourcesBuildPhase) + build_phase.files.each do |file| + if !file.settings.nil? && file.settings.key?(compiler_flags_key) + compiler_flags = file.settings[compiler_flags_key] + file.settings[compiler_flags_key] = compiler_flags.gsub(/-DOS_OBJECT_USE_OBJC=0\s*/, '') + end + end + end + end + end + project.save() end \ No newline at end of file diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 1bc12af3..c9abb4e8 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -11,6 +11,8 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da class LabsService extends BaseService { List patientLabOrdersList = List(); + String labReportPDF = ""; + Future getPatientLabOrdersList() async { hasError = false; Map body = Map(); @@ -211,7 +213,13 @@ class LabsService extends BaseService { _requestSendLabReportEmail.isDownload = isDownload; _requestSendLabReportEmail.doctorID = patientLabOrder.doctorID; - await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { + await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) { + + if(isDownload) { + labReportPDF = response['LabReportsPDFContent']; + } + + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: _requestSendLabReportEmail.toJson()); diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index e250a85c..c9fdd114 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -20,6 +20,8 @@ class LabsViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; List timeSeries = []; + String get labReportPDF => _labsService.labReportPDF; + List _patientLabOrdersListClinic = List(); List _patientLabOrdersListHospital = List(); @@ -136,10 +138,15 @@ class LabsViewModel extends BaseViewModel { } sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj, bool isDownload = false}) async { - await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isDownload: true); + await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isDownload: isDownload); if (_labsService.hasError) { error = _labsService.error; - } else - AppToast.showSuccessToast(message: mes); + } else { + if(isDownload) { + + } else { + AppToast.showSuccessToast(message: mes); + } + } } } diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 9ef18fb3..f2c86c5f 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -1,7 +1,12 @@ +import 'dart:convert'; +import 'dart:io'; +import 'dart:typed_data'; + import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; @@ -9,6 +14,8 @@ import 'package:diplomaticquarterapp/widgets/data_display/medical/LabResult/labo import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:open_filex/open_filex.dart'; +import 'package:path_provider/path_provider.dart'; import 'package:provider/provider.dart'; class LaboratoryResultPage extends StatefulWidget { @@ -80,6 +87,12 @@ class _LaboratoryResultPageState extends State { GifLoaderDialogUtils.showMyDialog(context); await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isDownload: true); GifLoaderDialogUtils.hideDialog(context); + try { + String path = await _createFileFromString(model.labReportPDF, "pdf"); + OpenFilex.open(path); + } catch (ex) { + AppToast.showErrorToast(message: "Cannot open file."); + } }, textColor: Colors.white, ), @@ -91,6 +104,14 @@ class _LaboratoryResultPageState extends State { ); } + Future _createFileFromString(String encodedStr, String ext) async { + Uint8List bytes = base64.decode(encodedStr); + String dir = (await getApplicationDocumentsDirectory()).path; + File file = File("$dir/" + DateTime.now().millisecondsSinceEpoch.toString() + "." + ext); + await file.writeAsBytes(bytes); + return file.path; + } + String getSpecialResults(LabsViewModel model) { String labResults = ""; model.patientLabSpecialResult.forEach((element) { diff --git a/pubspec.yaml b/pubspec.yaml index 9f3755da..a711467e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -207,7 +207,7 @@ dependencies: sms_otp_auto_verify: ^2.1.0 flutter_ios_voip_kit: ^0.0.5 google_api_availability: ^3.0.1 -# open_file: ^3.2.1 + # open_file: ^3.2.1 open_filex: ^4.3.2 path_provider: ^2.0.8 # flutter_callkit_incoming: ^1.0.3+3 From af5b0766a27c0916d7b63f032f4c9fa9b4c6f22b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 3 Oct 2023 09:51:50 +0300 Subject: [PATCH 39/86] CR 6654, Disable update manual insurance temporarily. --- lib/config/localized_values.dart | 1 + .../AttachInsuranceCardImageDialog.dart | 41 +++++++++++-------- lib/pages/insurance/insurance_page.dart | 16 ++++---- lib/uitl/translations_delegate_base.dart | 1 + 4 files changed, 35 insertions(+), 24 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e818eb82..7fd9507b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1898,4 +1898,5 @@ const Map localizedValues = { "continueCash": {"en": "Continue as cash", "ar": "تواصل نقدا"}, "updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"}, "downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"}, + "habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."}, }; \ No newline at end of file diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart index c331da2a..16c8cdf5 100644 --- a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -132,24 +132,31 @@ class _AttachInsuranceCardImageDialogState extends State { Navigator.pop(context), Navigator.push( - context, - FadePage( - page: UpdateInsuranceManually( + context, + FadePage( + page: UpdateInsuranceManually( patientIdentificationNo: patientIdentificationID, patientID: patientID, patientMobileNumber: mobileNumber, - ))) + ), + ), + ), }, cancelFunction: () => {}); dialog.showAlertDialog(context); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 0863de1e..804cecdd 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2907,6 +2907,7 @@ class TranslationBase { String get continueCash => localizedValues["continueCash"][locale.languageCode]; String get updateInsuranceText => localizedValues["updateInsurance"][locale.languageCode]; String get downloadReport => localizedValues["downloadReport"][locale.languageCode]; + String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode]; } From 3f6c05825d41893d7eee07377caaa60acb7ef01b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 5 Oct 2023 16:49:26 +0300 Subject: [PATCH 40/86] updates --- lib/config/config.dart | 8 ++++---- lib/core/service/client/base_app_client.dart | 2 +- lib/pages/feedback/send_feedback_page.dart | 2 +- lib/pages/medical/labs/laboratory_result_page.dart | 4 ++-- lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0764c199..44c635f4 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,10 +20,10 @@ 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:2018/'; - // var BASE_URL = 'https://uat.hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; -var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://webservices.hmg.com/'; @@ -45,9 +45,9 @@ var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // RC API URL -// var RC_BASE_URL = 'https://rc.hmg.com/'; +var RC_BASE_URL = 'https://rc.hmg.com/'; -var RC_BASE_URL = 'https://ms.hmg.com/rc/'; +// var RC_BASE_URL = 'https://ms.hmg.com/rc/'; var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 87faf867..698b3b43 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 197; //3844083 + // body['PatientID'] = 2001273; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 91ae7ba0..06e9560b 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -341,7 +341,7 @@ class _SendFeedbackPageState extends State { } }, color: Color(0xffD02127), - textColor: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty) ? Color(0xff000000) : Colors.white, + textColor: Colors.white, disabledColor: Color(0xffEAEAEA), ), ), diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 3e4aa2be..9cf303aa 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -58,7 +58,7 @@ class _LaboratoryResultPageState extends State { itemBuilder: (context, index) => LaboratoryResultWidget( onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID))); GifLoaderDialogUtils.hideDialog(context); }, billNo: widget.patientLabOrders.invoiceNo, @@ -88,7 +88,7 @@ class _LaboratoryResultPageState extends State { TranslationBase.of(context).downloadReport, () async { GifLoaderDialogUtils.showMyDialog(context); - await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isDownload: true); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); GifLoaderDialogUtils.hideDialog(context); try { String path = await _createFileFromString(model.labReportPDF, "pdf"); diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 73069b22..28a364e5 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,11 +35,11 @@ class MyInAppBrowser extends InAppBrowser { // 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/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS + // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; From f0a4bd69258e3874ca8c2b5040088d3c71876d2f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 8 Oct 2023 12:49:05 +0300 Subject: [PATCH 41/86] Commented the CRs code --- ios/Runner.xcodeproj/project.pbxproj | 4 +- lib/config/config.dart | 8 +-- .../AttachInsuranceCardImageDialog.dart | 49 +++++++------- lib/pages/insurance/insurance_page.dart | 9 ++- .../medical/labs/laboratory_result_page.dart | 56 ++++++++-------- .../medical/reports/report_home_page.dart | 64 +++++++++---------- .../medical/reports/report_list_widget.dart | 34 +++++----- 7 files changed, 115 insertions(+), 109 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 240eb6e4..02d0d9b7 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -322,6 +322,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -392,6 +393,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); diff --git a/lib/config/config.dart b/lib/config/config.dart index 44c635f4..23c9f20a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -33,12 +33,12 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // // Pharmacy Production URLs -// var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; -// var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; +var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; +var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; // Pharmacy VidaPlus URLs -var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; -var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; +// var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; +// var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // // Pharmacy Pre-Production URLs // var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart index 16c8cdf5..03e61116 100644 --- a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -132,31 +132,32 @@ class _AttachInsuranceCardImageDialogState extends State { Navigator.pop(context), Navigator.push( diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 9cf303aa..d5bb9035 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -75,34 +75,34 @@ class _LaboratoryResultPageState extends State { ], ), ), - bottomSheet: Container( - color: Colors.white, - height: MediaQuery.of(context).size.height * 0.081, - width: double.infinity, - padding: EdgeInsets.all(12.0), - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.9, - child: DefaultButton( - TranslationBase.of(context).downloadReport, - () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); - GifLoaderDialogUtils.hideDialog(context); - try { - String path = await _createFileFromString(model.labReportPDF, "pdf"); - OpenFilex.open(path); - } catch (ex) { - AppToast.showErrorToast(message: "Cannot open file."); - } - }, - textColor: Colors.white, - ), - ), - ], - ), - ), + // bottomSheet: Container( + // color: Colors.white, + // height: MediaQuery.of(context).size.height * 0.081, + // width: double.infinity, + // padding: EdgeInsets.all(12.0), + // child: Column( + // children: [ + // Container( + // width: MediaQuery.of(context).size.width * 0.9, + // child: DefaultButton( + // TranslationBase.of(context).downloadReport, + // () async { + // GifLoaderDialogUtils.showMyDialog(context); + // await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); + // GifLoaderDialogUtils.hideDialog(context); + // try { + // String path = await _createFileFromString(model.labReportPDF, "pdf"); + // OpenFilex.open(path); + // } catch (ex) { + // AppToast.showErrorToast(message: "Cannot open file."); + // } + // }, + // textColor: Colors.white, + // ), + // ), + // ], + // ), + // ), ), ); } diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 911e74a0..55d1b901 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -70,38 +70,38 @@ class _HomeReportPageState extends State with SingleTickerProvid body: Container( child: Column( children: [ - TabBar( - controller: _tabController_new, - indicatorWeight: 3.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Color(0xff2B353E), - unselectedLabelColor: Color(0xff575757), - labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), - labelStyle: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - ), - unselectedLabelStyle: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - ), - onTap: (int value) { - print(value); - setState(() {}); - }, - tabs: [ - Text( - TranslationBase.of(context).outpatient, - style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), - ), - Text( - TranslationBase.of(context).inPatient, - style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), - ), - ], - ), + // TabBar( + // controller: _tabController_new, + // indicatorWeight: 3.0, + // indicatorSize: TabBarIndicatorSize.tab, + // labelColor: Color(0xff2B353E), + // unselectedLabelColor: Color(0xff575757), + // labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + // labelStyle: TextStyle( + // fontSize: 16, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.48, + // ), + // unselectedLabelStyle: TextStyle( + // fontSize: 16, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.48, + // ), + // onTap: (int value) { + // print(value); + // setState(() {}); + // }, + // tabs: [ + // Text( + // TranslationBase.of(context).outpatient, + // style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + // ), + // Text( + // TranslationBase.of(context).inPatient, + // style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + // ), + // ], + // ), if (model.user != null) Expanded( child: TabBarView( diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index adaef00e..2809b317 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -117,23 +117,23 @@ class ReportListWidget extends StatelessWidget { if (reportList[index].status == 2) Row( children: [ - InkWell( - onTap: () { - getMedicalReportPDF(report); - }, - child: Padding( - padding: const EdgeInsets.only(right: 11.0, left: 11.0), - child: Text(TranslationBase.of(context).viewReport, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - fontStyle: FontStyle.italic, - color: CustomColors.accentColor, - letterSpacing: -0.48, - height: 18 / 12, - decoration: TextDecoration.underline)), - ), - ), + // InkWell( + // onTap: () { + // getMedicalReportPDF(report); + // }, + // child: Padding( + // padding: const EdgeInsets.only(right: 11.0, left: 11.0), + // child: Text(TranslationBase.of(context).viewReport, + // style: TextStyle( + // fontSize: 12, + // fontWeight: FontWeight.w600, + // fontStyle: FontStyle.italic, + // color: CustomColors.accentColor, + // letterSpacing: -0.48, + // height: 18 / 12, + // decoration: TextDecoration.underline)), + // ), + // ), IconButton( icon: Icon(Icons.email), color: Color(0xff28323A), From 645e266af8096f5234746f14ed07bde65ab5b9d6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 9 Oct 2023 12:09:57 +0300 Subject: [PATCH 42/86] Vida plus updates sent to stores --- lib/config/config.dart | 6 ++++-- lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- pubspec.yaml | 10 +++++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 23c9f20a..24b1378a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,14 +20,16 @@ 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:2018/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; + // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://webservices.hmg.com/'; +// var BASE_URL = 'http://10.50.100.198:4422/'; + // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 28a364e5..f38ad57c 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // 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/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS diff --git a/pubspec.yaml b/pubspec.yaml index a711467e..235254f9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.026+4050026 +version: 4.5.028+4050028 environment: sdk: ">=2.7.0 <3.0.0" @@ -42,6 +42,7 @@ dependencies: # Permissions permission_handler: ^10.2.0 + # Flutter Html View flutter_html: ^2.2.1 @@ -136,6 +137,13 @@ dependencies: #device_calendar device_calendar: ^4.2.0 + # TEMPORAL FIX for https://github.com/builttoroam/device_calendar/issues/507 + # device_calendar: ^4.3.1 +# device_calendar: +# git: +# url: https://github.com/builttoroam/device_calendar.git +# ref: develop + #Handle Geolocation geolocator: ^9.0.2 From d11b12ac9a9a07b4f381de84a168822744bd0068 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 10 Oct 2023 12:11:03 +0300 Subject: [PATCH 43/86] no message --- lib/core/service/client/base_app_client.dart | 4 +- .../medical/labs/laboratory_result_page.dart | 56 +++++++++---------- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 698b3b43..bf6bff20 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -159,11 +159,11 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); - if (AppGlobal.isNetworkDebugEnabled) { + // if (AppGlobal.isNetworkDebugEnabled) { print("URL : $url"); final jsonBody = json.encode(body); print(jsonBody); - } + // } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index d5bb9035..9cf303aa 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -75,34 +75,34 @@ class _LaboratoryResultPageState extends State { ], ), ), - // bottomSheet: Container( - // color: Colors.white, - // height: MediaQuery.of(context).size.height * 0.081, - // width: double.infinity, - // padding: EdgeInsets.all(12.0), - // child: Column( - // children: [ - // Container( - // width: MediaQuery.of(context).size.width * 0.9, - // child: DefaultButton( - // TranslationBase.of(context).downloadReport, - // () async { - // GifLoaderDialogUtils.showMyDialog(context); - // await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); - // GifLoaderDialogUtils.hideDialog(context); - // try { - // String path = await _createFileFromString(model.labReportPDF, "pdf"); - // OpenFilex.open(path); - // } catch (ex) { - // AppToast.showErrorToast(message: "Cannot open file."); - // } - // }, - // textColor: Colors.white, - // ), - // ), - // ], - // ), - // ), + bottomSheet: Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.081, + width: double.infinity, + padding: EdgeInsets.all(12.0), + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: DefaultButton( + TranslationBase.of(context).downloadReport, + () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); + GifLoaderDialogUtils.hideDialog(context); + try { + String path = await _createFileFromString(model.labReportPDF, "pdf"); + OpenFilex.open(path); + } catch (ex) { + AppToast.showErrorToast(message: "Cannot open file."); + } + }, + textColor: Colors.white, + ), + ), + ], + ), + ), ), ); } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f38ad57c..28a364e5 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // 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/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS From 7c804f77fbabb0f74469a85c2ef324c22bfaed2d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 11 Oct 2023 11:53:38 +0300 Subject: [PATCH 44/86] updates & fixes --- lib/config/config.dart | 4 ++-- lib/core/service/medical/PatientSickLeaveService.dart | 8 +++++--- lib/core/service/medical/labs_service.dart | 6 +++--- lib/core/viewModels/medical/labs_view_model.dart | 4 ++-- lib/pages/insurance/insurance_update_screen.dart | 2 +- lib/pages/medical/allergies_page.dart | 5 +++-- lib/pages/medical/patient_sick_leave_page.dart | 5 +++-- .../data_display/medical/LabResult/FlowChartPage.dart | 11 +++++++++-- .../medical/LabResult/laboratory_result_widget.dart | 2 ++ lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- 10 files changed, 32 insertions(+), 19 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 24b1378a..6778932a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,11 +20,11 @@ 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:2018/'; - // var BASE_URL = 'https://uat.hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; -var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://webservices.hmg.com/'; diff --git a/lib/core/service/medical/PatientSickLeaveService.dart b/lib/core/service/medical/PatientSickLeaveService.dart index 10d30606..3c4a397a 100644 --- a/lib/core/service/medical/PatientSickLeaveService.dart +++ b/lib/core/service/medical/PatientSickLeaveService.dart @@ -11,9 +11,11 @@ class PatientSickLeaveService extends BaseService { await baseAppClient.post(GET_PATIENT_SICK_LEAVE_STATUS, onSuccess: (response, statusCode) async { sickLeaveList.clear(); - response['List_SickLeave'].forEach((sickLeave) { - sickLeaveList.add(SickLeave.fromJson(sickLeave)); - }); + if(response['List_SickLeave'] != null && response['List_SickLeave'].length != 0) { + response['List_SickLeave'].forEach((sickLeave) { + sickLeaveList.add(SickLeave.fromJson(sickLeave)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 15337576..bee65b87 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -177,11 +177,11 @@ class LabsService extends BaseService { return Future.value(localRes); } - Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { + Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, bool isVidaPlus}) async { hasError = false; Map body = Map(); - body['InvoiceNo'] = "0"; - body['InvoiceNo_VP'] = patientLabOrder.invoiceNo; + body['InvoiceNo_VP'] = isVidaPlus ? patientLabOrder.invoiceNo : "0"; + body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 4fbab4e6..ca577ac6 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -114,9 +114,9 @@ class LabsViewModel extends BaseViewModel { } } - getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { + getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, bool isVidaPlus}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure); + await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, isVidaPlus: isVidaPlus); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 56f67282..49446730 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/medical/allergies_page.dart b/lib/pages/medical/allergies_page.dart index b3f54a60..ba6ce2cc 100644 --- a/lib/pages/medical/allergies_page.dart +++ b/lib/pages/medical/allergies_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/AllergiesViewModel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -22,7 +23,7 @@ class AllergiesPage extends StatelessWidget { baseViewModel: model, description: TranslationBase.of(context).infoAllergies, imagesInfo: imagesInfo, - body: ListView.builder( + body: model.allergies.isNotEmpty ? ListView.builder( itemCount: model.allergies.length, itemBuilder: (context, index) => Container( margin: EdgeInsets.all(15), @@ -54,7 +55,7 @@ class AllergiesPage extends StatelessWidget { ], ), ), - ), + ) : getNoDataWidget(context), ), ); } diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 479b5fe6..15e68e0e 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -10,6 +10,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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; @@ -49,7 +50,7 @@ class _PatientSickLeavePageState extends State { backgroundColor: Color(0xffF7F7F7), imagesInfo: imagesInfo, baseViewModel: model, - body: ListView.separated( + body: model.sickLeaveList.isNotEmpty ? ListView.separated( physics: BouncingScrollPhysics(), itemCount: model.sickLeaveList.length, padding: EdgeInsets.all(21), @@ -69,7 +70,7 @@ class _PatientSickLeavePageState extends State { showConfirmMessage(model, index); }, ), - ), + ) : getNoDataWidget(context), ), ); } diff --git a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart index 8f5a0df9..c369c84e 100644 --- a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart +++ b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart @@ -1,13 +1,16 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.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/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'LineChartCurved.dart'; import 'lab_result_chart_and_detials.dart'; @@ -18,10 +21,14 @@ class FlowChartPage extends StatelessWidget { FlowChartPage({this.patientLabOrder, this.filterName}); + ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: filterName), + onModelReady: (model) => + model.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: filterName, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(patientLabOrder.projectID))), builder: (context, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: filterName, @@ -72,7 +79,7 @@ class FlowChartPage extends StatelessWidget { ) : Center( child: Container( - padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.32), + padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.32), child: Center( child: getNoDataWidget(context), ), 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 3436523d..f08bc3dd 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -151,6 +151,7 @@ class _LaboratoryResultWidgetState extends State { ], ), child: Column( + mainAxisSize: MainAxisSize.min, children: [ Row( children: [ @@ -170,6 +171,7 @@ class _LaboratoryResultWidgetState extends State { if (_isShowMore) Container( width: double.infinity, + // height: 450.0, child: Html( data: widget.details ?? TranslationBase.of(context).noDataAvailable, ), diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 28a364e5..f38ad57c 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // 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/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS From 55f1e4166e8101ecb109ba3ff09a7110c4d28b9b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 29 Oct 2023 16:13:34 +0300 Subject: [PATCH 45/86] updates --- lib/core/service/client/base_app_client.dart | 2 +- .../widgets/AppointmentActions.dart | 21 ++++++++++++++++--- lib/pages/ToDoList/ToDo.dart | 7 ++++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index bf6bff20..313742fa 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 2001273; //3844083 + // body['PatientID'] = 4767512; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 8068c541..0802f91d 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -73,7 +73,8 @@ class _AppointmentActionsState extends State { shrinkWrap: true, itemBuilder: (context, index) { // bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule"); - bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc")); + bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || + (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc")); return InkWell( onTap: shouldEnable ? null @@ -583,12 +584,26 @@ class _AppointmentActionsState extends State { navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { if (widget.projectViewModel.isLogin) { if (model.count != 0) { - Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); + Navigator.push( + context, + FadePage( + page: ToDo( + isShowAppBar: true, + isFromMyAppointments: true, + appointment: widget.appo, + ))); } else { AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); } } else { - Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); + Navigator.push( + context, + FadePage( + page: ToDo( + isShowAppBar: true, + isFromMyAppointments: true, + appointment: widget.appo, + ))); } } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 75290ab1..b147f6c1 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -55,8 +55,10 @@ class ToDo extends StatefulWidget { bool isShowAppBar = true; Function onBackClick; + bool isFromMyAppointments; + AppoitmentAllHistoryResultList appointment; - ToDo({@required this.isShowAppBar, this.onBackClick}); + ToDo({@required this.isShowAppBar, this.onBackClick, this.isFromMyAppointments = false, this.appointment}); @override _ToDoState createState() => _ToDoState(); @@ -833,6 +835,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { }); } dataLoaded = true; + if(widget.isFromMyAppointments) { + getPatientShare(context, widget.appointment); + } }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); From a5e0de08cef3c8f6fc09011748a5095f15268c0c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 30 Oct 2023 12:05:07 +0300 Subject: [PATCH 46/86] updates for ancillary --- lib/config/config.dart | 2 +- .../ancillary-orders/ancillaryOrdersDetails.dart | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 6778932a..5ab2c668 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -337,7 +337,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 10.9; +var VERSION_ID = 11.1; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index b1b457f5..547d8467 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -134,9 +134,13 @@ class _AnicllaryOrdersState extends State with SingleTic SizedBox(height: 12), DefaultButton( TranslationBase.of(context).payNow.toUpperCase(), - selectedProcList.length > 0 && getTotalValue() != "0.00" + selectedProcList.length > 0 ? () { - makePayment(model); + if (getTotalValue() != "0.00") { + makePayment(model); + } else { + autoGenerateInvoice(); + } } : null, color: CustomColors.green, @@ -677,6 +681,8 @@ class _AnicllaryOrdersState extends State with SingleTic }); }); + GifLoaderDialogUtils.showMyDialog(localContext); + DoctorsListService service = new DoctorsListService(); service.autoGenerateAncillaryOrdersInvoice(widget.orderNo, widget.projectID, widget.appoNo, selectedProcListAPI, localContext).then((res) { GifLoaderDialogUtils.hideDialog(localContext); From 542501f5c58ec83ac65d65332029458fc88338b3 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 31 Oct 2023 09:47:45 +0300 Subject: [PATCH 47/86] updates --- lib/config/localized_values.dart | 2 +- lib/pages/BookAppointment/QRCode.dart | 49 ++++++-------------- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- 3 files changed, 17 insertions(+), 38 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7fd9507b..29671b2d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -182,7 +182,7 @@ const Map localizedValues = { 'passQRAppoAttend': {'en': 'Pass the QR code through the attendance devices available in the Hospital.', 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.'}, 'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'}, 'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'}, - 'scanQRHospital': {'en': 'Approach the Online Check-In board in the hospital & scan via NFC to Check-In', 'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وافحصها عبر NFC لتسجيل الوصول'}, + 'scanQRHospital': {'en': 'Approach the Online Check-In board in the hospital & scan via NFC or QR Code to Check-In', 'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وقم بالمسح الضوئي عبر NFC أو رمز الاستجابة السريعة لتسجيل الوصول'}, 'scanNFC': {'en': 'Scan NFC to Check-In', 'ar': 'مسح NFC لتسجيل الوصول'}, "sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"}, "success": {"en": "Done successfully", "ar": "تم تنفذ الطلب بنجاح"}, diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 2f861bd3..5c17950b 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -16,6 +16,7 @@ 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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; @@ -111,44 +112,22 @@ class _QRCodeState extends State { onTap: () {}, onRatingAndReviewTap: () {}, ), - InkWell( - child: Container( - margin: EdgeInsets.only(top: 30.0), - padding: EdgeInsets.all(8), - child: SvgPicture.asset( - "assets/images/nfc/contactless.svg", - width: 80.0, - height: 80.0, - ), - ), - onTap: () { - showNfcReader(context, onNcfScan: (String nfcId) { - Future.delayed(const Duration(milliseconds: 100), () { - sendNfcCheckInRequest(nfcId); - locator().todoList.to_do_list_nfc(widget.appointment); - }); - }, onCancel: () { - // Navigator.of(context).pop(); - locator().todoList.to_do_list_nfc_cancel(widget.appointment); - }); - }, + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(TranslationBase.of(context).scanQRHospital, + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + )), ), + mHeight(21), Row( - children: [ - Expanded( - child: Container( - width: double.infinity, - margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(TranslationBase.of(context).scanQRHospital, - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - )), - ), - ), + children: [ + ], - ), + ) ], ), ), diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f38ad57c..28a364e5 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // 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/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS From 0a478e077aec0411bb70ea054acf56930b74142b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 31 Oct 2023 10:42:07 +0300 Subject: [PATCH 48/86] QR Code checkin implemented --- lib/pages/BookAppointment/QRCode.dart | 126 +++++++++++++----- lib/uitl/utils.dart | 23 ++-- .../medical/medical_profile_item.dart | 4 +- 3 files changed, 105 insertions(+), 48 deletions(-) diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 5c17950b..ad676eff 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -1,5 +1,6 @@ import 'dart:typed_data'; +import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -18,6 +19,7 @@ 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/custom_text_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart'; @@ -56,7 +58,7 @@ class _QRCodeState extends State { }); WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - startNFCScan(); + // startNFCScan(); }); super.initState(); @@ -76,9 +78,18 @@ class _QRCodeState extends State { }); } + startQRCodeScan() async { + String onlineCheckInQRCode = (await BarcodeScanner.scan())?.rawContent; + if (onlineCheckInQRCode != "") { + sendNfcCheckInRequest(onlineCheckInQRCode); + locator().todoList.to_do_list_nfc(widget.appointment); + } else {} + } + @override Widget build(BuildContext context) { _context = context; + List checkInOptionsList = getCheckInOptionsList(context); return AppScaffold( appBarTitle: TranslationBase.of(context).onlineCheckIn, isShowAppBar: true, @@ -123,47 +134,94 @@ class _QRCodeState extends State { )), ), mHeight(21), - Row( - children: [ - - ], - ) - ], - ), - ), - bottomSheet: Container( - color: CustomColors.appBackgroudGreyColor, - padding: EdgeInsets.all(21), - // height: 45.0, - child: Row( - children: [ - Expanded( - flex: 1, - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - height: 45.0, - child: CustomTextButton( - backgroundColor: CustomColors.green, - elevation: 0, - onPressed: () { - startNFCScan(); - }, - child: Text(TranslationBase.of(context).scanNFC, - style: TextStyle( - fontSize: 18.0, - color: Colors.white, - )), - ), + Padding( + padding: EdgeInsets.only(left: 21, right: 21), + child: GridView.builder( + shrinkWrap: true, + primary: false, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), + padding: EdgeInsets.zero, + itemCount: checkInOptionsList.length, + itemBuilder: (BuildContext context, int index) { + return checkInOptionsList[index]; + }, ), ), ], ), ), + // bottomSheet: Container( + // color: CustomColors.appBackgroudGreyColor, + // padding: EdgeInsets.all(21), + // // height: 45.0, + // child: Row( + // children: [ + // Expanded( + // flex: 1, + // child: ButtonTheme( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10.0), + // ), + // height: 45.0, + // child: CustomTextButton( + // backgroundColor: CustomColors.green, + // elevation: 0, + // onPressed: () { + // startNFCScan(); + // }, + // child: Text(TranslationBase.of(context).scanNFC, + // style: TextStyle( + // fontSize: 18.0, + // color: Colors.white, + // )), + // ), + // ), + // ), + // ], + // ), + // ), ); } + List getCheckInOptionsList(BuildContext context) { + List optionsList = []; + + optionsList.add( + InkWell( + onTap: () { + startNFCScan(); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).scanNFC, + imagePath: 'contactless.svg', + subTitle: "", + isEnable: true, + width: 80.0, + height: 80.0, + ), + ), + ); + + optionsList.add( + InkWell( + onTap: () { + startQRCodeScan(); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).pharmaLiveCareScanQR, + imagePath: 'qr_code.svg', + subTitle: "", + isEnable: true, + width: 80.0, + height: 80.0, + ), + ), + ); + + return optionsList; + } + sendEmail() async { DoctorsListService service = new DoctorsListService(); diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 75b11879..d41d4f1f 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -294,15 +294,17 @@ class Utils { )); } - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).radiology, - imagePath: 'radiology.svg', - subTitle: TranslationBase.of(context).radiologySubtitle, - isEnable: projectViewModel.havePrivilege(7), + medical.add( + InkWell( + onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).radiology, + imagePath: 'radiology.svg', + subTitle: TranslationBase.of(context).radiologySubtitle, + isEnable: projectViewModel.havePrivilege(7), + ), ), - )); + ); medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, @@ -820,10 +822,7 @@ class Utils { return isVidaPlus; } - static String generateSignature() { - - } - + static String generateSignature() {} } Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) { diff --git a/lib/widgets/data_display/medical/medical_profile_item.dart b/lib/widgets/data_display/medical/medical_profile_item.dart index cfe7f59f..0a4a1928 100644 --- a/lib/widgets/data_display/medical/medical_profile_item.dart +++ b/lib/widgets/data_display/medical/medical_profile_item.dart @@ -51,8 +51,8 @@ class MedicalProfileItem extends StatelessWidget { ) : SvgPicture.asset( "assets/images/new/services/$imagePath", - height: SizeConfig.widthMultiplier * 7, - width: SizeConfig.widthMultiplier * 7, + height: height != null ? height : SizeConfig.widthMultiplier * 7, + width: width != null ? width : SizeConfig.widthMultiplier * 7, color: imgColor, ), mFlex(2), From 6bd6572e7e64f80fe8bd0a49606b8f56f771a204 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 31 Oct 2023 16:28:53 +0300 Subject: [PATCH 49/86] Lab, Rad & prescription disabled in my appointments screen in case of ER appointment (Clinic ID 10) & project is Vida Plus. --- lib/config/config.dart | 4 ++-- lib/core/service/client/base_app_client.dart | 4 ++-- lib/pages/MyAppointments/widgets/AppointmentActions.dart | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 5ab2c668..d1fbb48e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,13 +20,13 @@ 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:2018/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; + // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // 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/'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 313742fa..44dc5764 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,8 +150,8 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 4767512; //3844083 - // body['TokenID'] = "@dm!n"; + body['PatientID'] = 2621536; //3844083 + body['TokenID'] = "@dm!n"; // Patient ID: 3027574 // Mobile no.: 0502303285 diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 0802f91d..9a71e55c 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -29,6 +29,7 @@ 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/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -74,7 +75,10 @@ class _AppointmentActionsState extends State { itemBuilder: (context, index) { // bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule"); bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || - (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc")); + (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || + (Utils.isVidaPlusProject(projectViewModel, widget.appo.projectID) && + widget.appo.clinicID == 10 && + (appoButtonsList[index].caller == "prescriptions" || appoButtonsList[index].caller == "radiology" || appoButtonsList[index].caller == "labResult"))); return InkWell( onTap: shouldEnable ? null From 13b2db47b58fcefe74faa813b4ac7c957502490a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 1 Nov 2023 10:40:18 +0300 Subject: [PATCH 50/86] HMC color change applied in my appointments --- .../model/privilege/HMCProjectListModel.dart | 15 +++++++++++++++ lib/core/service/privilege_service.dart | 12 ++++++++++-- lib/core/viewModels/project_view_model.dart | 9 +++++++++ lib/pages/MyAppointments/MyAppointments.dart | 1 + lib/splashPage.dart | 1 + lib/uitl/utils.dart | 10 ++++++++++ .../data_display/medical/doctor_card.dart | 17 +++++++++++------ 7 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 lib/core/model/privilege/HMCProjectListModel.dart diff --git a/lib/core/model/privilege/HMCProjectListModel.dart b/lib/core/model/privilege/HMCProjectListModel.dart new file mode 100644 index 00000000..6b69c1c5 --- /dev/null +++ b/lib/core/model/privilege/HMCProjectListModel.dart @@ -0,0 +1,15 @@ +class HMCProjectListModel { + int projectID; + + HMCProjectListModel({this.projectID}); + + HMCProjectListModel.fromJson(Map json) { + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/service/privilege_service.dart b/lib/core/service/privilege_service.dart index e9b2d8a9..137bfca6 100644 --- a/lib/core/service/privilege_service.dart +++ b/lib/core/service/privilege_service.dart @@ -1,11 +1,13 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; class PrivilegeService extends BaseService { - List privilegeModelList = List(); - List vidaPlusProjectListModel = List(); + List privilegeModelList = []; + List vidaPlusProjectListModel = []; + List hMCProjectListModel = []; Future getPrivilege() async { Map body = Map(); @@ -20,6 +22,12 @@ class PrivilegeService extends BaseService { vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); }); } + + if (response['HMCProjectList'].length != 0) { + response['HMCProjectList'].forEach((item) { + hMCProjectListModel.add(HMCProjectListModel.fromJson(item)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index d3b7566c..3a47c753 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -4,6 +4,7 @@ import 'package:connectivity/connectivity.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; @@ -60,11 +61,14 @@ class ProjectViewModel extends BaseViewModel { List privilegeRootUser = List(); List privilegeChildUser = List(); List _vidaPlusProjectListModel = List(); + List _hMCProjectListModel = []; List get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser; List get vidaPlusProjectList => _vidaPlusProjectListModel; + List get hMCProjectListModel => _hMCProjectListModel; + List selectedBodyPartList = []; StreamSubscription subscription; @@ -130,6 +134,11 @@ class ProjectViewModel extends BaseViewModel { notifyListeners(); } + setHMCProjectList(List hMCProjectListModel) { + _hMCProjectListModel = hMCProjectListModel; + notifyListeners(); + } + setPrivilege({privilegeList, bool isLoginChild = false}) { List privilege = List(); diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index cccff881..533bd6e6 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -371,6 +371,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid }), isInOutPatient: _appointmentResult.isInOutPatient, name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj, + projectID: _appointmentResult.projectID, // billNo: _appointmentResult.invoiceNo, profileUrl: _appointmentResult.doctorImageURL, subName: _isSortByClinic ? _appointmentResult.projectName : _appointmentResult.clinicName, diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 04e1c3b5..8ffef7a4 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -55,6 +55,7 @@ class _SplashScreenState extends State { ProjectViewModel projectProvider = Provider.of(context, listen: false); projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); projectProvider.setVidaPlusProjectList(_privilegeService.vidaPlusProjectListModel); + projectProvider.setHMCProjectList(_privilegeService.hMCProjectListModel); AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en"); var themeNotifier = Provider.of(context, listen: false); diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index d41d4f1f..a39029b8 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -822,6 +822,16 @@ class Utils { return isVidaPlus; } + static bool isHMCProject(ProjectViewModel projectViewModel, int projectID) { + bool isHMCProject = false; + projectViewModel.hMCProjectListModel.forEach((element) { + if (element.projectID == projectID) { + isHMCProject = true; + } + }); + return isHMCProject; + } + static String generateSignature() {} } diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 20b2714e..12454335 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.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/widgets/avatar/large_avatar.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -32,6 +33,7 @@ class DoctorCard extends StatelessWidget { final String vaccineName; final bool isSickLeave; final int sickLeaveStatus; + final int projectID; DoctorCard( {this.name, @@ -51,7 +53,8 @@ class DoctorCard extends StatelessWidget { this.vaccineName = "", this.isParentAppointment = false, this.isSickLeave = false, - this.sickLeaveStatus = 0}); + this.sickLeaveStatus = 0, + this.projectID = 0}); ProjectViewModel projectViewModel; @@ -87,11 +90,13 @@ class DoctorCard extends StatelessWidget { decoration: isShowInOutPatient ? BoxDecoration( //Colors.red[900] Color(0xff404545) - color: isLiveCareAppointment - ? Color(0xff2E303A) - : !isInOutPatient - ? Color(0xffD02127) - : Color(0xffa9a089), + color: Utils.isHMCProject(projectViewModel, projectID) + ? Color(0xff3FACC8) + : isLiveCareAppointment + ? Color(0xff2E303A) + : !isInOutPatient + ? Color(0xffD02127) + : Color(0xffa9a089), borderRadius: BorderRadius.only( topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10), bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10), From 772992e3ffd60fbfcf6e69d33a231bf5eedef827 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 2 Nov 2023 15:10:29 +0300 Subject: [PATCH 51/86] updates --- lib/core/service/client/base_app_client.dart | 4 ++-- lib/pages/ToDoList/ToDo.dart | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 44dc5764..e2fbe537 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,8 +150,8 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - body['PatientID'] = 2621536; //3844083 - body['TokenID'] = "@dm!n"; + // body['PatientID'] = 2621536; //3844083 + // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 // Mobile no.: 0502303285 diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index b147f6c1..fbfe1cdb 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -906,7 +906,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { GifLoaderDialogUtils.showMyDialog(context); service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); - widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); + if(res['OnlineCheckInAppointments'].length != 0) { + widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); + } isInsured = res["IsInsured"]; isEligible = res["IsEligible"]; isCash = res["IsCash"]; From d5dd8757e9c02387238806c1a5fa6b02e5847ef7 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 2 Nov 2023 15:40:57 +0300 Subject: [PATCH 52/86] Privileges added for QR & NFC CheckIn options --- lib/config/config.dart | 4 ++-- lib/pages/BookAppointment/BookConfirm.dart | 5 +++-- lib/pages/BookAppointment/QRCode.dart | 17 +++++++++++++---- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index d1fbb48e..5ab2c668 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,13 +20,13 @@ 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:2018/'; - // var BASE_URL = 'https://uat.hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // 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/'; diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 50dbc70f..42a12f5e 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -446,8 +446,9 @@ class _BookConfirmState extends State { widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) { projectViewModel.selectedBodyPartList.clear(); projectViewModel.laserSelectionDuration = 0; - print(res); - widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); + if(res['OnlineCheckInAppointments'].length != 0) { + widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); + } isInsured = res["IsInsured"]; isEligible = res["IsEligible"]; diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index ad676eff..e9d88d7b 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -3,6 +3,7 @@ import 'dart:typed_data'; import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; @@ -27,6 +28,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_nfc_kit/flutter_nfc_kit.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; class QRCode extends StatefulWidget { PatientShareResponse patientShareResponse; @@ -46,6 +48,8 @@ class _QRCodeState extends State { bool _supportsNFC = false; BuildContext _context; + ProjectViewModel projectViewModel; + @override void initState() { // TODO: implement initState @@ -88,6 +92,7 @@ class _QRCodeState extends State { @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); _context = context; List checkInOptionsList = getCheckInOptionsList(context); return AppScaffold( @@ -190,13 +195,15 @@ class _QRCodeState extends State { optionsList.add( InkWell( onTap: () { - startNFCScan(); + if (projectViewModel.havePrivilege(80)) { + startNFCScan(); + } }, child: MedicalProfileItem( title: TranslationBase.of(context).scanNFC, imagePath: 'contactless.svg', subTitle: "", - isEnable: true, + isEnable: projectViewModel.havePrivilege(80), width: 80.0, height: 80.0, ), @@ -206,13 +213,15 @@ class _QRCodeState extends State { optionsList.add( InkWell( onTap: () { - startQRCodeScan(); + if (projectViewModel.havePrivilege(79)) { + startQRCodeScan(); + } }, child: MedicalProfileItem( title: TranslationBase.of(context).pharmaLiveCareScanQR, imagePath: 'qr_code.svg', subTitle: "", - isEnable: true, + isEnable: projectViewModel.havePrivilege(79), width: 80.0, height: 80.0, ), From 81de6f9848098a5d79323df421a37c6e35e6e53c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 5 Nov 2023 09:33:07 +0300 Subject: [PATCH 53/86] updated app to stores Version ID 11.0 --- lib/config/config.dart | 6 +- .../medical/labs/laboratory_result_page.dart | 56 +++++++++---------- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- pubspec.yaml | 22 ++++---- 4 files changed, 44 insertions(+), 44 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 5ab2c668..cf605410 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:2018/'; - 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/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; @@ -337,7 +337,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 11.1; +var VERSION_ID = 11.0; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 9cf303aa..d5bb9035 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -75,34 +75,34 @@ class _LaboratoryResultPageState extends State { ], ), ), - bottomSheet: Container( - color: Colors.white, - height: MediaQuery.of(context).size.height * 0.081, - width: double.infinity, - padding: EdgeInsets.all(12.0), - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.9, - child: DefaultButton( - TranslationBase.of(context).downloadReport, - () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); - GifLoaderDialogUtils.hideDialog(context); - try { - String path = await _createFileFromString(model.labReportPDF, "pdf"); - OpenFilex.open(path); - } catch (ex) { - AppToast.showErrorToast(message: "Cannot open file."); - } - }, - textColor: Colors.white, - ), - ), - ], - ), - ), + // bottomSheet: Container( + // color: Colors.white, + // height: MediaQuery.of(context).size.height * 0.081, + // width: double.infinity, + // padding: EdgeInsets.all(12.0), + // child: Column( + // children: [ + // Container( + // width: MediaQuery.of(context).size.width * 0.9, + // child: DefaultButton( + // TranslationBase.of(context).downloadReport, + // () async { + // GifLoaderDialogUtils.showMyDialog(context); + // await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); + // GifLoaderDialogUtils.hideDialog(context); + // try { + // String path = await _createFileFromString(model.labReportPDF, "pdf"); + // OpenFilex.open(path); + // } catch (ex) { + // AppToast.showErrorToast(message: "Cannot open file."); + // } + // }, + // textColor: Colors.white, + // ), + // ), + // ], + // ), + // ), ), ); } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 28a364e5..f38ad57c 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // 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/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS diff --git a/pubspec.yaml b/pubspec.yaml index 235254f9..ae5a6c0a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.028+4050028 +version: 4.5.029+4050029 environment: sdk: ">=2.7.0 <3.0.0" @@ -57,8 +57,8 @@ dependencies: shared_preferences: ^2.0.0 # flutter_flexible_toast: ^0.1.4 fluttertoast: ^8.0.8 - firebase_messaging: ^14.1.0 - firebase_analytics: ^10.0.5 + firebase_messaging: 14.1.0 + firebase_analytics: 10.0.5 # Progress bar @@ -100,7 +100,7 @@ dependencies: location: ^4.3.0 # Qr code Scanner # barcode_scan_fix: ^1.0.2 - barcode_scan2: ^4.2.2 + barcode_scan2: 4.2.2 # Rating Stars rating_bar: ^0.2.0 @@ -132,17 +132,17 @@ dependencies: carousel_pro: ^1.0.0 #local_notifications - flutter_local_notifications: any + flutter_local_notifications: 10.0.0 #device_calendar device_calendar: ^4.2.0 # TEMPORAL FIX for https://github.com/builttoroam/device_calendar/issues/507 # device_calendar: ^4.3.1 -# device_calendar: -# git: -# url: https://github.com/builttoroam/device_calendar.git -# ref: develop + # device_calendar: + # git: + # url: https://github.com/builttoroam/device_calendar.git + # ref: develop #Handle Geolocation geolocator: ^9.0.2 @@ -178,7 +178,7 @@ dependencies: wifi: ^0.1.5 vibration: ^1.7.3 - flutter_nfc_kit: ^3.3.1 + flutter_nfc_kit: 3.3.1 geofencing: ^0.1.0 @@ -187,7 +187,7 @@ dependencies: in_app_update: ^3.0.0 - in_app_review: ^2.0.3 + in_app_review: 2.0.3 badges: ^2.0.1 flutter_app_icon_badge: ^2.0.0 From bbee4dba665edff71155e5d4bd614335308f228a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 6 Nov 2023 11:24:57 +0300 Subject: [PATCH 54/86] CR 6654 cancel manual insurance update CR done. --- .../AttachInsuranceCardImageDialog.dart | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart index 03e61116..3d33825f 100644 --- a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -133,31 +133,31 @@ class _AttachInsuranceCardImageDialogState extends State Date: Mon, 6 Nov 2023 11:36:12 +0300 Subject: [PATCH 55/86] CR 6654 done --- lib/pages/insurance/insurance_page.dart | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/pages/insurance/insurance_page.dart b/lib/pages/insurance/insurance_page.dart index 5d19789a..dc17520b 100644 --- a/lib/pages/insurance/insurance_page.dart +++ b/lib/pages/insurance/insurance_page.dart @@ -184,24 +184,24 @@ class InsurancePage extends StatelessWidget { void updateManually(BuildContext context, String errorMsg, String patientIdentificationID, int patientID, String mobileNumber) { ConfirmDialog dialog = new ConfirmDialog( context: context, - // confirmMessage: errorMsg + ". " + TranslationBase.of(context).habibCallCenter, - // okText: TranslationBase.of(context).ok, - // cancelText: TranslationBase.of(context).cancel, - confirmMessage: errorMsg + ". " + TranslationBase.of(context).updateInsuranceManuallyDialog, - okText: TranslationBase.of(context).yes, - cancelText: TranslationBase.of(context).no, + confirmMessage: errorMsg + ". " + TranslationBase.of(context).habibCallCenter, + okText: TranslationBase.of(context).ok, + cancelText: TranslationBase.of(context).cancel, + // confirmMessage: errorMsg + ". " + TranslationBase.of(context).updateInsuranceManuallyDialog, + // okText: TranslationBase.of(context).yes, + // cancelText: TranslationBase.of(context).no, okFunction: () => { Navigator.pop(context), - Navigator.push( - context, - FadePage( - page: UpdateInsuranceManually( - patientIdentificationNo: patientIdentificationID, - patientID: patientID, - patientMobileNumber: mobileNumber, - ), - ), - ), + // Navigator.push( + // context, + // FadePage( + // page: UpdateInsuranceManually( + // patientIdentificationNo: patientIdentificationID, + // patientID: patientID, + // patientMobileNumber: mobileNumber, + // ), + // ), + // ), }, cancelFunction: () => {}); dialog.showAlertDialog(context); From cb2bacf53919ea7e807429acf0fe9f07ec9c9beb Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 6 Nov 2023 13:20:43 +0300 Subject: [PATCH 56/86] Update insurance for cash patient in ToDo List --- lib/config/localized_values.dart | 1 + lib/pages/ToDoList/ToDo.dart | 6 +- lib/pages/ToDoList/widgets/paymentDialog.dart | 186 +++++++++++------- .../insurance/insurance_update_screen.dart | 4 +- lib/uitl/translations_delegate_base.dart | 1 + 5 files changed, 119 insertions(+), 79 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 29671b2d..006b5f53 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1899,4 +1899,5 @@ const Map localizedValues = { "updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"}, "downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"}, "habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."}, + "cashAmountUpdateInsurance": {"en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:", "ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:"}, }; \ No newline at end of file diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index fbfe1cdb..95be336f 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -835,7 +835,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { }); } dataLoaded = true; - if(widget.isFromMyAppointments) { + if (widget.isFromMyAppointments) { getPatientShare(context, widget.appointment); } }); @@ -906,7 +906,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { GifLoaderDialogUtils.showMyDialog(context); service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); - if(res['OnlineCheckInAppointments'].length != 0) { + if (res['OnlineCheckInAppointments'].length != 0) { widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); } isInsured = res["IsInsured"]; @@ -1009,7 +1009,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), child: Opacity( opacity: a1.value, - child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse), + child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse, isCashPatient: isCash), ), ); }, diff --git a/lib/pages/ToDoList/widgets/paymentDialog.dart b/lib/pages/ToDoList/widgets/paymentDialog.dart index 9445e341..d12b5bf8 100644 --- a/lib/pages/ToDoList/widgets/paymentDialog.dart +++ b/lib/pages/ToDoList/widgets/paymentDialog.dart @@ -3,20 +3,24 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.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_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; class PaymentDialog extends StatefulWidget { AppoitmentAllHistoryResultList appo; PatientShareResponse patientShareResponse; + bool isCashPatient; final Function onPaymentMethodSelected; - PaymentDialog({@required this.appo, @required this.onPaymentMethodSelected, this.patientShareResponse}); + PaymentDialog({@required this.appo, @required this.onPaymentMethodSelected, this.patientShareResponse, this.isCashPatient = false}); @override _PaymentDialogState createState() => _PaymentDialogState(); @@ -31,84 +35,118 @@ class _PaymentDialogState extends State { //height: 550.0, width: 450.0, padding: EdgeInsets.all(21), - child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ - Text( - TranslationBase.of(context).invoiceDetails, - style: TextStyle( - fontSize: 24.0, - fontWeight: FontWeight.w600, - letterSpacing: -1.14, - color: Color(0xff2B353E), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + TranslationBase.of(context).invoiceDetails, + style: TextStyle( + fontSize: 24.0, + fontWeight: FontWeight.w600, + letterSpacing: -1.14, + color: Color(0xff2B353E), + ), ), - ), - Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Color(0xff2E303A), fontSize: 16.0, fontWeight: FontWeight.w600,letterSpacing: -0.64)), - Text(getDate(widget.appo.appointmentDate), style: getTextStyle()), - Text(widget.appo.projectName, style: getTextStyle()), - Divider( - color: Colors.grey, - ), - Table( - children: [ - TableRow(decoration: BoxDecoration(), children: [ - TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)), - TableCell(child: _getNormalText(widget.patientShareResponse.patientShare.toString())), - ]), - TableRow(children: [ - TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)), - TableCell(child: _getNormalText(widget.patientShareResponse.patientTaxAmount.toString())), - ]), - TableRow(children: [ - TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)), - TableCell(child: _getNormalText(widget.patientShareResponse.patientShareWithTax.toString())), - ]), - ], - ), - Divider(color: Colors.grey), - Text( - TranslationBase.of(context).YouCanPayByTheFollowingOptions, - style: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.w600, - color: Color(0xff2E303A), + Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Color(0xff2E303A), fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)), + Text(getDate(widget.appo.appointmentDate), style: getTextStyle()), + Text(widget.appo.projectName, style: getTextStyle()), + Divider( + color: Colors.grey, ), - ), - getPaymentMethods(), - SizedBox(height: 12), - Text( - TranslationBase.of(context).appoPaymentConfirm, - style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.56), - ), - SizedBox(height: 12), - Container( - alignment: Alignment.center, - child: Row( - // direction: Axis.horizontal, - children: [ - Expanded( - child: DefaultButton( - TranslationBase.of(context).cancel_nocaps, - () { - Navigator.pop(context, null); - }, - color: CustomColors.accentColor, - textColor: Colors.white, + Table( + children: [ + TableRow(decoration: BoxDecoration(), children: [ + TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)), + TableCell(child: _getNormalText(widget.patientShareResponse.patientShare.toString())), + ]), + TableRow(children: [ + TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)), + TableCell(child: _getNormalText(widget.patientShareResponse.patientTaxAmount.toString())), + ]), + TableRow(children: [ + TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)), + TableCell(child: _getNormalText(widget.patientShareResponse.patientShareWithTax.toString())), + ]), + ], + ), + Divider(color: Colors.grey), + Text( + TranslationBase.of(context).YouCanPayByTheFollowingOptions, + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w600, + color: Color(0xff2E303A), + ), + ), + getPaymentMethods(), + SizedBox(height: 12), + Text( + TranslationBase.of(context).appoPaymentConfirm, + style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.56), + ), + SizedBox(height: 12), + Container( + alignment: Alignment.center, + child: Row( + // direction: Axis.horizontal, + children: [ + Expanded( + child: DefaultButton( + TranslationBase.of(context).cancel_nocaps, + () { + Navigator.pop(context, null); + }, + color: CustomColors.accentColor, + textColor: Colors.white, + ), ), - ), - mWidth(10.0), - Expanded( - child: DefaultButton( - TranslationBase.of(context).confirm, - () { - Navigator.pop(context, widget.patientShareResponse); - }, - color: CustomColors.green, - textColor: Colors.white, + mWidth(10.0), + Expanded( + child: DefaultButton( + TranslationBase.of(context).confirm, + () { + Navigator.pop(context, widget.patientShareResponse); + }, + color: CustomColors.green, + textColor: Colors.white, + ), ), - ), - ], + ], + ), ), - ), - ]), + widget.isCashPatient + ? 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: CustomColors.accentColor, + textColor: Colors.white, + ), + ], + ) + : Container(), + ], + ), ), ); } diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 49446730..c3c227c6 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -59,9 +59,9 @@ class _InsuranceUpdateState extends State with SingleTickerProv isScrollable: false, indicatorWeight: 3.0, indicatorColor: CustomColors.accentColor, - labelColor: Theme.of(context).primaryColor, + labelColor: CustomColors.textDarkColor, labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), - unselectedLabelColor: Colors.grey, + unselectedLabelColor: CustomColors.textDarkColor, tabs: [ Container( child: Center( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 804cecdd..f2a9e61d 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2908,6 +2908,7 @@ class TranslationBase { String get updateInsuranceText => localizedValues["updateInsurance"][locale.languageCode]; String get downloadReport => localizedValues["downloadReport"][locale.languageCode]; String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode]; + String get cashAmountUpdateInsurance => localizedValues["cashAmountUpdateInsurance"][locale.languageCode]; } From c7ee76d81603594b85bc0201ac674ef4c6fd4f8f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 6 Nov 2023 16:12:09 +0300 Subject: [PATCH 57/86] updates --- lib/pages/BookAppointment/BookConfirm.dart | 9 +- lib/pages/BookAppointment/BookSuccess.dart | 114 +++++++++++------- .../BookAppointment/book_reminder_page.dart | 22 ++-- 3 files changed, 93 insertions(+), 52 deletions(-) diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 42a12f5e..bb4d153a 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -455,10 +455,10 @@ class _BookConfirmState extends State { isCash = res["IsCash"]; if (isCash) { - navigateToBookSuccess(context, docObject, widget.patientShareResponse); + navigateToBookSuccess(context, docObject, widget.patientShareResponse, isCash); } else { if (isInsured && isEligible) { - navigateToBookSuccess(context, docObject, widget.patientShareResponse); + navigateToBookSuccess(context, docObject, widget.patientShareResponse, isCash); } else { if (isInsured && !isEligible) { errorMsg = TranslationBase.of(context).invalidEligibility; @@ -490,7 +490,7 @@ class _BookConfirmState extends State { widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) { widget.patientShareResponse = new PatientShareResponse.fromJson(res); GifLoaderDialogUtils.hideDialog(context); - navigateToBookSuccess(context, docObject, widget.patientShareResponse); + navigateToBookSuccess(context, docObject, widget.patientShareResponse, false); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); @@ -554,7 +554,7 @@ class _BookConfirmState extends State { Navigator.of(context).popAndPushNamed(HOME); } - Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async { + Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse, bool isCash) async { GifLoaderDialogUtils.hideDialog(context); this.sharedPref.remove(IS_LIVECARE_APPOINTMENT); Navigator.push( @@ -566,6 +566,7 @@ class _BookConfirmState extends State { appoDateFormatted: widget.appoDateFormatted, appoTimeFormatted: widget.selectedTime, dateTime: getDateTime(), + isCash: isCash, ), ), ); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 83c3fdbd..9b84a185 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -7,6 +7,8 @@ import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.da import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; +import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; @@ -17,6 +19,7 @@ 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/buttons/custom_text_button.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -36,8 +39,9 @@ class BookSuccess extends StatefulWidget { String appoDateFormatted; String appoTimeFormatted; + bool isCash; - BookSuccess({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted}); + BookSuccess({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted, this.isCash = false}); @override _BookSuccessState createState() => _BookSuccessState(); @@ -186,51 +190,79 @@ class _BookSuccessState extends State { child: Container( color: CustomColors.appBackgroudGreyColor, margin: EdgeInsets.all(14), - height: 45.0, - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Expanded( - flex: 1, - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), + height: 150.0, + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + height: 45.0, + child: CustomTextButton( + backgroundColor: CustomColors.green, + elevation: 0, + onPressed: () { + startPaymentProcess(); + projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true); + }, + child: Text(TranslationBase.of(context).payNow.toUpperCase(), + style: TextStyle( + fontSize: 18.0, + color: Colors.white, + )), + ), + ), ), - height: 45.0, - child: CustomTextButton( - backgroundColor: CustomColors.green, - elevation: 0, - onPressed: () { - startPaymentProcess(); - projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true); - }, - child: Text(TranslationBase.of(context).payNow.toUpperCase(), - style: TextStyle( - fontSize: 18.0, - color: Colors.white, - )), + mWidth(7), + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + height: 45.0, + child: CustomTextButton( + backgroundColor: Color(0xffc5272d), + elevation: 0, + onPressed: () { + navigateToHome(context); + projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false); + }, + child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)), + ), + ), ), - ), + ], ), - mWidth(7), - Expanded( - flex: 1, - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - height: 45.0, - child: CustomTextButton( - backgroundColor: Color(0xffc5272d), - elevation: 0, - onPressed: () { - navigateToHome(context); - projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false); - }, - child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)), - ), + 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: CustomColors.accentColor, + textColor: Colors.white, + ), ], ), ), diff --git a/lib/pages/BookAppointment/book_reminder_page.dart b/lib/pages/BookAppointment/book_reminder_page.dart index fb066c80..02b71ab4 100644 --- a/lib/pages/BookAppointment/book_reminder_page.dart +++ b/lib/pages/BookAppointment/book_reminder_page.dart @@ -27,8 +27,9 @@ class BookReminderPage extends StatefulWidget { String appoDateFormatted; String appoTimeFormatted; DateTime dateTime; + bool isCash; - BookReminderPage({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted, this.dateTime}); + BookReminderPage({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted, this.dateTime, this.isCash = false}); @override _BookReminderPageState createState() => _BookReminderPageState(); @@ -184,8 +185,8 @@ class _BookReminderPageState extends State { ), height: 45.0, child: CustomTextButton( - backgroundColor: CustomColors.green, - elevation: 0, + backgroundColor: CustomColors.green, + elevation: 0, onPressed: () async { print(widget.patientShareResponse.appointmentNo); showReminderDialog( @@ -215,10 +216,17 @@ class _BookReminderPageState extends State { Future navigateToBookSuccess(BuildContext context) async { Navigator.push( - context, - FadePage( - page: - BookSuccess(docObject: widget.docObject, patientShareResponse: widget.patientShareResponse, appoDateFormatted: widget.appoDateFormatted, appoTimeFormatted: widget.appoTimeFormatted))); + context, + FadePage( + page: BookSuccess( + docObject: widget.docObject, + patientShareResponse: widget.patientShareResponse, + appoDateFormatted: widget.appoDateFormatted, + appoTimeFormatted: widget.appoTimeFormatted, + isCash: widget.isCash, + ), + ), + ); } Future> requestPermissions() async { From dd0099236d6d599d8241e14703ebb299f6510544 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 7 Nov 2023 14:54:17 +0300 Subject: [PATCH 58/86] Insurance dialog added post registration --- lib/config/localized_values.dart | 1 + lib/pages/BookAppointment/BookSuccess.dart | 2 +- lib/pages/ToDoList/widgets/paymentDialog.dart | 2 +- lib/pages/login/register-info.dart | 55 ++++++++++--------- .../rate_appointment_doctor.dart | 38 +++++++++++-- lib/uitl/translations_delegate_base.dart | 1 + lib/widgets/dialogs/confirm_dialog.dart | 6 +- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- 8 files changed, 71 insertions(+), 38 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 006b5f53..63619f59 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1900,4 +1900,5 @@ const Map localizedValues = { "downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"}, "habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."}, "cashAmountUpdateInsurance": {"en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:", "ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:"}, + "validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"}, }; \ No newline at end of file diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 9b84a185..0cb858ea 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -260,7 +260,7 @@ class _BookSuccessState extends State { ); Navigator.push(context, FadePage(page: InsuranceUpdate())); }, - color: CustomColors.accentColor, + color: Color(0xff313A43), textColor: Colors.white, ), ], diff --git a/lib/pages/ToDoList/widgets/paymentDialog.dart b/lib/pages/ToDoList/widgets/paymentDialog.dart index d12b5bf8..9c0ef292 100644 --- a/lib/pages/ToDoList/widgets/paymentDialog.dart +++ b/lib/pages/ToDoList/widgets/paymentDialog.dart @@ -139,7 +139,7 @@ class _PaymentDialogState extends State { ); Navigator.push(context, FadePage(page: InsuranceUpdate())); }, - color: CustomColors.accentColor, + color: Color(0xff313A43), textColor: Colors.white, ), ], diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 1b81dbfb..f73d0913 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/models/Authentication/check_activation_code import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/countries_list.dart'; import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart'; +import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/routes.dart'; @@ -704,31 +705,35 @@ class _RegisterInfo extends State { projectViewModel.isLogin = true; projectViewModel.user = authenticatedUserObject.user; await authenticatedUserObject.getUser(getUser: true); - appointmentRateViewModel - .getIsLastAppointmentRatedList() - .then((value) => { - getToDoCount(), - GifLoaderDialogUtils.hideDialog(AppGlobal.context), - if (appointmentRateViewModel.isHaveAppointmentNotRate) - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - (r) => false) - } - else - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: LandingPage(), - ), - (r) => false) - } - }) - .catchError((err) { + appointmentRateViewModel.getIsLastAppointmentRatedList().then((value) { + getToDoCount(); + GifLoaderDialogUtils.hideDialog(AppGlobal.context); + if (appointmentRateViewModel.isHaveAppointmentNotRate) { + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: RateAppointmentDoctor(isFromRegistration: true), + ), + (r) => false); + } else { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: TranslationBase.of(context).validInsurance, + okText: TranslationBase.of(context).yes, + cancelText: TranslationBase.of(context).no, + okFunction: () { + ConfirmDialog.closeAlertDialog(context); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route route) => false, + ); + Navigator.push(context, FadePage(page: InsuranceUpdate())); + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + }).catchError((err) { print(err); //GifLoaderDialogUtils.hideDialog(context); }); diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 9c0b157e..53f080e9 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model 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/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_clinic.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; @@ -9,12 +10,18 @@ import 'package:diplomaticquarterapp/uitl/app_toast.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/dialogs/confirm_dialog.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'; class RateAppointmentDoctor extends StatefulWidget { + + bool isFromRegistration; + + RateAppointmentDoctor({Key key, this.isFromRegistration = false}) : super(key: key); + @override _RateAppointmentDoctorState createState() => _RateAppointmentDoctorState(); } @@ -158,12 +165,31 @@ class _RateAppointmentDoctorState extends State { child: DefaultButton( TranslationBase.of(context).later, () { - Navigator.pushReplacement( - context, - FadePage( - page: LandingPage(), - ), - ); + // if(widget.isFromRegistration) { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: TranslationBase.of(context).validInsurance, + okText: TranslationBase.of(context).yes, + cancelText: TranslationBase.of(context).no, + okFunction: () { + ConfirmDialog.closeAlertDialog(context); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route route) => false, + ); + Navigator.push(context, FadePage(page: InsuranceUpdate())); + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + // } else { + // Navigator.pushReplacement( + // context, + // FadePage( + // page: LandingPage(), + // ), + // ); + // } }, color: CustomColors.accentColor, textColor: Colors.white, diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index f2a9e61d..7af2010a 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2909,6 +2909,7 @@ class TranslationBase { String get downloadReport => localizedValues["downloadReport"][locale.languageCode]; String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode]; String get cashAmountUpdateInsurance => localizedValues["cashAmountUpdateInsurance"][locale.languageCode]; + String get validInsurance => localizedValues["validInsurance"][locale.languageCode]; } diff --git a/lib/widgets/dialogs/confirm_dialog.dart b/lib/widgets/dialogs/confirm_dialog.dart index 4892d09f..a6285fd2 100644 --- a/lib/widgets/dialogs/confirm_dialog.dart +++ b/lib/widgets/dialogs/confirm_dialog.dart @@ -99,9 +99,9 @@ class Mdialog extends StatelessWidget { cancelFunction(); }, child: Container( - decoration: containerRadius(CustomColors.lightGreyColor, 12), + decoration: containerRadius(CustomColors.accentColor, 12), padding: EdgeInsets.only(top: 8,bottom: 8), - child: Center(child: Texts(cancelText, variant: "caption3")), + child: Center(child: Texts(cancelText, variant: "caption3", color: CustomColors.white,)), ), ), ), @@ -110,7 +110,7 @@ class Mdialog extends StatelessWidget { child: InkWell( onTap: okFunction, child: Container( - decoration: containerRadius(CustomColors.accentColor, 12), + decoration: containerRadius(CustomColors.green, 12), padding: EdgeInsets.only(top: 8,bottom: 8), child: Center( child: Texts( diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f38ad57c..28a364e5 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // 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/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS From 7c426b90e5d33bc0dffafa850dc507d8e95f7a23 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 8 Nov 2023 12:58:27 +0300 Subject: [PATCH 59/86] updates --- lib/config/config.dart | 6 +-- lib/pages/BookAppointment/BookSuccess.dart | 54 ++++++++++--------- lib/pages/ToDoList/widgets/paymentDialog.dart | 2 +- .../AttachInsuranceCardImageDialog.dart | 49 ++++++++--------- lib/pages/insurance/insurance_page.dart | 32 +++++------ lib/pages/login/register-info.dart | 8 ++- .../rate_appointment_doctor.dart | 26 +++++---- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- 8 files changed, 100 insertions(+), 81 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index cf605410..5ab2c668 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:2018/'; - // 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/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; @@ -337,7 +337,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 11.0; +var VERSION_ID = 11.1; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 0cb858ea..3642bed4 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -239,30 +239,36 @@ class _BookSuccessState extends State { ), ], ), - 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(0xff313A43), - textColor: Colors.white, - ), + widget.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/ToDoList/widgets/paymentDialog.dart b/lib/pages/ToDoList/widgets/paymentDialog.dart index 9c0ef292..43ed4c69 100644 --- a/lib/pages/ToDoList/widgets/paymentDialog.dart +++ b/lib/pages/ToDoList/widgets/paymentDialog.dart @@ -139,7 +139,7 @@ class _PaymentDialogState extends State { ); Navigator.push(context, FadePage(page: InsuranceUpdate())); }, - color: Color(0xff313A43), + color: Color(0xffEAA118), textColor: Colors.white, ), ], diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart index 3d33825f..1ef48150 100644 --- a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -133,31 +133,32 @@ class _AttachInsuranceCardImageDialogState extends State { Navigator.pop(context), - // Navigator.push( - // context, - // FadePage( - // page: UpdateInsuranceManually( - // patientIdentificationNo: patientIdentificationID, - // patientID: patientID, - // patientMobileNumber: mobileNumber, - // ), - // ), - // ), + Navigator.push( + context, + FadePage( + page: UpdateInsuranceManually( + patientIdentificationNo: patientIdentificationID, + patientID: patientID, + patientMobileNumber: mobileNumber, + ), + ), + ), }, cancelFunction: () => {}); dialog.showAlertDialog(context); diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index f73d0913..0f8e031f 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -730,7 +730,13 @@ class _RegisterInfo extends State { ); Navigator.push(context, FadePage(page: InsuranceUpdate())); }, - cancelFunction: () => {}); + cancelFunction: () { + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route route) => false, + ); + }); dialog.showAlertDialog(context); } }).catchError((err) { diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 53f080e9..08a597ab 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -165,7 +165,7 @@ class _RateAppointmentDoctorState extends State { child: DefaultButton( TranslationBase.of(context).later, () { - // if(widget.isFromRegistration) { + if(widget.isFromRegistration) { ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: TranslationBase.of(context).validInsurance, @@ -180,16 +180,22 @@ class _RateAppointmentDoctorState extends State { ); Navigator.push(context, FadePage(page: InsuranceUpdate())); }, - cancelFunction: () => {}); + cancelFunction: () { + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LandingPage()), + (Route route) => false, + ); + }); dialog.showAlertDialog(context); - // } else { - // Navigator.pushReplacement( - // context, - // FadePage( - // page: LandingPage(), - // ), - // ); - // } + } else { + Navigator.pushReplacement( + context, + FadePage( + page: LandingPage(), + ), + ); + } }, color: CustomColors.accentColor, textColor: Colors.white, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 28a364e5..f38ad57c 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // 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/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS From b579e494c15104dd70269c790c0f1f2b221a26c0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 9 Nov 2023 10:59:19 +0300 Subject: [PATCH 60/86] updates --- .../AttachInsuranceCardImageDialog.dart | 50 +++++++++---------- lib/pages/insurance/insurance_page.dart | 32 ++++++------ 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart index 1ef48150..b0b63346 100644 --- a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -133,32 +133,32 @@ class _AttachInsuranceCardImageDialogState extends State { Navigator.pop(context), - Navigator.push( - context, - FadePage( - page: UpdateInsuranceManually( - patientIdentificationNo: patientIdentificationID, - patientID: patientID, - patientMobileNumber: mobileNumber, - ), - ), - ), + // Navigator.push( + // context, + // FadePage( + // page: UpdateInsuranceManually( + // patientIdentificationNo: patientIdentificationID, + // patientID: patientID, + // patientMobileNumber: mobileNumber, + // ), + // ), + // ), }, cancelFunction: () => {}); dialog.showAlertDialog(context); From 5c8bb241b3105f3c044673c919a63ee748559f40 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 13 Nov 2023 12:10:05 +0300 Subject: [PATCH 61/86] Next Actions handled when navigating from My Appointments to ToDo list --- .../widgets/AppointmentActions.dart | 36 ++++++++++++++----- lib/pages/ToDoList/ToDo.dart | 6 +++- .../appointment_services/GetDoctorsList.dart | 15 ++++++-- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 9a71e55c..bdab5211 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -588,14 +588,7 @@ class _AppointmentActionsState extends State { navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { if (widget.projectViewModel.isLogin) { if (model.count != 0) { - Navigator.push( - context, - FadePage( - page: ToDo( - isShowAppBar: true, - isFromMyAppointments: true, - appointment: widget.appo, - ))); + getPatientAppointmentHistoryWithAppo(); } else { AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); } @@ -611,6 +604,33 @@ class _AppointmentActionsState extends State { } } + getPatientAppointmentHistoryWithAppo() { + GifLoaderDialogUtils.showMyDialog(context); + DoctorsListService service = new DoctorsListService(); + service.getPatientAppointmentHistoryWithAppoNo(widget.appo.appointmentNo).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList.fromJson(res['AppoimentAllHistoryResultList'][0]); + Navigator.push( + context, + FadePage( + page: ToDo( + isShowAppBar: true, + isFromMyAppointments: true, + appointment: appo, + ), + ), + ); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + err != null ?? AppToast.showErrorToast(message: err); + }); + } + rateAppointment() { widget.browser = new MyInAppBrowser(); var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1'; diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 95be336f..76ed8e60 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -548,6 +548,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { case 10: confirmAppointment(appo); break; + case 15: + AppToast.showErrorToast(message: TranslationBase.of(context).upcomingPaymentPending); + break; case 20: getPatientShare(context, appo); // checkPatientNphiesEligibility(context, appo); @@ -836,7 +839,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } dataLoaded = true; if (widget.isFromMyAppointments) { - getPatientShare(context, widget.appointment); + performNextAction(widget.appointment); + widget.isFromMyAppointments = false; } }); } else { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 0a293818..8923f76e 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -614,6 +614,19 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future getPatientAppointmentHistoryWithAppoNo(int appoNo) async { + Map request; + request = {"IsActiveAppointment": true, "AppointmentNo": appoNo, "IsComingFromCOC": false}; + dynamic localRes; + await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + + return Future.value(localRes); + } + Future getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context, {bool isForCOC = false}) async { Map request; @@ -1843,6 +1856,4 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - - } From 6dd5fda997d6cbb1e56246b9a0cca5402b719143 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 13 Nov 2023 12:26:05 +0300 Subject: [PATCH 62/86] Location check in implementing --- lib/config/localized_values.dart | 1 + lib/pages/BookAppointment/QRCode.dart | 29 ++++++++++++++++++++++++ lib/uitl/translations_delegate_base.dart | 1 + 3 files changed, 31 insertions(+) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 63619f59..cc91b2af 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1901,4 +1901,5 @@ const Map localizedValues = { "habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."}, "cashAmountUpdateInsurance": {"en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:", "ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:"}, "validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"}, + "checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"}, }; \ No newline at end of file diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index e9d88d7b..99f5ce3a 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -17,6 +17,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; @@ -49,6 +50,7 @@ class _QRCodeState extends State { BuildContext _context; ProjectViewModel projectViewModel; + LocationUtils locationUtils; @override void initState() { @@ -90,6 +92,15 @@ class _QRCodeState extends State { } else {} } + startLocationCheckIn() async { + String onlineCheckInQRCode = ""; + locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); + locationUtils.getCurrentLocation(callBack: (value) { + print(value); + // sendNfcCheckInRequest(onlineCheckInQRCode); + }); + } + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -228,6 +239,24 @@ class _QRCodeState extends State { ), ); + optionsList.add( + InkWell( + onTap: () { + if (projectViewModel.havePrivilege(79)) { + startLocationCheckIn(); + } + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).checkInViaLocation, + imagePath: 'qr_code.svg', + subTitle: "", + isEnable: projectViewModel.havePrivilege(79), + width: 80.0, + height: 80.0, + ), + ), + ); + return optionsList; } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 7af2010a..ae885739 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2910,6 +2910,7 @@ class TranslationBase { String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode]; String get cashAmountUpdateInsurance => localizedValues["cashAmountUpdateInsurance"][locale.languageCode]; String get validInsurance => localizedValues["validInsurance"][locale.languageCode]; + String get checkInViaLocation => localizedValues["checkInViaLocation"][locale.languageCode]; } From 245716119e9b63c0973089e6f6b0bd662f31f0a7 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 13 Nov 2023 16:15:10 +0300 Subject: [PATCH 63/86] Location based Check In implemented --- lib/config/localized_values.dart | 1 + .../privilege/ProjectDetailListModel.dart | 32 +++++++++++++++++++ lib/core/service/privilege_service.dart | 8 +++++ lib/core/viewModels/project_view_model.dart | 9 ++++++ lib/pages/BookAppointment/QRCode.dart | 16 +++++++--- lib/splashPage.dart | 1 + lib/uitl/translations_delegate_base.dart | 1 + lib/uitl/utils.dart | 30 +++++++++++++++++ lib/widgets/in_app_browser/InAppBrowser.dart | 4 +-- 9 files changed, 96 insertions(+), 6 deletions(-) create mode 100644 lib/core/model/privilege/ProjectDetailListModel.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index cc91b2af..3f3074d3 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1902,4 +1902,5 @@ const Map localizedValues = { "cashAmountUpdateInsurance": {"en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:", "ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:"}, "validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"}, "checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"}, + "locationCheckInError": {"en": "Please make sure that you're within the hospital location to perform online check-in.", "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."}, }; \ No newline at end of file diff --git a/lib/core/model/privilege/ProjectDetailListModel.dart b/lib/core/model/privilege/ProjectDetailListModel.dart new file mode 100644 index 00000000..b8241797 --- /dev/null +++ b/lib/core/model/privilege/ProjectDetailListModel.dart @@ -0,0 +1,32 @@ +class ProjectDetailListModel { + int projectID; + String latitude; + String longitude; + int geofenceRadius; + String checkInQrCode; + + ProjectDetailListModel( + {this.projectID, + this.latitude, + this.longitude, + this.geofenceRadius, + this.checkInQrCode}); + + ProjectDetailListModel.fromJson(Map json) { + projectID = json['ProjectID']; + latitude = json['Latitude']; + longitude = json['Longitude']; + geofenceRadius = json['GeofenceRadius']; + checkInQrCode = json['CheckInQrCode']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['GeofenceRadius'] = this.geofenceRadius; + data['CheckInQrCode'] = this.checkInQrCode; + return data; + } +} diff --git a/lib/core/service/privilege_service.dart b/lib/core/service/privilege_service.dart index 137bfca6..ab0cee97 100644 --- a/lib/core/service/privilege_service.dart +++ b/lib/core/service/privilege_service.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; @@ -8,6 +9,7 @@ class PrivilegeService extends BaseService { List privilegeModelList = []; List vidaPlusProjectListModel = []; List hMCProjectListModel = []; + List projectDetailListModel = []; Future getPrivilege() async { Map body = Map(); @@ -28,6 +30,12 @@ class PrivilegeService extends BaseService { hMCProjectListModel.add(HMCProjectListModel.fromJson(item)); }); } + + if (response['ProjectDetailList'].length != 0) { + response['ProjectDetailList'].forEach((item) { + projectDetailListModel.add(ProjectDetailListModel.fromJson(item)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index 3a47c753..aff0faff 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -62,6 +63,7 @@ class ProjectViewModel extends BaseViewModel { List privilegeChildUser = List(); List _vidaPlusProjectListModel = List(); List _hMCProjectListModel = []; + List _projectDetailListModel = []; List get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser; @@ -69,6 +71,8 @@ class ProjectViewModel extends BaseViewModel { List get hMCProjectListModel => _hMCProjectListModel; + List get projectDetailListModel => _projectDetailListModel; + List selectedBodyPartList = []; StreamSubscription subscription; @@ -134,6 +138,11 @@ class ProjectViewModel extends BaseViewModel { notifyListeners(); } + setProjectsDetailList(List projectDetailListModel) { + _projectDetailListModel = projectDetailListModel; + notifyListeners(); + } + setHMCProjectList(List hMCProjectListModel) { _hMCProjectListModel = hMCProjectListModel; notifyListeners(); diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 99f5ce3a..a4355187 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -3,6 +3,7 @@ import 'dart:typed_data'; import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; @@ -19,6 +20,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/location_util.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/buttons/custom_text_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; @@ -51,6 +53,7 @@ class _QRCodeState extends State { ProjectViewModel projectViewModel; LocationUtils locationUtils; + ProjectDetailListModel projectDetailListModel; @override void initState() { @@ -93,11 +96,16 @@ class _QRCodeState extends State { } startLocationCheckIn() async { - String onlineCheckInQRCode = ""; locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); locationUtils.getCurrentLocation(callBack: (value) { - print(value); - // sendNfcCheckInRequest(onlineCheckInQRCode); + projectDetailListModel = Utils.getProjectDetailObj(projectViewModel, widget.appointment.projectID); + double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude), double.parse(projectDetailListModel.longitude)).ceilToDouble() * 1000; + print(dist); + if (dist <= projectDetailListModel.geofenceRadius) { + sendNfcCheckInRequest(projectDetailListModel.checkInQrCode); + } else { + AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError); + } }); } @@ -248,7 +256,7 @@ class _QRCodeState extends State { }, child: MedicalProfileItem( title: TranslationBase.of(context).checkInViaLocation, - imagePath: 'qr_code.svg', + imagePath: 'location.svg', subTitle: "", isEnable: projectViewModel.havePrivilege(79), width: 80.0, diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 8ffef7a4..7d6aa06f 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -56,6 +56,7 @@ class _SplashScreenState extends State { projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); projectProvider.setVidaPlusProjectList(_privilegeService.vidaPlusProjectListModel); projectProvider.setHMCProjectList(_privilegeService.hMCProjectListModel); + projectProvider.setProjectsDetailList(_privilegeService.projectDetailListModel); AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en"); var themeNotifier = Provider.of(context, listen: false); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index ae885739..e1f1ac74 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2911,6 +2911,7 @@ class TranslationBase { String get cashAmountUpdateInsurance => localizedValues["cashAmountUpdateInsurance"][locale.languageCode]; String get validInsurance => localizedValues["validInsurance"][locale.languageCode]; String get checkInViaLocation => localizedValues["checkInViaLocation"][locale.languageCode]; + String get locationCheckInError => localizedValues["locationCheckInError"][locale.languageCode]; } diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index a39029b8..77522108 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -10,6 +10,7 @@ import 'package:connectivity/connectivity.dart'; import 'package:crypto/crypto.dart' as crypto; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; @@ -45,6 +46,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:google_api_availability/google_api_availability.dart'; +import 'dart:math' show asin, cos, pi, pow, sin, sqrt; // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; import 'package:provider/provider.dart'; @@ -784,6 +786,24 @@ class Utils { return false; } + static double distance(double lat1, double lon1, double lat2, double lon2) { + const r = 6372.8; // Earth radius in kilometers + + final dLat = _toRadians(lat2 - lat1); + final dLon = _toRadians(lon2 - lon1); + final lat1Radians = _toRadians(lat1); + final lat2Radians = _toRadians(lat2); + + final a = _haversin(dLat) + cos(lat1Radians) * cos(lat2Radians) * _haversin(dLon); + final c = 2 * asin(sqrt(a)); + + return r * c; + } + + static double _toRadians(double degrees) => degrees * pi / 180; + + static double _haversin(double radians) => pow(sin(radians / 2), 2); + static Widget tableColumnValueWithUnderLine(String text, {bool isLast = false, bool isCapitable = true}) { return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -832,6 +852,16 @@ class Utils { return isHMCProject; } + static ProjectDetailListModel getProjectDetailObj(ProjectViewModel projectViewModel, int projectID) { + ProjectDetailListModel projectDetailListModel; + projectViewModel.projectDetailListModel.forEach((element) { + if (element.projectID == projectID) { + projectDetailListModel = element; + } + }); + return projectDetailListModel; + } + static String generateSignature() {} } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f38ad57c..28a364e5 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // 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/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS From f8fb33674054b1f2031544ac43981efadc7192df Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 16 Nov 2023 11:33:24 +0300 Subject: [PATCH 64/86] Location checkin privilege applied --- lib/config/config.dart | 6 +++--- lib/pages/BookAppointment/BookSuccess.dart | 1 + lib/pages/BookAppointment/QRCode.dart | 8 ++++---- lib/pages/ToDoList/ToDo.dart | 3 +++ lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 5ab2c668..177390af 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:2018/'; - 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/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; @@ -337,7 +337,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 11.1; +var VERSION_ID = 11.2; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 3642bed4..0a3d90ef 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -174,6 +174,7 @@ class _BookSuccessState extends State { elevation: 0, onPressed: () { // navigateToQR(context); + GifLoaderDialogUtils.showMyDialog(context); getAppoQR(context); }, child: Text(TranslationBase.of(context).viewQR.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)), diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index a4355187..a6d55dce 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -250,7 +250,7 @@ class _QRCodeState extends State { optionsList.add( InkWell( onTap: () { - if (projectViewModel.havePrivilege(79)) { + if (projectViewModel.havePrivilege(102)) { startLocationCheckIn(); } }, @@ -258,9 +258,9 @@ class _QRCodeState extends State { title: TranslationBase.of(context).checkInViaLocation, imagePath: 'location.svg', subTitle: "", - isEnable: projectViewModel.havePrivilege(79), - width: 80.0, - height: 80.0, + isEnable: projectViewModel.havePrivilege(102), + width: 70.0, + height: 70.0, ), ), ); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 76ed8e60..c4e4bcb9 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -545,6 +545,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { performNextAction(AppoitmentAllHistoryResultList appo) { switch (appo.nextAction) { + case 0: + // getAppoQR(context, appo); + break; case 10: confirmAppointment(appo); break; diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 28a364e5..f38ad57c 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // 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/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS From 1ecb8ebfe9675620e29f9dd90da453b1f107a28e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 21 Nov 2023 17:07:47 +0300 Subject: [PATCH 65/86] updated to stores version 11.3 --- lib/config/config.dart | 4 +- .../service/ancillary_orders_service.dart | 8 +- lib/core/service/client/base_app_client.dart | 8 +- .../ancillary_orders_view_model.dart | 9 +- .../ancillaryOrdersDetails.dart | 211 +++++++++--------- .../MyAppointments/models/BookedButtons.dart | 3 +- .../widgets/AppointmentActions.dart | 8 +- .../fragments/home_page_fragment2.dart | 3 +- lib/pages/landing/home_page_2.dart | 7 +- lib/pages/landing/widgets/services_view.dart | 5 +- .../appointment_services/GetDoctorsList.dart | 14 +- .../clinic_services/get_clinic_service.dart | 61 +---- lib/splashPage.dart | 9 +- pubspec.yaml | 2 +- 14 files changed, 169 insertions(+), 183 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 177390af..0eeacbad 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -38,6 +38,8 @@ var BASE_URL = 'https://hmgwebservices.com/'; var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; +var PHARMACY_REDIRECT_URL = 'https://bit.ly/AlhabibPharmacy'; + // Pharmacy VidaPlus URLs // var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; @@ -337,7 +339,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 11.2; +var VERSION_ID = 11.3; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/core/service/ancillary_orders_service.dart b/lib/core/service/ancillary_orders_service.dart index 631f17ff..dcb34aad 100644 --- a/lib/core/service/ancillary_orders_service.dart +++ b/lib/core/service/ancillary_orders_service.dart @@ -54,15 +54,18 @@ class AncillaryOrdersService extends BaseService { return Future.value(localRes); } - Future getOrdersDetails(appointmentNo, orderNo, projectID) async { + Future getOrdersDetails(appointmentNo, orderNo, projectID) async { Map body = Map(); body['AppointmentNo_Vida'] = appointmentNo; body['OrderNo'] = orderNo; body['ProjectID'] = projectID; hasError = false; + + dynamic localRes; + await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS, onSuccess: (dynamic response, int statusCode) { + localRes = response; _ancillaryProcLists = []; - response['AncillaryOrderProcList'].forEach((item) { ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item)); }); @@ -70,5 +73,6 @@ class AncillaryOrdersService extends BaseService { hasError = true; super.error = error; }, body: body); + return Future.value(localRes); } } diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index e2fbe537..8c9118c8 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -90,7 +90,7 @@ class BaseAppClient { : IS_DENTAL_ALLOWED_BACKEND; } - body['DeviceTypeID'] = Platform.isIOS ? 1 : 2; + body['DeviceTypeID'] = Platform.isIOS ? 1 : await Utils.isGoogleServicesAvailable() ? 2 : 3; if (!body.containsKey('IsPublicRequest')) { // if (!body.containsKey('PatientType')) { @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 2621536; //3844083 + // body['PatientID'] = 1048710; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 @@ -159,11 +159,11 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); - // if (AppGlobal.isNetworkDebugEnabled) { + if (AppGlobal.isNetworkDebugEnabled) { print("URL : $url"); final jsonBody = json.encode(body); print(jsonBody); - // } + } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); diff --git a/lib/core/viewModels/ancillary_orders_view_model.dart b/lib/core/viewModels/ancillary_orders_view_model.dart index 0d846313..4cc4628f 100644 --- a/lib/core/viewModels/ancillary_orders_view_model.dart +++ b/lib/core/viewModels/ancillary_orders_view_model.dart @@ -10,11 +10,10 @@ class AnciallryOrdersViewModel extends BaseViewModel { bool hasError = false; AncillaryOrdersService _ancillaryService = locator(); - List get ancillaryLists => - _ancillaryService.ancillaryLists; - List get ancillaryListsDetails => - _ancillaryService.ancillaryProcLists; + List get ancillaryLists => _ancillaryService.ancillaryLists; + + List get ancillaryListsDetails => _ancillaryService.ancillaryProcLists; Future getOrders() async { hasError = false; @@ -30,7 +29,7 @@ class AnciallryOrdersViewModel extends BaseViewModel { Future getOrdersDetails(appointmentNo, orderNo, projectID) async { hasError = false; setState(ViewState.Busy); - await _ancillaryService.getOrdersDetails(appointmentNo, orderNo, projectID ); + await _ancillaryService.getOrdersDetails(appointmentNo, orderNo, projectID); if (_ancillaryService.hasError) { error = _ancillaryService.error; setState(ViewState.ErrorLocal); diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 547d8467..8e224320 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -2,6 +2,7 @@ import 'dart:io'; import "package:collection/collection.dart"; import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; @@ -24,6 +25,7 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:flutter_svg/flutter_svg.dart'; class AnicllaryOrdersDetails extends StatefulWidget { final dynamic appoNo; @@ -47,10 +49,15 @@ class _AnicllaryOrdersState extends State with SingleTic List selectedProcList = []; + List _ancillaryProcLists = []; + String tamaraPaymentStatus; String tamaraOrderID; void initState() { + WidgetsBinding.instance.addPostFrameCallback((_) { + getAncillaryOrderDetails(); + }); super.initState(); } @@ -58,12 +65,21 @@ class _AnicllaryOrdersState extends State with SingleTic super.dispose(); } - void getAncillaryOrderDetails(AnciallryOrdersViewModel model) { + void getAncillaryOrderDetails() { GifLoaderDialogUtils.showMyDialog(context); - model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((value) { - addToSelectedProcedures(model); + AncillaryOrdersService ancillaryOrdersService = new AncillaryOrdersService(); + ancillaryOrdersService.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((response) { + _ancillaryProcLists = []; + selectedProcList = []; + if (response['AncillaryOrderProcList'] != null && response['AncillaryOrderProcList'].length != 0) { + response['AncillaryOrderProcList'].forEach((item) { + _ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item)); + }); + addToSelectedProcedures(); + } GifLoaderDialogUtils.hideDialog(context); }).catchError((err) { + AppToast.showErrorToast(message: err.toString()); GifLoaderDialogUtils.hideDialog(context); }); } @@ -73,83 +89,74 @@ class _AnicllaryOrdersState extends State with SingleTic projectViewModel = Provider.of(context); localContext = context; AppGlobal.context = context; - return BaseView( - onModelReady: (model) { - // getAncillaryOrderDetails(model); - model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((value) { - addToSelectedProcedures(model); - }); - }, - builder: (_, model, widget) => AppScaffold( - isShowAppBar: true, - showNewAppBar: true, - showNewAppBarTitle: true, - baseViewModel: model, - appBarTitle: TranslationBase.of(context).anicllaryOrders, - body: SingleChildScrollView( - padding: EdgeInsets.all(12), - child: model.ancillaryListsDetails.length > 0 - ? Column(children: [ - getPatientInfo(model), - getAncillaryDetails(model), - ]) - : getNoDataWidget(context), - ), - bottomSheet: model.ancillaryListsDetails.length > 0 - ? Container( - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.5), - spreadRadius: 5, - blurRadius: 7, - offset: Offset(0, 3), // changes position of shadow - ), - ], - ), - padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15), - width: double.infinity, - // color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - SizedBox(height: 12), - Text( - TranslationBase.of(context).YouCanPayByTheFollowingOptions, - style: TextStyle( - fontSize: 16.0, - fontWeight: FontWeight.w600, - color: Color(0xff2B353E), - letterSpacing: -0.64, - ), - ), - SizedBox( - width: MediaQuery.of(context).size.width * 0.75, - child: getPaymentMethods(), - ), - _amountView(TranslationBase.of(context).patientShareTotalToDo, getTotalValue() + " " + TranslationBase.of(context).sar, isBold: true, isTotal: true), - SizedBox(height: 12), - DefaultButton( - TranslationBase.of(context).payNow.toUpperCase(), - selectedProcList.length > 0 - ? () { - if (getTotalValue() != "0.00") { - makePayment(model); - } else { - autoGenerateInvoice(); - } - } - : null, - color: CustomColors.green, - disabledColor: CustomColors.grey2, - ), - ], - ), + return AppScaffold( + isShowAppBar: true, + showNewAppBar: true, + showNewAppBarTitle: true, + appBarTitle: TranslationBase.of(context).anicllaryOrders, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: _ancillaryProcLists.isNotEmpty + ? Column( + children: [ + getPatientInfo(), + getAncillaryDetails(), + ], ) - : Container(), + : getNoDataWidget(context), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 5, + blurRadius: 7, + offset: Offset(0, 3), // changes position of shadow + ), + ], + ), + padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15), + width: double.infinity, + // color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox(height: 12), + Text( + TranslationBase.of(context).YouCanPayByTheFollowingOptions, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.64, + ), + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.75, + child: getPaymentMethods(), + ), + _amountView(TranslationBase.of(context).patientShareTotalToDo, getTotalValue() + " " + TranslationBase.of(context).sar, isBold: true, isTotal: true), + SizedBox(height: 12), + DefaultButton( + TranslationBase.of(context).payNow.toUpperCase(), + selectedProcList.length > 0 + ? () { + if (getTotalValue() != "0.00") { + makePayment(); + } else { + autoGenerateInvoice(); + } + } + : null, + color: selectedProcList.length > 0 ? CustomColors.green : CustomColors.grey2, + disabledColor: CustomColors.grey2, + ), + ], + ), ), ); } @@ -184,7 +191,7 @@ class _AnicllaryOrdersState extends State with SingleTic ); } - Widget getPatientInfo(AnciallryOrdersViewModel model) { + Widget getPatientInfo() { return Padding( child: Column( children: [ @@ -277,7 +284,7 @@ class _AnicllaryOrdersState extends State with SingleTic ), mWidth(3), Text( - model.ancillaryListsDetails[0].appointmentNo.toString(), + _ancillaryProcLists[0].appointmentNo.toString(), style: TextStyle( fontWeight: FontWeight.w600, fontSize: 12, @@ -300,7 +307,7 @@ class _AnicllaryOrdersState extends State with SingleTic ), mWidth(3), Text( - model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList[0].orderNo.toString(), + _ancillaryProcLists[0].ancillaryOrderProcDetailsList[0].orderNo.toString(), style: TextStyle( fontWeight: FontWeight.w600, fontSize: 12, @@ -325,7 +332,7 @@ class _AnicllaryOrdersState extends State with SingleTic mWidth(3), Expanded( child: Text( - model.ancillaryListsDetails[0].companyName.toString(), + _ancillaryProcLists[0].companyName.toString(), overflow: TextOverflow.clip, style: TextStyle( fontWeight: FontWeight.w600, @@ -350,7 +357,7 @@ class _AnicllaryOrdersState extends State with SingleTic ), mWidth(3), Text( - model.ancillaryListsDetails[0].insurancePolicyNo.toString(), + _ancillaryProcLists[0].insurancePolicyNo.toString(), style: TextStyle( fontWeight: FontWeight.w600, fontSize: 12, @@ -370,8 +377,8 @@ class _AnicllaryOrdersState extends State with SingleTic ); } - Widget getAncillaryDetails(model) { - Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList, (obj) => obj.procedureCategoryName); + Widget getAncillaryDetails() { + Map newMap = groupBy(_ancillaryProcLists[0].ancillaryOrderProcDetailsList, (obj) => obj.procedureCategoryName); return Padding(padding: EdgeInsets.only(top: 0, bottom: 200), child: getHeaderDetails(newMap)); } @@ -493,21 +500,21 @@ class _AnicllaryOrdersState extends State with SingleTic return tableRow; } - makePayment(AnciallryOrdersViewModel model) { + makePayment() { showDraggableDialog( context, PaymentMethod( onSelectedMethod: (String method, [String selectedInstallmentPlan]) { selectedPaymentMethod = method; this.selectedInstallmentPlan = selectedInstallmentPlan; - openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, model, selectedInstallmentPlan); + openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan); }, patientShare: double.parse(getTotalValue()), isFromAdvancePayment: !projectViewModel.havePrivilege(94), )); } - openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo, AnciallryOrdersViewModel model, [String selectedInstallmentPlan]) { + openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo, [String selectedInstallmentPlan]) { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID); @@ -529,10 +536,10 @@ class _AnicllaryOrdersState extends State with SingleTic // Need to get new Service ID from Ayman for Ancillary Tamara "", context, - model.ancillaryListsDetails[0].appointmentDate, - model.ancillaryListsDetails[0].appointmentNo, - model.ancillaryListsDetails[0].clinicID, - model.ancillaryListsDetails[0].doctorID, + _ancillaryProcLists[0].appointmentDate, + _ancillaryProcLists[0].appointmentNo, + _ancillaryProcLists[0].clinicID, + _ancillaryProcLists[0].doctorID, selectedInstallmentPlan); } @@ -717,16 +724,18 @@ class _AnicllaryOrdersState extends State with SingleTic } } - addToSelectedProcedures(AnciallryOrdersViewModel model) { - if (model.ancillaryListsDetails.isNotEmpty) { + addToSelectedProcedures() { + if (_ancillaryProcLists.isNotEmpty) { selectedProcList.clear(); - model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList.forEach((element) { - if (!isProcedureDisabled(element)) { - selectedProcList.add(element); - } - }); - setState(() {}); + if (_ancillaryProcLists[0].ancillaryOrderProcDetailsList.isNotEmpty) { + _ancillaryProcLists[0].ancillaryOrderProcDetailsList.forEach((element) { + if (!isProcedureDisabled(element)) { + selectedProcList.add(element); + } + }); + } else {} } + setState(() {}); } String getInsuranceText(value) { diff --git a/lib/pages/MyAppointments/models/BookedButtons.dart b/lib/pages/MyAppointments/models/BookedButtons.dart index bec7f39c..66e4366f 100644 --- a/lib/pages/MyAppointments/models/BookedButtons.dart +++ b/lib/pages/MyAppointments/models/BookedButtons.dart @@ -38,6 +38,7 @@ class BookedButtons { "subtitle": TranslationBase.of(AppGlobal.context).location, "icon": "hosp_location.svg", "caller": "navigateToProject", - } + }, + {"title": TranslationBase.of(AppGlobal.context).online, "subtitle": TranslationBase.of(AppGlobal.context).payment, "icon": "online_payment.svg", "caller": "goToTodoList"} ]; } diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index bdab5211..deee5a5e 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -587,11 +587,11 @@ class _AppointmentActionsState extends State { navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { if (widget.projectViewModel.isLogin) { - if (model.count != 0) { + // if (model.count != 0) { getPatientAppointmentHistoryWithAppo(); - } else { - AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); - } + // } else { + // AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); + // } } else { Navigator.push( context, diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 207310b4..c25e9fd0 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -417,7 +417,8 @@ class _HomePageFragment2State extends State { flex: 1, child: InkWell( onTap: () { - if (projectViewModel.havePrivilege(100)) widget.onPharmacyClick(); + if (projectViewModel.havePrivilege(100)) + widget.onPharmacyClick(); }, child: Stack(children: [ Container( diff --git a/lib/pages/landing/home_page_2.dart b/lib/pages/landing/home_page_2.dart index 7374d273..a8b3a531 100644 --- a/lib/pages/landing/home_page_2.dart +++ b/lib/pages/landing/home_page_2.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -11,6 +12,8 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; +import 'package:url_launcher/url_launcher_string.dart'; import 'fragments/home_page_fragment2.dart'; import 'landing_page_pharmcy.dart'; @@ -48,7 +51,9 @@ class _HomePageState2 extends State { widget.onLoginClick(); }, onPharmacyClick: () { - getPharmacyToken(model); + // getPharmacyToken(model); + Uri uri = Uri.parse(PHARMACY_REDIRECT_URL); + launchUrl(uri, mode: LaunchMode.externalApplication); }, onMedicalFileClick: () { widget.onMedicalFileClick(); diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart index f1753f3c..84682c64 100644 --- a/lib/pages/landing/widgets/services_view.dart +++ b/lib/pages/landing/widgets/services_view.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:auto_size_text/auto_size_text.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -209,7 +210,9 @@ class ServicesView extends StatelessWidget { Navigator.push(context, FadePage(page: CMCPage())); locator().hmgServices.logServiceName('comprehensive medical checkup'); } else if (hmgServices.action == 5) { - getPharmacyToken(context); + // getPharmacyToken(context); + Uri uri = Uri.parse(PHARMACY_REDIRECT_URL); + launchUrl(uri, mode: LaunchMode.externalApplication); locator().hmgServices.logServiceName('al habib pharmacy'); } else if (hmgServices.action == 6) { Navigator.push(context, FadePage(page: MedicalProfilePageNew())); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 8923f76e..052078bf 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -48,16 +48,16 @@ class DoctorsListService extends BaseService { } var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - Request req = appGlobal.getPublicRequest(); + // Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, - "IPAdress": "10.20.10.20", - "VersionID": req.VersionID, - "Channel": req.Channel, - "generalid": 'Cs2020@2016\$2958', + // "LanguageID": languageID == 'ar' ? 1 : 2, + // "IPAdress": "10.20.10.20", + // "VersionID": req.VersionID, + // "Channel": req.Channel, + // "generalid": 'Cs2020@2016\$2958', "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "TokenID": "", - "DeviceTypeID": req.DeviceTypeID, + // "DeviceTypeID": req.DeviceTypeID, "SessionID": "YckwoXhUmWBsnHKEKig", "ClinicID": clinicID, "ProjectID": projectID, diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 8bf3a0ec..9f75f8fa 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -18,19 +18,7 @@ class ClinicListService extends BaseService { double long; Future getClinicsList(context) async { - Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - Request req = appGlobal.getPublicRequest(); - request = { - "LanguageID": languageID == 'ar' ? 1 : 2, - "IPAdress": "10.20.10.20", - "VersionID": req.VersionID, - "Channel": req.Channel, - "generalid": 'Cs2020@2016\$2958', - "TokenID": "", - "DeviceTypeID": req.DeviceTypeID, - "SessionID": null - }; + Map request = {}; dynamic localRes; @@ -44,22 +32,7 @@ class ClinicListService extends BaseService { } Future getActiveAppointmentNo(context) async { - Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - Request req = appGlobal.getPublicRequest(); - request = { - // "LanguageID": languageID == 'ar' ? 1 : 2, - // "IPAdress": "10.20.10.20", - // "VersionID": req.VersionID, - // "Channel": req.Channel, - // "generalid": 'Cs2020@2016\$2958', - // "PatientOutSA": user.outSA, - "IsActiveAppointment": true, - // "DeviceTypeID": req.DeviceTypeID, - // "PatientType": user.patientType, - // "PatientTypeID": user.patientType, - // "SessionID": null - }; + Map request = {}; dynamic localRes; @@ -72,19 +45,7 @@ class ClinicListService extends BaseService { } Future getProjectsList(context) async { - Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - Request req = appGlobal.getPublicRequest(); - request = { - "LanguageID": languageID == 'ar' ? 1 : 2, - "IPAdress": "10.20.10.20", - "VersionID": req.VersionID, - "Channel": req.Channel, - "generalid": 'Cs2020@2016\$2958', - "TokenID": "", - "DeviceTypeID": req.DeviceTypeID, - "SessionID": null - }; + Map request = {}; dynamic localRes; @@ -113,9 +74,9 @@ class ClinicListService extends BaseService { "SelectedDate": "", "SelectedTime": "", "License": true, - "VersionID": 5.6, - "Channel": 3, - "LanguageID": languageID == 'ar' ? 1 : 2, + // "VersionID": 5.6, + // "Channel": 3, + // "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "generalid": "Cs2020@2016\$2958", "SessionID": null, @@ -155,11 +116,11 @@ class ClinicListService extends BaseService { request = { "ChiefComplaintID": chiefComplaintID, "ProjectID": projectID, - "VersionID": 5.6, - "Channel": 3, - "LanguageID": languageID == 'ar' ? 1 : 2, - "IPAdress": req.IPAdress, - "generalid": req.generalid, + // "VersionID": 5.6, + // "Channel": 3, + // "LanguageID": languageID == 'ar' ? 1 : 2, + // "IPAdress": req.IPAdress, + // "generalid": req.generalid, "SessionID": null, "isDentalAllowedBackend": true, "Latitude": lat != null ? lat.toString() : "0.0", diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 7d6aa06f..2c74a963 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:convert'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; @@ -32,8 +33,8 @@ class _SplashScreenState extends State { super.initState(); Timer( Duration(seconds: 1, milliseconds: 500), - () { - loadPrivilege().then((value) { + () async { + await loadPrivilege().then((value) { Navigator.of(context).pushReplacement( MaterialPageRoute( builder: (BuildContext context) => LandingPage(), @@ -44,8 +45,8 @@ class _SplashScreenState extends State { ); AppSharedPreferences().getAll().then((value) { - // debugPrint("ALL SHARED PREFERENCES!!!!!"); - // debugPrint(jsonEncode(value)); + debugPrint("ALL SHARED PREFERENCES!!!!!"); + debugPrint(jsonEncode(value)); }); } diff --git a/pubspec.yaml b/pubspec.yaml index ae5a6c0a..2494a580 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.029+4050029 +version: 4.5.73+1 environment: sdk: ">=2.7.0 <3.0.0" From cb9ced27c2ec9bfe80b500608bd3e1f63fd9bede Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 23 Nov 2023 10:45:53 +0300 Subject: [PATCH 66/86] updates --- lib/pages/BookAppointment/BookSuccess.dart | 2 +- lib/services/clinic_services/get_clinic_service.dart | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 0a3d90ef..62708472 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -191,7 +191,7 @@ class _BookSuccessState extends State { child: Container( color: CustomColors.appBackgroudGreyColor, margin: EdgeInsets.all(14), - height: 150.0, + height: widget.isCash ? 150.0 : 50, child: Column( children: [ Row( diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 9f75f8fa..ce9d511f 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -34,6 +34,10 @@ class ClinicListService extends BaseService { Future getActiveAppointmentNo(context) async { Map request = {}; + request = { + "IsActiveAppointment": true, + }; + dynamic localRes; await baseAppClient.post(GET_ACTIVE_APPOINTMENTS_LIST_URL, onSuccess: (response, statusCode) async { From ded6e02663f4efdde3812318b6f25a51df919f3b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 26 Nov 2023 15:05:45 +0300 Subject: [PATCH 67/86] CheckIn By Param added --- lib/pages/BookAppointment/QRCode.dart | 10 +++++----- lib/services/appointment_services/GetDoctorsList.dart | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index a6d55dce..2c2cc83d 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -77,7 +77,7 @@ class _QRCodeState extends State { Future.delayed(const Duration(milliseconds: 500), () { showNfcReader(context, onNcfScan: (String nfcId) { Future.delayed(const Duration(milliseconds: 100), () { - sendNfcCheckInRequest(nfcId); + sendNfcCheckInRequest(nfcId, 1); locator().todoList.to_do_list_nfc(widget.appointment); }); }, onCancel: () { @@ -90,7 +90,7 @@ class _QRCodeState extends State { startQRCodeScan() async { String onlineCheckInQRCode = (await BarcodeScanner.scan())?.rawContent; if (onlineCheckInQRCode != "") { - sendNfcCheckInRequest(onlineCheckInQRCode); + sendNfcCheckInRequest(onlineCheckInQRCode, 2); locator().todoList.to_do_list_nfc(widget.appointment); } else {} } @@ -102,7 +102,7 @@ class _QRCodeState extends State { double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude), double.parse(projectDetailListModel.longitude)).ceilToDouble() * 1000; print(dist); if (dist <= projectDetailListModel.geofenceRadius) { - sendNfcCheckInRequest(projectDetailListModel.checkInQrCode); + sendNfcCheckInRequest(projectDetailListModel.checkInQrCode, 3); } else { AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError); } @@ -341,12 +341,12 @@ class _QRCodeState extends State { return docSpeciality; } - sendNfcCheckInRequest(String nfcId) { + sendNfcCheckInRequest(String nfcId, int checkInBy) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, context).then((res) { + service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, checkInBy, context).then((res) { print(res); GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 052078bf..a7482eaa 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1553,13 +1553,14 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, BuildContext context) async { + Future sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, int checkInBy, BuildContext context) async { Map request; request = { "AppointmentNo": appointmentNo, "NFC_Code": nfcCode, "ProjectID": projectId, + "CheckinBy": checkInBy }; dynamic localRes; await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async { From beb3453ff5e57842c0ba0ee52929f50ee261eb40 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 27 Nov 2023 14:09:54 +0300 Subject: [PATCH 68/86] updates --- lib/core/model/rate/appoitment_rated.dart | 4 ++-- lib/uitl/push-notification-handler.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/core/model/rate/appoitment_rated.dart b/lib/core/model/rate/appoitment_rated.dart index 95358b23..2f0d0dae 100644 --- a/lib/core/model/rate/appoitment_rated.dart +++ b/lib/core/model/rate/appoitment_rated.dart @@ -26,12 +26,12 @@ class AppoitmentRated { String arrivedOn; int editedBy; String editedOn; - Null doctorName; + String doctorName; String doctorNameN; String statusDesc; String statusDescN; bool vitalStatus; - Null vitalSignAppointmentNo; + dynamic vitalSignAppointmentNo; int episodeID; String doctorTitle; bool isAppoitmentLiveCare; diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 3e765c17..03e6ec29 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -336,7 +336,7 @@ class PushNotificationHandler { onToken(String token) async { print("Push Notification Token: " + token); - AppSharedPreferences().setString(PUSH_TOKEN, token); + await AppSharedPreferences().setString(PUSH_TOKEN, token); DEVICE_TOKEN = token; } From 8b468fe4b541738c4ab434335dfff3691b8416a9 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 28 Nov 2023 11:18:37 +0300 Subject: [PATCH 69/86] Updates & fixes --- lib/config/config.dart | 4 +- lib/pages/BookAppointment/BookSuccess.dart | 60 ++++++++++++----- .../models/BookedButtonsAllowCheckIn.dart | 6 +- .../widgets/AppointmentActions.dart | 1 + lib/pages/landing/landing_page.dart | 23 +++++++ lib/pages/login/confirm-login.dart | 53 +++++---------- lib/pages/login/login.dart | 67 +++++++++++-------- .../rate_appointment_clinic.dart | 14 ++-- .../rate_appointment_doctor.dart | 8 +-- lib/splashPage.dart | 8 +-- 10 files changed, 147 insertions(+), 97 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0eeacbad..3b774575 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:2018/'; - // 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/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 62708472..ea0f186b 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -159,26 +159,54 @@ class _BookSuccessState extends State { Widget _getQRButtons() { return Container( alignment: Alignment.bottomCenter, + margin: EdgeInsets.all(14), height: MediaQuery.of(context).size.height * 0.18, child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ - ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - minWidth: MediaQuery.of(context).size.width * 0.7, - height: 45.0, - child: CustomTextButton( - backgroundColor: Color(0xFF60686b), - elevation: 0, - onPressed: () { -// navigateToQR(context); - GifLoaderDialogUtils.showMyDialog(context); - getAppoQR(context); - }, - child: Text(TranslationBase.of(context).viewQR.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)), - ), + Row( + children: [ + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: CustomTextButton( + backgroundColor: CustomColors.green, + elevation: 0, + onPressed: () { + GifLoaderDialogUtils.showMyDialog(context); + getAppoQR(context); + }, + child: Text(TranslationBase.of(context).checkinOptions, style: TextStyle(fontSize: 18.0, color: Colors.white)), + ), + ), + ), + mWidth(7), + Expanded( + flex: 1, + child: ButtonTheme( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ), + minWidth: MediaQuery.of(context).size.width * 0.7, + height: 45.0, + child: CustomTextButton( + backgroundColor: Color(0xffc5272d), + elevation: 0, + onPressed: () { + navigateToHome(context); + // GifLoaderDialogUtils.showMyDialog(context); + // getAppoQR(context); + }, + child: Text(TranslationBase.of(context).done, style: TextStyle(fontSize: 18.0, color: Colors.white)), + ), + ), + ), + ], ), ], ), diff --git a/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart b/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart index 96174828..1062eaf3 100644 --- a/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart +++ b/lib/pages/MyAppointments/models/BookedButtonsAllowCheckIn.dart @@ -30,19 +30,19 @@ class BookedButtonsAllowCheckIn { { "title": TranslationBase.of(AppGlobal.context).add, "subtitle": TranslationBase.of(AppGlobal.context).reminder, - "icon": "reminder_icon.png", + "icon": "assets/images/new-design/reminder_icon.png", "caller": "addReminder", }, { "title": TranslationBase.of(AppGlobal.context).hospital, "subtitle": TranslationBase.of(AppGlobal.context).location, - "icon": "location_icon.png", + "icon": "assets/images/new-design/location_icon.png", "caller": "navigateToProject", }, { "title": TranslationBase.of(AppGlobal.context).online, "subtitle": TranslationBase.of(AppGlobal.context).payment, - "icon": "check-in.png", + "icon": "assets/images/new-design/check-in.png", "caller": "goToTodoList", } ]; diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index deee5a5e..76d89f82 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -92,6 +92,7 @@ class _AppointmentActionsState extends State { hasBadge: true, isEnable: !shouldEnable, imgColor: Color(0xff28323A), + isPngImage: appoButtonsList[index].icon.contains(".png") ? true : false, ), ); }, diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 0c044e6b..eef268ab 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart'; +import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -17,6 +18,7 @@ import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page_2.dart'; import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart'; +import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; @@ -36,6 +38,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -71,6 +74,7 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State with WidgetsBindingObserver { var authProvider = new AuthProvider(); + AppointmentRateViewModel appointmentRateViewModel = locator(); int currentTab = 0; PageController pageController; @@ -648,6 +652,25 @@ class _LandingPageState extends State with WidgetsBindingObserver { model.setState(model.count, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); + + appointmentRateViewModel + .getIsLastAppointmentRatedList() + .then((value) => { + // getToDoCount(), + // GifLoaderDialogUtils.hideDialog(AppGlobal.context), + if (appointmentRateViewModel.isHaveAppointmentNotRate) + { + Navigator.push( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + ), + } + }) + .catchError((err) { + print(err); + }); } }), }); diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 73012bd5..12ee9ecb 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -42,8 +42,9 @@ import 'package:provider/provider.dart'; class ConfirmLogin extends StatefulWidget { final Function changePageViewIndex; final fromRegistration; - final bool isDubai; - const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai =false}) : super(key: key); + final bool isDubai; + + const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai = false}) : super(key: key); @override _ConfirmLogin createState() => _ConfirmLogin(); @@ -386,9 +387,9 @@ class _ConfirmLogin extends State { request.sMSSignature = await SMSOTP.getSignature(); GifLoaderDialogUtils.showMyDialog(context); if (healthId != null || widget.isDubai) { - if(!widget.isDubai){ - request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); - } + if (!widget.isDubai) { + request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); + } request.healthId = healthId; request.isHijri = isHijri; await this.authService.sendActivationCodeRegister(request).then((result) { @@ -568,7 +569,7 @@ class _ConfirmLogin extends State { var request = this.getCommonRequest().toJson(); dynamic res; if (healthId != null || widget.isDubai) { - if(!widget.isDubai) { + if (!widget.isDubai) { request['DOB'] = dob; } request['HealthId'] = healthId; @@ -583,7 +584,7 @@ class _ConfirmLogin extends State { result = CheckActivationCode.fromJson(result), if (this.registerd_data != null && this.registerd_data.isRegister == true) { - // if(widget.isDubai ==false){ + // if(widget.isDubai ==false){ widget.changePageViewIndex(1), Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), } @@ -694,36 +695,16 @@ class _ConfirmLogin extends State { projectViewModel.user = authenticatedUserObject.user; await authenticatedUserObject.getUser(getUser: true); - // getToDoCount(); + GifLoaderDialogUtils.hideDialog(context); - appointmentRateViewModel - .getIsLastAppointmentRatedList() - .then((value) => { - getToDoCount(), - GifLoaderDialogUtils.hideDialog(AppGlobal.context), - if (appointmentRateViewModel.isHaveAppointmentNotRate) - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - (r) => false) - } - else - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: LandingPage(), - ), - (r) => false) - }, - insertIMEI() - }) - .catchError((err) { - print(err); - }); + getToDoCount(); + + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false); } loading(flag) { diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index adcc4820..107db2c3 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -345,34 +345,45 @@ class _Login extends State { authenticatedUserObject.user = result.list; projectViewModel.user = authenticatedUserObject.user; - appointmentRateViewModel - .getIsLastAppointmentRatedList() - .then((value) => { - getToDoCount(), - GifLoaderDialogUtils.hideDialog(context), - if (appointmentRateViewModel.isHaveAppointmentNotRate) - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - (r) => false) - } - else - { - Navigator.pushAndRemoveUntil( - context, - FadePage( - page: LandingPage(), - ), - (r) => false) - } - }) - .catchError((err) { - print(err); - GifLoaderDialogUtils.hideDialog(context); - }); + GifLoaderDialogUtils.hideDialog(context); + + getToDoCount(); + + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false); + + // appointmentRateViewModel + // .getIsLastAppointmentRatedList() + // .then((value) => { + // getToDoCount(), + // GifLoaderDialogUtils.hideDialog(context), + // if (appointmentRateViewModel.isHaveAppointmentNotRate) + // { + // Navigator.pushAndRemoveUntil( + // context, + // FadePage( + // page: RateAppointmentDoctor(), + // ), + // (r) => false) + // } + // else + // { + // Navigator.pushAndRemoveUntil( + // context, + // FadePage( + // page: LandingPage(), + // ), + // (r) => false) + // } + // }) + // .catchError((err) { + // print(err); + // GifLoaderDialogUtils.hideDialog(context); + // }); }); } diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart index aac0a4d6..09b083cc 100644 --- a/lib/pages/rateAppointment/rate_appointment_clinic.dart +++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart @@ -191,11 +191,17 @@ class _RateAppointmentClinicState extends State { child: DefaultButton( TranslationBase.of(context).later, () { - Navigator.pushReplacement( + // Navigator.pushReplacement( + // context, + // FadePage( + // page: LandingPage(), + // ), + // ); + Navigator.pop( + context, + ); + Navigator.pop( context, - FadePage( - page: LandingPage(), - ), ); }, color: CustomColors.accentColor, diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 08a597ab..5127dfa6 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -189,11 +189,11 @@ class _RateAppointmentDoctorState extends State { }); dialog.showAlertDialog(context); } else { - Navigator.pushReplacement( + Navigator.pop( context, - FadePage( - page: LandingPage(), - ), + // FadePage( + // page: LandingPage(), + // ), ); } }, diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 2c74a963..b8293e0f 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -44,10 +44,10 @@ class _SplashScreenState extends State { }, ); - AppSharedPreferences().getAll().then((value) { - debugPrint("ALL SHARED PREFERENCES!!!!!"); - debugPrint(jsonEncode(value)); - }); + // AppSharedPreferences().getAll().then((value) { + // debugPrint("ALL SHARED PREFERENCES!!!!!"); + // debugPrint(jsonEncode(value)); + // }); } /// load the Privilege from service From 421bae2037d6a5f1754a83b6ec4316a115972930 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 5 Dec 2023 11:36:14 +0300 Subject: [PATCH 70/86] updates --- lib/config/config.dart | 4 +- lib/config/shared_pref_kay.dart | 1 + lib/core/model/rate/appoitment_rated.dart | 2 +- lib/core/service/client/base_app_client.dart | 2 +- lib/pages/landing/landing_page.dart | 52 +++++++++----------- 5 files changed, 29 insertions(+), 32 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3b774575..0eeacbad 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:2018/'; - 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/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index ec82db11..f92841e3 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -43,3 +43,4 @@ const CLINICS_LIST = 'CLINICS_LIST'; const COVID_QA_LIST = 'COVID_QA_LIST'; const IS_COVID_CONSENT_SHOWN = 'IS_COVID_CONSENT_SHOWN'; const REGISTER_INFO_DUBAI ='register-info-dubai'; +const IS_LAST_APPOINTMENT_RATE_SHOWN ='is-last-appointment-rate-shown'; diff --git a/lib/core/model/rate/appoitment_rated.dart b/lib/core/model/rate/appoitment_rated.dart index 2f0d0dae..820e36a5 100644 --- a/lib/core/model/rate/appoitment_rated.dart +++ b/lib/core/model/rate/appoitment_rated.dart @@ -26,7 +26,7 @@ class AppoitmentRated { String arrivedOn; int editedBy; String editedOn; - String doctorName; + dynamic doctorName; String doctorNameN; String statusDesc; String statusDescN; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 8c9118c8..81fc2d6a 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 1048710; //3844083 + // body['PatientID'] = 3183712; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index eef268ab..0ecdc0d4 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -645,35 +645,31 @@ class _LandingPageState extends State with WidgetsBindingObserver { var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {}); - authService.getDashboard().then((value) => { - setState(() { - if (value != null) { - notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); - model.setState(model.count, true, notificationCount); - sharedPref.setString(NOTIFICATION_COUNT, notificationCount); - FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); - - appointmentRateViewModel - .getIsLastAppointmentRatedList() - .then((value) => { - // getToDoCount(), - // GifLoaderDialogUtils.hideDialog(AppGlobal.context), - if (appointmentRateViewModel.isHaveAppointmentNotRate) - { - Navigator.push( - context, - FadePage( - page: RateAppointmentDoctor(), - ), - ), - } - }) - .catchError((err) { - print(err); - }); - } - }), + authService.getDashboard().then((value) async { + setState(() { + if (value != null) { + notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + model.setState(model.count, true, notificationCount); + sharedPref.setString(NOTIFICATION_COUNT, notificationCount); + FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); + } + }); + if (await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN) == null || !await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN)) { + appointmentRateViewModel.getIsLastAppointmentRatedList().then((value) async { + if (appointmentRateViewModel.isHaveAppointmentNotRate) { + await AppSharedPreferences().setBool(IS_LAST_APPOINTMENT_RATE_SHOWN, true); + Navigator.push( + context, + FadePage( + page: RateAppointmentDoctor(), + ), + ); + } + }).catchError((err) { + print(err); }); + } + }); } projectViewModel.analytics.setUser(data); } else { From 0a9aee0246c5af174ea41a93f3ba95e3fc85fe76 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 5 Dec 2023 14:47:56 +0300 Subject: [PATCH 71/86] updates --- lib/pages/landing/landing_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 0ecdc0d4..47dab9ba 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -640,7 +640,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { void checkUserStatus(token) async { await PushNotificationHandler.getInstance().isAndroidPermissionGranted(); - authService.selectDeviceImei(token).then((SelectDeviceIMEIRES value) => setUserValues(value)); + // authService.selectDeviceImei(token).then((SelectDeviceIMEIRES value) => setUserValues(value)); if (authenticatedUserObject.isLogin) { var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { From c6c4f933b2c43ced4c964a11875cab70572fcd14 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 6 Dec 2023 09:56:57 +0300 Subject: [PATCH 72/86] Invoice Type param added in Labs & Rad --- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 2 +- lib/core/model/labs/patient_lab_orders.dart | 16 +++++--- .../request_patient_lab_special_result.dart | 38 ++++++++++--------- .../labs/request_send_lab_report_email.dart | 4 ++ lib/core/model/radiology/final_radiology.dart | 18 +++++---- .../request_send_rad_report_email.dart | 4 ++ lib/core/service/client/base_app_client.dart | 2 +- lib/core/service/medical/labs_service.dart | 6 ++- .../service/medical/radiology_service.dart | 4 +- .../viewModels/medical/labs_view_model.dart | 3 +- .../medical/radiology_view_model.dart | 4 +- .../notification_details_page.dart | 28 +++++++++----- .../medical/labs/laboratory_result_page.dart | 1 + .../radiology/radiology_details_page.dart | 1 + 15 files changed, 86 insertions(+), 47 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0eeacbad..4ae8f64d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -339,7 +339,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 11.3; +var VERSION_ID = 11.4; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3f3074d3..ba17f2ec 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -791,7 +791,7 @@ const Map localizedValues = { "Upon activation of this service, the system will send a monthly report automatically to the registered email which lists the vital signs and the results for the last visits made in AlHabib Medical Group.", "ar": "خدمة التقارير الشهرية: عند تفعيل هذه الخدمة سيقوم النظام بارسال تقرير شهري بشكل آلي على الايميل المسجل والذي يسرد المؤشرات الحيوية ونتائج التحاليل لآخر زيارات تمت بمجموعة الحبيب الطبية." }, - "language-setting": {"en": "SMS and Confirmation Calls Language", "ar": "لغة الرسائل القصيرة و الاتصال الآلي"}, + "language-setting": {"en": "SMS, WhatsApp and Confirmation Calls Language", "ar": "لغة الرسائل القصيرة والواتس اب وتأكيد المكالمات"}, "alert": {"en": "Alerts", "ar": "التنبيهات"}, "email-alert": {"en": "Alert by Email", "ar": "استلام التنبيهات بالبريد الالكتروني"}, "sms-alert": {"en": "Alert by SMS", "ar": "استلام التنبيهات بالرسائل القصيرة"}, diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index c2908023..c58222e3 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -17,6 +17,7 @@ class PatientLabOrders { String genderDescription; String invoiceNo; String invoiceNo_VP; + String invoiceType; bool isActiveDoctorProfile; bool isDoctorAllowVedioCall; bool isExecludeDoctor; @@ -36,6 +37,7 @@ class PatientLabOrders { String setupID; List speciality; bool isLiveCareAppointment; + PatientLabOrders( {this.actualDoctorRate, this.clinicDescription, @@ -69,8 +71,10 @@ class PatientLabOrders { this.projectNameN, this.qR, this.setupID, - this.invoiceNo_VP, - this.speciality,this.isLiveCareAppointment}); + this.invoiceNo_VP, + this.invoiceType, + this.speciality, + this.isLiveCareAppointment}); PatientLabOrders.fromJson(Map json) { actualDoctorRate = json['ActualDoctorRate']; @@ -106,8 +110,9 @@ class PatientLabOrders { qR = json['QR']; setupID = json['SetupID']; invoiceNo_VP = json['invoiceNo_VP']; + invoiceType = json['InvoiceType']; isLiveCareAppointment = json['IsLiveCareAppointment']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); } Map toJson() { @@ -146,7 +151,7 @@ class PatientLabOrders { data['SetupID'] = this.setupID; data['Speciality'] = this.speciality; data['IsLiveCareAppointment'] = this.isLiveCareAppointment; - data['invoiceNo_VP'] =this.invoiceNo_VP; + data['invoiceNo_VP'] = this.invoiceNo_VP; return data; } } @@ -155,8 +160,7 @@ class PatientLabOrdersList { String filterName = ""; List patientLabOrdersList = List(); - PatientLabOrdersList( - {this.filterName, PatientLabOrders patientDoctorAppointment}) { + PatientLabOrdersList({this.filterName, PatientLabOrders patientDoctorAppointment}) { patientLabOrdersList.add(patientDoctorAppointment); } } diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart index b3794e3c..795fa025 100644 --- a/lib/core/model/labs/request_patient_lab_special_result.dart +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -1,6 +1,7 @@ class RequestPatientLabSpecialResult { String invoiceNo; String invoiceNoVP; + String invoiceType; String orderNo; String setupID; String projectID; @@ -22,27 +23,29 @@ class RequestPatientLabSpecialResult { RequestPatientLabSpecialResult( {this.invoiceNo, this.invoiceNoVP, - this.orderNo, - this.setupID, - this.projectID, - this.clinicID, - this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType}); + this.invoiceType, + this.orderNo, + this.setupID, + this.projectID, + this.clinicID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); RequestPatientLabSpecialResult.fromJson(Map json) { invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo_VP']; + invoiceType = json['InvoiceType']; orderNo = json['OrderNo']; setupID = json['SetupID']; projectID = json['ProjectID']; @@ -66,6 +69,7 @@ class RequestPatientLabSpecialResult { final Map data = new Map(); data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo_VP'] = this.invoiceNoVP; + data['InvoiceType'] = this.invoiceType; data['OrderNo'] = this.orderNo; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index 2188c500..41fa30f9 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -24,6 +24,7 @@ class RequestSendLabReportEmail { String projectID; String invoiceNo; String invoiceNoVP; + String invoiceType; String orderDate; String orderNo; bool isDownload; @@ -55,6 +56,7 @@ class RequestSendLabReportEmail { this.projectID, this.invoiceNo, this.invoiceNoVP, + this.invoiceType, this.orderDate, this.orderNo, this.isDownload, @@ -86,6 +88,7 @@ class RequestSendLabReportEmail { projectID = json['ProjectID']; invoiceNo = json['InvoiceNo']; invoiceNoVP = json['InvoiceNo_VP']; + invoiceType = json['InvoiceType']; orderDate = json['OrderDate']; orderNo = json['OrderNo']; isDownload = json['IsDownload']; @@ -119,6 +122,7 @@ class RequestSendLabReportEmail { data['ProjectID'] = this.projectID; data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo_VP'] = this.invoiceNoVP; + data['InvoiceType'] = this.invoiceType; data['OrderDate'] = this.orderDate; data['OrderNo'] = this.orderNo; data['IsDownload'] = this.isDownload; diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index d92ffead..a600d0be 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -7,6 +7,7 @@ class FinalRadiology { int invoiceLineItemNo; int invoiceNo; dynamic invoiceNo_VP; + String invoiceType; int doctorID; int clinicID; DateTime orderDate; @@ -50,7 +51,8 @@ class FinalRadiology { this.patientID, this.invoiceLineItemNo, this.invoiceNo, - this.invoiceNo_VP, + this.invoiceNo_VP, + this.invoiceType, this.doctorID, this.clinicID, this.orderDate, @@ -85,7 +87,8 @@ class FinalRadiology { this.reportDataTextString, this.speciality, this.isCVI, - this.isRadMedicalReport,this.isLiveCareAppointment}); + this.isRadMedicalReport, + this.isLiveCareAppointment}); FinalRadiology.fromJson(Map json) { try { @@ -95,6 +98,7 @@ class FinalRadiology { invoiceLineItemNo = json['InvoiceLineItemNo']; invoiceNo = json['InvoiceNo']; invoiceNo_VP = json['InvoiceNo_VP']; + invoiceType = json['InvoiceType']; doctorID = json['DoctorID']; clinicID = json['ClinicID']; orderDate = DateUtil.convertStringToDate(json['OrderDate']); @@ -128,10 +132,9 @@ class FinalRadiology { isLiveCareAppointment = json['IsLiveCareAppointment']; reportDataHTML = json['ReportDataHTML']; reportDataTextString = json['ReportDataTextString']; - // speciality = json['Speciality'].cast(); + // speciality = json['Speciality'].cast(); isCVI = json['isCVI']; isRadMedicalReport = json['isRadMedicalReport']; - } catch (e) { print(e); } @@ -145,6 +148,7 @@ class FinalRadiology { data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo_VP'] = this.invoiceNo_VP; + data['InvoiceType'] = this.invoiceType; data['DoctorID'] = this.doctorID; data['ClinicID'] = this.clinicID; data['OrderDate'] = this.orderDate; @@ -189,7 +193,7 @@ class FinalRadiologyList { List finalRadiologyList = List(); FinalRadiologyList({this.filterName, this.finalRadiologyList}); - // { - // finalRadiologyList.add(finalRadiology); - // } +// { +// finalRadiologyList.add(finalRadiology); +// } } diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart index 6819de0d..1f3b7117 100644 --- a/lib/core/model/radiology/request_send_rad_report_email.dart +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -7,6 +7,7 @@ class RequestSendRadReportEmail { String generalid; int invoiceNo; int invoiceNo_VP; + String invoiceType; String iPAdress; bool isDentalAllowedBackend; int languageID; @@ -37,6 +38,7 @@ class RequestSendRadReportEmail { this.generalid, this.invoiceNo, this.invoiceNo_VP, + this.invoiceType, this.iPAdress, this.isDentalAllowedBackend, this.languageID, @@ -66,6 +68,7 @@ class RequestSendRadReportEmail { generalid = json['generalid']; invoiceNo = json['InvoiceNo']; invoiceNo_VP = json['InvoiceNo_VP']; + invoiceType = json['InvoiceType']; iPAdress = json['IPAdress']; isDentalAllowedBackend = json['isDentalAllowedBackend']; languageID = json['LanguageID']; @@ -98,6 +101,7 @@ class RequestSendRadReportEmail { data['generalid'] = this.generalid; data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo_VP'] = this.invoiceNo_VP; + data['InvoiceType'] = this.invoiceType; data['IPAdress'] = this.iPAdress; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['LanguageID'] = this.languageID; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 81fc2d6a..34a0a753 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 3183712; //3844083 + // body['PatientID'] = 2941698; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index bee65b87..1d635c69 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -34,7 +34,7 @@ class LabsService extends BaseService { List labResultList = List(); List labOrdersResultsList = List(); - Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID, bool isVidaPlus}) async { + Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String invoiceType, String orderNo, String setupID, bool isVidaPlus}) async { hasError = false; _requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.clinicID = clinicID; @@ -42,6 +42,8 @@ class LabsService extends BaseService { _requestPatientLabSpecialResult.invoiceNo = isVidaPlus ? "0" : invoiceNo; _requestPatientLabSpecialResult.invoiceNoVP = isVidaPlus ? invoiceNo : "0"; + _requestPatientLabSpecialResult.invoiceType = invoiceType; + _requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.setupID = setupID; @@ -61,6 +63,7 @@ class LabsService extends BaseService { Map body = Map(); body['InvoiceNo_VP'] = isVidaPlus ? patientLabOrder.invoiceNo : "0"; body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder.invoiceNo; + body['InvoiceType'] = patientLabOrder.invoiceType; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; @@ -205,6 +208,7 @@ class LabsService extends BaseService { _requestSendLabReportEmail.projectID = patientLabOrder.projectID; _requestSendLabReportEmail.invoiceNo = isVidaPlus ? "0" : patientLabOrder.invoiceNo; _requestSendLabReportEmail.invoiceNoVP = isVidaPlus ? patientLabOrder.invoiceNo : "0"; + _requestSendLabReportEmail.invoiceType = patientLabOrder.invoiceType; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; _requestSendLabReportEmail.patientName = userObj.firstName + " " + userObj.lastName; diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index f2a54c0c..68822085 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -10,13 +10,14 @@ class RadiologyService extends BaseService { bool isRadiologyVIDAPlus = false; - Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus}) async { + Future getRadImageURL({int invoiceNo, String invoiceType, int lineItem, int projectId, bool isVidaPlus}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo; body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0"; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; + body['InvoiceType'] = invoiceType; await baseAppClient.post(GET_RAD_IMAGE_URL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) { url = response['Data']; @@ -79,6 +80,7 @@ class RadiologyService extends BaseService { _requestSendRadReportEmail.radResult = finalRadiology.reportData; _requestSendRadReportEmail.to = userObj.emailAddress; _requestSendRadReportEmail.dateofBirth = userObj.dateofBirth; + _requestSendRadReportEmail.invoiceType = finalRadiology.invoiceType; hasError = false; await baseAppClient.post(SEND_RAD_REPORT_EMAIL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index ca577ac6..b75dafad 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -74,9 +74,10 @@ class LabsViewModel extends BaseViewModel { List labResultLists = List(); - getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID, bool isVidaPlus}) async { + getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String invoiceType, String orderNo, String setupID, bool isVidaPlus}) async { setState(ViewState.Busy); await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, + invoiceType: invoiceType, orderNo: orderNo, projectID: projectID, clinicID: clinicID, diff --git a/lib/core/viewModels/medical/radiology_view_model.dart b/lib/core/viewModels/medical/radiology_view_model.dart index 3ee6fedf..ddffd50b 100644 --- a/lib/core/viewModels/medical/radiology_view_model.dart +++ b/lib/core/viewModels/medical/radiology_view_model.dart @@ -48,9 +48,9 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus}) async { + getRadImageURL({int invoiceNo, String invoiceType, int lineItem, int projectId, bool isVidaPlus}) async { setState(ViewState.Busy); - await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus); + await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, invoiceType: invoiceType, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/pages/DrawerPages/notifications/notification_details_page.dart b/lib/pages/DrawerPages/notifications/notification_details_page.dart index 65547b39..e32a234c 100644 --- a/lib/pages/DrawerPages/notifications/notification_details_page.dart +++ b/lib/pages/DrawerPages/notifications/notification_details_page.dart @@ -79,6 +79,16 @@ class _NotificationsDetailsPageState extends State { letterSpacing: -0.64, ), ), + SizedBox(height: 18), + Text( + widget.notification.message.trim(), + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: Color(0xff575757), + letterSpacing: -0.48, + ), + ), if (widget.notification.notificationType == "2") Padding( padding: const EdgeInsets.only(top: 18), @@ -103,15 +113,15 @@ class _NotificationsDetailsPageState extends State { }, fit: BoxFit.fill), ), SizedBox(height: 18), - Text( - widget.notification.message.trim(), - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - color: Color(0xff575757), - letterSpacing: -0.48, - ), - ), + // Text( + // widget.notification.message.trim(), + // style: TextStyle( + // fontSize: 12, + // fontWeight: FontWeight.w600, + // color: Color(0xff575757), + // letterSpacing: -0.48, + // ), + // ), ], ), ); diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index d5bb9035..43254265 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -35,6 +35,7 @@ class _LaboratoryResultPageState extends State { return BaseView( onModelReady: (model) => model.getLaboratoryResult( invoiceNo: widget.patientLabOrders.invoiceNo, + invoiceType: widget.patientLabOrders.invoiceType, clinicID: widget.patientLabOrders.clinicID, projectID: widget.patientLabOrders.projectID, orderNo: widget.patientLabOrders.orderNo, diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index 7e609370..55f156cb 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -28,6 +28,7 @@ class RadiologyDetailsPage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getRadImageURL( + invoiceType: finalRadiology.invoiceType, projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo, From eef6f78fd6681c5588ad15334d4b2130f8d84423 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 6 Dec 2023 11:03:59 +0300 Subject: [PATCH 73/86] Updates --- lib/pages/MyAppointments/MyAppointments.dart | 22 +++++++++++++++++++- lib/pages/ToDoList/ToDo.dart | 15 ++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index 533bd6e6..31b8f85b 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -5,8 +5,10 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; +import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; @@ -52,6 +54,8 @@ class _MyAppointmentsState extends State with SingleTickerProvid int _currentPage = 0; + ToDoCountProviderModel toDoProvider; + @override void initState() { filterType = FilterType.Clinic; @@ -72,6 +76,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid @override Widget build(BuildContext context) { + toDoProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).myAppointmentsList, isShowAppBar: true, @@ -168,6 +173,19 @@ class _MyAppointmentsState extends State with SingleTickerProvid print(err); AppToast.showErrorToast(message: err); }); + getToDoCount(); + } + + getToDoCount() { + toDoProvider.setState(0, true, "0"); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); + } else {} + }).catchError((err) { + print(err); + }); } bool isConfirmed(AppoitmentAllHistoryResultList appo) { @@ -379,7 +397,9 @@ class _MyAppointmentsState extends State with SingleTickerProvid date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate), isSortByClinic: _isSortByClinic, rating: _appointmentResult.actualDoctorRate + 0.0, - appointmentTime: _appointmentResult.isLiveCareAppointment ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate).toString().split(" ")[1].substring(0, 5) : _appointmentResult.startTime.substring(0, 5), + appointmentTime: _appointmentResult.isLiveCareAppointment + ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate).toString().split(" ")[1].substring(0, 5) + : _appointmentResult.startTime.substring(0, 5), // appointmentTime: _appointmentResult.startTime.substring(0, 5), remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED) ? _appointmentResult.remaniningHoursTocanPay diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index c4e4bcb9..4253fcd8 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -20,6 +20,7 @@ import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; +import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; @@ -854,7 +855,19 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { GifLoaderDialogUtils.hideDialog(context); err != null ?? AppToast.showErrorToast(message: err); }); - // getAncillaryOrders(); + getToDoCount(); + } + + getToDoCount() { + toDoProvider.setState(0, true, "0"); + ClinicListService service = new ClinicListService(); + service.getActiveAppointmentNo(context).then((res) { + if (res['MessageStatus'] == 1) { + toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); + } else {} + }).catchError((err) { + print(err); + }); } checkPatientNphiesEligibility(context, AppoitmentAllHistoryResultList appo) { From 80167378d9f3fecd81f9061105731885bdeb4fc2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 6 Dec 2023 15:42:21 +0300 Subject: [PATCH 74/86] lat long fixes --- lib/core/service/client/base_app_client.dart | 13 ++++++++++--- lib/splashPage.dart | 9 ++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 34a0a753..a397a928 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -79,8 +79,11 @@ class BaseAppClient { body['generalid'] = GENERAL_ID; // body['isVidaPlus'] = true; - body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT); - body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG); + double lat = await AppSharedPreferences().getDouble(USER_LAT); + double long = await AppSharedPreferences().getDouble(USER_LONG); + + body['Latitude'] = lat == null ? 0.0 : lat; + body['Longitude'] = long == null ? 0.0 : long; if (body.containsKey('isDentalAllowedBackend')) { body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') @@ -90,7 +93,11 @@ class BaseAppClient { : IS_DENTAL_ALLOWED_BACKEND; } - body['DeviceTypeID'] = Platform.isIOS ? 1 : await Utils.isGoogleServicesAvailable() ? 2 : 3; + body['DeviceTypeID'] = Platform.isIOS + ? 1 + : await Utils.isGoogleServicesAvailable() + ? 2 + : 3; if (!body.containsKey('IsPublicRequest')) { // if (!body.containsKey('PatientType')) { diff --git a/lib/splashPage.dart b/lib/splashPage.dart index b8293e0f..290bbac0 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -43,11 +43,6 @@ class _SplashScreenState extends State { }); }, ); - - // AppSharedPreferences().getAll().then((value) { - // debugPrint("ALL SHARED PREFERENCES!!!!!"); - // debugPrint(jsonEncode(value)); - // }); } /// load the Privilege from service @@ -63,6 +58,10 @@ class _SplashScreenState extends State { var themeNotifier = Provider.of(context, listen: false); themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins')); PushNotificationHandler(context).init(); // Asyncronously + AppSharedPreferences().getAll().then((value) { + // debugPrint("ALL SHARED PREFERENCES!!!!!"); + // debugPrint(jsonEncode(value)); + }); } @override From 01db5408c945449152fad23951d232b4f1fa2b44 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 10 Dec 2023 11:48:40 +0300 Subject: [PATCH 75/86] fixes --- lib/config/config.dart | 4 ++-- lib/pages/ToDoList/ToDo.dart | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 4ae8f64d..e604cdfd 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:2018/'; - // 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/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 4253fcd8..7e647fab 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -52,7 +52,6 @@ class ToDo extends StatefulWidget { List ancillaryLists = []; List obGyneAppoList = []; var languageID; - MyInAppBrowser browser; bool isShowAppBar = true; Function onBackClick; @@ -85,6 +84,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { bool isInsured = false; bool isEligible = false; bool isCash = false; + MyInAppBrowser browser; @override void initState() { @@ -1051,9 +1051,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } openPayment(List paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) { - widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); + browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); - widget.browser.openPaymentBrowser( + browser.openPaymentBrowser( amount, "Appointment check in", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), @@ -1064,7 +1064,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, - widget.browser, + browser, appo.isLiveCareAppointment, "2", appo.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "", @@ -1095,7 +1095,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { // if(selectedPaymentMethod != "TAMARA") { MyInAppBrowser.successURLS.forEach((element) { if (url.contains(element)) { - if (widget.browser.isOpened()) widget.browser.close(); + browser.close(); MyInAppBrowser.isPaymentDone = true; return; } @@ -1105,7 +1105,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { // if(selectedPaymentMethod != "TAMARA") { MyInAppBrowser.errorURLS.forEach((element) { if (url.contains(element)) { - if (widget.browser.isOpened()) widget.browser.close(); + browser.close(); MyInAppBrowser.isPaymentDone = false; return; } From 47779f6fa72c16d4ddb064d1a909157df3b57027 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 14 Dec 2023 10:47:43 +0300 Subject: [PATCH 76/86] last appointment rating fixed --- .../medical/ask_doctor/request_type.dart | 3 ++- .../rate_appointment_doctor.dart | 25 ++++++++++++++----- lib/uitl/push-notification-handler.dart | 8 +++--- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/lib/pages/medical/ask_doctor/request_type.dart b/lib/pages/medical/ask_doctor/request_type.dart index 4c21e826..bb868e7b 100644 --- a/lib/pages/medical/ask_doctor/request_type.dart +++ b/lib/pages/medical/ask_doctor/request_type.dart @@ -27,7 +27,8 @@ class _RequestTypePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getQuestionTypes(), + // onModelReady: (model) => model.getQuestionTypes(), + onModelReady: (model) => model.getCallRequestTypeLOVs(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: TranslationBase.of(context).requestType, diff --git a/lib/pages/rateAppointment/rate_appointment_doctor.dart b/lib/pages/rateAppointment/rate_appointment_doctor.dart index 5127dfa6..aa49d15a 100644 --- a/lib/pages/rateAppointment/rate_appointment_doctor.dart +++ b/lib/pages/rateAppointment/rate_appointment_doctor.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -15,6 +16,7 @@ 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 RateAppointmentDoctor extends StatefulWidget { @@ -30,9 +32,11 @@ class _RateAppointmentDoctorState extends State { final formKey = GlobalKey(); String note = ""; int rating = 0; + ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return BaseView( builder: (_, model, w) => AppScaffold( isShowAppBar: true, @@ -189,12 +193,21 @@ class _RateAppointmentDoctorState extends State { }); dialog.showAlertDialog(context); } else { - Navigator.pop( - context, - // FadePage( - // page: LandingPage(), - // ), - ); + if(projectViewModel.isLoginChild) { + Navigator.pushReplacement( + context, + FadePage( + page: LandingPage(), + ), + ); + } else { + Navigator.pop( + context, + // FadePage( + // page: LandingPage(), + // ), + ); + } } }, color: CustomColors.accentColor, diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 03e6ec29..c66a8215 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -303,9 +303,11 @@ class PushNotificationHandler { onToken(token); }); - FirebaseMessaging.instance.getAPNSToken().then((value) { - print("Push APNS getToken: " + value); - }); + if(Platform.isIOS) { + FirebaseMessaging.instance.getAPNSToken().then((value) { + print("Push APNS getToken: " + value); + }); + } FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); } From 165f3fb9f6bc2fae740db650ba728fd27ec4731b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Fri, 15 Dec 2023 15:36:21 +0300 Subject: [PATCH 77/86] NFC Check removed for appo checkin --- lib/pages/ToDoList/ToDo.dart | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 7e647fab..30c043e5 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -989,23 +989,23 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { patientShareResponse.projectID = appo.projectID; patientShareResponse.isFollowup = appo.isFollowup; - FlutterNfcKit.nfcAvailability.then((value) { - if (value == NFCAvailability.available) { - PatientShareResponse patientShareResponse = new PatientShareResponse(); - patientShareResponse.doctorNameObj = appo.doctorNameObj; - patientShareResponse.doctorSpeciality = appo.doctorSpeciality; - patientShareResponse.projectName = appo.projectName; - patientShareResponse.appointmentDate = appo.appointmentDate; - patientShareResponse.appointmentNo = appo.appointmentNo; - patientShareResponse.clinicID = appo.clinicID; - patientShareResponse.projectID = appo.projectID; - patientShareResponse.isFollowup = appo.isFollowup; - navigateToQR(context, "", patientShareResponse, appo); - projectViewModel.analytics.todoList.to_do_list_check_in(appo); - } else { - Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported); - } - }); + // FlutterNfcKit.nfcAvailability.then((value) { + // if (value == NFCAvailability.available) { + // PatientShareResponse patientShareResponse = new PatientShareResponse(); + patientShareResponse.doctorNameObj = appo.doctorNameObj; + patientShareResponse.doctorSpeciality = appo.doctorSpeciality; + patientShareResponse.projectName = appo.projectName; + patientShareResponse.appointmentDate = appo.appointmentDate; + patientShareResponse.appointmentNo = appo.appointmentNo; + patientShareResponse.clinicID = appo.clinicID; + patientShareResponse.projectID = appo.projectID; + patientShareResponse.isFollowup = appo.isFollowup; + navigateToQR(context, "", patientShareResponse, appo); + projectViewModel.analytics.todoList.to_do_list_check_in(appo); + // } else { + // Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported); + // } + // }); projectViewModel.analytics.todoList.to_do_list_check_in(appo); DoctorsListService service = new DoctorsListService(); From 264aed70a05f85346a6f986b1f92c5ef5bc11c67 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 17 Dec 2023 13:48:00 +0300 Subject: [PATCH 78/86] NFC Check added --- lib/pages/BookAppointment/QRCode.dart | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 2c2cc83d..3b7e6300 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -62,13 +62,9 @@ class _QRCodeState extends State { // _bytes = base64.decode(widget.appoQR.split(',').last); widget.authUser = new AuthenticatedUser(); - FlutterNfcKit.nfcAvailability.then((value) { - _supportsNFC = (value == NFCAvailability.available); - }); - - WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + // WidgetsBinding.instance.addPostFrameCallback((timeStamp) { // startNFCScan(); - }); + // }); super.initState(); } @@ -113,6 +109,9 @@ class _QRCodeState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); _context = context; + FlutterNfcKit.nfcAvailability.then((value) { + _supportsNFC = (value == NFCAvailability.available); + }); List checkInOptionsList = getCheckInOptionsList(context); return AppScaffold( appBarTitle: TranslationBase.of(context).onlineCheckIn, @@ -214,8 +213,10 @@ class _QRCodeState extends State { optionsList.add( InkWell( onTap: () { - if (projectViewModel.havePrivilege(80)) { + if (projectViewModel.havePrivilege(80) && _supportsNFC) { startNFCScan(); + } else { + Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported); } }, child: MedicalProfileItem( From cfd8b5e8a5f9cb57b4e6219583034ffca490e02e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 18 Dec 2023 09:26:40 +0300 Subject: [PATCH 79/86] Language ID Changes --- lib/core/service/client/base_app_client.dart | 10 +++++++++- lib/core/service/privilege_service.dart | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index a397a928..3f1ce94c 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -73,7 +73,15 @@ class BaseAppClient { body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; - body['LanguageID'] = (languageID == 'ar' ? 1 : 2); + + if (body.containsKey('LanguageID')) { + body['LanguageID'] = body['LanguageID']; + } else { + // body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2); + body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; + } + + // body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; body['IPAdress'] = IP_ADDRESS; body['generalid'] = GENERAL_ID; diff --git a/lib/core/service/privilege_service.dart b/lib/core/service/privilege_service.dart index ab0cee97..799764f6 100644 --- a/lib/core/service/privilege_service.dart +++ b/lib/core/service/privilege_service.dart @@ -14,6 +14,7 @@ class PrivilegeService extends BaseService { Future getPrivilege() async { Map body = Map(); body['PatientType'] = 4; + body['LanguageID'] = 1; await baseAppClient.post(GET_PRIVILEGE, onSuccess: (dynamic response, int statusCode) { response['ServicePrivilegeList'].forEach((item) { privilegeModelList.add(PrivilegeModel.fromJson(item)); From bcfeff2661ea7ef58ec9ee39b7b1be861bc641fa Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 18 Dec 2023 09:51:51 +0300 Subject: [PATCH 80/86] updates --- lib/services/authentication/auth_provider.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index d61e8ef7..a629df89 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -155,6 +155,7 @@ class AuthProvider with ChangeNotifier { dynamic localRes; Map request = {}; request['IMEI'] = imei; + request['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; await new BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { localRes = SelectDeviceIMEIRES.fromJson(response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); }, onFailure: (String error, int statusCode) { From a9d4cb2fd8c2d8c4796d3c26ff1c9ace0dc8ea97 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 18 Dec 2023 10:47:08 +0300 Subject: [PATCH 81/86] InApp Browser Update --- lib/widgets/in_app_browser/InAppBrowser.dart | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f38ad57c..f3a277fe 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -27,7 +27,12 @@ var _InAppBrowserOptions = InAppBrowserClassOptions( ios: IOSInAppWebViewOptions(applePayAPIEnabled: true, isFraudulentWebsiteWarningEnabled: false)), crossPlatform: InAppBrowserOptions(hideUrlBar: true, toolbarTopBackgroundColor: Colors.black), android: AndroidInAppBrowserOptions(), - ios: IOSInAppBrowserOptions(hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, closeButtonColor: Colors.white, presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN)); + ios: IOSInAppBrowserOptions( + hideToolbarBottom: true, + toolbarBottomBackgroundColor: Colors.white, + closeButtonColor: Colors.white, + closeButtonCaption: "Close", + presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN)); class MyInAppBrowser extends InAppBrowser { _PAYMENT_TYPE paymentType; @@ -176,8 +181,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']; // Prod - // String url = "https://uat.hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // UAT + // String url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // Prod + String url = "https://uat.hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // UAT // safariBrowser.open(url: Uri.parse(url)); this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(url)), options: _InAppBrowserOptions); }).catchError((err) { From 724a26ca682e90fe6b05186305ad3e4ac280cacd Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 18 Dec 2023 12:29:09 +0300 Subject: [PATCH 82/86] Updates --- lib/config/config.dart | 6 +++--- lib/core/service/client/base_app_client.dart | 8 ++++++-- .../Authentication/check_activation_code_request.dart | 8 ++++---- lib/services/appointment_services/GetDoctorsList.dart | 1 + lib/widgets/in_app_browser/InAppBrowser.dart | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index e604cdfd..b399fa00 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -19,9 +19,9 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; 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:2018/'; - 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://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 3f1ce94c..8921d5f9 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -75,7 +75,11 @@ class BaseAppClient { body['Channel'] = CHANNEL; if (body.containsKey('LanguageID')) { - body['LanguageID'] = body['LanguageID']; + if(body['LanguageID'] != null) { + body['LanguageID'] = body['LanguageID']; + } else { + body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; + } } else { // body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2); body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; @@ -165,7 +169,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 2941698; //3844083 + // body['PatientID'] = 1231755; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/models/Authentication/check_activation_code_request.dart b/lib/models/Authentication/check_activation_code_request.dart index f6509f3b..7113dd6d 100644 --- a/lib/models/Authentication/check_activation_code_request.dart +++ b/lib/models/Authentication/check_activation_code_request.dart @@ -15,7 +15,7 @@ class CheckActivationCodeReq { bool isSilentLogin; double versionID; int channel; - int languageID; + // int languageID; String iPAdress; String generalid; int patientOutSA; @@ -41,7 +41,7 @@ class CheckActivationCodeReq { this.isSilentLogin, this.versionID, this.channel, - this.languageID, + // this.languageID, this.iPAdress, this.generalid, this.patientOutSA, @@ -68,7 +68,7 @@ class CheckActivationCodeReq { isSilentLogin = json['IsSilentLogin']; versionID = json['VersionID']; channel = json['Channel']; - languageID = json['LanguageID']; + // languageID = json['LanguageID']; iPAdress = json['IPAdress']; generalid = json['generalid']; patientOutSA = json['PatientOutSA']; @@ -96,7 +96,7 @@ class CheckActivationCodeReq { data['IsSilentLogin'] = this.isSilentLogin; data['VersionID'] = this.versionID; data['Channel'] = this.channel; - data['LanguageID'] = this.languageID; + // data['LanguageID'] = this.languageID; data['IPAdress'] = this.iPAdress; data['generalid'] = this.generalid; data['PatientOutSA'] = this.patientOutSA; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index a7482eaa..224f36f2 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1165,6 +1165,7 @@ class DoctorsListService extends BaseService { "ProjectID": appo.projectID, "SetupID": appo.setupID, "DoctorID": appo.doctorID, + "ClinicID": appo.clinicID, "RequestType": requestType, "RequestTypeID": requestType, "PatientMobileNumber": authUser.mobileNumber, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f3a277fe..f6b54dac 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -284,7 +284,7 @@ class MyInAppBrowser extends InAppBrowser { Platform.isIOS ? form = form.replaceFirst('DEVICE_TOKEN', await AppSharedPreferences().getString(PUSH_TOKEN) + "," + await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN)) - : form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN)); + : form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN) ?? ""); // form = form.replaceFirst('DEVICE_TOKEN', await AppSharedPreferences().getString(PUSH_TOKEN) + "," + await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN)); // form = form.replaceFirst('DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN)); From f7dffea2ebf4db277116a3ffe8c67694d5712fe8 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 18 Dec 2023 13:59:52 +0300 Subject: [PATCH 83/86] Language ID fixes --- lib/config/config.dart | 2 +- .../GetAllSharedRecordsByStatusReq.dart | 8 ++++---- lib/pages/MyAppointments/AppointmentDetails.dart | 14 +++++++++----- .../clinic_services/get_clinic_service.dart | 5 +++++ lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index b399fa00..f0dd61b1 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -339,7 +339,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 11.4; +var VERSION_ID = 11.5; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart b/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart index ac0adc34..5313a7c7 100644 --- a/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart +++ b/lib/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart @@ -1,7 +1,7 @@ class GetAllSharedRecordsByStatusReq { double versionID; int channel; - int languageID; + // int languageID; String iPAdress; String generalid; int patientOutSA; @@ -17,7 +17,7 @@ class GetAllSharedRecordsByStatusReq { GetAllSharedRecordsByStatusReq( {this.versionID, this.channel, - this.languageID, + // this.languageID, this.iPAdress, this.generalid, this.patientOutSA, @@ -33,7 +33,7 @@ class GetAllSharedRecordsByStatusReq { GetAllSharedRecordsByStatusReq.fromJson(Map json) { versionID = json['VersionID']; channel = json['Channel']; - languageID = json['LanguageID']; + // languageID = json['LanguageID']; iPAdress = json['IPAdress']; generalid = json['generalid']; patientOutSA = json['PatientOutSA']; @@ -51,7 +51,7 @@ class GetAllSharedRecordsByStatusReq { final Map data = new Map(); data['VersionID'] = this.versionID; data['Channel'] = this.channel; - data['LanguageID'] = this.languageID; + // data['LanguageID'] = this.languageID; data['IPAdress'] = this.iPAdress; data['generalid'] = this.generalid; data['PatientOutSA'] = this.patientOutSA; diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 2a4c9386..ceee266b 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -592,12 +592,16 @@ class _AppointmentDetailsState extends State with SingleTick RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate); - await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) { - Result> events = value; - events.data.forEach((element) { - if (element.title.contains(widget.appo.doctorNameObj)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element); + try { + await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) { + Result> events = value; + events.data.forEach((element) { + if (element.title.contains(widget.appo.doctorNameObj)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element); + }); }); - }); + } catch (ex) { + print(ex); + } } cancelAppointment() { diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index ce9d511f..469ac404 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -36,6 +36,7 @@ class ClinicListService extends BaseService { request = { "IsActiveAppointment": true, + "LanguageID": 1 }; dynamic localRes; @@ -51,6 +52,10 @@ class ClinicListService extends BaseService { Future getProjectsList(context) async { Map request = {}; + request = { + "LanguageID": null + }; + dynamic localRes; await baseAppClient.post(GET_PROJECTS_LIST, onSuccess: (response, statusCode) async { diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f6b54dac..c9fecbf9 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -181,8 +181,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']; // Prod - String url = "https://uat.hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // UAT + String url = "https://hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // Prod + // String url = "https://uat.hmgwebservices.com/HMGApplePayLive/applepay/pay?apq=" + res['result']; // UAT // safariBrowser.open(url: Uri.parse(url)); this.browser.openUrlRequest(urlRequest: URLRequest(url: Uri.parse(url)), options: _InAppBrowserOptions); }).catchError((err) { From 2008ccf92c836681ce82b3fc7a3e75363b79a23b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 19 Dec 2023 10:41:19 +0300 Subject: [PATCH 84/86] updates --- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 02d0d9b7..c3e46b58 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -540,7 +540,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.63; + MARKETING_VERSION = 4.5.75; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -684,7 +684,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.63; + MARKETING_VERSION = 4.5.75; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -722,7 +722,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.63; + MARKETING_VERSION = 4.5.75; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/pubspec.yaml b/pubspec.yaml index 2494a580..2b657883 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.73+1 +version: 4.5.75+1 environment: sdk: ">=2.7.0 <3.0.0" From 512db615befb1dba89a104f2bb56df3518c745ab Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 20 Dec 2023 09:39:52 +0300 Subject: [PATCH 85/86] Language ID fixes & app update to stores, VersionID 11.5 --- .../service/appointment_rate_service.dart | 6 +- .../appointment_rate_view_model.dart | 4 +- .../components/DocAvailableAppointments.dart | 9 +- lib/pages/DrawerPages/family/my-family.dart | 30 ++--- .../widgets/AppointmentActions.dart | 15 ++- lib/pages/landing/landing_page.dart | 6 +- lib/pages/livecare/widgets/clinic_list.dart | 15 ++- lib/pages/login/confirm-login.dart | 1 + lib/pages/login/register-info.dart | 3 +- .../appointment_services/GetDoctorsList.dart | 123 +++++------------- .../authentication/auth_provider.dart | 8 +- .../family_files/family_files_provider.dart | 12 +- .../livecare_services/livecare_provider.dart | 15 ++- .../my_invoice_services.dart | 38 ++---- .../SmartWatchIntegrationService.dart | 2 - lib/widgets/drawer/app_drawer_widget.dart | 12 +- pubspec.yaml | 2 +- 17 files changed, 127 insertions(+), 174 deletions(-) diff --git a/lib/core/service/appointment_rate_service.dart b/lib/core/service/appointment_rate_service.dart index 16355e9a..848aeb48 100644 --- a/lib/core/service/appointment_rate_service.dart +++ b/lib/core/service/appointment_rate_service.dart @@ -8,8 +8,10 @@ class AppointmentRateService extends BaseService { List appointmentRatedList = List(); AppointmentDetails appointmentDetails; - Future getIsLastAppointmentRatedList() async { + Future getIsLastAppointmentRatedList(int languageID) async { hasError = false; + Map bodyData = Map(); + bodyData['LanguageID'] = languageID; await baseAppClient.post(IS_LAST_APPOITMENT_RATED, onSuccess: (dynamic response, int statusCode) { appointmentRatedList.clear(); response['IsLastAppoitmentRatedList'].forEach((appoint) { @@ -18,7 +20,7 @@ class AppointmentRateService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: Map()); + }, body: bodyData); } Future getAppointmentDetails() async { diff --git a/lib/core/viewModels/appointment_rate_view_model.dart b/lib/core/viewModels/appointment_rate_view_model.dart index 9e0d338b..9396c2f5 100644 --- a/lib/core/viewModels/appointment_rate_view_model.dart +++ b/lib/core/viewModels/appointment_rate_view_model.dart @@ -12,10 +12,10 @@ class AppointmentRateViewModel extends BaseViewModel { AppointmentDetails get appointmentDetails => _appointmentRateService.appointmentDetails; - Future getIsLastAppointmentRatedList() async { + Future getIsLastAppointmentRatedList(int languageID) async { isHaveAppointmentNotRate = false; setState(ViewState.Busy); - await _appointmentRateService.getIsLastAppointmentRatedList(); + await _appointmentRateService.getIsLastAppointmentRatedList(languageID); if (_appointmentRateService.hasError) { error = _appointmentRateService.error; setState(ViewState.Error); diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 04f6d1b0..61e697f4 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -376,10 +376,11 @@ class _DocAvailableAppointmentsState extends State wit } getCurrentLanguage() async { - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - setState(() { - this.language = languageID; - }); + this.language = projectViewModel.isArabic ? "ar" : "en"; + // var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + // setState(() { + // this.language = languageID; + // }); } } diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index fa7d4a6a..d88c86e3 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -447,20 +447,20 @@ class _MyFamily extends State with TickerProviderStateMixin { } refreshFamily(context) async { - - await sharedPref.remove(FAMILY_FILE); - await checkUserData(); + await sharedPref.remove(FAMILY_FILE); + await checkUserData(); } switchUser(user, context) { GifLoaderDialogUtils.showMyDialog(context); + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; // this // .familyFileProvider // .silentLoggin(user) // .then((value) => loginAfter(value, context)); // Utils.showProgressDialog(context); - this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser).then((value) => loginAfter(value, context)).catchError((err) { + this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, languageID, mainUser: user is AuthenticatedUser).then((value) => loginAfter(value, context)).catchError((err) { print("err:$err"); AppToast.showErrorToast(message: err.toString()); Navigator.of(context).pop(); @@ -524,9 +524,8 @@ class _MyFamily extends State with TickerProviderStateMixin { Map request = {}; request["ID"] = ID; request["Status"] = status; - this.familyFileProvider.acceptRejectFamily(request).then((value) async{ - - await refreshFamily(context); + this.familyFileProvider.acceptRejectFamily(request).then((value) async { + await refreshFamily(context); GifLoaderDialogUtils.hideDialog(context); }); } @@ -537,10 +536,8 @@ class _MyFamily extends State with TickerProviderStateMixin { // var data2 = AuthenticatedUser.fromJson(await this.sharedPref.getObject(MAIN_USER)); await getFamilyFiles(); - this.user = data; - setState(() { - - }); + this.user = data; + setState(() {}); } } @@ -557,18 +554,18 @@ class _MyFamily extends State with TickerProviderStateMixin { GifLoaderDialogUtils.showMyDialog(context); try { if (familySharedRecords == null) { - - familySharedRecords = await familyFileProvider.getSharedRecordByStatus(); + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + familySharedRecords = await familyFileProvider.getSharedRecordByStatus(languageID); } - sentRecordsList =[]; + sentRecordsList = []; familySharedRecords.getAllSharedRecordsByStatusList.forEach((element) { if (element.status == 3) { familySharedRecordsList.add(element); } sentRecordsList.add(element); }); - approvedRecordsList =[]; - pendingRecordsList =[]; + approvedRecordsList = []; + pendingRecordsList = []; GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest(); pendingAndApprovedRecords.getAllSharedRecordsByStatusList.forEach((element) { @@ -580,7 +577,6 @@ class _MyFamily extends State with TickerProviderStateMixin { } }); } catch (ex) { - familySharedRecords = GetAllSharedRecordsByStatusResponse(getAllSharedRecordsByStatusList: []); } GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 76d89f82..b7083b7c 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -467,7 +467,8 @@ class _AppointmentActionsState extends State { askYourDoc() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + service.isAllowedToAskDoctor(widget.appo.doctorID, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); print(res['PatientDoctorAppointmentResultList']); if (res['PatientDoctorAppointmentResultList'].length != 0) { @@ -483,9 +484,10 @@ class _AppointmentActionsState extends State { } getCallRequestType() { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getCallRequestType(context).then((res) { + service.getCallRequestType(languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); List requestData = new List(); res['ListReqTypes'].forEach((element) { @@ -528,9 +530,11 @@ class _AppointmentActionsState extends State { } sendAskDocRequest(int requestType) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.sendAskDocCallRequest(widget.appo, requestType.toString(), context).then((res) { + + service.sendAskDocCallRequest(widget.appo, requestType.toString(), languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: "Request Sent Successfully"); @@ -589,7 +593,7 @@ class _AppointmentActionsState extends State { navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { if (widget.projectViewModel.isLogin) { // if (model.count != 0) { - getPatientAppointmentHistoryWithAppo(); + getPatientAppointmentHistoryWithAppo(); // } else { // AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); // } @@ -608,7 +612,8 @@ class _AppointmentActionsState extends State { getPatientAppointmentHistoryWithAppo() { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getPatientAppointmentHistoryWithAppoNo(widget.appo.appointmentNo).then((res) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + service.getPatientAppointmentHistoryWithAppoNo(widget.appo.appointmentNo, languageID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList.fromJson(res['AppoimentAllHistoryResultList'][0]); diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 47dab9ba..7e56896f 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -298,7 +298,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { WidgetsBinding.instance.addPostFrameCallback((_) { if (projectViewModel.isLogin && !projectViewModel.isLoginChild) { - familyFileProvider.getSharedRecordByStatus(); + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + familyFileProvider.getSharedRecordByStatus(languageID); } }); @@ -655,7 +656,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { } }); if (await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN) == null || !await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN)) { - appointmentRateViewModel.getIsLastAppointmentRatedList().then((value) async { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + appointmentRateViewModel.getIsLastAppointmentRatedList(languageID).then((value) async { if (appointmentRateViewModel.isHaveAppointmentNotRate) { await AppSharedPreferences().setBool(IS_LAST_APPOINTMENT_RATE_SHOWN, true); Navigator.push( diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 361d2381..bbf7a159 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -102,25 +102,25 @@ class _clinic_listState extends State { }); } }); - - getLanguageID(); super.initState(); } @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); + getLanguageID(); return Container( child: currentSelectedLiveCareType == "immediate" ? getLiveCareImmediateClinicList() : getLiveCareScheduleClinicList(), ); } void startLiveCare() { + int languageID = projectViewModel.isArabic ? 1 : 2; bool isError = false; LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); ERAppointmentFeesResponse erAppointmentFeesResponse = new ERAppointmentFeesResponse(); - service.getERAppointmentFees(selectedClinicID, widget.isPharmacyLiveCare, context).then((res) { + service.getERAppointmentFees(selectedClinicID, widget.isPharmacyLiveCare, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['HasAppointment'] == true) { isError = true; @@ -183,9 +183,10 @@ class _clinic_listState extends State { } getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) { + int languageID = projectViewModel.isArabic ? 1 : 2; LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); - service.getERAppointmentTime(selectedClinicID, widget.isPharmacyLiveCare, context).then((res) { + service.getERAppointmentTime(selectedClinicID, widget.isPharmacyLiveCare, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); }).catchError((err) { @@ -504,7 +505,8 @@ class _clinic_listState extends State { } getLanguageID() async { - languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + languageID = projectViewModel.isArabic ? "ar" : "en"; + // languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); } getLiveCareClinicsList() { @@ -757,11 +759,12 @@ class _clinic_listState extends State { } void startScheduleLiveCare() { + int languageID = projectViewModel.isArabic ? 1 : 2; List doctorsList = []; LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); List _patientDoctorAppointmentListHospital = List(); - service.getLiveCareScheduledDoctorList(context, selectedClinicID).then((res) { + service.getLiveCareScheduledDoctorList(context, selectedClinicID, languageID).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 12ee9ecb..b99e7c07 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -705,6 +705,7 @@ class _ConfirmLogin extends State { page: LandingPage(), ), (r) => false); + insertIMEI(); } loading(flag) { diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index 0f8e031f..e004663e 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -705,7 +705,8 @@ class _RegisterInfo extends State { projectViewModel.isLogin = true; projectViewModel.user = authenticatedUserObject.user; await authenticatedUserObject.getUser(getUser: true); - appointmentRateViewModel.getIsLastAppointmentRatedList().then((value) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + appointmentRateViewModel.getIsLastAppointmentRatedList(languageID).then((value) { getToDoCount(); GifLoaderDialogUtils.hideDialog(AppGlobal.context); if (appointmentRateViewModel.isHaveAppointmentNotRate) { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 224f36f2..f3b7670c 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -47,10 +47,9 @@ class DoctorsListService extends BaseService { long = await this.sharedPref.getDouble(USER_LONG); } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); // Request req = appGlobal.getPublicRequest(); request = { - // "LanguageID": languageID == 'ar' ? 1 : 2, + // // "IPAdress": "10.20.10.20", // "VersionID": req.VersionID, // "Channel": req.Channel, @@ -105,10 +104,8 @@ class DoctorsListService extends BaseService { long = await this.sharedPref.getDouble(USER_LONG); } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -144,10 +141,9 @@ class DoctorsListService extends BaseService { Future getDoctorsProfile(int docID, int clinicID, int projectID, context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -177,10 +173,9 @@ class DoctorsListService extends BaseService { Future getDoctorsRating(int docID, context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -228,10 +223,9 @@ class DoctorsListService extends BaseService { Future getDoctorsRatingDetails(int docID, context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -259,7 +253,7 @@ class DoctorsListService extends BaseService { Future getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context, [ProjectViewModel projectViewModel]) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "DoctorID": docID, @@ -271,7 +265,6 @@ class DoctorsListService extends BaseService { "isReschadual": false, "VersionID": req.VersionID, "Channel": 3, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "generalid": "Cs2020@2016\$2958", "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, @@ -302,7 +295,7 @@ class DoctorsListService extends BaseService { Future getDoctorScheduledFreeSlots(int docID, int clinicID, int projectID, int serviceID, BuildContext context) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "DoctorID": docID, @@ -315,7 +308,6 @@ class DoctorsListService extends BaseService { "isReschadual": false, "VersionID": req.VersionID, "Channel": 3, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "generalid": "Cs2020@2016\$2958", "PatientOutSA": authUser.outSA, @@ -343,7 +335,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "IsForLiveCare": false, @@ -367,7 +358,6 @@ class DoctorsListService extends BaseService { "Age": authUser.age != null ? authUser.age : 0, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -407,7 +397,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "IsForLiveCare": true, @@ -430,7 +419,6 @@ class DoctorsListService extends BaseService { "GenderID": authUser.gender, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -460,7 +448,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -470,7 +457,6 @@ class DoctorsListService extends BaseService { "IsActiveAppointment": true, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -519,7 +505,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -530,7 +515,6 @@ class DoctorsListService extends BaseService { "IsForLiveCare": true, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -560,17 +544,9 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); - request = { - "LanguageID": languageID == 'ar' ? 1 : 2, - "ProjectID": 15, - "DeviceTypeID": req.DeviceTypeID, - "PatientID": authUser.patientID, - "PatientTypeID": authUser.patientType, - "PatientType": authUser.patientType - }; + request = {"ProjectID": 15, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType}; dynamic localRes; @@ -590,11 +566,9 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "ProjectID": projectID, "SetupID": setupID, "isDentalAllowedBackend": false, @@ -614,9 +588,9 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getPatientAppointmentHistoryWithAppoNo(int appoNo) async { + Future getPatientAppointmentHistoryWithAppoNo(int appoNo, int languageID) async { Map request; - request = {"IsActiveAppointment": true, "AppointmentNo": appoNo, "IsComingFromCOC": false}; + request = {"IsActiveAppointment": true, "AppointmentNo": appoNo, "IsComingFromCOC": false, "LanguageID": languageID}; dynamic localRes; await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async { localRes = response; @@ -635,14 +609,12 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { "IsActiveAppointment": isActiveAppointment, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "SessionID": "YckwoXhUmWBsnHKEKig", @@ -666,14 +638,13 @@ class DoctorsListService extends BaseService { Future getPatientAppointmentCurfewHistory(bool isActiveAppointment) async { Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "IsActiveAppointment": isActiveAppointment, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "SessionID": "YckwoXhUmWBsnHKEKig", @@ -702,7 +673,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -713,7 +683,6 @@ class DoctorsListService extends BaseService { "ConfirmationBy": 102, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "SessionID": "YckwoXhUmWBsnHKEKig", @@ -749,7 +718,6 @@ class DoctorsListService extends BaseService { long = await this.sharedPref.getDouble(USER_LONG); } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -767,7 +735,6 @@ class DoctorsListService extends BaseService { "DeviceType": req.DeviceType, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -798,7 +765,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -815,7 +781,6 @@ class DoctorsListService extends BaseService { "StrAppointmentDate": DateUtil.getDateFormatted(appo.appointmentDate), "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -845,7 +810,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -855,7 +819,6 @@ class DoctorsListService extends BaseService { "IsFollowup": patientShareResponse.isFollowup, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -885,7 +848,6 @@ class DoctorsListService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { @@ -898,7 +860,6 @@ class DoctorsListService extends BaseService { "To": to, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -926,14 +887,13 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "ClientRequestID": transactionID, "IsPharmacy": isPharma, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -971,7 +931,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "AdvanceNumber": advanceNumber, @@ -980,7 +940,6 @@ class DoctorsListService extends BaseService { "AppointmentID": appointmentID, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1006,7 +965,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "AdvanceNumber": advanceNumber, @@ -1021,7 +980,6 @@ class DoctorsListService extends BaseService { "DeviceType": Platform.isIOS ? "iOS" : "Android", "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1083,13 +1041,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future isAllowedToAskDoctor(int docID, BuildContext context) async { + Future isAllowedToAskDoctor(int docID, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "IsForAskYourDoctor": true, @@ -1097,9 +1055,9 @@ class DoctorsListService extends BaseService { "Top": 25, "beforeDays": 15, "exludType": 4, + "LanguageID": languageID, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1120,18 +1078,17 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getCallRequestType(BuildContext context) async { + Future getCallRequestType(int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1140,6 +1097,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; @@ -1152,13 +1110,13 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future sendAskDocCallRequest(AppoitmentAllHistoryResultList appo, String requestType, BuildContext context) async { + Future sendAskDocCallRequest(AppoitmentAllHistoryResultList appo, String requestType, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { @@ -1180,7 +1138,6 @@ class DoctorsListService extends BaseService { "EditedOn": DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()).split(" ")[0], "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1189,6 +1146,7 @@ class DoctorsListService extends BaseService { "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, + "LanguageID": languageID, "PatientType": authUser.patientType }; @@ -1207,13 +1165,12 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "AppointmentNo": appoNo, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1240,7 +1197,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "AppointmentNo": appoNo, @@ -1248,7 +1205,6 @@ class DoctorsListService extends BaseService { "ClinicID": clinicID, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1275,7 +1231,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "AppointmentNo": appo.appointmentNo, @@ -1285,7 +1241,6 @@ class DoctorsListService extends BaseService { "VersionID": req.VersionID, "SetupID": appo.setupID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1312,7 +1267,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "AppointmentDate": appoDate, @@ -1325,7 +1280,6 @@ class DoctorsListService extends BaseService { "SetupID": setupId, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1352,7 +1306,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "ProjectID": projectID, @@ -1370,7 +1324,6 @@ class DoctorsListService extends BaseService { }, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1397,7 +1350,7 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { @@ -1416,7 +1369,7 @@ class DoctorsListService extends BaseService { "PaymentMethod": paymentMethodName, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1442,13 +1395,12 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1483,13 +1435,12 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1527,14 +1478,13 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { "MedCategoryID": medCategoryId, "MedGetStsID": medCategoryStsId, "VersionID": req.VersionID, "Channel": req.Channel, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": req.IPAdress, "generalid": req.generalid, "PatientOutSA": authUser.outSA, @@ -1557,12 +1507,7 @@ class DoctorsListService extends BaseService { Future sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, int checkInBy, BuildContext context) async { Map request; - request = { - "AppointmentNo": appointmentNo, - "NFC_Code": nfcCode, - "ProjectID": projectId, - "CheckinBy": checkInBy - }; + request = {"AppointmentNo": appointmentNo, "NFC_Code": nfcCode, "ProjectID": projectId, "CheckinBy": checkInBy}; dynamic localRes; await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async { localRes = response; @@ -1827,7 +1772,6 @@ class DoctorsListService extends BaseService { Map requestFreeSlots; Map request; - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); requestFreeSlots = { "DoctorID": docID, @@ -1839,7 +1783,6 @@ class DoctorsListService extends BaseService { "isReschadual": false, "VersionID": req.VersionID, "Channel": 3, - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "generalid": "Cs2020@2016\$2958", "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index a629df89..ff8abbdc 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -248,7 +248,7 @@ class AuthProvider with ChangeNotifier { return Future.value(localRes); } - Future checkActivationCode(request, [value]) async { + Future checkActivationCode(request, [value]) async { var neRequest = CheckActivationCodeReq.fromJson(request); neRequest.activationCode = value ?? "0000"; @@ -377,16 +377,14 @@ class AuthProvider with ChangeNotifier { requestN.patientOutSA = requestN.patientobject.patientOutSA; final DateFormat dateFormat = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); - if(nhic !=null) { - requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format( - dateFormat.parse(nhic['DateOfBirth'])); + if (nhic != null) { + requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth'])); requestN.isHijri = nhic['IsHijri'] ? 1 : 0; requestN.healthId = requestN.patientobject.eHealthIDField; } requestN.zipCode = requestN.patientOutSA == 1 ? '971' : '966'; - await sharedPref.remove(USER_PROFILE); dynamic localRes; diff --git a/lib/services/family_files/family_files_provider.dart b/lib/services/family_files/family_files_provider.dart index 7a41f6b9..7d07e2e5 100644 --- a/lib/services/family_files/family_files_provider.dart +++ b/lib/services/family_files/family_files_provider.dart @@ -1,7 +1,9 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart'; import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/send_activation_request.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; @@ -9,6 +11,7 @@ import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsBySta import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:flutter/cupertino.dart'; +import 'package:provider/provider.dart'; // SharedPreferences sharedPref = new SharedPreferences(); enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } @@ -36,7 +39,7 @@ class FamilyFilesProvider with ChangeNotifier { dynamic authenticatedUser; GetAllSharedRecordsByStatusResponse allSharedRecordsByStatusResponse; - Future getSharedRecordByStatus() async { + Future getSharedRecordByStatus(int languageID) async { dynamic localRes; try { var request = GetAllSharedRecordsByStatusReq(); @@ -233,7 +236,7 @@ class FamilyFilesProvider with ChangeNotifier { } } - Future silentLoggin(GetAllSharedRecordsByStatusList switchUser, {onSuccess, mainUser}) async { + Future silentLoggin(GetAllSharedRecordsByStatusList switchUser, int languageID, {onSuccess, mainUser}) async { Map request = {}; if (mainUser == true) { var currentUser = AuthenticatedUser.fromJson(await sharedPref.getObject(MAIN_USER)); @@ -251,6 +254,7 @@ class FamilyFilesProvider with ChangeNotifier { request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966"; request['activationCode'] = '0000'; request['isRegister'] = false; + request['LanguageID'] = languageID; } else { var currentUser = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); //const request = new SwitchUserRequest(); @@ -268,6 +272,7 @@ class FamilyFilesProvider with ChangeNotifier { // request['ZipCode'] = currentUser.outSA == 1 ? "971" : "966"; request['activationCode'] = '0000'; request['isRegister'] = false; + request['LanguageID'] = languageID; } try { dynamic localRes; @@ -280,7 +285,8 @@ class FamilyFilesProvider with ChangeNotifier { }, body: request); sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType']); return Future.value(localRes); - } catch (error) { + } + catch (error) { print(error); throw error; } diff --git a/lib/services/livecare_services/livecare_provider.dart b/lib/services/livecare_services/livecare_provider.dart index 2a18c79c..126f5a73 100644 --- a/lib/services/livecare_services/livecare_provider.dart +++ b/lib/services/livecare_services/livecare_provider.dart @@ -57,7 +57,7 @@ class LiveCareService extends BaseService { return Future.value(localRes); } - Future getLiveCareScheduledDoctorList(BuildContext context, int serviceID) async { + Future getLiveCareScheduledDoctorList(BuildContext context, int serviceID, int languageID) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -69,7 +69,8 @@ class LiveCareService extends BaseService { "ServiceID": serviceID, "Age": authUser.age != null ? authUser.age : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0, - "Gender": authUser.gender != null ? authUser.gender : 0 + "Gender": authUser.gender != null ? authUser.gender : 0, + "LanguageID": languageID }; dynamic localRes; @@ -146,7 +147,7 @@ class LiveCareService extends BaseService { return Future.value(localRes); } - Future getERAppointmentFees(int serviceID, bool isPharmaLiveCare, BuildContext context) async { + Future getERAppointmentFees(int serviceID, bool isPharmaLiveCare, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -160,7 +161,8 @@ class LiveCareService extends BaseService { "ProjectID": 12, "PatientID": authUser.patientID != null ? authUser.patientID : 0, "Age": authUser.age != null ? authUser.age : 0, - "Gender": authUser.gender != null ? authUser.gender : 0 + "Gender": authUser.gender != null ? authUser.gender : 0, + "LanguageID": languageID }; dynamic localRes; @@ -173,7 +175,7 @@ class LiveCareService extends BaseService { return Future.value(localRes); } - Future getERAppointmentTime(int serviceID, bool isPharmaLiveCare, BuildContext context) async { + Future getERAppointmentTime(int serviceID, bool isPharmaLiveCare, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -187,7 +189,8 @@ class LiveCareService extends BaseService { "ProjectID": 12, "Age": authUser.age != null ? authUser.age : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0, - "Gender": authUser.gender != null ? authUser.gender : 0 + "Gender": authUser.gender != null ? authUser.gender : 0, + "LanguageID": languageID }; dynamic localRes; diff --git a/lib/services/my_invoice_service/my_invoice_services.dart b/lib/services/my_invoice_service/my_invoice_services.dart index 561f0da1..75807506 100644 --- a/lib/services/my_invoice_service/my_invoice_services.dart +++ b/lib/services/my_invoice_service/my_invoice_services.dart @@ -15,11 +15,9 @@ class MyInvoicesService extends BaseService { Future getAllDentalAppointments(int projectID, context) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -38,8 +36,7 @@ class MyInvoicesService extends BaseService { dynamic localRes; - await baseAppClient.post(GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC, - onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; @@ -49,11 +46,9 @@ class MyInvoicesService extends BaseService { Future getDentalAppointmentInvoice(int projectID, int appoNo, int invoiceNo, context) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -74,22 +69,19 @@ class MyInvoicesService extends BaseService { dynamic localRes; - await baseAppClient.post(GET_DENTAL_APPOINTMENT_INVOICE, - onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + await baseAppClient.post(GET_DENTAL_APPOINTMENT_INVOICE, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } Future sendDentalAppointmentInvoiceEmail(int projectID, int appoNo, context) async { Map request; - var languageID = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, @@ -110,13 +102,11 @@ class MyInvoicesService extends BaseService { dynamic localRes; - await baseAppClient.post(SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL, - onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); + await baseAppClient.post(SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); return Future.value(localRes); } - } diff --git a/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart b/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart index 459c0e83..6c316f7f 100644 --- a/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart +++ b/lib/services/smartwatch_integration/SmartWatchIntegrationService.dart @@ -23,11 +23,9 @@ class SmartWatchIntegrationService extends BaseService { authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, "IPAdress": "10.20.10.20", "VersionID": req.VersionID, "Channel": req.Channel, diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index e71a4266..408b0afc 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -650,15 +650,17 @@ class _AppDrawerState extends State { // print(await sharedPref.getObject(FAMILY_FILE)); return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE))); } else { - return familyFileProvider.getSharedRecordByStatus(); + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + return familyFileProvider.getSharedRecordByStatus(languageID); } } } switchUser(user, context) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); sharedPref.remove(BLOOD_TYPE); - this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser).then((value) { + this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, languageID, mainUser: user is AuthenticatedUser).then((value) { // GifLoaderDialogUtils.hideDialog(context); // Navigator.of(context).pop(); loginAfter(value, context, user is AuthenticatedUser); @@ -666,7 +668,7 @@ class _AppDrawerState extends State { }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); - AppToast.showErrorToast(message: err); + AppToast.showErrorToast(message: err.toString()); Navigator.of(context).pop(); }); } @@ -705,8 +707,10 @@ class _AppDrawerState extends State { if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser(); + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + appointmentRateViewModel - .getIsLastAppointmentRatedList() + .getIsLastAppointmentRatedList(languageID) .then((value) => { getToDoCount(), //Utils.hideProgressDialog(), diff --git a/pubspec.yaml b/pubspec.yaml index 2b657883..4e49ef9d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.75+1 +version: 4.5.035+4050035 environment: sdk: ">=2.7.0 <3.0.0" From 4ac11b21697314c1ca5df4ce8013214f3600b8ee Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 20 Dec 2023 23:23:31 +0300 Subject: [PATCH 86/86] LanguageID Fixes --- lib/config/config.dart | 2 +- lib/core/service/hospital_service.dart | 3 +- lib/core/viewModels/er/EdOnlineViewModel.dart | 4 +- .../viewModels/er/am_request_view_model.dart | 8 +- lib/core/viewModels/hospital_view_model.dart | 4 +- .../medical/my_balance_view_model.dart | 4 +- .../NewCMC/new_cmc_step_three_page.dart | 6 +- .../new_e_referral_step_three_page.dart | 5 +- .../bmi_calculator/bariatrics-screen.dart | 6 +- .../bmi_calculator/result_page.dart | 6 +- .../BookAppointment/DentalComplaints.dart | 16 +- .../components/LaserClinic.dart | 3 +- .../components/SearchByClinic.dart | 6 +- .../components/SearchByDoctor.dart | 3 +- .../widgets/DentalComplaintCard.dart | 5 +- .../BookAppointment/widgets/DoctorView.dart | 3 +- lib/pages/ErService/AmbulanceReq.dart | 2 +- .../EdOnlineSelectedHospitalPage.dart | 2 +- .../medical/balance/advance_payment_page.dart | 2 +- .../appointment_services/GetDoctorsList.dart | 11 +- .../clinic_services/get_clinic_service.dart | 36 ++--- lib/widgets/others/bottom_bar.dart | 140 +++++++----------- .../others/floating_button_search.dart | 6 +- pubspec.yaml | 2 +- 24 files changed, 138 insertions(+), 147 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index f0dd61b1..f9296273 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -339,7 +339,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 11.5; +var VERSION_ID = 11.6; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/core/service/hospital_service.dart b/lib/core/service/hospital_service.dart index be0024ab..e6dc7727 100644 --- a/lib/core/service/hospital_service.dart +++ b/lib/core/service/hospital_service.dart @@ -51,13 +51,14 @@ class HospitalService extends BaseService { } } - Future getHospitals({bool isResBasedOnLoc = true, bool isAdvancePayment = false}) async { + Future getHospitals(int languageID, {bool isResBasedOnLoc = true, bool isAdvancePayment = false}) async { if (isResBasedOnLoc) await _getCurrentLocation(); Map body = Map(); body['Latitude'] = await this.sharedPref.getDouble(USER_LAT); body['Longitude'] = await this.sharedPref.getDouble(USER_LONG); body['IsOnlineCheckIn'] = isResBasedOnLoc; body['IsAdvancePayment'] = isAdvancePayment; + body['LanguageID'] = languageID; await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) { _hospitals.clear(); diff --git a/lib/core/viewModels/er/EdOnlineViewModel.dart b/lib/core/viewModels/er/EdOnlineViewModel.dart index 1970a965..00be41b2 100644 --- a/lib/core/viewModels/er/EdOnlineViewModel.dart +++ b/lib/core/viewModels/er/EdOnlineViewModel.dart @@ -20,10 +20,10 @@ class EdOnlineViewModel extends BaseViewModel { ErPatientShareModel get erPatientShareModel => _edOnlineServices.erPatientShareModel; - Future getHospitals() async { + Future getHospitals(int languageID) async { if(_hospitalService.hospitals.isEmpty){ setState(ViewState.Busy); - await _hospitalService.getHospitals(); + await _hospitalService.getHospitals(languageID); if (_hospitalService.hasError) { error = _hospitalService.error; setState(ViewState.Error); diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart index aff532d7..53eb477a 100644 --- a/lib/core/viewModels/er/am_request_view_model.dart +++ b/lib/core/viewModels/er/am_request_view_model.dart @@ -50,19 +50,19 @@ class AmRequestViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getAmRequestOrders() async { + Future getAmRequestOrders(int languageID) async { setState(ViewState.Busy); await _amService.getAllTransportationOrders(); if (_amService.hasError) { error = _amService.error; setState(ViewState.Error); } else - getHospitals(); + getHospitals(languageID); } - Future getHospitals() async { + Future getHospitals(int languageID) async { setState(ViewState.Busy); - await _hospitalService.getHospitals(isResBasedOnLoc: false); + await _hospitalService.getHospitals(languageID, isResBasedOnLoc: false); if (_hospitalService.hasError) { error = _hospitalService.error; setState(ViewState.Error); diff --git a/lib/core/viewModels/hospital_view_model.dart b/lib/core/viewModels/hospital_view_model.dart index 66ad4b01..c406c3dc 100644 --- a/lib/core/viewModels/hospital_view_model.dart +++ b/lib/core/viewModels/hospital_view_model.dart @@ -10,9 +10,9 @@ class HospitalViewModel extends BaseViewModel { List get hospitals => _hospitalService.hospitals; - Future getHospitals() async { + Future getHospitals(int languageID) async { setState(ViewState.Busy); - await _hospitalService.getHospitals(); + await _hospitalService.getHospitals(languageID); if (_hospitalService.hasError) { error = _hospitalService.error; setState(ViewState.Error); diff --git a/lib/core/viewModels/medical/my_balance_view_model.dart b/lib/core/viewModels/medical/my_balance_view_model.dart index 4166a4b3..47289b81 100644 --- a/lib/core/viewModels/medical/my_balance_view_model.dart +++ b/lib/core/viewModels/medical/my_balance_view_model.dart @@ -70,9 +70,9 @@ class MyBalanceViewModel extends BaseViewModel { } } - Future getHospitals({bool isAdvancePayment = false}) async { + Future getHospitals(int languageID, {bool isAdvancePayment = false}) async { setState(ViewState.Busy); - await _hospitalService.getHospitals(isAdvancePayment: isAdvancePayment); + await _hospitalService.getHospitals(languageID, isAdvancePayment: isAdvancePayment); if (_hospitalService.hasError) { error = _hospitalService.error; setState(ViewState.Error); diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart index ec020f49..154dbe19 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart @@ -41,6 +41,7 @@ class _NewCMCStepThreePageState extends State { HospitalsModel selectedHospital; final GlobalKey projectDropdownKey = GlobalKey(); bool isLocationSelected = false; + ProjectViewModel projectViewModel; static CameraPosition _kGooglePlex = CameraPosition( target: LatLng(37.42796133580664, -122.085749655962), @@ -74,7 +75,7 @@ class _NewCMCStepThreePageState extends State { @override Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); + projectViewModel = Provider.of(context); return AppScaffold( isShowAppBar: true, description: TranslationBase.of(context).infoCMC, @@ -360,10 +361,11 @@ class _NewCMCStepThreePageState extends State { } getProjectsList() { + int languageID = projectViewModel.isArabic ? 1 : 2; ClinicListService service = new ClinicListService(); GifLoaderDialogUtils.showMyDialog(context); List projectsListLocal = []; - service.getProjectsList(context).then((res) { + service.getProjectsList(languageID, context).then((res) { if (res['MessageStatus'] == 1) { setState(() { res['ListProject'].forEach((v) { diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart index 7bacad65..e5ed6ff4 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart'; @@ -22,6 +23,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import '../dialogs/select_city_dialog.dart'; @@ -436,9 +438,10 @@ class _NewEReferralStepThreePageState extends State { } void getAllProjects() { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; ClinicListService service = new ClinicListService(); List projectsListLocal = []; - service.getProjectsList(context).then((res) { + service.getProjectsList(languageID, context).then((res) { if (res['MessageStatus'] == 1) { setState(() { res['ListProject'].forEach((v) { diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart index 13de0140..48ef57ff 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart @@ -32,10 +32,11 @@ class BariatricsPage extends StatefulWidget { class _BariatricsPageState extends State { DiseasesByClinic _selectedDisease; + ProjectViewModel projectProvider; @override Widget build(BuildContext context) { - ProjectViewModel projectProvider = Provider.of(context); + projectProvider = Provider.of(context); return BaseView( onModelReady: (model) => model.getClinicCategory(), @@ -139,6 +140,7 @@ class _BariatricsPageState extends State { } callDoctorsSearchAPI() { + int languageID = projectProvider.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; List arr = []; @@ -148,7 +150,7 @@ class _BariatricsPageState extends State { List _patientDoctorAppointmentListHospital = List(); DoctorsListService service = new DoctorsListService(); - service.getDoctorsList(108, 0, false, context).then((res) { + service.getDoctorsList(108, 0, false, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart index fa12a9fe..d4a4f5fc 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart @@ -1,8 +1,8 @@ import 'dart:collection'; import 'package:auto_size_text/auto_size_text.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; @@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; +import 'package:provider/provider.dart'; class ResultPage extends StatefulWidget { final double finalResult; @@ -137,6 +138,7 @@ class _ResultPageState extends State { } callDoctorsSearchAPI() { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; List arr = []; @@ -146,7 +148,7 @@ class _ResultPageState extends State { List _patientDoctorAppointmentListHospital = List(); DoctorsListService service = new DoctorsListService(); - service.getDoctorsList(108, 0, false, context).then((res) { + service.getDoctorsList(108, 0, false, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 27cb951e..487fbab4 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -75,10 +75,12 @@ class _DentalComplaintsState extends State { languageID: languageID, isDoctorNameSearch: widget.isDoctorNameSearch, onSelectedMethod: widget.onSelectedMethod, - )..logAnalytics = (){ - final info = widget.searchInfo; - locator().appointment.book_appointment_chief_complaints(appointment_type: 'regular', hospital: info.hospital, clinic: info.clinic, treatment: complaintsList[index]); - }, + )..logAnalytics = () { + final info = widget.searchInfo; + locator() + .appointment + .book_appointment_chief_complaints(appointment_type: 'regular', hospital: info.hospital, clinic: info.clinic, treatment: complaintsList[index]); + }, ); }, separatorBuilder: (BuildContext context, int index) { @@ -207,11 +209,12 @@ class _DentalComplaintsState extends State { } continueDentalPlan() { + int languageID = projectViewModel.isArabic ? 1 : 2; DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); int appoTime = 0; - service.getDoctorsList(int.parse("17"), widget.searchInfo.ProjectID, false, context, isContinueDentalPlan: true).then((res) { + service.getDoctorsList(int.parse("17"), widget.searchInfo.ProjectID, false, languageID, context, isContinueDentalPlan: true).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { dentalProceduresModel = DentalProceduresModel.fromJson(res); @@ -254,10 +257,11 @@ class _DentalComplaintsState extends State { } getChiefComplaintsList() { + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); getLanguageID(); ClinicListService service = new ClinicListService(); - service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context).then((res) { + service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/BookAppointment/components/LaserClinic.dart b/lib/pages/BookAppointment/components/LaserClinic.dart index 918ca9ad..c7e32565 100644 --- a/lib/pages/BookAppointment/components/LaserClinic.dart +++ b/lib/pages/BookAppointment/components/LaserClinic.dart @@ -204,6 +204,7 @@ class _LaserClinicState extends State with SingleTickerProviderStat } callDoctorsSearchAPI() { + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; List arr = []; @@ -214,7 +215,7 @@ class _LaserClinicState extends State with SingleTickerProviderStat DoctorsListService service = new DoctorsListService(); projectViewModel.selectedBodyPartList = _selectedBodyPartList; - service.getDoctorsList(253, 0, false, context).then((res) { + service.getDoctorsList(253, 0, false, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 26deb0f8..a0fed504 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -499,10 +499,11 @@ class _SearchByClinicState extends State { } getProjectsList() { + int languageID = projectViewModel.isArabic ? 1 : 2; ClinicListService service = new ClinicListService(); List projectsListLocal = []; service - .getProjectsList(context) + .getProjectsList(languageID, context) .then((res) { if (res['MessageStatus'] == 1) { setState(() { @@ -572,6 +573,7 @@ class _SearchByClinicState extends State { } callDoctorsSearchAPI(int clinicID) { + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; List arr = []; @@ -581,7 +583,7 @@ class _SearchByClinicState extends State { List _patientDoctorAppointmentListHospital = List(); DoctorsListService service = new DoctorsListService(); - service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, nearestAppo, context).then((res) { + service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, nearestAppo, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 4425d926..a37f45e1 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -90,13 +90,14 @@ class _SearchByDoctorState extends State { } getDoctorsList(BuildContext context) { + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; DoctorsListService service = new DoctorsListService(); List _patientDoctorAppointmentListHospital = List(); - service.getDoctorsListByName(doctorNameController.text, context).then((res) { + service.getDoctorsListByName(doctorNameController.text, languageID, context).then((res) { // GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart index 83b298f2..7e93dc9f 100644 --- a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart +++ b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; @@ -6,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; // ignore: must_be_immutable class DentalComplaintCard extends StatefulWidget { @@ -60,12 +62,13 @@ class _DentalComplaintCardState extends State { } getChiefComplaintsList() { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; List doctorsList = []; List _patientDoctorAppointmentListHospital = List(); GifLoaderDialogUtils.showMyDialog(context); ClinicListService service = new ClinicListService(); - service.getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD, widget.listDentalChiefComplain.projectID, context).then((res) { + service.getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD, widget.listDentalChiefComplain.projectID, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { print(res['List_DentalDoctorChiefComplaintMapping']); diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 32aff5ac..6969302f 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -183,10 +183,11 @@ class DoctorView extends StatelessWidget { } getDoctorsProfile(context, DoctorList docObject, {isAppo}) { + int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List docProfileList = []; DoctorsListService service = new DoctorsListService(); - service.getDoctorsProfile(docObject.doctorID, docObject.clinicID, docObject.projectID, context).then((res) { + service.getDoctorsProfile(docObject.doctorID, docObject.clinicID, docObject.projectID, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['DoctorProfileList'].length != 0) { diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 3803bcd4..29abc3fc 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -40,7 +40,7 @@ class _AmbulanceReqState extends State with SingleTickerProviderSt imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/Ambulance/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/Ambulance/ar/0.png')); return BaseView( - onModelReady: (model) => model.getAmRequestOrders(), + onModelReady: (model) => model.getAmRequestOrders(projectViewModel.isArabic ? 1 : 2), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, showNewAppBarTitle: true, diff --git a/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart b/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart index 76eace88..ca933f42 100644 --- a/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart +++ b/lib/pages/ErService/EdOnline/EdOnlineSelectedHospitalPage.dart @@ -33,7 +33,7 @@ class _EdOnlineSelectedHospitalPageState extends State( - onModelReady: (model) => model.getHospitals(), + onModelReady: (model) => model.getHospitals(projectViewModel.isArabic ? 1 : 2), builder: (_, model, w) => AppScaffold( baseViewModel: model, body: SingleChildScrollView( diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index a07944f1..f2a9c79a 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -67,7 +67,7 @@ class _AdvancePaymentPageState extends State { projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) { - model.getHospitals(isAdvancePayment: true); + model.getHospitals(projectViewModel.isArabic ? 1 : 2, isAdvancePayment: true); model.getFamilyFiles(); }, builder: (_, model, w) => AppScaffold( diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index f3b7670c..94766e3c 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -34,7 +34,7 @@ class DoctorsListService extends BaseService { String tokenID; List selectedBodyPartList = []; - Future getDoctorsList(int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async { + Future getDoctorsList(int clinicID, int projectID, bool isNearest, int languageID, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -74,6 +74,7 @@ class DoctorsListService extends BaseService { "Longitude": long != null ? long.toString() : 0, "isDentalAllowedBackend": clinicID == 17 ? true : isContinueDentalPlan, "IsGetNearAppointment": isNearest, + "LanguageID": languageID, if (isNearest) "SelectedDate": DateUtil.convertDateToString(DateTime.now()), "License": true }; @@ -88,7 +89,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorsListByName(String docName, BuildContext context) async { + Future getDoctorsListByName(String docName, int languageID, BuildContext context) async { Map request; double lat; @@ -126,6 +127,7 @@ class DoctorsListService extends BaseService { "IsGetNearAppointment": false, "Latitude": lat == null ? 0.0 : lat, "Longitude": long == null ? 0.0 : long, + "LanguageID": languageID, "License": true }; @@ -139,7 +141,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorsProfile(int docID, int clinicID, int projectID, context) async { + Future getDoctorsProfile(int docID, int clinicID, int projectID, int languageID, context) async { Map request; Request req = appGlobal.getPublicRequest(); @@ -158,7 +160,8 @@ class DoctorsListService extends BaseService { "License": true, "IsRegistered": true, "ProjectID": projectID, - "isDentalAllowedBackend": false + "isDentalAllowedBackend": false, + "LanguageID": languageID, }; dynamic localRes; diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 469ac404..80032015 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -34,10 +34,7 @@ class ClinicListService extends BaseService { Future getActiveAppointmentNo(context) async { Map request = {}; - request = { - "IsActiveAppointment": true, - "LanguageID": 1 - }; + request = {"IsActiveAppointment": true, "LanguageID": 1}; dynamic localRes; @@ -49,12 +46,10 @@ class ClinicListService extends BaseService { return Future.value(localRes); } - Future getProjectsList(context) async { + Future getProjectsList(int languageID, context) async { Map request = {}; - request = { - "LanguageID": null - }; + request = {"LanguageID": languageID}; dynamic localRes; @@ -66,7 +61,7 @@ class ClinicListService extends BaseService { return Future.value(localRes); } - Future getChiefComplaintsList(int clinicID, int projectID, BuildContext context, {doctorId}) async { + Future getChiefComplaintsList(int clinicID, int projectID, int languageID, BuildContext context, {doctorId}) async { //Utils.showProgressDialog(context); Map request; @@ -85,7 +80,7 @@ class ClinicListService extends BaseService { "License": true, // "VersionID": 5.6, // "Channel": 3, - // "LanguageID": languageID == 'ar' ? 1 : 2, + "LanguageID": languageID, "IPAdress": "10.20.10.20", "generalid": "Cs2020@2016\$2958", "SessionID": null, @@ -107,7 +102,7 @@ class ClinicListService extends BaseService { return Future.value(localRes); } - Future getChiefComplaintDoctorList(int chiefComplaintID, int projectID, BuildContext context, {doctorId}) async { + Future getChiefComplaintDoctorList(int chiefComplaintID, int projectID, int languageID, BuildContext context, {doctorId}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -127,7 +122,7 @@ class ClinicListService extends BaseService { "ProjectID": projectID, // "VersionID": 5.6, // "Channel": 3, - // "LanguageID": languageID == 'ar' ? 1 : 2, + "LanguageID": languageID, // "IPAdress": req.IPAdress, // "generalid": req.generalid, "SessionID": null, @@ -147,14 +142,15 @@ class ClinicListService extends BaseService { }, body: request); return Future.value(localRes); } + Future getCountries() async { - Map request ={}; + Map request = {}; dynamic localRes; - await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); - return Future.value(localRes); -} + await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } } diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 04f4f851..ab747e64 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -2,6 +2,7 @@ import 'dart:collection'; import 'dart:math'; import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; @@ -33,6 +34,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:provider/provider.dart'; + // import 'package:speech_to_text/speech_recognition_error.dart'; // import 'package:speech_to_text/speech_recognition_result.dart'; // import 'package:speech_to_text/speech_to_text.dart'; @@ -44,9 +47,10 @@ class BottomBarSearch extends StatefulWidget { class _SearchBot extends State { SearchProvider searchProvider = new SearchProvider(); - RobotProvider Provider = RobotProvider(); + RobotProvider robotProvider = RobotProvider(); bool isLoading = false; bool isError = false; + // final SpeechToText speech = SpeechToText(); String error = ''; String _currentLocaleId = ""; @@ -64,6 +68,7 @@ class _SearchBot extends State { bool _isInit = true; TextEditingController searchController = TextEditingController(); + ProjectViewModel projectProvider; @override void initState() { @@ -74,40 +79,37 @@ class _SearchBot extends State { @override Widget build(BuildContext context) { + projectProvider = Provider.of(context); return BottomAppBar( - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Expanded( - child: SizedBox( - height: 64, - child: Material( - type: MaterialType.transparency, - child: TextField( - keyboardType: TextInputType.multiline, - maxLines: null, - controller: searchController, - decoration: InputDecoration( - hintText: TranslationBase.of(context).textToSpeech, - suffixIcon: IconButton( - icon: Icon(Icons.mic), - onPressed: () async { - setState(() { - searchController.text = ''; - }); - // await flutterTts.speak("Hello!"); - //Future.delayed(const Duration(seconds: 1), () { - initSpeechState() - .then((value) => startVoiceSearch()); - //}); - }, - )), - ), - ), + child: Row(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ + Expanded( + child: SizedBox( + height: 64, + child: Material( + type: MaterialType.transparency, + child: TextField( + keyboardType: TextInputType.multiline, + maxLines: null, + controller: searchController, + decoration: InputDecoration( + hintText: TranslationBase.of(context).textToSpeech, + suffixIcon: IconButton( + icon: Icon(Icons.mic), + onPressed: () async { + setState(() { + searchController.text = ''; + }); + // await flutterTts.speak("Hello!"); + //Future.delayed(const Duration(seconds: 1), () { + initSpeechState().then((value) => startVoiceSearch()); + //}); + }, + )), ), ), - ]), + ), + ), + ]), ); } @@ -164,10 +166,7 @@ class _SearchBot extends State { Future initSpeechState() async { // await speech.initialize(onError: errorListener, onStatus: statusListener); - _currentLocaleId = - TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' - ? 'en-GB' - : 'ar-SA'; // systemLocale.localeId; + _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId; flutterTts.setLanguage(_currentLocaleId); // if (!mounted) return; @@ -187,16 +186,9 @@ class _SearchBot extends State { } getPages(text) { - var request = { - 'VoiceMessage': text, - 'Lang': TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' - ? 'En' - : 'Ar' - }; - - searchProvider - .getBotPages(request) - .then((value) => {getCommands(value['Understand'])}); + var request = {'VoiceMessage': text, 'Lang': TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' ? 'En' : 'Ar'}; + + searchProvider.getBotPages(request).then((value) => {getCommands(value['Understand'])}); } getCommands(result) async { @@ -207,9 +199,7 @@ class _SearchBot extends State { case '100': { List clnicID = unique(result['ClinicId']); - if (result['ProjectId'] != 0 && - clnicID.length > 0 && - result['DoctorId'].length > 0) { + if (result['ProjectId'] != 0 && clnicID.length > 0 && result['DoctorId'].length > 0) { if (clnicID.length == 1) { getDoctorsList( result['ProjectId'], @@ -221,9 +211,7 @@ class _SearchBot extends State { } else { goToClinic(clnicID); } - } else if (result['ProjectId'] != 0 && - clnicID.length > 0 && - result['DoctorId'].length == 0) { + } else if (result['ProjectId'] != 0 && clnicID.length > 0 && result['DoctorId'].length == 0) { if (clnicID.length == 1) { getDoctorsList( result['ProjectId'], @@ -233,9 +221,7 @@ class _SearchBot extends State { } else { goToClinic(clnicID); } - } else if (result['ProjectId'] == 0 && - clnicID.length > 0 && - result['DoctorId'].length == 0) { + } else if (result['ProjectId'] == 0 && clnicID.length > 0 && result['DoctorId'].length == 0) { if (clnicID.length == 1) { getDoctorsList( result['ProjectId'], @@ -245,9 +231,7 @@ class _SearchBot extends State { } else { goToClinic(clnicID); } - } else if (result['ProjectId'] == 0 && - clnicID.length > 0 && - result['DoctorId'].length > 0) { + } else if (result['ProjectId'] == 0 && clnicID.length > 0 && result['DoctorId'].length > 0) { if (clnicID.length == 1) { getDoctorsList( result['ProjectId'], @@ -394,12 +378,11 @@ class _SearchBot extends State { } getDoctorProfile(projectId, clinicId, doctorId, context, doctorData) { + int languageID = projectProvider.isArabic ? 1 : 2; List docProfileList = []; DoctorsListService service = new DoctorsListService(); - service - .getDoctorsProfile(doctorId, clinicId, projectId, context) - .then((res) { + service.getDoctorsProfile(doctorId, clinicId, projectId, languageID, context).then((res) { if (res['MessageStatus'] == 1) { if (res['DoctorProfileList'].length != 0) { res['DoctorProfileList'].forEach((v) { @@ -407,8 +390,7 @@ class _SearchBot extends State { }); } - navigateToDoctorProfile(context, doctorData[0], docProfileList[0], - isAppo: true); + navigateToDoctorProfile(context, doctorData[0], docProfileList[0], isAppo: true); //speak(); } }).catchError((err) { @@ -417,33 +399,27 @@ class _SearchBot extends State { } getDoctorsList(projectId, clinicId, context, {doctorId, doctorName}) { + int languageID = projectProvider.isArabic ? 1 : 2; List doctorsList = []; List arr = []; List arrDistance = []; DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service - .getDoctorsList(clinicId, projectId, false, context, - doctorId: doctorId, doctorName: doctorName) - .then((res) { + service.getDoctorsList(clinicId, projectId, false, languageID, context, doctorId: doctorId, doctorName: doctorName).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { - if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && - res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) { + if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) { doctorsList.clear(); res['SearchDoctorsByTime_IsVoiceCommandList'].forEach((v1) { v1['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); arr.add(new DoctorList.fromJson(v).projectName); - arrDistance.add(new DoctorList.fromJson(v) - .projectDistanceInKiloMeters - .toString()); + arrDistance.add(new DoctorList.fromJson(v).projectDistanceInKiloMeters.toString()); }); }); if (doctorsList.length == 1) { - getDoctorProfile( - projectId, clinicId, doctorId[0], context, doctorsList); + getDoctorProfile(projectId, clinicId, doctorId[0], context, doctorsList); //speak(); } else { @@ -455,14 +431,11 @@ class _SearchBot extends State { res['DoctorList'].forEach((v) { doctorsList.add(new DoctorList.fromJson(v)); arr.add(new DoctorList.fromJson(v).projectName); - arrDistance.add(new DoctorList.fromJson(v) - .projectDistanceInKiloMeters - .toString()); + arrDistance.add(new DoctorList.fromJson(v).projectDistanceInKiloMeters.toString()); }); if (doctorsList.length == 1) { - getDoctorProfile( - projectId, clinicId, doctorId[0], context, doctorsList); + getDoctorProfile(projectId, clinicId, doctorId[0], context, doctorsList); //speak(); } else { @@ -479,8 +452,7 @@ class _SearchBot extends State { }); } - Future navigateToDoctorProfile(context, docObject, docProfile, - {isAppo}) async { + Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async { Navigator.push( context, FadePage( @@ -497,11 +469,7 @@ class _SearchBot extends State { Navigator.push( context, FadePage( - page: BranchView( - doctorsList: docList, - result: result, - num: numAll, - resultDistance: arrDistance), + page: BranchView(doctorsList: docList, result: result, num: numAll, resultDistance: arrDistance), ), ); } diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 8e5c16b5..41f6f6cb 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -729,10 +729,11 @@ class _FloatingSearchButton extends State with TickerProvi } getDoctorProfile(projectId, clinicId, doctorId, context, doctorData) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; List docProfileList = []; DoctorsListService service = new DoctorsListService(); - service.getDoctorsProfile(doctorId, clinicId, projectId, context).then((res) { + service.getDoctorsProfile(doctorId, clinicId, projectId, languageID, context).then((res) { if (res['MessageStatus'] == 1) { if (res['DoctorProfileList'].length != 0) { res['DoctorProfileList'].forEach((v) { @@ -749,12 +750,13 @@ class _FloatingSearchButton extends State with TickerProvi } getDoctorsList(projectId, clinicId, context, {doctorId, doctorName, isNearest = false}) { + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; List doctorsList = []; List arr = []; List arrDistance = []; DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.getDoctorsList(clinicId, projectId, isNearest, context, doctorId: doctorId, doctorName: doctorName).then((res) { + service.getDoctorsList(clinicId, projectId, isNearest, languageID, context, doctorId: doctorId, doctorName: doctorName).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/pubspec.yaml b/pubspec.yaml index 4e49ef9d..58c83fe0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.035+4050035 +version: 4.5.037+4050037 environment: sdk: ">=2.7.0 <3.0.0"