lerp static method

lerp two SnackStyle

Implementation

static SnackStyle lerp(SnackStyle? a, SnackStyle? b, double t) {
  return SnackStyle(
    gradient: Gradient.lerp(a?.gradient, b?.gradient, t),
    decoration: BoxDecoration.lerp(a?.decoration, b?.decoration, t),
    height: ui.lerpDouble(a?.height, b?.height, t),
    maxWidth: ui.lerpDouble(a?.maxWidth, b?.maxWidth, t),
    contentPadding: EdgeInsetsGeometry.lerp(
      a?.contentPadding,
      b?.contentPadding,
      t,
    ),
    elevation: ui.lerpDouble(a?.elevation, b?.elevation, t),
    backgroundColor: Color.lerp(a?.backgroundColor, b?.backgroundColor, t),
    foregroundColor: Color.lerp(a?.foregroundColor, b?.foregroundColor, t),
    borderRadius: BorderRadius.lerp(a?.borderRadius, b?.borderRadius, t),
    enterAnimation: t < 0.5 ? a?.enterAnimation : b?.enterAnimation,
    leaveAnimation: t < 0.5 ? a?.leaveAnimation : b?.leaveAnimation,
  );
}