spinTo method

Future<WheelSpinResult?> spinTo(
  1. int index
)

Spins the wheel so that it lands on the segment at index, ignoring probabilities. Useful when the result is decided elsewhere, e.g. by a server.

Throws a RangeError if index is out of range, or an ArgumentError if that segment isn't drawn (a 0-probability segment with SliceSizing.proportional). Otherwise behaves like startSpin.

Implementation

Future<WheelSpinResult?> spinTo(int index) async {
  if (_state == null) {
    debugPrint("Error: SpinnerWheelState is not attached to the controller!");
    return null;
  }
  return _state!.startSpin(targetIndex: index);
}