lerp static method

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

Linearly interpolate between two EdgeInstes

Implementation

static EdgeInsets? lerp(EdgeInsets? a, EdgeInsets? 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 EdgeInsets.fromLTRB(
    _lerpDouble(a.left, b.left, t),
    _lerpDouble(a.top, b.top, t),
    _lerpDouble(a.right, b.right, t),
    _lerpDouble(a.bottom, b.bottom, t),
  );
}