我使用image_picker:^0.8.4+11来打开一个画廊。我需要申请开画廊的许可。在iOS中,它要求一个开放画廊的许可,但是Android却没有请求许可。
我在我的AndroidManifest文件中尝试过这样的方法
但对我来说没有用。你能帮我解决这个问题吗?
提前谢谢。
发布于 2022-05-13 05:23:58
//这些权限必须添加到您的AndroidManifest.xml中
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
// Add these to android/grade.properties file.
android.useAndroidX=true
android.enableJetifier=true
// Get from gallery
_getFromGallery() async {
PickedFile pickedFile = await ImagePicker().getImage(
source: ImageSource.gallery,
maxWidth: 1800,
maxHeight: 1800,
);
if (pickedFile != null) {
File imageFile = File(pickedFile.path);
}
}https://stackoverflow.com/questions/72224592
复制相似问题