copyWith method
use copyWith to create a new instance with some values changed
Implementation
Particle copyWith({
ParticleType? particle,
String? texture,
Location? location,
Location? delta,
double? speed,
int? count,
bool? force,
Entity? player,
}) {
return Particle(
particle ?? this.particle,
texture: texture ?? this.texture,
location: location ?? this.location,
delta: delta ?? this.delta,
speed: speed ?? this.speed,
count: count ?? this.count,
force: force ?? this.force,
player: player ?? this.player,
);
}