copyWith method

MPDirectionsRendererOptions copyWith({
  1. Color? strokeColor,
  2. double? strokeOpacity,
  3. double? strokeWeight,
  4. MPStrokeStyle? strokeStyle,
  5. bool? haloEnabled,
  6. Color? haloColor,
  7. double? haloOpacity,
  8. double? haloWeight,
  9. MPRouteAnimationType? animationType,
  10. double? animationSpeed,
  11. double? animationMinDuration,
  12. bool? animationRepeating,
  13. bool? forceAnimation,
  14. Color? animatedOverlayColor,
  15. double? animatedOverlayOpacity,
  16. double? animatedOverlayWeight,
  17. bool? fitBounds,
  18. double? fitBoundsMaxZoom,
  19. EdgeInsets? fitBoundsPadding,
})

Returns a copy of these options with the given properties replaced.

Properties left out keep their current value. Like Flutter's own copyWith methods this cannot set a property back to unset — build a new MPDirectionsRendererOptions, or call MPDirectionsRenderer.clearOptions, to drop an override.

Implementation

MPDirectionsRendererOptions copyWith({
  Color? strokeColor,
  double? strokeOpacity,
  double? strokeWeight,
  MPStrokeStyle? strokeStyle,
  bool? haloEnabled,
  Color? haloColor,
  double? haloOpacity,
  double? haloWeight,
  MPRouteAnimationType? animationType,
  double? animationSpeed,
  double? animationMinDuration,
  bool? animationRepeating,
  bool? forceAnimation,
  Color? animatedOverlayColor,
  double? animatedOverlayOpacity,
  double? animatedOverlayWeight,
  bool? fitBounds,
  double? fitBoundsMaxZoom,
  EdgeInsets? fitBoundsPadding,
}) {
  return MPDirectionsRendererOptions(
    strokeColor: strokeColor ?? this.strokeColor,
    strokeOpacity: strokeOpacity ?? this.strokeOpacity,
    strokeWeight: strokeWeight ?? this.strokeWeight,
    strokeStyle: strokeStyle ?? this.strokeStyle,
    haloEnabled: haloEnabled ?? this.haloEnabled,
    haloColor: haloColor ?? this.haloColor,
    haloOpacity: haloOpacity ?? this.haloOpacity,
    haloWeight: haloWeight ?? this.haloWeight,
    animationType: animationType ?? this.animationType,
    animationSpeed: animationSpeed ?? this.animationSpeed,
    animationMinDuration: animationMinDuration ?? this.animationMinDuration,
    animationRepeating: animationRepeating ?? this.animationRepeating,
    forceAnimation: forceAnimation ?? this.forceAnimation,
    animatedOverlayColor: animatedOverlayColor ?? this.animatedOverlayColor,
    animatedOverlayOpacity:
        animatedOverlayOpacity ?? this.animatedOverlayOpacity,
    animatedOverlayWeight:
        animatedOverlayWeight ?? this.animatedOverlayWeight,
    fitBounds: fitBounds ?? this.fitBounds,
    fitBoundsMaxZoom: fitBoundsMaxZoom ?? this.fitBoundsMaxZoom,
    fitBoundsPadding: fitBoundsPadding ?? this.fitBoundsPadding,
  );
}