lerp static method

Linearly interpolate between two ExpandIconThemes

Implementation

static ExpandIconTheme lerp(
  ExpandIconTheme? a,
  ExpandIconTheme? b,
  double t,
) {
  if (a == null && b == null) {
    return const ExpandIconTheme();
  }
  if (a == null) return b!;
  if (b == null) return a;

  return ExpandIconTheme(
    widget: t < 0.5 ? a.widget : b.widget,
    width: lerpDouble(a.width, b.width, t) ?? 20.0,
    height: lerpDouble(a.height, b.height, t) ?? 20.0,
    padding: EdgeInsets.lerp(a.padding, b.padding, t) ?? EdgeInsets.zero,
    margin: EdgeInsets.lerp(a.margin, b.margin, t) ?? EdgeInsets.zero,
    color: Color.lerp(a.color, b.color, t),
    expandedColor: Color.lerp(a.expandedColor, b.expandedColor, t),
  );
}