copyWith method

ParticleOptions copyWith({
  1. Image? image = const _NotSetImage(),
  2. Color? baseColor,
  3. double? spawnMinRadius,
  4. double? spawnMaxRadius,
  5. double? spawnMinSpeed,
  6. double? spawnMaxSpeed,
  7. double? spawnOpacity,
  8. double? minOpacity,
  9. double? maxOpacity,
  10. double? opacityChangeRate,
  11. int? particleCount,
})

Creates a copy of this ParticleOptions but with the given fields replaced with new values.

Implementation

ParticleOptions copyWith({
  Image? image = const _NotSetImage(),
  Color? baseColor,
  double? spawnMinRadius,
  double? spawnMaxRadius,
  double? spawnMinSpeed,
  double? spawnMaxSpeed,
  double? spawnOpacity,
  double? minOpacity,
  double? maxOpacity,
  double? opacityChangeRate,
  int? particleCount,
}) {
  return ParticleOptions(
    image: image is _NotSetImage ? this.image : image,
    baseColor: baseColor ?? this.baseColor,
    spawnMinRadius: spawnMinRadius ?? this.spawnMinRadius,
    spawnMaxRadius: spawnMaxRadius ?? this.spawnMaxRadius,
    spawnMinSpeed: spawnMinSpeed ?? this.spawnMinSpeed,
    spawnMaxSpeed: spawnMaxSpeed ?? this.spawnMaxSpeed,
    spawnOpacity: spawnOpacity ?? this.spawnOpacity,
    minOpacity: minOpacity ?? this.minOpacity,
    maxOpacity: maxOpacity ?? this.maxOpacity,
    opacityChangeRate: opacityChangeRate ?? this.opacityChangeRate,
    particleCount: particleCount ?? this.particleCount,
  );
}