removePhoto method

void removePhoto(
  1. int index,
  2. int photoIndex
)

Marker'dan fotoğraf siler

index - Marker'ın index'i photoIndex - Silinecek fotoğrafın index'i

Implementation

void removePhoto(int index, int photoIndex) {
  if (index >= 0 &&
      index < markers.length &&
      markers[index].photos != null &&
      photoIndex >= 0 &&
      photoIndex < markers[index].photos!.length) {
    markers[index].photos!.removeAt(photoIndex);
    if (markers[index].photosName != null &&
        photoIndex < markers[index].photosName!.length) {
      markers[index].photosName!.removeAt(photoIndex);
    }
    if (markers[index].photos!.isEmpty) {
      markers[index].photos = null;
      markers[index].photosName = null;
    }
    markers.refresh();
  }
}