lerp method

  1. @override
FlexSpec lerp(
  1. covariant FlexSpec? other,
  2. double t
)
override

Linearly interpolate with another Spec object.

Implementation

@override
FlexSpec lerp(FlexSpec? other, double t) {
  if (other == null) return this;

  return FlexSpec(
    crossAxisAlignment:
        lerpSnap(crossAxisAlignment, other.crossAxisAlignment, t),
    mainAxisAlignment:
        lerpSnap(mainAxisAlignment, other.mainAxisAlignment, t),
    mainAxisSize: lerpSnap(mainAxisSize, other.mainAxisSize, t),
    verticalDirection:
        lerpSnap(verticalDirection, other.verticalDirection, t),
    direction: lerpSnap(direction, other.direction, t),
    textDirection: lerpSnap(textDirection, other.textDirection, t),
    textBaseline: lerpSnap(textBaseline, other.textBaseline, t),
    clipBehavior: lerpSnap(clipBehavior, other.clipBehavior, t),
    gap: lerpDouble(gap, other.gap, t),
    animated: other.animated ?? animated,
  );
}