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