addPhoto method

void addPhoto(
  1. int index,
  2. String photoBase64,
  3. String photoFileName
)

Marker'a fotoğraf ekler

index - Marker'ın index'i photoBase64 - Base64 encoded fotoğraf string'i photoFileName - Fotoğraf dosya ismi

Not: Her marker maksimum 3 fotoğraf içerebilir.

Implementation

void addPhoto(int index, String photoBase64, String photoFileName) {
  if (index >= 0 && index < markers.length) {
    if (markers[index].photos == null) {
      markers[index].photos = [];
    }
    if (markers[index].photosName == null) {
      markers[index].photosName = [];
    }
    if (markers[index].photos!.length < 3) {
      markers[index].photos!.add(photoBase64);
      markers[index].photosName!.add(photoFileName);
      markers.refresh();
    }
  }
}