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

Linearly interpolate between two BoxConstraints.

If either is null, this function interpolates from BoxConstraints.zero.

Source

static BoxConstraints lerp(BoxConstraints a, BoxConstraints b, double t) {
  if (a == null && b == null)
    return null;
  if (a == null)
    return b * t;
  if (b == null)
    return a * (1.0 - t);
  assert(a.debugAssertIsValid());
  assert(b.debugAssertIsValid());
  return new BoxConstraints(
    minWidth: ui.lerpDouble(a.minWidth, b.minWidth, t),
    maxWidth: ui.lerpDouble(a.maxWidth, b.maxWidth, t),
    minHeight: ui.lerpDouble(a.minHeight, b.minHeight, t),
    maxHeight: ui.lerpDouble(a.maxHeight, b.maxHeight, t)
  );
}