applyAnimations method

Offset applyAnimations(
  1. LinearGauge linearGauge,
  2. Offset offset
)

Implementation

Offset applyAnimations(LinearGauge linearGauge, Offset offset) {
  if (enableAnimation && getPointerAnimation.value > 0) {
    double animationValue = getPointerAnimation.value;

    double endPoint =
        (linearGauge.gaugeOrientation! == GaugeOrientation.horizontal)
            ? offset.dx
            : offset.dy;

    double animatedAxisPoint =
        getAnimatedAxisPoint(endPoint, animationValue, linearGauge);
    offset = (linearGauge.gaugeOrientation! == GaugeOrientation.horizontal)
        ? Offset(animatedAxisPoint, offset.dy)
        : Offset(offset.dx, animatedAxisPoint);
  }
  return offset;
}