drawSquares method
Draws multiple squares with centers positioned at pos.
Parameters:
canvas
The Canvas object from custom paint used for drawing the squares.sizes
List of sizes for the squares to be drawn.
Implementation
void drawSquares(Canvas canvas, List<double> sizes) {
for (double d in sizes)
canvas.drawRect(
Rect.fromPoints(
Offset(pos.dx - d, pos.dy - d), Offset(pos.dx + d, pos.dy + d)),
getPaint());
}