copyWith method

Polygon copyWith({
  1. bool? consumeTapEventsParam,
  2. List<LatLng>? pointsParam,
  3. Color? strokeColorParam,
  4. Color? fillColorParam,
  5. int? strokeWidthParam,
  6. bool? visibleParam,
  7. int? zIndexParam,
  8. VoidCallback? onTapParam,
})

Creates a new Polygon object whose values are the same as this instance, unless overwritten by the specified parameters.

Implementation

Polygon copyWith({
  bool? consumeTapEventsParam,
  List<LatLng>? pointsParam,
  Color? strokeColorParam,
  Color? fillColorParam,
  int? strokeWidthParam,
  bool? visibleParam,
  int? zIndexParam,
  VoidCallback? onTapParam,
}) {
  return Polygon(
    polygonId: polygonId,
    consumeTapEvents: consumeTapEventsParam ?? consumeTapEvents,
    points: pointsParam ?? points,
    strokeColor: strokeColorParam ?? strokeColor,
    fillColor: fillColorParam ?? fillColor,
    strokeWidth: strokeWidthParam ?? strokeWidth,
    visible: visibleParam ?? visible,
    zIndex: zIndexParam ?? zIndex,
    onTap: onTapParam ?? onTap,
  );
}