center method

Offset center (Offset origin)

The offset to the point halfway between the left and right and the top and bottom edges of the rectangle described by the given offset (which is interpreted as the top-left corner) and this size.

See also Rect.center.

Implementation

Offset center(Offset origin) => new Offset(origin.dx + width / 2.0, origin.dy + height / 2.0);