Rect.fromCircle constructor Null safety

Rect.fromCircle(
  1. {required Offset center,
  2. required double radius}
)

Construct a rectangle that bounds the given circle.

The center argument is assumed to be an offset from the origin.

Implementation

Rect.fromCircle({ required Offset center, required double radius }) : this.fromCenter(
  center: center,
  width: radius * 2,
  height: radius * 2,
);