getPositionForIteration method

  1. @override
Offset getPositionForIteration(
  1. int iteration,
  2. ScatterContext context
)
override

Returns an offset for the specified iteration.

For a given iteration, the offset should be unique.

Implementation

@override
Offset getPositionForIteration(int iteration, ScatterContext context) {
  final double angle = iteration * _stepRadians;
  final double x = a * math.cos(angle + _startRadians);
  final double y = b * math.sin(angle + _startRadians);
  return Offset(x, y);
}