copyWith method

Particle copyWith({
  1. double? dx,
  2. double? dy,
  3. double? size,
  4. Color? color,
  5. double? life,
  6. double? speed,
  7. double? angle,
  8. Rect? rect,
})

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