removeMarker method

void removeMarker(
  1. GpsCoordinates gps
)

Removes a marker from gps

Implementation

void removeMarker(GpsCoordinates gps) {
  final lengthBefore = markers.length;
  markers.removeWhere((e) => e.toGridBlock(centerPosition) == gps.toGridBlock(centerPosition));
  if (markers.length != lengthBefore) {
    notifyListeners();
  } else {
    models.home.setMessage(severity: Severity.info, text: "Marker not found");
  }
}