copyWith method

  1. @override
AdvancedMarker copyWith({
  1. double? alphaParam,
  2. Offset? anchorParam,
  3. bool? consumeTapEventsParam,
  4. bool? draggableParam,
  5. bool? flatParam,
  6. BitmapDescriptor? iconParam,
  7. InfoWindow? infoWindowParam,
  8. LatLng? positionParam,
  9. double? rotationParam,
  10. bool? visibleParam,
  11. @Deprecated('Use zIndexIntParam instead. ' 'On some platforms zIndex is truncated to an int, which can lead to incorrect/unstable ordering.') double? zIndexParam,
  12. int? zIndexIntParam,
  13. VoidCallback? onTapParam,
  14. ValueChanged<LatLng>? onDragStartParam,
  15. ValueChanged<LatLng>? onDragParam,
  16. ValueChanged<LatLng>? onDragEndParam,
  17. ClusterManagerId? clusterManagerIdParam,
  18. MarkerCollisionBehavior? collisionBehaviorParam,
  19. double? altitudeParam,
})
override

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

Implementation

@override
AdvancedMarker copyWith({
  double? alphaParam,
  Offset? anchorParam,
  bool? consumeTapEventsParam,
  bool? draggableParam,
  bool? flatParam,
  BitmapDescriptor? iconParam,
  InfoWindow? infoWindowParam,
  LatLng? positionParam,
  double? rotationParam,
  bool? visibleParam,
  @Deprecated(
    'Use zIndexIntParam instead. '
    'On some platforms zIndex is truncated to an int, which can lead to incorrect/unstable ordering.',
  )
  double? zIndexParam,
  int? zIndexIntParam,
  VoidCallback? onTapParam,
  ValueChanged<LatLng>? onDragStartParam,
  ValueChanged<LatLng>? onDragParam,
  ValueChanged<LatLng>? onDragEndParam,
  ClusterManagerId? clusterManagerIdParam,
  MarkerCollisionBehavior? collisionBehaviorParam,
  double? altitudeParam,
}) {
  return AdvancedMarker(
    markerId: markerId,
    alpha: alphaParam ?? alpha,
    anchor: anchorParam ?? anchor,
    consumeTapEvents: consumeTapEventsParam ?? consumeTapEvents,
    draggable: draggableParam ?? draggable,
    flat: flatParam ?? flat,
    icon: iconParam ?? icon,
    infoWindow: infoWindowParam ?? infoWindow,
    position: positionParam ?? position,
    rotation: rotationParam ?? rotation,
    visible: visibleParam ?? visible,
    zIndex: (zIndexIntParam ?? zIndexParam ?? zIndex).toInt(),
    onTap: onTapParam ?? onTap,
    onDragStart: onDragStartParam ?? onDragStart,
    onDrag: onDragParam ?? onDrag,
    onDragEnd: onDragEndParam ?? onDragEnd,
    clusterManagerId: clusterManagerIdParam ?? clusterManagerId,
    collisionBehavior: collisionBehaviorParam ?? collisionBehavior,
  );
}