photos constant
Permission
const photos
Permission for accessing the device's photos.
Photos can be read and added. If you only want to read them, you can use the photos permission instead (iOS only).
Depending on the platform and version, the requirements are slightly different:
iOS:
- When running Photos (iOS 14+ read & write access level)
Android:
- Devices running Android 12 (API level 32) or lower: use Permission.storage.
- Devices running Android 13 (API level 33) and above: Should use Permission.photos.
EXAMPLE: in Manifest: <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
In Flutter to check the status:
if (Platform.isAndroid) {
final androidInfo = await DeviceInfoPlugin().androidInfo;
if (androidInfo.version.sdkInt <= 32) {
use Permission.storage.status
} else {
use Permission.photos.status
}
}
Implementation
static const photos = Permission._(9);