From 02e5b07681a9a45dc60c727054e78e3132b42839 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 23 Aug 2026 16:54:45 +0300 Subject: [PATCH] updates --- .../book_appointments_repo.dart | 5 +++-- .../book_appointments_view_model.dart | 2 +- lib/features/paytabs/paytabs_view_model.dart | 2 +- lib/main.dart | 17 ++++++++++------- .../appointments/appointment_payment_page.dart | 4 ++-- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/features/book_appointments/book_appointments_repo.dart b/lib/features/book_appointments/book_appointments_repo.dart index 1e0b8739..a705d84a 100644 --- a/lib/features/book_appointments/book_appointments_repo.dart +++ b/lib/features/book_appointments/book_appointments_repo.dart @@ -32,7 +32,7 @@ abstract class BookAppointmentsRepo { Future>> getDoctorProfile(int clinicID, int projectID, int doctorId, {Function(dynamic)? onSuccess, Function(String)? onError}); - Future>> getDoctorRatingDetails(int doctorId, {Function(dynamic)? onSuccess, Function(String)? onError}); + Future>> getDoctorRatingDetails(int doctorId, int projectID, {Function(dynamic)? onSuccess, Function(String)? onError}); Future>> getDoctorFreeSlots(int clinicID, int projectID, int doctorId, bool isBookingForLiveCare, {bool continueDentalPlan = false, Function(dynamic)? onSuccess, Function(String)? onError}); @@ -314,9 +314,10 @@ class BookAppointmentsRepoImp implements BookAppointmentsRepo { } @override - Future>> getDoctorRatingDetails(int doctorId, {Function(dynamic)? onSuccess, Function(String)? onError}) async { + Future>> getDoctorRatingDetails(int doctorId, int projectID, {Function(dynamic)? onSuccess, Function(String)? onError}) async { Map mapDevice = { "DoctorID": doctorId, + "ProjectID": projectID, "PatientID": 0, "License": true, "IsRegistered": true, diff --git a/lib/features/book_appointments/book_appointments_view_model.dart b/lib/features/book_appointments/book_appointments_view_model.dart index 4831901d..dbed528e 100644 --- a/lib/features/book_appointments/book_appointments_view_model.dart +++ b/lib/features/book_appointments/book_appointments_view_model.dart @@ -806,7 +806,7 @@ class BookAppointmentsViewModel extends ChangeNotifier { doctorDetailsList.clear(); notifyListeners(); - final result = await bookAppointmentsRepo.getDoctorRatingDetails(selectedDoctor.doctorID ?? 0, onSuccess: onSuccess, onError: onError); + final result = await bookAppointmentsRepo.getDoctorRatingDetails(selectedDoctor.doctorID ?? 0, selectedDoctor.projectID ?? 0, onSuccess: onSuccess, onError: onError); result.fold( (failure) async { diff --git a/lib/features/paytabs/paytabs_view_model.dart b/lib/features/paytabs/paytabs_view_model.dart index b2563452..3e36233d 100644 --- a/lib/features/paytabs/paytabs_view_model.dart +++ b/lib/features/paytabs/paytabs_view_model.dart @@ -320,7 +320,7 @@ class PayTabsViewModel extends ChangeNotifier { payfortResponseInsertModel.cardNumber = paytabsTransactionResponseModel.paymentInfo!.paymentDescription; payfortResponseInsertModel.cardBin = ""; payfortResponseInsertModel.installmentsNumber = 0; - payfortResponseInsertModel.status = paytabsTransactionResponseModel.isSuccess! ? "success" : "failed"; + payfortResponseInsertModel.status = paytabsTransactionResponseModel.isSuccess! ? "14" : "00"; payfortResponseInsertModel.merchantRef = transactionID; payfortResponseInsertModel.isRefund = false; payfortResponseInsertModel.remmeberMe = true; diff --git a/lib/main.dart b/lib/main.dart index b22bbb6b..223103ae 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -7,8 +7,11 @@ import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:hmg_patient_app_new/core/api/api_client.dart'; +import 'package:hmg_patient_app_new/core/api_consts.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart'; +import 'package:hmg_patient_app_new/core/enums.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/features/active_prescriptions/active_prescriptions_view_model.dart'; import 'package:hmg_patient_app_new/features/ask_doctor/ask_doctor_view_model.dart'; @@ -76,12 +79,12 @@ Future _firebaseMessagingBackgroundHandler(RemoteMessage message) async { // flutter3_32 pub run easy_localization:generate -O ./lib/generated -f keys -o locale_keys.g.dart --source-dir ./assets/langs -// class MyHttpOverrides extends HttpOverrides { -// @override -// HttpClient createHttpClient(SecurityContext? context) { -// return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true; -// } -// } +class MyHttpOverrides extends HttpOverrides { + @override + HttpClient createHttpClient(SecurityContext? context) { + return super.createHttpClient(context)..badCertificateCallback = (X509Certificate cert, String host, int port) => true; + } +} Future callAppStateInitializations() async { final String deviceTypeId = (Platform.isIOS @@ -130,7 +133,7 @@ Future callInitializations() async { await AppDependencies.addDependencies(); SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]); - // HttpOverrides.global = MyHttpOverrides(); + HttpOverrides.global = MyHttpOverrides(); await callAppStateInitializations(); // Initialize Security Service early to catch threats before app logic runs diff --git a/lib/presentation/appointments/appointment_payment_page.dart b/lib/presentation/appointments/appointment_payment_page.dart index 5c8bacf3..fb2c3043 100644 --- a/lib/presentation/appointments/appointment_payment_page.dart +++ b/lib/presentation/appointments/appointment_payment_page.dart @@ -649,9 +649,9 @@ class _AppointmentPaymentPageState extends State { doctorID: widget.patientAppointmentHistoryResponseModel.doctorID.toString(), transactionID: transID, amount: myAppointmentsViewModel.patientAppointmentShareResponseModel!.patientShareWithTax!.toString(), - fileNumber: widget.patientAppointmentHistoryResponseModel.patientID, + fileNumber: widget.patientAppointmentHistoryResponseModel.patientID.toString(), serviceID: "2", - projectID: widget.patientAppointmentHistoryResponseModel.projectID, + projectID: widget.patientAppointmentHistoryResponseModel.projectID.toString(), isSchedule: widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment ?? false, onSuccess: (PaytabsTransactionResponseModel transactionData) async { tamaraOrderID = transactionData.cartID!;