animate method

void animate()

Implementation

void animate() {
  if (!isAnimation) return;
  final timestamp = DateTime.timestamp().microsecondsSinceEpoch;
  final durationDelta = timestamp - _previous;
  dt = durationDelta / Duration.microsecondsPerSecond;
  if (updateCallback != null) {
    updateCallback!(dt);
  }

  _previous = timestamp;
  render();

  Future.delayed(const Duration(milliseconds: 25), () {
    animate();
  });
}