Skip to content

Instantly share code, notes, and snippets.

@TechieBlossom
Last active January 13, 2023 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TechieBlossom/978f535f1531341e577fb6e0c0027ed1 to your computer and use it in GitHub Desktop.
Save TechieBlossom/978f535f1531341e577fb6e0c0027ed1 to your computer and use it in GitHub Desktop.
Generate 6 offsets
for (int i = 0; i < 6; i++) {
final degree = 60 * i;
canvas.drawLine(
Offset(
radius * cos(pi * 2 * degree / 360) + center.dx,
radius * sin(pi * 2 * degree / 360) + center.dy,
),
Offset(
radius * cos(pi * 2 * (degree + 60) / 360) + center.dx,
radius * sin(pi * 2 * (degree + 60) / 360) + center.dy,
),
borderPaint,
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment