IntRect.fromCenter constructor
Creates a new IntRect from center point, width, and height values.
center The IntOffset of the center point.
width The width of the rectangle.
height The height of the rectangle.
Implementation
factory IntRect.fromCenter({
required final IntOffset center,
required final int width,
required final int height,
}) {
return IntRect(
center.x - width ~/ 2,
center.y - height ~/ 2,
width,
height,
);
}