Rect.fromCoordinates constructor

Rect.fromCoordinates(
  1. double? x1,
  2. double? y1,
  3. double? x2,
  4. double? y2,
)

Implementation

Rect.fromCoordinates(this.x1, this.y1, this.x2, this.y2) {
  if (x1 != null && x2 != null) {
    width = (x2 as double) - (x1 as double);
  }

  if (y1 != null && y2 != null) {
    height = (y2 as double) - (y1 as double);
  }
}