copyWith method
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,
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,
);
}