translate method

  1. @override
Rectangle translate({
  1. double x = 0,
  2. double y = 0,
})
override

translate the shape with x in horizontally and y vertically

Implementation

@override
Rectangle translate({double x = 0, double y = 0}) {
  return Rectangle(
    x: this.x + x,
    y: this.y + y,
    width: width,
    height: height,
  );
}