photos static method
相册权限
Implementation
static Future<bool> photos({double? width}) async {
String message = '我们申请使用您设备的相册权限,用于读写您相册中的照片';
String error = '请授权相册权限';
if (Platform.isAndroid) {
int version = await getAndroidSdkVersion() ?? 0;
if (version < 33) {
return await request(
permission: Permission.storage,
message: message,
error: error,
width: width,
);
}
}
return await request(
permission: Permission.photos,
message: message,
error: error,
width: width,
);
}