lerp static method

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

If both are null, returns null.

If either is null, replaced with Peek.NONE.

Implementation

static Peek? lerp(Peek? a, Peek? b, double t) {
  if (a == null && b == null) return null;
  a ??= Peek.NONE;
  b ??= Peek.NONE;
  return Peek(
    peek: lerpDouble(a.peek, b.peek, t)!,
    peekRatio: lerpDouble(a.peekRatio, b.peekRatio, t)!,
    peekAlignment:
        AlignmentGeometry.lerp(a.peekAlignment, b.peekAlignment, t)!,
  );
}