position method

  1. @override
Offset position(
  1. int n
)
override

Implementation

@override
Offset position(int n) {
  var nProgress = n / particles * pi * 2;

  var px = (1 - variation1) *
      sin(nProgress +
          value +
          offset +
          nProgress * sin(variation3 * nProgress));
  var py = (1 - variation2) *
      cos(nProgress +
          value +
          offset +
          nProgress * sin(variation3 * nProgress));

  var x = px * canvasSize.width / 2;
  var y = py * canvasSize.height / 2;

  return Offset(
    canvasSize.width / 2 + x,
    canvasSize.height / 2 + y,
  );
}