I am using Image Picker to select an image from the gallery. When I don’t have any images uploaded, after I add one image, this pop-up is appearing as shown below.
If I press "Select More Photos…", the image or images are not added after selection. How to get rid of this pop-up or what do I need to change in my code to be able to Select More Photos if he wants. I read that Image Picker is unable to handle picking multiple images once, and I don’t need that necessarily, so I need to get rid of this pop-up, because even if I select only one image from "Select more photos…", it is not added.
void _openCameraAndAddPossibleImage(String? cleverClosetOrganizer, String cameraOrGallery, int isMyClosetCheck) async{
try{
var pickedFile = await ImagePicker().pickImage(
source: cameraOrGallery == 'camera' ? ImageSource.camera : ImageSource.gallery,
);
if (pickedFile != null) {
var imageFile = File(pickedFile.path);
Uint8List imageRaw = await imageFile.readAsBytes();
String newImage = CleverCloset.base64String(imageRaw);
if (mounted) {
setState(() {
if(isMyClosetCheck==1) {
CleverCloset cleverClosetToAdd = CleverCloset(closetOrganizer: cleverClosetOrganizer, isMyCloset: isMyClosetCheck, image: newImage);
addImageOnClosetOrganizer(cleverClosetToAdd);
}
else {
CleverCloset cleverClosetToAdd = CleverCloset(isMyCloset: isMyClosetCheck, image: newImage);
addImageOnToBuy(cleverClosetToAdd);
}
});
}
}
}
catch (e){
return ;
}
}
2
Answers
Based on this discussion https://github.com/flutter/flutter/issues/65995, I find out that it's a common bug on iOS.
I solved this issue by adding:
Using this branch, it will remove the pop-up.
Please try passing
requestFullMetadata: false
to pickImage function:As per docs: