lerp static method

SimpleBar lerp(
  1. BarGroup? current,
  2. BarGroup target,
  3. double t
)
override

Lerps between two SimpleBars for a factor t

Implementation

static SimpleBar lerp(BarGroup? current, BarGroup target, double t) {
  if ((current is SimpleBar?) && target is SimpleBar) {
    return SimpleBar(
      xValue: lerpDouble(current?.xValue, target.xValue, t) as num,
      yValue: BarData.lerp(current?.yValue, target.yValue, t),
      style: BarDataStyle.lerp(
        current?.style,
        target.style,
        t,
      ),
      padding: lerpDouble(current?.padding, target.padding, t) ?? 0.0,
    );
  } else {
    throw Exception('Both current & target data should be of same series!');
  }
}