Rectangle.fromCenter constructor
Create a rectangle from center point, width, and height
Implementation
factory Rectangle.fromCenter({
required Point center,
required double width,
required double height,
}) {
return Rectangle(
x: center.x - width / 2,
y: center.y - height / 2,
width: width,
height: height,
);
}