Rectangle.fromPoints constructor

Rectangle.fromPoints(
  1. Vector2 a,
  2. Vector2 b
)

Constructs a Rectangle from two opposite corners. The points can be in any disposition to each other.

Implementation

factory Rectangle.fromPoints(Vector2 a, Vector2 b) =>
    Rectangle.fromLTRB(a.x, a.y, b.x, b.y);