From 227dd407f55ab6443d6cdb02fd10fc664ce5cb0a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 17 May 2026 10:47:48 +0300 Subject: [PATCH] Updates --- .../my_appointments/my_appointments_view_model.dart | 7 ++++++- .../appointments/appointment_payment_page.dart | 10 ++++++++++ lib/presentation/my_family/widget/family_cards.dart | 3 ++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/features/my_appointments/my_appointments_view_model.dart b/lib/features/my_appointments/my_appointments_view_model.dart index 38336a5a..e2c456fb 100644 --- a/lib/features/my_appointments/my_appointments_view_model.dart +++ b/lib/features/my_appointments/my_appointments_view_model.dart @@ -617,7 +617,12 @@ class MyAppointmentsViewModel extends ChangeNotifier { patientType: patientType); result.fold( - (failure) async => await errorHandlerService.handleError(failure: failure), + // (failure) async => await errorHandlerService.handleError(failure: failure), + (failure) async { + if (onError != null) { + onError(failure.message); + } + }, (apiResponse) { if (apiResponse.messageStatus == 2) { // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); diff --git a/lib/presentation/appointments/appointment_payment_page.dart b/lib/presentation/appointments/appointment_payment_page.dart index 2c39b43c..d909b73a 100644 --- a/lib/presentation/appointments/appointment_payment_page.dart +++ b/lib/presentation/appointments/appointment_payment_page.dart @@ -862,6 +862,16 @@ class _AppointmentPaymentPageState extends State { }); } }); + }, + onError: (err) { + LoaderBottomSheet.hideLoader(); + showCommonBottomSheetWithoutHeight( + context, + child: Utils.getErrorWidget(loadingText: err.toString()), + callBackFunc: () {}, + isFullScreen: false, + isCloseButtonVisible: true, + ); }); }, onError: (err) { showCommonBottomSheetWithoutHeight( diff --git a/lib/presentation/my_family/widget/family_cards.dart b/lib/presentation/my_family/widget/family_cards.dart index d2706732..bfae773f 100644 --- a/lib/presentation/my_family/widget/family_cards.dart +++ b/lib/presentation/my_family/widget/family_cards.dart @@ -249,7 +249,8 @@ class _FamilyCardsState extends State { galleryPermission = Permission.photos; } else { // Android: use photos permission which handles API level differences automatically - galleryPermission = Permission.photos; + print('✅ Android Photo Picker will handle permissions internally'); + return true; } // First check current status