Skip to content

Instantly share code, notes, and snippets.

@salihgueler
Last active March 5, 2019 16:16
Show Gist options
  • Save salihgueler/622ddcd24bdeb31a16fcee38e5dd48bf to your computer and use it in GitHub Desktop.
Save salihgueler/622ddcd24bdeb31a16fcee38e5dd48bf 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;
Path path = Path();
// Adds a rectangle
path.addRect(Rect.fromLTWH(size.width / 2, size.height / 2, size.width / 4, size.height / 4));
canvas.drawPath(path, paint);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment