compute method
Computes the value for this keyframe at the given progress.
Parameters
timeline- The parent timeline animation.index- The index of this keyframe in the timeline.t- The local progress through this keyframe (0.0 to 1.0).
Returns
The computed value of type T at the given progress.
Implementation
@override
T compute(TimelineAnimation<T> timeline, int index, double t) {
if (index <= 0) {
// act as still keyframe when there is no previous keyframe
return target;
}
final previous =
timeline.keyframes[index - 1].compute(timeline, index - 1, 1.0);
return timeline.lerp(previous!, target!, t)!;
}