This project requires camera and photo library permissions for document scanning and image selection.
Configure in ios/Runner/Info.plist:
Purpose: Use camera to scan documents Message: "This app needs camera access to scan and analyze document layouts"
Purpose: Select images from photo library Message: "This app needs photo library access to select document images for analysis"
Purpose: Save processed images to photo library Message: "This app needs to save processed document images to your photo library"
Configure in android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.CAMERA"/>Purpose: Use camera to scan documents
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32"/>Purpose: Read photos (Android 12 and below)
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>Purpose: Read photos (Android 13+)
<uses-feature android:name="android.hardware.camera" android:required="false"/>Note: Declares camera feature but not required (supports devices without camera)
When using image_picker, permissions are requested automatically:
import 'package:image_picker/image_picker.dart';
final ImagePicker picker = ImagePicker();
// Take photo - automatically requests camera permission
final XFile? photo = await picker.pickImage(source: ImageSource.camera);
// Pick from gallery - automatically requests photo library permission
final XFile? image = await picker.pickImage(source: ImageSource.gallery);Use permission_handler package to check permission status:
dependencies:
permission_handler: ^11.0.0import 'package:permission_handler/permission_handler.dart';
Future<void> requestCameraPermission() async {
final status = await Permission.camera.request();
if (status.isGranted) {
// Permission granted
} else if (status.isDenied) {
// Permission denied
} else if (status.isPermanentlyDenied) {
// Permission permanently denied, open settings
openAppSettings();
}
}A: Android 13 (API 33) introduced new granular media permissions:
READ_EXTERNAL_STORAGE- For Android 12 and belowREAD_MEDIA_IMAGES- For Android 13+
Both are configured to ensure compatibility with all Android versions.
A: The app won't be able to use camera or photo library features. Recommendations:
- Show explanation dialog before requesting permission
- If denied, provide option to open settings
- Provide alternative options (e.g., manual file path input)