setTopRight method
Set the top-right corner of the rectangle to the given position. May change the size, but will never change the bottom-left corner of the rectangle.
Implementation
Rect setTopRight(Offset topRight) {
return Rect.fromLTRB(
left,
topRight.dy,
topRight.dx,
bottom,
);
}