1. override
bool operator ==(Object other)

A Point is only equal to another Point with the same coordinates.

This point is equal to other if, and only if, other is a Point with x equal to other.x and y equal to other.y.

Source

@override
bool operator ==(Object other) {
  return other is math.Point && this.x == other.x && this.y == other.y;
}