copyWith method

VehicleConfig copyWith({
  1. Color? primaryColor,
  2. double? size,
  3. VehicleDirection? direction,
  4. bool? isFlashing,
  5. bool? isCrashed,
  6. bool? showEffects,
  7. double? animationSpeed,
})

Create a copy with modified properties

Implementation

VehicleConfig copyWith({
  Color? primaryColor,
  double? size,
  VehicleDirection? direction,
  bool? isFlashing,
  bool? isCrashed,
  bool? showEffects,
  double? animationSpeed,
}) {
  return VehicleConfig(
    primaryColor: primaryColor ?? this.primaryColor,
    size: size ?? this.size,
    direction: direction ?? this.direction,
    isFlashing: isFlashing ?? this.isFlashing,
    isCrashed: isCrashed ?? this.isCrashed,
    showEffects: showEffects ?? this.showEffects,
    animationSpeed: animationSpeed ?? this.animationSpeed,
  );
}