lerp method

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

Linearly interpolate with another Spec object.

Implementation

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

  return ImageTestSpec(
    alignment: AlignmentGeometry.lerp(
      alignment,
      other.alignment,
      t,
    ),
    animated: t < 0.5 ? animated : other.animated,
    centerSlice: t < 0.5 ? centerSlice : other.centerSlice,
    color: t < 0.5 ? color : other.color,
    colorBlendMode: t < 0.5 ? colorBlendMode : other.colorBlendMode,
    filterQuality: t < 0.5 ? filterQuality : other.filterQuality,
    fit: t < 0.5 ? fit : other.fit,
    height: lerpDouble(
      height,
      other.height,
      t,
    ),
    repeat: t < 0.5 ? repeat : other.repeat,
    width: lerpDouble(
      width,
      other.width,
      t,
    ),
  );
}