lerp static method

Linearly interpolate between two icon theme data objects.

Implementation

static AvatarStyle? lerp(AvatarStyle? a, AvatarStyle? b, double t) {
  if (a == null && b == null) return null;
  return AvatarStyle(
    size: lerpDouble(a?.size, b?.size, t),
    shape: t < 0.5 ? a?.shape : b?.shape,
    margin: EdgeInsetsGeometry.lerp(a?.margin, b?.margin, t),
    clipBehavior: t < 0.5 ? a?.clipBehavior : b?.clipBehavior,
    shadowColor: Color.lerp(a?.shadowColor, b?.shadowColor, t),
    elevation: lerpDouble(a?.elevation, b?.elevation, t),
    foregroundStyle:
        TextStyle.lerp(a?.foregroundStyle, b?.foregroundStyle, t),
    foregroundColor: Color.lerp(a?.foregroundColor, b?.foregroundColor, t),
    foregroundOpacity:
        lerpDouble(a?.foregroundOpacity, b?.foregroundOpacity, t),
    foregroundAlpha: lerpInt(a?.foregroundAlpha, b?.foregroundAlpha, t),
    foregroundSpacing:
        lerpDouble(a?.foregroundSpacing, b?.foregroundSpacing, t),
    backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
    backgroundOpacity:
        lerpDouble(a?.backgroundOpacity, b?.backgroundOpacity, t),
    backgroundAlpha: lerpInt(a?.backgroundAlpha, b?.backgroundAlpha, t),
    borderColor: Color.lerp(a?.borderColor, b?.borderColor, t),
    borderOpacity: lerpDouble(a?.borderOpacity, b?.borderOpacity, t),
    borderAlpha: lerpInt(a?.borderAlpha, b?.borderAlpha, t),
    borderWidth: lerpDouble(a?.borderWidth, b?.borderWidth, t),
    borderRadius: BorderRadius.lerp(a?.borderRadius, b?.borderRadius, t),
    borderStyle: t < 0.5 ? a?.borderStyle : b?.borderStyle,
  );
}