copyWith method
Returns a copy of this rectangle with the given arguments replaced.
If no arguments are given, the original rectangle is returned.
Implementation
Rect copyWith({
int? x,
int? y,
int? width,
int? height,
}) {
return Rect.fromLTWH(
x ?? this.x,
y ?? this.y,
width ?? this.width,
height ?? this.height,
);
}