I want to deselect images if I selected more than 4 images, here i can’t go back gallery
List<XFile?> imageFiles = await ImagePicker.platform.pickMultiImage();
if(imageFiles.length <= 4) {
///successfully uploaded images
} else{
///go back to gallery to deselect images until <= 4
}
I want to go back to gallery to deselect selected images
2
Answers
Try once the below code :-
You can use library multi_image_picker_view to limit the number of images selected instead of coding the logic yourself.