tick method

  1. @override
bool tick(
  1. double delta,
  2. Duration elapsed
)
override

Called each time there is an update from the ticker on the AnimatedBackground

The implementation must return true if there is a need to repaint and false otherwise.

Implementation

@override
bool tick(double delta, Duration elapsed) {
  if (particles == null) return false;

  for (Particle particle in particles!) {
    if (!size!.contains(Offset(particle.cx, particle.cy))) {
      initParticle(particle);
      continue;
    }

    updateParticle(particle, delta, elapsed);
  }

  return true;
}