copyWith method

Polygon copyWith({
  1. bool? consumeTapEventsParam,
  2. Color? fillColorParam,
  3. bool? geodesicParam,
  4. List<LatLng>? pointsParam,
  5. List<List<LatLng>>? holesParam,
  6. Color? strokeColorParam,
  7. int? strokeWidthParam,
  8. bool? visibleParam,
  9. int? zIndexParam,
  10. bool? editableParam,
  11. VoidCallback? onTapParam,
  12. ArgumentCallback<Map>? onDragendParam,
  13. ArgumentCallback<Map>? onInsertAtParam,
  14. ArgumentCallback<Map>? onRemoveAtParam,
  15. ArgumentCallback<Map>? onSetAtParam,
})

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

Implementation

Polygon copyWith({
  bool? consumeTapEventsParam,
  Color? fillColorParam,
  bool? geodesicParam,
  List<LatLng>? pointsParam,
  List<List<LatLng>>? holesParam,
  Color? strokeColorParam,
  int? strokeWidthParam,
  bool? visibleParam,
  int? zIndexParam,
  bool? editableParam,
  VoidCallback? onTapParam,
  ArgumentCallback<Map>? onDragendParam,
  ArgumentCallback<Map>? onInsertAtParam,
  ArgumentCallback<Map>? onRemoveAtParam,
  ArgumentCallback<Map>? onSetAtParam,
}) {
  return Polygon(
    polygonId: polygonId,
    consumeTapEvents: consumeTapEventsParam ?? consumeTapEvents,
    fillColor: fillColorParam ?? fillColor,
    geodesic: geodesicParam ?? geodesic,
    points: pointsParam ?? points,
    holes: holesParam ?? holes,
    strokeColor: strokeColorParam ?? strokeColor,
    strokeWidth: strokeWidthParam ?? strokeWidth,
    visible: visibleParam ?? visible,
    onTap: onTapParam ?? onTap,
    onDragend: onDragendParam ?? onDragend,
    onInsertAt: onInsertAtParam ?? onInsertAt,
    onRemoveAt: onRemoveAtParam ?? onRemoveAt,
    onSetAt: onSetAtParam ?? onSetAt,
    zIndex: zIndexParam ?? zIndex,
    editable: editableParam ?? editable,
  );
}