center method Null safety

Offset center(
  1. 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) => Offset(origin.dx + width / 2.0, origin.dy + height / 2.0);