How to manage upload/deletion of multiple images in flutter and keeping it in sync between firestore, cloud-storage and UI

Viewed 288

We can select multiple images using the flutter plugin : https://pub.dev/packages/multi_image_picker We can then use firebase - cloud storage to upload these pics and save the url in firestore db for easy access and display. I have done this part successfully. I also know how to delete a single image but have following Question:

If I have selected 5 images, how do we allow the user to delete these images. Following scenarios are troubling me

  1. delete only 3 images out of 5
  2. delete all the 5 images and save
  3. delete all the 3 images and select new 3 images and save
  4. there are two text fields in that screen which can also be edited. Ideally we should not touch the images to save these changes. But How do we know this?

I do not want to delete all the images and save it again every time the user makes a change in that screen

how would u go about doing this?

0 Answers
Related