copyWith method
Copy the particle with new values
Implementation
Particle copyWith({
double? dx,
double? dy,
double? size,
Color? color,
double? life,
double? speed,
double? angle,
Rect? rect,
}) {
return Particle(
dx ?? this.dx,
dy ?? this.dy,
size ?? this.size,
color ?? this.color,
life ?? this.life,
speed ?? this.speed,
angle ?? this.angle,
rect ?? this.rect,
);
}