Flutter: How to display images gotten from ImagePicker with buildGridView()

Viewed 51

I'm using ImagePicker in flutter and I'd like to see if I can use the function buildGridView to display all the images I have in a list. I can use this function with a list of assets like shown in the documentation of it. The question is if I can do the same with the files I get from ImagePicker instead of Assets. I'm trying to have a list of images and adding more with imagePicker from camera or gallery. And everytime one more is added, display all the list like I could do with assets in buildGridView. As a second step I'd like to add a cancel button on each image like in this question: Flutter: How to put button on each image like (x) to cancel selected image And as a third step, do the same with videos instead of images. My question here is if it is possible to have a list of videos

1 Answers

Yes you can first time you can check if the gridview list is empty just ask for videos or images to select and than on second time to pick just check if the images or videos list is not empty launch image picker to pick file and just add that item in list.And When you click on delete button just delete that item from list.

Related