apply method

  1. @override
MarkerOp apply(
  1. List<Marker> list
)
override

Applies this operation to the current list.

Modifies current in place and returns the effective operation (e.g. populated with captured state like removed index).

Implementation

@override
MarkerOp apply(List<Marker> list) {
  if (index >= 0 && index < list.length && list[index].key == oldMarker.key) {
    list[index] = newMarker;
  } else {
    list.updateByKey(oldMarker.key, newMarker); // Fallback
  }
  return this;
}