lerp static method

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

If both are null, returns null.

If either is null, replaced with Shape().

Implementation

static Shape? lerp(Shape? a, Shape? b, double t) {
  if (a == null && b == null) return null;
  a ??= Shape();
  b ??= Shape();
  return Shape(
      corners: CornerSpec.lerp(a.corners, b.corners, t)!,
      baseCorners: CornerSpec.lerp(a.baseCorners, b.baseCorners, t),
      border: BorderSide.lerp(
          a.border ?? BorderSide.none, b.border ?? BorderSide.none, t));
}