From b78c83a32dce471b81418e8fc15fb59f8b8ce889 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 20 Sep 2026 11:02:29 +0300 Subject: [PATCH] updates --- lib/core/api/api_client.dart | 2 +- lib/features/lab/lab_view_model.dart | 12 ++++++------ lib/features/myfatoorah/myfatoorah_view_model.dart | 13 +++++++++++++ 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 lib/features/myfatoorah/myfatoorah_view_model.dart diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index 4c961843..f9cf2fa2 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -211,7 +211,7 @@ class ApiClientImp implements ApiClient { } // body['TokenID'] = "@dm!n"; - // body['PatientID'] = 5422188; + // body['PatientID'] = 1987471; // body['PatientID'] = 53320; // body['PatientTypeID'] = 1; // body['PatientOutSA'] = 0; diff --git a/lib/features/lab/lab_view_model.dart b/lib/features/lab/lab_view_model.dart index 1c25ef9d..d7f5bb62 100644 --- a/lib/features/lab/lab_view_model.dart +++ b/lib/features/lab/lab_view_model.dart @@ -209,12 +209,12 @@ class LabViewModel extends ChangeNotifier { final result = await labRepo.getLabResultReportPDF(labOrder: labOrder); result.fold( - (failure) async => await errorHandlerService.handleError( - failure: failure, - onOkPressed: () { - onError!(failure.message); - }, - ), + // (failure) async => await errorHandlerService.handleError( + (failure) async { + if (onError != null) { + onError(failure.message); + } + }, (apiResponse) { if (apiResponse.messageStatus == 2) { onError!(apiResponse.errorMessage!); diff --git a/lib/features/myfatoorah/myfatoorah_view_model.dart b/lib/features/myfatoorah/myfatoorah_view_model.dart new file mode 100644 index 00000000..8a4160e9 --- /dev/null +++ b/lib/features/myfatoorah/myfatoorah_view_model.dart @@ -0,0 +1,13 @@ +import 'package:flutter/material.dart'; +import 'package:hmg_patient_app_new/core/app_state.dart'; +import 'package:hmg_patient_app_new/services/error_handler_service.dart'; + +class MyFatoorahViewModel extends ChangeNotifier { + final AppState appState; + final ErrorHandlerService errorHandlerService; + + MyFatoorahViewModel({ + required this.appState, + required this.errorHandlerService, + }); +}