RelativeRect.fromSize constructor

  1. Rect rect,
  2. Size container

Creates a RelativeRect from a Rect and a Size. The Rect (first argument) and the RelativeRect (the output) are in the coordinate space of the rectangle described by the Size, with 0,0 being at the top left.


factory RelativeRect.fromSize(Rect rect, Size container) {
  return RelativeRect.fromLTRB(rect.left,, container.width - rect.right, container.height - rect.bottom);