Skip to content

Instantly share code, notes, and snippets.

@divyanshub024
Created April 9, 2020 20:46
Show Gist options
  • Save divyanshub024/f770354a38017e680ac7ebdf00d0f31f to your computer and use it in GitHub Desktop.
Save divyanshub024/f770354a38017e680ac7ebdf00d0f31f to your computer and use it in GitHub Desktop.
Path createSpiralPath(Size size) {
double radius = 0, angle = 0;
Path path = Path();
for (int n = 0; n < 200; n++) {
radius += 0.75;
angle += (math.pi * 2) / 50;
var x = size.width / 2 + radius * math.cos(angle);
var y = size.height / 2 + radius * math.sin(angle);
path.lineTo(x, y);
}
return path;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment