Size lerp(Size a, Size b, double t)

Linearly interpolate between two sizes

If either size is null, this function interpolates from Size.zero.

Source

static Size lerp(Size a, Size b, double t) {
  if (a == null && b == null)
    return null;
  if (a == null)
    return b * t;
  if (b == null)
    return a * (1.0 - t);
  return new Size(lerpDouble(a.width, b.width, t), lerpDouble(a.height, b.height, t));
}