endRotationFor method
The end rotation for a spin starting at startRotation that turns at
least fullTurns whole turns in the given direction and stops with
fraction of slice index under the pointer.
Implementation
double endRotationFor({
required double startRotation,
required int index,
required double fraction,
required double pointerAngle,
required int fullTurns,
bool clockwise = true,
}) {
final double target = restingRotationFor(index, fraction, pointerAngle);
final double phase = startRotation % (2 * pi);
if (clockwise) {
final double diff = (target - phase) % (2 * pi);
return startRotation + fullTurns * 2 * pi + diff;
}
final double diff = (phase - target) % (2 * pi);
return startRotation - fullTurns * 2 * pi - diff;
}