lerpTo method
Interpolate between this and next using interpolation factor t (0.0 to 1.0)
Implementation
@override
ISparklinesData lerpTo(ISparklinesData next, double t) {
if (next is! LineData) return next;
if (line.length != next.line.length) return next;
if (visible != next.visible) return next;
final interpolatedPoints = <DataPoint>[];
for (int i = 0; i < line.length; i++) {
interpolatedPoints.add(line[i].lerpTo(next.line[i], t));
}
return LineData(
visible: next.visible,
rotation: next.rotation,
flip: next.flip,
origin: Offset.lerp(origin, next.origin, t) ?? next.origin,
layout: next.layout,
crop: next.crop,
line: interpolatedPoints,
thickness: thickness.lerpTo(next.thickness, t),
areaGradient: Gradient.lerp(areaGradient, next.areaGradient, t),
areaColor: Color.lerp(areaColor, next.areaColor, t),
areaFillType: next.areaFillType,
lineType: next.lineType,
pointStyle: ILerpTo.lerp<IDataPointData>(pointStyle, next.pointStyle, t) as IDataPointStyle?,
);
}