lerp method

  1. @useResult
FItemGroupStyle lerp(
  1. FItemGroupStyle other,
  2. double t
)

Linearly interpolate between this and another FItemGroupStyle using the given factor t.

Implementation

@useResult
FItemGroupStyle lerp(FItemGroupStyle other, double t) => .new(
  decoration: .lerp(decoration, other.decoration, t) ?? decoration,
  spacing: lerpDouble(spacing, other.spacing, t) ?? spacing,
  dividerColor: .lerpColor(dividerColor, other.dividerColor, t),
  dividerWidth: lerpDouble(dividerWidth, other.dividerWidth, t) ?? dividerWidth,
  itemStyles: .lerpWhere(itemStyles, other.itemStyles, t, (a, b, t) => a!.lerp(b!, t)),
  slideableItems: t < 0.5 ? slideableItems : other.slideableItems,
);