rotate method
Implementation
Offset rotate({Offset center = Offset.zero, double angle = 0}) {
final double x = center.dx +
(dx - center.dx) * cos(angle) -
(dy - center.dy) * sin(angle);
final double y = center.dy +
(dx - center.dx) * sin(angle) +
(dy - center.dy) * cos(angle);
return Offset(x, y);
}