lerp static method

ProgressIndicatorThemeData? lerp(
  1. ProgressIndicatorThemeData? a,
  2. ProgressIndicatorThemeData? b,
  3. double t
)

Linearly interpolate between two progress indicator themes.

If both arguments are null, then null is returned.

Implementation

static ProgressIndicatorThemeData? lerp(
  ProgressIndicatorThemeData? a,
  ProgressIndicatorThemeData? b,
  double t,
) {
  if (identical(a, b)) {
    return a;
  }
  return ProgressIndicatorThemeData(
    color: Color.lerp(a?.color, b?.color, t),
    linearTrackColor: Color.lerp(a?.linearTrackColor, b?.linearTrackColor, t),
    linearMinHeight: lerpDouble(a?.linearMinHeight, b?.linearMinHeight, t),
    circularTrackColor: Color.lerp(a?.circularTrackColor, b?.circularTrackColor, t),
    refreshBackgroundColor: Color.lerp(a?.refreshBackgroundColor, b?.refreshBackgroundColor, t),
    borderRadius: BorderRadiusGeometry.lerp(a?.borderRadius, b?.borderRadius, t),
    stopIndicatorColor: Color.lerp(a?.stopIndicatorColor, b?.stopIndicatorColor, t),
    stopIndicatorRadius: lerpDouble(a?.stopIndicatorRadius, b?.stopIndicatorRadius, t),
    strokeWidth: lerpDouble(a?.strokeWidth, b?.strokeWidth, t),
    strokeAlign: lerpDouble(a?.strokeAlign, b?.strokeAlign, t),
    strokeCap: t < 0.5 ? a?.strokeCap : b?.strokeCap,
    constraints: BoxConstraints.lerp(a?.constraints, b?.constraints, t),
    trackGap: lerpDouble(a?.trackGap, b?.trackGap, t),
    circularTrackPadding: EdgeInsetsGeometry.lerp(
      a?.circularTrackPadding,
      b?.circularTrackPadding,
      t,
    ),
    year2023: t < 0.5 ? a?.year2023 : b?.year2023,
  );
}