lerp static method

Implementation

static ButtonStyle lerp(ButtonStyle? a, ButtonStyle? b, double t) {
  return ButtonStyle(
    textStyle:
        ButtonState.lerp(a?.textStyle, b?.textStyle, t, TextStyle.lerp),
    backgroundColor: ButtonState.lerp(
        a?.backgroundColor, b?.backgroundColor, t, Color.lerp),
    foregroundColor: ButtonState.lerp(
        a?.foregroundColor, b?.foregroundColor, t, Color.lerp),
    shadowColor:
        ButtonState.lerp(a?.shadowColor, b?.shadowColor, t, Color.lerp),
    elevation: ButtonState.lerp(a?.elevation, b?.elevation, t, lerpDouble),
    padding:
        ButtonState.lerp(a?.padding, b?.padding, t, EdgeInsetsGeometry.lerp),
    border: ButtonState.lerp(a?.border, b?.border, t, (a, b, t) {
      if (a == null && b == null) return null;
      if (a == null) return b;
      if (b == null) return a;
      return BorderSide.lerp(a, b, t);
    }),
    shape: ButtonState.lerp(a?.shape, b?.shape, t, (a, b, t) {
      return ShapeBorder.lerp(a, b, t) as OutlinedBorder;
    }),
    zFactor: ButtonState.lerp(a?.zFactor, b?.zFactor, t, lerpDouble),
  );
}