From 1ff91bb1591a4d552b762088c69209d51b717f27 Mon Sep 17 00:00:00 2001 From: "Aamir.Muhammad" Date: Sun, 17 May 2026 14:37:48 +0300 Subject: [PATCH] Image Functionality & Discounts & Offers --- lib/services/permission_service.dart | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/services/permission_service.dart b/lib/services/permission_service.dart index 2692bbbc..5f749af8 100644 --- a/lib/services/permission_service.dart +++ b/lib/services/permission_service.dart @@ -177,14 +177,17 @@ class PermissionService { // For Android 13+ (API 33+), the Android Photo Picker handles permissions internally // No need to request READ_MEDIA_IMAGES or READ_EXTERNAL_STORAGE permissions - if (Platform.isAndroid) { + // Determine which permission to check based on platform and Android version + Permission galleryPermission; + + if (Platform.isIOS) { + galleryPermission = Permission.photos; + } else { + // Android: use photos permission which handles API level differences automatically print('✅ Android Photo Picker will handle permissions internally'); return true; } - // iOS: Check photos permission - Permission galleryPermission = Permission.photos; - // First check current status PermissionStatus currentStatus = await galleryPermission.status; print('Current gallery permission status: $currentStatus'); @@ -219,6 +222,7 @@ class PermissionService { Navigator.pop(context); }, onConfirmTap: () async { + Navigator.pop(context); openAppSettings(); }, ),