Skip to content

Instantly share code, notes, and snippets.

@salihgueler
Created March 5, 2019 20:34
Show Gist options
  • Save salihgueler/4fc8666524eef574eabe9690726442f1 to your computer and use it in GitHub Desktop.
Save salihgueler/4fc8666524eef574eabe9690726442f1 to your computer and use it in GitHub Desktop.
@override
void paint(Canvas canvas, Size size) {
Paint paint = Paint()
..color = Colors.red
..style = PaintingStyle.stroke
..strokeWidth = 8.0;
// Method to convert degree to radians
num degToRad(num deg) => deg * (Math.pi / 180.0);
Path path = Path();
path.arcTo(Rect.fromLTWH(size.width / 2, size.height / 2, size.width / 4, size.height / 4), degToRad(0), degToRad(90), true);
canvas.drawPath(path, paint);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment