lerp static method

AnimationStyle? lerp(
  1. AnimationStyle? a,
  2. AnimationStyle? b,
  3. double t
)

Linearly interpolate between two animation styles.

Implementation

static AnimationStyle? lerp(AnimationStyle? a, AnimationStyle? b, double t) {
  if (identical(a, b)) {
    return a;
  }
  return AnimationStyle(
    curve: t < 0.5 ? a?.curve : b?.curve,
    duration: t < 0.5 ? a?.duration : b?.duration,
    reverseCurve: t < 0.5 ? a?.reverseCurve : b?.reverseCurve,
    reverseDuration: t < 0.5 ? a?.reverseDuration : b?.reverseDuration,
  );
}