getGalleryAccessPermissions static method
Future<List<Permission>>
getGalleryAccessPermissions(
)
Implementation
static Future<List<Permission>> getGalleryAccessPermissions() async {
var permissions = <Permission>[];
var sdkVersion = 0;
if (Platform.isAndroid) {
var sdk = await DeviceInfoPlugin().androidInfo;
sdkVersion = sdk.version.sdkInt;
} else {
sdkVersion = 0;
}
if (Platform.isIOS) {
permissions.addAll([Permission.photos, Permission.storage]);
} else if (sdkVersion < 33 && Platform.isAndroid) {
permissions.addAll([Permission.storage, Permission.notification]);
} else {
///[Permission.photos] for Android 33+ gallery access
///[Permission.videos] for Android 33+ gallery access
permissions.addAll(
[Permission.photos, Permission.videos, Permission.notification]);
}
LogMessage.d("getGalleryAccessPermissions", permissions.join(","));
return permissions;
}