PolygonController constructor

PolygonController({
  1. required Polygon polygon,
  2. bool consumeTapEvents = false,
  3. VoidCallback? onTap,
  4. void onEdited(
    1. List<LatLng> points,
    2. List<List<LatLng>> holes
    )?,
})

Creates a PolygonController that wraps a gmaps.Polygon object and its onTap behavior.

Implementation

PolygonController({
  required gmaps.Polygon polygon,
  bool consumeTapEvents = false,
  VoidCallback? onTap,
  void Function(List<gmaps.LatLng> points, List<List<gmaps.LatLng>> holes)?
  onEdited,
}) : _polygon = polygon,
     _consumeTapEvents = consumeTapEvents {
  if (onTap != null) {
    _subscriptions.add(
      polygon.onClick.listen((gmaps.PolyMouseEvent event) {
        onTap.call();
      }),
    );
  }
  if (onEdited != null) {
    _listenToPathEdits(polygon, onEdited);
  }
}