restore method

void restore(
  1. List<PolygonGeofence> polygons
)

Initializes the service with persisted polygons.

Implementation

void restore(List<PolygonGeofence> polygons) {
  _polygons.clear();
  _insideState.clear();

  for (final polygon in polygons) {
    if (polygon.isValid) {
      _polygons[polygon.identifier] = polygon;
      _insideState[polygon.identifier] = false;
    }
  }

  debugPrint(
      '[PolygonGeofenceService] Restored ${_polygons.length} polygon geofences');
}