compute method

  1. @override
T compute(
  1. TimelineAnimation<T> timeline,
  2. int index,
  3. double t
)
override

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