queueEvents method
Implementation
void queueEvents(TrackEntry entry, double animationTime) {
final double animationStart = entry.animationStart,
animationEnd = entry.animationEnd;
final double duration = animationEnd - animationStart;
final double trackLastWrapped = entry.trackLast % duration;
// Queue events before complete.
final List<Event?> events = this.events;
int i = 0;
final int n = events.length;
for (; i < n; i++) {
final Event event = events[i]!;
if (event.time < trackLastWrapped) break;
if (event.time > animationEnd) {
continue;
} // Discard events outside animation start/end.
queue.event(entry, event);
}
// Queue complete if completed a loop iteration or the animation.
bool complete = false;
if (entry.loop) {
complete = duration == 0 || trackLastWrapped > entry.trackTime % duration;
} else {
complete =
animationTime >= animationEnd && entry.animationLast < animationEnd;
}
if (complete) queue.complete(entry);
// Queue events after complete.
for (; i < n; i++) {
final Event event = events[i]!;
if (event.time < animationStart) {
continue;
} // Discard events outside animation start/end.
queue.event(entry, events[i]);
}
}